summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-11-07 10:52:26 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-11-07 10:52:26 +0000
commit3952e6d008ce429d78740363bf2ec76b89f825ee (patch)
tree7e23ffaef8dc44340811e558c1f6a4a0348ddb2b
parent2b81bce27caeb3d4abb800dbac9bdf803d9170ea (diff)
downloadrockbox-3952e6d008ce429d78740363bf2ec76b89f825ee.zip
rockbox-3952e6d008ce429d78740363bf2ec76b89f825ee.tar.gz
rockbox-3952e6d008ce429d78740363bf2ec76b89f825ee.tar.bz2
rockbox-3952e6d008ce429d78740363bf2ec76b89f825ee.tar.xz
AS3525: enable access to the embedded SD card
Don't reset the peripherals Don't mind about the spare register Don't mind about MEMSTICK peripheral Use correct clock speeds for IDE Tested on Clip only git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19036 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 9c64a96..77d1ec1 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -285,25 +285,10 @@ static void init_pl180_controller(const int drive)
int sd_init(void)
{
- /* reset peripherals */
-
- CCU_SRC =
-#ifdef HAVE_MULTIVOLUME
- CCU_SRC_SDMCI_EN |
-#endif
- CCU_SRC_NAF_EN | CCU_SRC_IDE_EN | CCU_SRC_IDE_AHB_EN | CCU_SRC_MST_EN;
-
- CCU_SRL = CCU_SRL_MAGIC_NUMBER;
- CCU_SRL = 0;
-
- GPIOC_DIR &= ~(1<<1);
- if(GPIOC_PIN(1))
- CCU_SPARE1 |= 4; /* sets bit 2 of undocumented register */
- else
- CCU_SPARE1 &= ~4; /* or clear it */
-
- CGU_IDE = (1<<7)|(1<<6); /* enable, 24MHz clock */
- CGU_MEMSTICK = (1<<8); /* enable, 24MHz clock */
+ CGU_IDE = (1<<7) /* AHB interface enable */ |
+ (1<<6) /* interface enable */ |
+ (2<<2) /* clock didiver = 2+1 */ |
+ 1 /* clock source = PLLA */;
CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
#ifdef HAVE_MULTIVOLUME