-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This driver just sets CNTVOFF_El2 to 0 if possible. This can only be done if the elfloader is in hyp-mode, otherwise nothing happens. Signed-off-by: Kent McLeod <kent@kry10.com>
- Loading branch information
1 parent
db74273
commit 93a6e92
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ enum driver_type { | |
DRIVER_INVALID = 0, | ||
DRIVER_SMP, | ||
DRIVER_UART, | ||
DRIVER_TIMER, | ||
DRIVER_MAX | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <devices_gen.h> | ||
#include <drivers/common.h> | ||
#include <mode/arm_generic_timer.h> | ||
|
||
#include <elfloader_common.h> | ||
|
||
|
||
static int generic_timer_init(UNUSED struct elfloader_device *dev, UNUSED void *match_data) | ||
{ | ||
reset_cntvoff(); | ||
return 0; | ||
} | ||
|
||
static const struct dtb_match_table generic_timer_matches[] = { | ||
{ .compatible = "arm,armv7-timer" }, | ||
{ .compatible = "arm,armv8-timer" }, | ||
{ .compatible = NULL /* sentinel */ }, | ||
}; | ||
|
||
static const struct elfloader_driver generic_timer = { | ||
.match_table = generic_timer_matches, | ||
.type = DRIVER_TIMER, | ||
.init = &generic_timer_init, | ||
.init_non_boot = &generic_timer_init, | ||
.ops = NULL, | ||
}; | ||
|
||
ELFLOADER_DRIVER(generic_timer); |