[U-Boot] [PATCH 3/3 v8] mmc: add generic mmc spi driver
Mike Frysinger
vapier at gentoo.org
Mon Jul 5 22:11:52 CEST 2010
On Monday, July 05, 2010 10:22:45 Thomas Chou wrote:
> On 07/05/2010 03:40 PM, Mike Frysinger wrote:
> > On Wednesday, May 19, 2010 00:37:47 Thomas Chou wrote:
> >> --- /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.
those arent required for basic probing functionality, right ?
> > 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;
> ---------------------^^^^^^^^^
that does fix the timeout/warning, but the card doesnt probe yet:
bfin> mmcinfo
mmc_spi_init_p: clock 0
mmc_spi_set_ios: clock 0
mmc_spi_set_ios: clock 400000
mmc_spi_request:cmd0 0 0 0
mmc_spi_sendcmd:cmd0 resp8 ff
Device: MMC_SPI
Manufacturer ID: 0
OEM: 0
Name: Tran Speed: 0
Rd Block Len: 0
MMC version 0.0
High Capacity: No
Capacity: 0
Bus Width: 1-bit
if i boot up the old u-boot and probe the card there, then load up the new u-
boot and try again, things get further:
bfin> mmcinfo
mmc_spi_init_p: clock 0
mmc_spi_set_ios: clock 0
mmc_spi_set_ios: clock 400000
mmc_spi_request:cmd0 0 0 0
mmc_spi_sendcmd:cmd0 resp6 1
mmc_spi_request:cmd8 15 1aa 0
mmc_spi_sendcmd:cmd8 resp8 ff
mmc_spi_request:cmd55 15 0 0
mmc_spi_sendcmd:cmd55 resp6 5
mmc_spi_request:cmd0 0 0 0
mmc_spi_sendcmd:cmd0 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 1
mmc_spi_request:cmd1 1 300000 0
mmc_spi_sendcmd:cmd1 resp6 0
mmc_spi_request:cmd58 1 0 0
mmc_spi_sendcmd:cmd58 resp6 0
r32 ffffffff
mmc_spi_request:cmd10 7 0 0
mmc_spi_sendcmd:cmd10 resp6 0
mmc_spi_readdata:tok0 80
r128 0 ff7a0000 fdff 3831f903
mmc_spi_request:cmd9 7 0 0
mmc_spi_sendcmd:cmd9 resp6 0
mmc_spi_readdata:tok1 fe
r128 ff4900 263 61726420 1659810
mmc_spi_set_ios: clock 20000000
mmc_spi_request:cmd16 15 1 0
mmc_spi_sendcmd:cmd16 resp6 0
mmc_spi_request:cmd17 15 0 0
mmc_spi_sendcmd:cmd17 resp8 ff
block read failed: -16
Device: MMC_SPI
Manufacturer ID: 0
OEM: 0
Name: Tran Speed: 0
Rd Block Len: 1
MMC version 1.2
High Capacity: Yes
Capacity: 2374355968
Bus Width: 1-bit
however, in poking the code, i see your mmc_spi_init_p() function calls
spi_claim_bus(), but nowhere do i see spi_release_bus().
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100705/5bf8f0e8/attachment.pgp
More information about the U-Boot
mailing list