From 19fc7297bae8225bfaab51bd8b1f2f8c3aa67858 Mon Sep 17 00:00:00 2001 From: Jack Halpin Date: Tue, 23 Mar 2010 17:00:59 +0000 Subject: SansaAMSv2: Give register CGU_BASE + 0x3C the name CGU_SDSLOT. Move CLKDIV macros into clock-target.h. Only enable the necessary interfaces for the 3 clock registers used for SD. Add MEMSTICK and SDSLOT registers to bottom of register display in View HW info debug page. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25309 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'firmware/target/arm/as3525/sd-as3525v2.c') diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 945d6e5302..250dfca784 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -641,18 +641,20 @@ static void init_controller(void) int sd_init(void) { int ret; + CGU_PERI |= CGU_MCI_CLOCK_ENABLE; - CGU_IDE = (1<<7) /* AHB interface enable */ | - (1<<6) /* interface enable */ | - ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1) << 2) | - 1; /* clock source = PLLA */ + CGU_IDE = (1<<7) /* AHB interface enable */ + | (AS3525_IDE_DIV << 2) + | 1; /* clock source = PLLA */ - CGU_MEMSTICK = (1<<8) | (1<<7) | - ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_MS_FREQ) -1) << 2) | 1; + CGU_MEMSTICK = (1<<7) /* interface enable */ + | (AS3525_MS_DIV << 2) + | 1; /* clock source = PLLA */ - *(volatile int*)(CGU_BASE+0x3C) = (1<<7) | - (CLK_DIV(AS3525_PLLA_FREQ, 24000000) -1)<<2 | 1; + CGU_SDSLOT = (1<<7) /* interface enable */ + | (AS3525_SDSLOT_DIV << 2) + | 1; /* clock source = PLLA */ wakeup_init(&transfer_completion_signal); -- cgit v1.2.3