[U-Boot] [PATCH 7/7] arm: rmobile: gose: Halt clock prior to booting kernel
Nobuhiro Iwamatsu
nobuhiro.iwamatsu.yj at renesas.com
Mon Dec 1 08:05:56 CET 2014
Before a kernel boots, GPIO, SYS-DMAC, QSPI, MSIOF and IPMMU-GP
clock is halted.
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak at renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
---
board/renesas/gose/gose.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index 0b2d904..5ee5a06 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -60,14 +60,54 @@ int board_early_init_f(void)
return 0;
}
+static struct mstp_ctl {
+ u32 s_addr;
+ u32 s_dis;
+ u32 s_ena;
+ u32 r_addr;
+ u32 r_dis;
+ u32 r_ena;
+} mstptbl[] = {
+ [0] = { SMSTPCR0, 0x00640801, 0x00400000,
+ RMSTPCR0, 0x00640801, 0x00000000 },
+ [1] = { SMSTPCR1, 0x9B6C9B5A, 0x00000000,
+ RMSTPCR1, 0x9B6C9B5A, 0x00000000 },
+ [2] = { SMSTPCR2, 0x100D21FC, 0x00002000,
+ RMSTPCR2, 0x100D21FC, 0x00000000 },
+ [3] = { SMSTPCR3, 0xF08CD810, 0x00000000,
+ RMSTPCR3, 0xF08CD810, 0x00000000 },
+ [4] = { SMSTPCR4, 0x800001C4, 0x00000180,
+ RMSTPCR4, 0x800001C4, 0x00000000 },
+ [5] = { SMSTPCR5, 0x44C00046, 0x00000000,
+ RMSTPCR5, 0x44C00046, 0x00000000 },
+ [7] = { SMSTPCR7, 0x05BFE618, 0x00200000,
+ RMSTPCR7, 0x05BFE618, 0x00000000 },
+ [8] = { SMSTPCR8, 0x40C0FE85, 0x00000000,
+ RMSTPCR8, 0x40C0FE85, 0x00000000 },
+ [9] = { SMSTPCR9, 0xFF979FFF, 0x00000000,
+ RMSTPCR9, 0xFF979FFF, 0x00000000 },
+ [10] = { SMSTPCR10, 0xFFFEFFE0, 0x00000000,
+ RMSTPCR10, 0xFFFEFFE0, 0x00000000 },
+ [11] = { SMSTPCR11, 0x000001C0, 0x00000000,
+ RMSTPCR11, 0x000001C0, 0x00000000 },
+};
+
#define TSTR0 0x04
#define TSTR0_STR0 0x01
void arch_preboot_os(void)
{
+ int i;
+
/* stop TMU0 */
mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0);
- /* Disable TMU0 */
- mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125);
+
+ /* Stop all module clock */
+ for (i = 0; i < ARRAY_SIZE(mstptbl); i++) {
+ mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr,
+ mstptbl[i].s_dis, mstptbl[i].s_ena);
+ mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr,
+ mstptbl[i].r_dis, mstptbl[i].r_ena);
+ }
}
#define PUPR5 0xE6060114
--
2.1.3
More information about the U-Boot
mailing list