summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-08-22 11:07:30 +0100
committerGerrit <chrome-bot@google.com>2012-08-27 12:16:10 -0700
commitd7ed508b66dc50b408b0a6a49b2c5558157b3826 (patch)
tree65166d20e335569de856d8a872be6d71a77d77ae
parent130531ab8ca916de4934315264353bfbfcda7871 (diff)
downloadchrome-ec-d7ed508b66dc50b408b0a6a49b2c5558157b3826.tar.gz
Add CONFIG_CONFIGURE_BOARD_LATE for late board init
It is useful to be able to perform some board init after GPIOs are set up. When defined, configure_board_late() will be called after GPIOs are ready. BUG=chrome-os-partner:13064 BRANCH=snow,link TEST=manual build and boot on snow with later changes. See the AC power GPIO does not change when un/plugging power. Change-Id: Idc56c0acde9f7bd46b4379731b973d1fce760b3f Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/31303
-rw-r--r--README5
-rw-r--r--common/main.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/README b/README
index c03731c032..1efc6a730c 100644
--- a/README
+++ b/README
@@ -60,3 +60,8 @@ Build Options
enabled an ASSERT() which fails will produce message in the form:
ASSERTION FAILURE '<expr>' in function() at file:line
+
+- CONFIG_CONFIGURE_BOARD_LATE
+
+ Define this to call configure_board_late() after initial system init
+ is complete (and after GPIOs are set up).
diff --git a/common/main.c b/common/main.c
index 22906cb7be..b38b862f91 100644
--- a/common/main.c
+++ b/common/main.c
@@ -37,6 +37,9 @@ int main(void)
jtag_pre_init();
gpio_pre_init();
+#ifdef CONFIG_CONFIGURE_BOARD_LATE
+ configure_board_late();
+#endif
/*
* Initialize interrupts, but don't enable any of them. Note that
* task scheduling is not enabled until task_start() below.