Hello there . I'm trying to enable MCI for SDIO 4 bit wide bus mode on AT91SAM9261 Evalution Kit to test a Wifi application . And I modified the bootstrap sources provided by Atmel a bit to include the SDIO 4 bit mode. I modified the at91sam9261ek.c to add a few statements in the hw_init function :
Code:
/*Configure processor clock = main clock and the MCK = Processor Clock divided by 4 */
writel(0x0,(AT91C_BASE_PMC + PMC_MCKR));
/* Configure the Peripheral Clocks to enable MCI Clock*/
pmc_cfg_MCIclk();
/* Configure the MCI control resgister to enable Multi-Media Interface*/
writel(AT91C_MCI_MCIEN , (AT91C_BASE_MCI + MCI_CR));
/* Configure MCI Mode Resgister to set Clock Divider to zero */
writel(0x0 , (AT91C_BASE_MCI + MCI_MR));
/* Configure MCI SDCard Register to set slot A and 4-bit SDIO */
writel(((0x1<<7)|(0x0<<0)),(AT91C_BASE_MCI + MCI_SDCR));
Then , I re-compiled the whole sources and check it with my board . I found that the bootstrap couldn't recognize the Uboot and there is no signal on the MCI_CLK output.
However , when i commented the statement writel(0x0,(AT91C_BASE_PMC + PMC_MCKR)); and re-compiled the sources , the Uboot can be normally loaded . The MCI_CLK could output unstable clock signal for a few seconds then it goes to zero. Could somebody tell me how can i include the SDIO4-bit mode normally ? Sorry for my poor English and I would appreciate your help . Thanks !