From 3372a9a7a83ca62f5d3536afef8aec6ac553ad9e Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:07:16 +0900 Subject: arm: rmobile: r8a7790: Update initialize L2 cache Initialization of L2CTLR[5] was set only as R8A7790 by commit 237faf095fb43abbed6e40266ef7efccc8b9308b. However, initialization of cash needs to be performed continuously. This changes into the processing which continues initialization of L2CTLR[5] into L2CTLR cash and performs it. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S b/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S index 879e0e0..d47546a 100644 --- a/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S +++ b/arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S @@ -60,17 +60,10 @@ do_lowlevel_init: cmp r1, #3 /* has already been set up */ bicne r0, r0, #0xe7 orrne r0, r0, #0x83 /* L2CTLR[7:6] + L2CTLR[2:0] */ - - ldr r2, =0xFF000044 /* PRR */ - ldr r1, [r2] - and r1, r1, #0x7F00 - lsrs r1, r1, #8 - cmp r1, #0x45 /* 0x45 is ID of r8a7790 */ - bne L2CTLR_5_SKIP +#if defined(CONFIG_R8A7790) orrne r0, r0, #0x20 /* L2CTLR[5] */ -L2CTLR_5_SKIP: +#endif mcrne p15, 1, r0, c9, c0, 2 - _exit_init_l2_a15: ldr r3, =(CONFIG_SYS_INIT_SP_ADDR) sub sp, r3, #4 -- cgit v0.10.2 From d8659c6d25219e3f89b6696b86c3b18dcf5c3fb5 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:08:11 +0900 Subject: arm: rmobile: lager: Fix change of the CPU frequency The change of the CPU frequency is waited for until PLL0ST of the PLLECR is set to 1. Signed-off-by: Hisashi Nakamura Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/arch/arm/include/asm/arch-rmobile/rcar-base.h b/arch/arm/include/asm/arch-rmobile/rcar-base.h index 027e9b1..9c1439b 100644 --- a/arch/arm/include/asm/arch-rmobile/rcar-base.h +++ b/arch/arm/include/asm/arch-rmobile/rcar-base.h @@ -385,6 +385,8 @@ #define PLL0CR 0xE61500D8 #define PLL0_STC_MASK 0x7F000000 #define PLL0_STC_BIT 24 +#define PLLECR 0xE61500D0 +#define PLL0ST 0x100 #ifndef __ASSEMBLY__ #include diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 5302839..1fc5833 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -36,9 +36,14 @@ void s_init(void) /* CPU frequency setting. Set to 1.4GHz */ if (rmobile_get_cpu_rev_integer() >= R8A7790_CUT_ES2X) { + u32 stat = 0; u32 stc = ((1400 / CLK2MHZ(CONFIG_SYS_CLK_FREQ)) - 1) << PLL0_STC_BIT; clrsetbits_le32(PLL0CR, PLL0_STC_MASK, stc); + + do { + stat = readl(PLLECR) & PLL0ST; + } while (stat == 0x0); } /* QoS(Quality-of-Service) Init */ -- cgit v0.10.2 From fb6f6001ed0f0f8987728ef00e6bab2e2b9af706 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:26 +0900 Subject: 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index c46a0cc..75e38ea 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -23,6 +23,11 @@ endchoice 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 /* 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) -- cgit v0.10.2 From 69191fedf49671cfed7de7067f2193c227e18ad1 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:27 +0900 Subject: arm: rmobile: koelsch: Add external RAM boot 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 75e38ea..082c767 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -25,7 +25,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 /* 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) -- cgit v0.10.2 From c9b59bf795804a25b9654e729a491363ef9e6a54 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:28 +0900 Subject: arm: rmobile: alt: Add external RAM boot 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/arch/arm/cpu/armv7/rmobile/Kconfig b/arch/arm/cpu/armv7/rmobile/Kconfig index 082c767..8444d42 100644 --- a/arch/arm/cpu/armv7/rmobile/Kconfig +++ b/arch/arm/cpu/armv7/rmobile/Kconfig @@ -25,7 +25,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 #include +#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) -- cgit v0.10.2 From 1c556194d05845acdd271fe1e8f6d973b8841906 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:29 +0900 Subject: arm: rmobile: lager: Remove RAM address initialization 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu 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; -- cgit v0.10.2 From ef97b6ed89f52c3a39777f710081eb53f9496086 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:30 +0900 Subject: arm: rmobile: koelsch: Remove RAM address initialization 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu 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; -- cgit v0.10.2 From ca7bc8ff0d5255a85edf5d451d5e68006044e7cc Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:16:31 +0900 Subject: arm: rmobile: alt: Remove RAM address initialization 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 Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu 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; -- cgit v0.10.2 From 0e429bdf216934bd8179aedc6eab5c7a6448d3b6 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:30:25 +0900 Subject: arm: rmobile: alt: Fix typo of SCIF id Alt board use SCIF2, not SCIF0. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c index b668bf6..5c5a86f 100644 --- a/board/renesas/alt/alt.c +++ b/board/renesas/alt/alt.c @@ -43,7 +43,7 @@ void s_init(void) #define MSTPSR7 0xE61501C4 #define SMSTPCR7 0xE615014C -#define SCIF0_MSTP719 (1 << 19) +#define SCIF2_MSTP719 (1 << 19) #define MSTPSR8 0xE61509A0 #define SMSTPCR8 0xE6150990 @@ -63,8 +63,8 @@ int board_early_init_f(void) /* TMU */ mstp_clrbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125); - /* SCIF0 */ - mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF0_MSTP719); + /* SCIF2 */ + mstp_clrbits_le32(MSTPSR7, SMSTPCR7, SCIF2_MSTP719); /* ETHER */ mstp_clrbits_le32(MSTPSR8, SMSTPCR8, ETHER_MSTP813); -- cgit v0.10.2 From 7ffc8dfb98d8828c82e194b2475f5150d03c133a Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:30:26 +0900 Subject: arm: rmobile: alt: Add support USB and USB commands This adds support for USB commands and USB storage device. Signed-off-by: Yoshiyuki Ito Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/include/configs/alt.h b/include/configs/alt.h index 5a19096..502b727 100644 --- a/include/configs/alt.h +++ b/include/configs/alt.h @@ -31,6 +31,7 @@ #define CONFIG_CMD_DHCP #define CONFIG_CMD_NFS #define CONFIG_CMD_BOOTZ +#define CONFIG_CMD_USB #define CONFIG_CMD_SF #define CONFIG_CMD_SPI @@ -170,4 +171,10 @@ #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */ +/* USB */ +#define CONFIG_USB_STORAGE +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_RMOBILE +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 + #endif /* __ALT_H */ -- cgit v0.10.2 From 9cb8d9d2e0a34582f55939cbb9b2989633f24b34 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 31 Oct 2014 16:30:27 +0900 Subject: arm: rmobile: alt: Add VFAT filesystem support Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Nobuhiro Iwamatsu diff --git a/include/configs/alt.h b/include/configs/alt.h index 502b727..7bd649f 100644 --- a/include/configs/alt.h +++ b/include/configs/alt.h @@ -32,6 +32,8 @@ #define CONFIG_CMD_NFS #define CONFIG_CMD_BOOTZ #define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_FAT_WRITE #define CONFIG_CMD_SF #define CONFIG_CMD_SPI @@ -171,6 +173,10 @@ #define CONFIG_SYS_I2C_POWERIC_ADDR 0x58 /* da9063 */ +/* Filesystems */ +#define CONFIG_DOS_PARTITION +#define CONFIG_SUPPORT_VFAT + /* USB */ #define CONFIG_USB_STORAGE #define CONFIG_USB_EHCI -- cgit v0.10.2