[U-Boot] [PATCH 3/3 v8] mmc: add generic mmc spi driver

Thomas Chou thomas at wytron.com.tw
Mon Jul 5 16:22:45 CEST 2010


Hi Mike,

Thank you very much for the review and testing.


On 07/05/2010 03:40 PM, Mike Frysinger wrote:
> On Wednesday, May 19, 2010 00:37:47 Thomas Chou wrote:
>> --- /dev/null
>> +++ b/common/cmd_mmc_spi.c
>> +	printf("%s: %d at %u:%u %u %u\n", mmc->name, mmc->block_dev.dev,
>> +	       bus, cs, speed, mode);
>
> this is a bit terse.  how about prefixing the hz output with like "hz:" and
> the mode with like "mode:" ?

Yes, I will add them.

>
>> +U_BOOT_CMD(
>> +	mmc_spi,	4,	0,	do_mmc_spi,
>> +	"mmc_spi setup",
>> +	"[bus:]cs [hz] [mode]	- setup mmc_spi device on given\n"
>> +	"				   SPI bus and chip select\n"
>> +);
>
> there should be no newline at the end of the help string

OK. I will remove the last newline.

>
>> --- /dev/null
>> +++ b/drivers/mmc/mmc_spi.c
>> +struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode)
>> +{
>> +	struct mmc *mmc;
>> +	mmc->b_max = MMC_SPI_MAX_BLOCKS;
>
> do you have some local modification ?  i dont see b_max anywhere in
> include/mmc.h ...

Please apply the multi-blocks patches (1,2,3/4) from Alagu on 05/12, as 
Andy said he had applied them.


>
> unfortunately though, i tried this on my system and it doesnt seem to work.
> using a simple SPI<->MMC card, the old mmc_spi driver works on my board, but
> booting the new u-boot and running the same things shows:
>

> mmc_spi_request:cmd1 1 40300000 0
> mmc_spi_sendcmd:cmd1 resp4 1
> <these last 2 lines repeat for a while>
> Card did not respond to voltage select!

It seems the mmc card was not initialized and timed out. Please try 
remove the OCR_HCS in mmc_send_op_cond() of mmc.c temporarily.

	cmd.cmdarg = OCR_HCS | mmc->voltages;
---------------------^^^^^^^^^

Best regards,
Thomas



More information about the U-Boot mailing list