summaryrefslogtreecommitdiff
path: root/board/sandbox
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-02-27 13:26:13 -0700
committerSimon Glass <sjg@chromium.org>2014-03-17 20:05:48 -0600
commit86bf601d0414541d210d31fe44d44c85c5d0fee0 (patch)
tree4c49b86b6752d580252c0398cb7051e1d6d20c49 /board/sandbox
parentdf93d90aea85deff0b19ece43ba6f379c7c4d9cc (diff)
downloadu-boot-imx-86bf601d0414541d210d31fe44d44c85c5d0fee0.zip
u-boot-imx-86bf601d0414541d210d31fe44d44c85c5d0fee0.tar.gz
u-boot-imx-86bf601d0414541d210d31fe44d44c85c5d0fee0.tar.bz2
sandbox: Plumb in Chrome OS EC emulation
Add board code to set up the Chrome OS EC on startup. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/sandbox')
-rw-r--r--board/sandbox/sandbox/sandbox.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/board/sandbox/sandbox/sandbox.c b/board/sandbox/sandbox/sandbox.c
index 2f90df5..402afea 100644
--- a/board/sandbox/sandbox/sandbox.c
+++ b/board/sandbox/sandbox/sandbox.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <cros_ec.h>
#include <dm.h>
#include <os.h>
@@ -33,3 +34,32 @@ int dram_init(void)
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;
}
+
+int arch_early_init_r(void)
+{
+#ifdef CONFIG_CROS_EC
+ if (cros_ec_board_init()) {
+ printf("%s: Failed to init EC\n", __func__);
+ return 0;
+ }
+#endif
+
+ return 0;
+}
+
+#ifdef CONFIG_BOARD_LATE_INIT
+int board_late_init(void)
+{
+ if (cros_ec_get_error()) {
+ /* Force console on */
+ gd->flags &= ~GD_FLG_SILENT;
+
+ printf("cros-ec communications failure %d\n",
+ cros_ec_get_error());
+ puts("\nPlease reset with Power+Refresh\n\n");
+ panic("Cannot init cros-ec device");
+ return -1;
+ }
+ return 0;
+}
+#endif