diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2017-03-03 13:34:00 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-09 07:36:15 +0100 |
commit | 92c1033036a0f1d65fb71e7c04cfb9393d31aa1c (patch) | |
tree | d39a32ee22abc9c433299693e49b6f78258a3bf8 | |
parent | 035842ff5588df73170171587a08f02d29838302 (diff) | |
download | barebox-92c1033036a0f1d65fb71e7c04cfb9393d31aa1c.tar.gz barebox-92c1033036a0f1d65fb71e7c04cfb9393d31aa1c.tar.xz |
efi: move x86 clocksource init at core initcall level
so we can use device/driver model
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/efi/efi.c | 1 | ||||
-rw-r--r-- | drivers/clocksource/efi.c | 5 | ||||
-rw-r--r-- | include/efi/efi.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/common/efi/efi.c b/common/efi/efi.c index 1c7aee872d..4b589b600f 100644 --- a/common/efi/efi.c +++ b/common/efi/efi.c @@ -348,7 +348,6 @@ efi_status_t efi_main(efi_handle_t image, efi_system_table_t *sys_table) efi_strerror(efiret)); mem_malloc_init((void *)mem, (void *)mem + memsize); - efi_clocksource_init(); start_barebox(); return EFI_SUCCESS; diff --git a/drivers/clocksource/efi.c b/drivers/clocksource/efi.c index 59fd9918a1..6d2fee8eba 100644 --- a/drivers/clocksource/efi.c +++ b/drivers/clocksource/efi.c @@ -1,4 +1,5 @@ #include <common.h> +#include <init.h> #include <efi.h> #include <efi/efi.h> #include <clock.h> @@ -48,7 +49,7 @@ static struct clocksource cs = { .shift = 0, }; -int efi_clocksource_init(void) +static int efi_clocksource_init(void) { cs.mult = clocksource_hz2mult(1000 * 1000, cs.shift); @@ -56,3 +57,5 @@ int efi_clocksource_init(void) return init_clock(&cs); } +/* for efi the time must be init at core initcall level */ +core_initcall(efi_clocksource_init); diff --git a/include/efi/efi.h b/include/efi/efi.h index 2b25cf1868..648afb9ec5 100644 --- a/include/efi/efi.h +++ b/include/efi/efi.h @@ -12,8 +12,6 @@ extern efi_loaded_image_t *efi_loaded_image; int efi_errno(efi_status_t err); -int efi_clocksource_init(void); - void *efi_get_variable(char *name, efi_guid_t *vendor, int *var_size); static inline void *efi_get_global_var(char *name, int *var_size) |