[U-Boot] CONFIG_GENERIC_MMC Usage

I have a PXA270 system with U-boot v2009.08 installed, currently this system is successfully using the U-boot mmc interface (legacy) . However, after looking through the u-boot source code, I see there is a new mmc interface (CONFIG_GENERIC_MMC), should I be using the generic mmc interface? I have tried it but it does not seem to work, I'm assuming that it probably requires initialization of the MMC hardware in the board files whereas in the legacy mmc system that was done by the (legacy_mmc_init) board specific mmc (pxa_mmc.c) code.
Questions regarding the new GENERIC_MMC interface: 1.) Is there any documentation in place (or can someone send me off a quick reply) on how to set up the generic mmc driver with a board? 2.) Is it ready (recommended) to use or is it still under heavy development? 3.) Does it support SDHC or just SD?
Regards, Shane

Dear Shane Volpe
2009/10/15 Shane Volpe shanevolpe@gmail.com:
I have a PXA270 system with U-boot v2009.08 installed, currently this system is successfully using the U-boot mmc interface (legacy) . However, after looking through the u-boot source code, I see there is a new mmc interface (CONFIG_GENERIC_MMC), should I be using the generic mmc interface? I have tried it but it does not seem to work, I'm assuming that it probably requires initialization of the MMC hardware in the board files whereas in the legacy mmc system that was done by the (legacy_mmc_init) board specific mmc (pxa_mmc.c) code.
Questions regarding the new GENERIC_MMC interface: 1.) Is there any documentation in place (or can someone send me off a quick reply) on how to set up the generic mmc driver with a board? 2.) Is it ready (recommended) to use or is it still under heavy development?
generic mmc interface is ready
3.) Does it support SDHC or just SD?
support both of them
Regards, Shane _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Thanks Minkyu Kang

Minkyu, Thank you for the response. I have only one question remaining:
1.) Is there any documentation in place (or can someone send me off a quick reply) on how to set up the generic mmc driver with a board?
I'm assuming what I need to do is add code to my board file to initialize the MMC hardware. This was originally done in " drivers/mmc/pxa_mmc.c" with mmc_init() well now it is mmc_legacy_init().
I'm assuming all I would need to do is remove all the mmc commands from that code and just *take* the hardware initialization code from it (check it for accuracy) and add it to my board file, is that correct?
Regards, Shane
On Fri, Oct 16, 2009 at 7:57 AM, Minkyu Kang promsoft@gmail.com wrote:
Dear Shane Volpe
2009/10/15 Shane Volpe shanevolpe@gmail.com:
I have a PXA270 system with U-boot v2009.08 installed, currently this system is successfully using the U-boot mmc interface (legacy) . However, after looking through the u-boot source code, I see there is a new mmc interface (CONFIG_GENERIC_MMC), should I be using the generic mmc interface? I have tried it but it does not seem to work, I'm assuming that it probably requires initialization of the MMC hardware in the board files whereas in the legacy mmc system that was done by the (legacy_mmc_init) board specific mmc (pxa_mmc.c) code.
Questions regarding the new GENERIC_MMC interface: 1.) Is there any documentation in place (or can someone send me off a quick reply) on how to set up the generic mmc driver with a board? 2.) Is it ready (recommended) to use or is it still under heavy development?
generic mmc interface is ready
3.) Does it support SDHC or just SD?
support both of them
Regards, Shane _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Thanks Minkyu Kang -- from. prom. www.promsoft.net

On Friday 16 October 2009 09:45:20 Shane Volpe wrote:
Minkyu,
please do not top post
1.) Is there any documentation in place (or can someone send me off a quick reply) on how to set up the generic mmc driver with a board?
if you read the arch-specific init files you'll see that a call is made to mmc_initialize() which in turn calls a board-specific board_mmc_init(). your board_mmc_init() then calls the driver init functions. it's the same idiom that is used for most U-Boot subsystems now.
I'm assuming what I need to do is add code to my board file to initialize the MMC hardware. This was originally done in " drivers/mmc/pxa_mmc.c" with mmc_init() well now it is mmc_legacy_init().
no, your board should not be doing any driver-specific initialization -mike

Sorry for the top post, I forgot to delete it.
Mike,
if you read the arch-specific init files you'll see that a call is made to mmc_initialize() which in turn calls a board-specific board_mmc_init(). your board_mmc_init() then calls the driver init functions. it's the same idiom that is used for most U-Boot subsystems now.
Ok, thanks I see the board_mmc_init() call and I also grep'd the board directory and see the following example: board/freescale/mpc837xemds/mpc837xemds.c
That's what I thought, I should add the function board_mmc_init to my board file and add in all code needed to initialize the MMC hardware for the PXA270.
-Shane

After further reviewing the code I now see getting the PXA working with the GENERIC_MMC interface is more complex than I thought. From what I can tell reading through the code I really need to re-write the driver/pxa_mmc.c to support the mmc structure (include/mmc.h). It needs to have an initializer that sets up all of the variables in the mmc structure and have the required functions for the new mmc: send_cmd, set_ios and init.
Before I attempt writing the pxa generic mmc code I just wanted to post and see if anyone else is working on it. Regards, Shane
participants (3)
-
Mike Frysinger
-
Minkyu Kang
-
Shane Volpe