-
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
6a46b98
commit 0504728
Showing
4 changed files
with
52 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,47 @@ | ||
/* | ||
* 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 unsigned int do_reset_cntvoff; | ||
|
||
/* Reset the virtual offset for the platform timer to 0 */ | ||
#if CONFIG_MAX_NUM_NODES > 1 | ||
void generic_timer_non_boot_init(void) | ||
{ | ||
if (do_reset_cntvoff) { | ||
reset_cntvoff(); | ||
} | ||
} | ||
#endif | ||
|
||
|
||
static int generic_timer_init(UNUSED struct elfloader_device *dev, UNUSED void *match_data) | ||
{ | ||
do_reset_cntvoff = 1; | ||
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, | ||
.ops = NULL, | ||
}; | ||
|
||
ELFLOADER_DRIVER(generic_timer); |