Commit 7ee37d0e0c06730f99926bdb05781bc0111c0161

Authored by Marek Vasut
Committed by Marek Vasut
1 parent 8a8d300005

ARM: rmobile: Convert Porter to SPL

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

Showing 4 changed files with 52 additions and 7 deletions Side-by-side Diff

arch/arm/mach-rmobile/Kconfig.32
... ... @@ -70,6 +70,8 @@
70 70 bool "Porter board"
71 71 select DM
72 72 select DM_SERIAL
  73 + select SUPPORT_SPL
  74 + select SPL_DM if SPL
73 75  
74 76 config TARGET_STOUT
75 77 bool "Stout board"
board/renesas/porter/porter.c
... ... @@ -115,4 +115,26 @@
115 115 val |= 0x02;
116 116 i2c_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
117 117 }
  118 +
  119 +#ifdef CONFIG_SPL_BUILD
  120 +#include <spl.h>
  121 +void board_init_f(ulong dummy)
  122 +{
  123 + board_early_init_f();
  124 +}
  125 +
  126 +void spl_board_init(void)
  127 +{
  128 + /* UART clocks enabled and gd valid - init serial console */
  129 + preloader_console_init();
  130 +}
  131 +
  132 +void board_boot_order(u32 *spl_boot_list)
  133 +{
  134 + /* Boot from SPI NOR with YMODEM UART fallback. */
  135 + spl_boot_list[0] = BOOT_DEVICE_SPI;
  136 + spl_boot_list[1] = BOOT_DEVICE_UART;
  137 + spl_boot_list[2] = BOOT_DEVICE_NONE;
  138 +}
  139 +#endif
configs/porter_defconfig
1 1 CONFIG_ARM=y
2 2 CONFIG_ARCH_RMOBILE=y
3   -CONFIG_SYS_TEXT_BASE=0xE6304000
  3 +CONFIG_SYS_TEXT_BASE=0x50000000
  4 +CONFIG_SPL_GPIO_SUPPORT=y
  5 +CONFIG_SPL_LIBCOMMON_SUPPORT=y
  6 +CONFIG_SPL_LIBGENERIC_SUPPORT=y
4 7 CONFIG_SYS_MALLOC_F_LEN=0x8000
5 8 CONFIG_R8A7791=y
6 9 CONFIG_TARGET_PORTER=y
  10 +CONFIG_SPL_SERIAL_SUPPORT=y
  11 +CONFIG_SPL_SPI_FLASH_SUPPORT=y
  12 +CONFIG_SPL_SPI_SUPPORT=y
7 13 CONFIG_DEFAULT_DEVICE_TREE="r8a7791-porter-u-boot"
8 14 CONFIG_BOOTDELAY=3
9 15 CONFIG_VERSION_VARIABLE=y
  16 +CONFIG_SPL=y
  17 +CONFIG_SPL_BOARD_INIT=y
  18 +CONFIG_SPL_I2C_SUPPORT=y
  19 +CONFIG_SPL_YMODEM_SUPPORT=y
10 20 CONFIG_CMD_BOOTZ=y
11 21 # CONFIG_CMD_IMI is not set
12 22 # CONFIG_CMD_XIMG is not set
13 23  
14 24  
... ... @@ -26,8 +36,14 @@
26 36 CONFIG_CMD_EXT4_WRITE=y
27 37 CONFIG_CMD_FAT=y
28 38 CONFIG_OF_CONTROL=y
  39 +CONFIG_SPL_OF_CONTROL=y
  40 +CONFIG_OF_EMBED=y
  41 +CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas power-domains"
29 42 CONFIG_ENV_IS_IN_SPI_FLASH=y
  43 +CONFIG_SPL_DM_SEQ_ALIAS=y
  44 +CONFIG_SPL_OF_TRANSLATE=y
30 45 CONFIG_CLK=y
  46 +CONFIG_SPL_CLK=y
31 47 CONFIG_CLK_RENESAS=y
32 48 CONFIG_DM_GPIO=y
33 49 CONFIG_RCAR_GPIO=y
... ... @@ -44,6 +60,7 @@
44 60 CONFIG_PCI_RCAR_GEN2=y
45 61 CONFIG_PINCTRL=y
46 62 CONFIG_PINCONF=y
  63 +CONFIG_SPL_PINCTRL=y
47 64 CONFIG_PINCTRL_PFC=y
48 65 CONFIG_DM_REGULATOR=y
49 66 CONFIG_DM_REGULATOR_FIXED=y
... ... @@ -55,4 +72,5 @@
55 72 CONFIG_USB_EHCI_HCD=y
56 73 CONFIG_USB_EHCI_PCI=y
57 74 CONFIG_USB_STORAGE=y
  75 +CONFIG_SPL_FRAMEWORK=y
include/configs/porter.h
... ... @@ -16,12 +16,8 @@
16 16  
17 17 #include "rcar-gen2-common.h"
18 18  
19   -#if defined(CONFIG_ARCH_RMOBILE_EXTRAM_BOOT)
20   -#define CONFIG_SYS_INIT_SP_ADDR 0x7023FFFC
21   -#else
22   -#define CONFIG_SYS_INIT_SP_ADDR 0xE633fffC
23   -#endif
24   -#define STACK_AREA_SIZE 0xC000
  19 +#define CONFIG_SYS_INIT_SP_ADDR 0x4f000000
  20 +#define STACK_AREA_SIZE 0x00100000
25 21 #define LOW_LEVEL_MERAM_STACK \
26 22 (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)
27 23  
... ... @@ -66,6 +62,13 @@
66 62 #define CONFIG_SH_I2C_CLOCK 10000000
67 63  
68 64 #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */
  65 +
  66 +/* SPL support */
  67 +#define CONFIG_SPL_TEXT_BASE 0xe6304000
  68 +#define CONFIG_SPL_STACK 0xe6340000
  69 +#define CONFIG_SPL_MAX_SIZE 0x40000
  70 +#define CONFIG_SPL_SPI_LOAD
  71 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x140000
69 72  
70 73 #endif /* __PORTER_H */