]> git.sur5r.net Git - u-boot/commitdiff
ARM: rmobile: Convert Porter to SPL
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Fri, 16 Feb 2018 00:33:27 +0000 (01:33 +0100)
committerMarek Vasut <marex@denx.de>
Fri, 16 Feb 2018 15:43:11 +0000 (16:43 +0100)
Due to size limitations of the MERAM, switch U-Boot to SPL.
The SPL is loaded by the SPI_LOADER into MERAM and then loads
U-Boot proper into DRAM. This way U-Boot can freely grow in
size in DRAM, as there is plenty of it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
NOTE: To update U-Boot, first install u-boot.img to 0x140000 in SPI NOR,
      then use the Minimon to flash u-boot-spl.srec using ls,2,e6304000.
      To generate u-boot-spl.srec, use objcopy:
        arm-linux-gnueabi-objcopy -O srec spl/u-boot-spl u-boot-spl.srec

arch/arm/mach-rmobile/Kconfig.32
board/renesas/porter/porter.c
configs/porter_defconfig
include/configs/porter.h

index ab05966d15ba60ead03bc9c04ef2fb74b2d18459..a96938c01ed60fa94371d72ae4162e4a635feb3b 100644 (file)
@@ -70,6 +70,8 @@ config TARGET_PORTER
        bool "Porter board"
        select DM
        select DM_SERIAL
+       select SUPPORT_SPL
+       select SPL_DM if SPL
 
 config TARGET_STOUT
        bool "Stout board"
index 86dea8bfa7a3bf85c437bffde313df9faa3de3f2..bd0080d2108f1ec041ff6705492dbad154587403 100644 (file)
@@ -115,3 +115,25 @@ void reset_cpu(ulong addr)
        val |= 0x02;
        i2c_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
 }
+
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+void board_init_f(ulong dummy)
+{
+       board_early_init_f();
+}
+
+void spl_board_init(void)
+{
+       /* UART clocks enabled and gd valid - init serial console */
+       preloader_console_init();
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+       /* Boot from SPI NOR with YMODEM UART fallback. */
+       spl_boot_list[0] = BOOT_DEVICE_SPI;
+       spl_boot_list[1] = BOOT_DEVICE_UART;
+       spl_boot_list[2] = BOOT_DEVICE_NONE;
+}
+#endif
index 38501d0bf1ab65f335df44a63577a0aef5f6f621..0fa308b5843cbacddd37bca45de29495e334901c 100644 (file)
@@ -1,12 +1,22 @@
 CONFIG_ARM=y
 CONFIG_ARCH_RMOBILE=y
-CONFIG_SYS_TEXT_BASE=0xE6304000
+CONFIG_SYS_TEXT_BASE=0x50000000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_R8A7791=y
 CONFIG_TARGET_PORTER=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7791-porter-u-boot"
 CONFIG_BOOTDELAY=3
 CONFIG_VERSION_VARIABLE=y
+CONFIG_SPL=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_XIMG is not set
@@ -26,8 +36,14 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_EMBED=y
+CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas power-domains"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
+CONFIG_SPL_CLK=y
 CONFIG_CLK_RENESAS=y
 CONFIG_DM_GPIO=y
 CONFIG_RCAR_GPIO=y
@@ -44,6 +60,7 @@ CONFIG_DM_PCI=y
 CONFIG_PCI_RCAR_GEN2=y
 CONFIG_PINCTRL=y
 CONFIG_PINCONF=y
+CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_PFC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
@@ -55,3 +72,4 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_PCI=y
 CONFIG_USB_STORAGE=y
+CONFIG_SPL_FRAMEWORK=y
index b4a317f724438ff5874f3099d72bf0a298393f99..758ed21c153c2fbb67a67f188bfa0a50d5ea577f 100644 (file)
 
 #include "rcar-gen2-common.h"
 
-#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT)
-#define CONFIG_SYS_INIT_SP_ADDR                0x7023FFFC
-#else
-#define CONFIG_SYS_INIT_SP_ADDR                0xE633fffC
-#endif
-#define STACK_AREA_SIZE                        0xC000
+#define CONFIG_SYS_INIT_SP_ADDR                0x4f000000
+#define STACK_AREA_SIZE                        0x00100000
 #define LOW_LEVEL_MERAM_STACK \
                (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
 
 
 #define CONFIG_SYS_I2C_POWERIC_ADDR    0x58 /* da9063 */
 
+/* SPL support */
+#define CONFIG_SPL_TEXT_BASE           0xe6304000
+#define CONFIG_SPL_STACK               0xe6340000
+#define CONFIG_SPL_MAX_SIZE            0x40000
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x140000
+
 #endif /* __PORTER_H */