]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
embestmx6boards: Add SPL support
authorFabien Lahoudere <fabien.lahoudere@collabora.com>
Thu, 8 Nov 2018 10:28:05 +0000 (11:28 +0100)
committerStefano Babic <sbabic@denx.de>
Tue, 1 Jan 2019 13:12:18 +0000 (14:12 +0100)
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>
arch/arm/mach-imx/mx6/Kconfig
board/embest/mx6boards/MAINTAINERS
board/embest/mx6boards/mx6boards.c
configs/riotboard_spl_defconfig [new file with mode: 0644]
include/configs/embestmx6boards.h

index 06c25bae3629620059e8a595a7bafafa574c120d..e7cce46e03d9007d30395ee8b2b1af5450c4432a 100644 (file)
@@ -182,6 +182,7 @@ config TARGET_DISPLAY5
 config TARGET_EMBESTMX6BOARDS
        bool "embestmx6boards"
        select BOARD_LATE_INIT
+       select SUPPORT_SPL
 
 config TARGET_GE_BX50V3
        bool "General Electric Bx50v3"
index 0ffd4668b42dbfba212c8b58bddf17ec7f1ae130..02756c58b3c85f9732c724aabe5f620084cfc492 100644 (file)
@@ -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
index 8930c36fe660a9790cef576e43c9d77ea7a6ca5e..fed92aa88a0d3cb393635cdd59685e8d62b89ba2 100644 (file)
@@ -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
diff --git a/configs/riotboard_spl_defconfig b/configs/riotboard_spl_defconfig
new file mode 100644 (file)
index 0000000..8b5459a
--- /dev/null
@@ -0,0 +1,48 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
+CONFIG_SYS_TEXT_BASE=0x17800000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_TARGET_EMBESTMX6BOARDS=y
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6s1g.cfg,SPL,MX6S,DDR_MB=1024"
+CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd"
+# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_SPL_RAW_IMAGE_SUPPORT=y
+CONFIG_SPL_EXT_SUPPORT=y
+CONFIG_SPL_OS_BOOT=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_DM=y
+CONFIG_FSL_ESDHC=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SST=y
+CONFIG_PHYLIB=y
+CONFIG_MII=y
+CONFIG_SPI=y
+CONFIG_MXC_SPI=y
+CONFIG_DM_THERMAL=y
+CONFIG_USB=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_VIDEO=y
+# CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_OF_LIBFDT=y
+CONFIG_SPL_OF_LIBFDT=y
index 71217f07e223fe8c10403c9c1b926d4f714621e0..7e7de4dae6401ee4dc997a7882a6320165142301 100644 (file)
 
 #include "mx6_common.h"
 
+#ifdef CONFIG_SPL
+#include "imx6_spl.h"
+/* RiOTboard */
+#define CONFIG_SYS_SPL_ARGS_ADDR 0x13000000
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME "imx6dl-riotboard.dtb"
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0 /* offset 69KB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0 /* offset 69KB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* offset 69KB */
+
+#endif
+
 /* 256M RAM (minimum), 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
  * 1M script, 1M pxe and the ramdisk at the end */
 #define MEM_LAYOUT_ENV_SETTINGS \