[U-Boot] [PATCH 1/6] arm: rmobile: lager: Add external RAM boot

If CONFIG_RMOBILE_EXTRAM_BOOT is enabled, U-Boot is booted from External RAM. The default boot address is 0xB0000000.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- arch/arm/cpu/armv7/rmobile/Kconfig | 5 +++++ board/renesas/lager/qos.c | 7 ++++++- include/configs/lager.h | 12 ++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 6c2bb22..0071edf 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -26,6 +26,11 @@ config SYS_CPU config SYS_SOC default "rmobile"
+config RMOBILE_EXTRAM_BOOT + bool "Enable boot from RAM" + depends on TARGET_LAGER + default n + source "board/atmark-techno/armadillo-800eva/Kconfig" source "board/renesas/koelsch/Kconfig" source "board/renesas/lager/Kconfig" diff --git a/board/renesas/lager/qos.c b/board/renesas/lager/qos.c index ce7f8ba..dec37d2 100644 --- a/board/renesas/lager/qos.c +++ b/board/renesas/lager/qos.c @@ -13,7 +13,7 @@ #include <asm/arch/rmobile.h>
/* QoS version 0.955 for ES1 and version 0.963 for ES2 */ - +#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -2381,3 +2381,8 @@ void qos_init(void) else qos_init_es1(); } +#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +void qos_init(void) +{ +} +#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ diff --git a/include/configs/lager.h b/include/configs/lager.h index 699135f..a814b4c 100644 --- a/include/configs/lager.h +++ b/include/configs/lager.h @@ -39,7 +39,11 @@ #define CONFIG_FAT_WRITE #define CONFIG_EXT4_WRITE
+#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_TEXT_BASE 0xB0000000 +#else #define CONFIG_SYS_TEXT_BASE 0xE8080000 +#endif #define CONFIG_SYS_THUMB_BUILD #define CONFIG_SYS_GENERIC_BOARD
@@ -70,8 +74,12 @@ #define CONFIG_TMU_TIMER
/* STACK */ -#define CONFIG_SYS_INIT_SP_ADDR 0xE827fffc -#define STACK_AREA_SIZE 0xC000 +#if defined(CONFIGF_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_INIT_SP_ADDR 0xB003FFFC +#else +#define CONFIG_SYS_INIT_SP_ADDR 0xE827FFFC +#endif +#define STACK_AREA_SIZE 0xC000 #define LOW_LEVEL_MERAM_STACK \ (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)

If CONFIG_RMOBILE_EXTRAM_BOOT is enabled, U-Boot is booted from External RAM. The default boot address is 0x70000000.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- arch/arm/cpu/armv7/rmobile/Kconfig | 2 +- board/renesas/koelsch/qos.c | 7 ++++++- include/configs/koelsch.h | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 0071edf..360141c 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -28,7 +28,7 @@ config SYS_SOC
config RMOBILE_EXTRAM_BOOT bool "Enable boot from RAM" - depends on TARGET_LAGER + depends on TARGET_LAGER || TARGET_KOELSCH default n
source "board/atmark-techno/armadillo-800eva/Kconfig" diff --git a/board/renesas/koelsch/qos.c b/board/renesas/koelsch/qos.c index ecf3eed..d293e3d 100644 --- a/board/renesas/koelsch/qos.c +++ b/board/renesas/koelsch/qos.c @@ -14,7 +14,7 @@ #include <asm/arch/rmobile.h>
/* QoS version 0.240 for ES1 and version 0.334 for ES2 */ - +#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) enum { DBSC3_00, DBSC3_01, DBSC3_02, DBSC3_03, DBSC3_04, DBSC3_05, DBSC3_06, DBSC3_07, DBSC3_08, DBSC3_09, @@ -1304,3 +1304,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } +#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +void qos_init(void) +{ +} +#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h index e015e90..3ccadd0 100644 --- a/include/configs/koelsch.h +++ b/include/configs/koelsch.h @@ -38,7 +38,12 @@ #define CONFIG_FAT_WRITE #define CONFIG_EXT4_WRITE
+#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_TEXT_BASE 0x70000000 +#else #define CONFIG_SYS_TEXT_BASE 0xE6304000 +#endif + #define CONFIG_SYS_THUMB_BUILD #define CONFIG_SYS_GENERIC_BOARD
@@ -69,8 +74,13 @@ #define CONFIG_TMU_TIMER
/* STACK */ -#define CONFIG_SYS_INIT_SP_ADDR 0xE633fffc -#define STACK_AREA_SIZE 0xC000 +#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_INIT_SP_ADDR 0x7003FFFC +#else +#define CONFIG_SYS_INIT_SP_ADDR 0xE633fffC +#endif + +#define STACK_AREA_SIZE 0xC000 #define LOW_LEVEL_MERAM_STACK \ (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)

If CONFIG_RMOBILE_EXTRAM_BOOT is enabled, U-Boot is booted from External RAM. The default boot address is 0x70000000.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- arch/arm/cpu/armv7/rmobile/Kconfig | 2 +- board/renesas/alt/qos.c | 6 ++++++ include/configs/alt.h | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 360141c..127f254 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -28,7 +28,7 @@ config SYS_SOC
config RMOBILE_EXTRAM_BOOT bool "Enable boot from RAM" - depends on TARGET_LAGER || TARGET_KOELSCH + depends on TARGET_ALT || TARGET_KOELSCH || TARGET_LAGER default n
source "board/atmark-techno/armadillo-800eva/Kconfig" diff --git a/board/renesas/alt/qos.c b/board/renesas/alt/qos.c index d788aa0..f0b349f 100644 --- a/board/renesas/alt/qos.c +++ b/board/renesas/alt/qos.c @@ -13,6 +13,7 @@ #include <asm/io.h> #include <asm/arch/rmobile.h>
+#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) /* QoS version 0.11 */
enum { @@ -942,3 +943,8 @@ void qos_init(void) writel(0x00000001, &axi_qos->qosthres2); writel(0x00000001, &axi_qos->qosqon); } +#else /* CONFIG_RMOBILE_EXTRAM_BOOT */ +void qos_init(void) +{ +} +#endif /* CONFIG_RMOBILE_EXTRAM_BOOT */ diff --git a/include/configs/alt.h b/include/configs/alt.h index 7238f68..5a19096 100644 --- a/include/configs/alt.h +++ b/include/configs/alt.h @@ -34,7 +34,11 @@ #define CONFIG_CMD_SF #define CONFIG_CMD_SPI
+#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_TEXT_BASE 0x70000000 +#else #define CONFIG_SYS_TEXT_BASE 0xE6304000 +#endif #define CONFIG_SYS_THUMB_BUILD #define CONFIG_SYS_GENERIC_BOARD
@@ -59,7 +63,11 @@ #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_TMU_TIMER
+#if defined(CONFIG_RMOBILE_EXTRAM_BOOT) +#define CONFIG_SYS_INIT_SP_ADDR 0x7003FFFC +#else #define CONFIG_SYS_INIT_SP_ADDR 0xE633FFFC +#endif #define STACK_AREA_SIZE 0xC000 #define LOW_LEVEL_MERAM_STACK \ (CONFIG_SYS_INIT_SP_ADDR + STACK_AREA_SIZE - 4)

Since board info structure is not still set up, the setting of RAM address causes illegal access. Therefore the setting of RAM address is removed.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/lager/lager.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 1fc5833..2bb8710 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -165,7 +165,6 @@ int board_phy_config(struct phy_device *phydev)
int dram_init(void) { - gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;

Since board info structure is not still set up, the setting of RAM address causes illegal access. Therefore the setting of RAM address is removed.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/koelsch/koelsch.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c index bfd0cc6..37202f9 100644 --- a/board/renesas/koelsch/koelsch.c +++ b/board/renesas/koelsch/koelsch.c @@ -150,7 +150,6 @@ int board_eth_init(bd_t *bis)
int dram_init(void) { - gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;

Since board info structure is not still set up, the setting of RAM address causes illegal access. Therefore the setting of RAM address is removed.
Signed-off-by: Hisashi Nakamura hisashi.nakamura.ak@renesas.com Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com --- board/renesas/alt/alt.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c index 9d8e8f9..b668bf6 100644 --- a/board/renesas/alt/alt.c +++ b/board/renesas/alt/alt.c @@ -140,7 +140,6 @@ int board_eth_init(bd_t *bis)
int dram_init(void) { - gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
return 0;
participants (1)
-
Nobuhiro Iwamatsu