summaryrefslogtreecommitdiff
path: root/board/embest/mx6boards
diff options
context:
space:
mode:
authorFabien Lahoudere <fabien.lahoudere@collabora.com>2018-11-08 11:28:05 +0100
committerStefano Babic <sbabic@denx.de>2019-01-01 14:12:18 +0100
commit725019bebeb681bab123a323e8a21ca858277c3d (patch)
treee3bb49cc0de0c25e9e8824b76874d48dc23d8a2f /board/embest/mx6boards
parent0b366cf2b01dee62b6084b515046cb9e6ce5305f (diff)
downloadu-boot-725019bebeb681bab123a323e8a21ca858277c3d.tar.gz
embestmx6boards: Add SPL support
In order to boot faster with falcon mode, we need to add SPL support to riotboard. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Diffstat (limited to 'board/embest/mx6boards')
-rw-r--r--board/embest/mx6boards/MAINTAINERS1
-rw-r--r--board/embest/mx6boards/mx6boards.c48
2 files changed, 49 insertions, 0 deletions
diff --git a/board/embest/mx6boards/MAINTAINERS b/board/embest/mx6boards/MAINTAINERS
index 0ffd4668b4..02756c58b3 100644
--- a/board/embest/mx6boards/MAINTAINERS
+++ b/board/embest/mx6boards/MAINTAINERS
@@ -5,3 +5,4 @@ F: board/embest/mx6boards/
F: include/configs/embestmx6boards.h
F: configs/marsboard_defconfig
F: configs/riotboard_defconfig
+F: configs/riotboard_spl_defconfig
diff --git a/board/embest/mx6boards/mx6boards.c b/board/embest/mx6boards/mx6boards.c
index 8930c36fe6..fed92aa88a 100644
--- a/board/embest/mx6boards/mx6boards.c
+++ b/board/embest/mx6boards/mx6boards.c
@@ -608,3 +608,51 @@ int checkboard(void)
return 0;
}
+
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+
+void board_init_f(ulong dummy)
+{
+ u32 cputype = cpu_type(get_cpu_rev());
+
+ switch (cputype) {
+ case MXC_CPU_MX6SOLO:
+ board_type = BOARD_IS_RIOTBOARD;
+ break;
+ case MXC_CPU_MX6D:
+ board_type = BOARD_IS_MARSBOARD;
+ break;
+ }
+ arch_cpu_init();
+
+ /* setup GP timer */
+ timer_init();
+
+#ifdef CONFIG_SPL_SERIAL_SUPPORT
+ setup_iomux_uart();
+ preloader_console_init();
+#endif
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+ spl_boot_list[0] = BOOT_DEVICE_MMC1;
+}
+
+/*
+ * In order to jump to standard u-boot shell, you have to connect pin 5 of J13
+ * to pin 3 (ground).
+ */
+int spl_start_uboot(void)
+{
+ int gpio_key = IMX_GPIO_NR(4, 16);
+
+ gpio_direction_input(gpio_key);
+ if (gpio_get_value(gpio_key) == 0)
+ return 1;
+ else
+ return 0;
+}
+
+#endif