mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 4/8] efi: move x86 clocksource init at core initcall level
Date: Mon, 27 Feb 2017 11:19:26 +0100	[thread overview]
Message-ID: <1488190770-4034-4-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1488190770-4034-1-git-send-email-plagnioj@jcrosoft.com>

so we can use device/driver model

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/efi/efi.c          | 1 -
 drivers/clocksource/efi.c | 5 ++++-
 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 1c7aee872..4b589b600 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 59fd9918a..6d2fee8eb 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 2b25cf186..648afb9ec 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)
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-02-27 10:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 10:14 [PATCH 0/8] add generic EFI timer Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19 ` [PATCH 1/8] efi: add prototype and definition for creating and closing event Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 2/8] efi: add prototype and definition for setting timer Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 3/8] efi: move LoaderTimeInitUSec and LoaderDevicePartUUID to postcore initcall Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2017-02-27 10:19   ` [PATCH 5/8] clocksource: allow to have multiple device from clock source Jean-Christophe PLAGNIOL-VILLARD
2017-02-28  7:09     ` Sascha Hauer
2017-03-01 15:52       ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-02  7:36         ` Sascha Hauer
2017-02-27 10:19   ` [PATCH 6/8] efi: move x86 clocksource to device/driver Jean-Christophe PLAGNIOL-VILLARD
2017-02-27 10:19   ` [PATCH 7/8] efi: clocksoure: use event for timer Jean-Christophe PLAGNIOL-VILLARD
2017-03-13 10:30     ` Michael Olbrich
2017-03-13 10:52       ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-13 13:16         ` [PATCH] fixup! efi: clocksoure: add EFI event timer Michael Olbrich
2017-03-13 15:55           ` Jean-Christophe PLAGNIOL-VILLARD
2017-03-14  7:16           ` Sascha Hauer
2017-02-27 10:19   ` [PATCH 8/8] efi: add veriable to report secure boot support and status Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488190770-4034-4-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox