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
This commit is contained in:
Rafaël Carré 2008-11-07 10:52:26 +00:00
parent 2b81bce27c
commit 3952e6d008

View file

@ -285,25 +285,10 @@ static void init_pl180_controller(const int drive)
int sd_init(void) int sd_init(void)
{ {
/* reset peripherals */ CGU_IDE = (1<<7) /* AHB interface enable */ |
(1<<6) /* interface enable */ |
CCU_SRC = (2<<2) /* clock didiver = 2+1 */ |
#ifdef HAVE_MULTIVOLUME 1 /* clock source = PLLA */;
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_PERI |= CGU_NAF_CLOCK_ENABLE; CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME