summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/system-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-02-23 06:59:58 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-02-23 06:59:58 +0000
commite32e180244a410088f97affda08d62521b78a054 (patch)
tree7722f0a0519a47109bcc2bf7b47110776511b3f7 /firmware/target/arm/as3525/system-as3525.c
parent01a6efc669997ddad7a72c8da4d36fdeb47fa426 (diff)
downloadrockbox-e32e180244a410088f97affda08d62521b78a054.tar.gz
rockbox-e32e180244a410088f97affda08d62521b78a054.tar.bz2
rockbox-e32e180244a410088f97affda08d62521b78a054.zip
as3525v2: share more of system_init() between the 2 SoCs
Differences remaining: - list of peripherals reset - CGU_PROC isn't modified on as3525v2 - CGU_PLLA bits aren't known, but we use a known setting for 240MHz git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24868 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/system-as3525.c')
-rw-r--r--firmware/target/arm/as3525/system-as3525.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index f0493d51d7..db01da426b 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -258,27 +258,13 @@ void memory_init(void)
void system_init(void)
{
#if CONFIG_CPU == AS3525v2
- /* Init procedure isn't fully understood yet
- * CCU_* registers differ from AS3525
- */
- unsigned int reset_loops = 640;
-
CCU_SRC = 0x57D7BF0;
- while(reset_loops--)
- CCU_SRL = CCU_SRL_MAGIC_NUMBER;
- CCU_SRC = CCU_SRL = 0;
-
-#ifdef BOOTLOADER /* FIXME */
- CGU_PERI &= ~0x7f; /* pclk 24 MHz */
- CGU_PERI |= ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_PCLK_FREQ) - 1) << 2)
- | 1; /* clk_in = PLLA */
-#endif
-
#else
- unsigned int reset_loops = 640;
-
CCU_SRC = 0x1fffff0
& ~CCU_SRC_IDE_EN; /* FIXME */
+#endif
+
+ unsigned int reset_loops = 640;
while(reset_loops--)
CCU_SRL = CCU_SRL_MAGIC_NUMBER;
CCU_SRC = CCU_SRL = 0;
@@ -286,7 +272,9 @@ void system_init(void)
CCU_SCON = 1; /* AHB master's priority configuration :
TIC (Test Interface Controller) > DMA > USB > IDE > ARM */
+#if CONFIG_CPU == AS3525
CGU_PROC = 0; /* fclk 24 MHz */
+#endif
CGU_PERI &= ~0x7f; /* pclk 24 MHz */
CGU_PLLASUP = 0; /* enable PLLA */
@@ -299,12 +287,15 @@ void system_init(void)
while(!(CGU_INTCTRL & (1<<1))); /* wait until PLLB is locked */
#endif
+#if CONFIG_CPU == AS3525
/* Set FCLK frequency */
CGU_PROC = ((AS3525_FCLK_POSTDIV << 4) |
(AS3525_FCLK_PREDIV << 2) |
AS3525_FCLK_SEL);
+#endif
+
/* Set PCLK frequency */
- CGU_PERI = ((CGU_PERI & ~0x7F) | /* reset divider bits 0:6 */
+ CGU_PERI = ((CGU_PERI & ~0x7F) | /* reset divider & clksel bits */
(AS3525_PCLK_DIV0 << 2) |
(AS3525_PCLK_DIV1 << 6) |
AS3525_PCLK_SEL);
@@ -315,8 +306,6 @@ void system_init(void)
"mcr p15, 0, r0, c1, c0 \n"
: : : "r0" );
-#endif /* CONFIG_CPU == AS3525v2 */
-
#ifdef BOOTLOADER
sdram_init();
#endif /* BOOTLOADER */