[U-Boot] at91sam9g45ekes SDHC/MMC

Henry Súcart henry.sucart at gmail.com
Mon Mar 15 22:40:45 CET 2010


Hi Albin,

First of all thanks for the quick reply.

I tried out what you said about adding #define CONFIG_AT91_MCI1 to the board
config file but although that did got rid of the mmc: command 1 failed
(status: 0x0c100025) error it still doesn't see the SD card. After doing
some debugging it seems like the statement:

if (aresp[0] & (R1_ILLEGAL_COMMAND | R1_APP_CMD)) != R1_APP_CMD)
     return -ENODEV;

in mmc_acmd() is being executed, which is causing my problem. Any
suggestions?

Thanks,
Henry

On Mon, Mar 15, 2010 at 4:10 PM, Albin Tonnerre <
albin.tonnerre at free-electrons.com> wrote:

> On Mon, 15 Mar 2010 15:51 -0400, Henry Súcart wrote :
> > Hi,
>
> Hi Henry,
>
> > I've been trying to get an SD card working with an at91sam9g45ek-es
> board. I
> > read a couple of threads in the archive and ended up doing this:
> >
> > I applied these patches:
> >
> > http://lists.denx.de/pipermail/u-boot/2009-August/059595.html
> > http://lists.denx.de/pipermail/u-boot/2009-September/060053.html
> > http://lists.denx.de/pipermail/u-boot/2009-September/060243.html
> >
> > Added these #define's to include/configs/at91sam9m10g45ek.h:
> >
> > #define CONFIG_CMD_EXT2   1
> > #define CONFIG_CMD_FAT     1
> > #define CONFIG_CMD_MMC   1
> > #define CONFIG_MMC            1
> > #define CONFIG_ATMEL_MCI  1
> >
> > Finally, I added this to the board init function:
> >
> > #ifdef CONFIG_ATMEL_MCI
> > at91_mci0_hw_init(0, 4);
> > #endif
> >
> > When I try it out this is what I get:
> > U-Boot> mmc init 0
> > mmc: clock 150000 too low; setting CLKDIV to 255
> > mmc: command 1 failed (status: 0x0c100025)
> > No MMC card found
> >
> > Am I doing something wrong? Any help is appreciated,
>
> Maybe you're not. The at91sam9m10g45 has 2 MMC ports, and the atmel_mci
> driver
> only uses one, defined using MMCI_BASE. Now if you look at the end of the
> third
> patch:
>
> diff --git a/include/asm-arm/arch-at91/memory-map.h
> b/include/asm-arm/arch-at91/memory-map.h
> index f605f37..de0aba7 100644
> --- a/include/asm-arm/arch-at91/memory-map.h
> +++ b/include/asm-arm/arch-at91/memory-map.h
> @@ -32,4 +32,10 @@
>  #define USART3_BASE (AT91_BASE_SYS + AT91_DBGU)
>  #define SPI0_BASE      AT91_BASE_SPI
>
> +#ifndef CONFIG_AT91_MCI1
> +#define MMCI_BASE AT91_BASE_MCI0
> +#else
> +#define MMCI_BASE AT91_BASE_MCI1
> +#endif
> +
>
> So maybe the issue is that it's trying to read on the wrong port. Could you
> try
> to add #define CONFIG_AT91_MCI1 in your board config, recompile and see if
> that
> works better?
>
> Thanks,
> --
> Albin Tonnerre, Free Electrons
> Kernel, drivers and embedded Linux development,
> consulting, training and support.
> http://free-electrons.com
>


More information about the U-Boot mailing list