On Mon, Oct 20, 2014 at 02:40:13AM -0400, Andrew Hills wrote: > On 10/19/14, 11:15 AM, Gerke M. Preussner wrote: > > I haven't had any time yet to look into this. Were you able to make any > > progress on your end? > > I'm not sure I'd call it progress; I'm not familiar with the MMC > protocol, so I'm spending most of my time learning rather than debugging. > > During the initialization, I see sys/dev/sdmmc roughly follow this order: > > sdmmc_card_attach() > . sdmmc_enable() > .. sdmmc_mem_enable() > ... sdmmc_mem_send_op_cond() reads memory OCR > ... sdmmc_mem_send_op_cond() attempts to send memory OCR > .... sdmmc_mmc_command() doesn't fail, but doesn't succeed > (MMC_OCR_MEM_READY is not set) > .... command times out after 100 attempts (sdmmc_mem.c:519-538) > > What I haven't been able to figure out is why the command doesn't have > the intended effect. Unfortunately, I enabled debug statements in > sys/arch/armv7/omap/ommmc.c without thinking, so the system is unusable > until I get the old bsd.umg back. Hopefully more to come soon. >
I tracked the problem down, it seems u-boot only sets up CAPA for emmc. With the diff below I can access the sd card on my bbb rev C (sd0) in addition to the emmc (sd1). Both are still quite slow though, with reads to the raw device around 780 KB/s on sd and 800 KB/s on emmc. Besides DMA, it sounds like opting into a higher bus width (4 bit on sd, 8 bit on emmc) and clock speeds might help there? Then there is also the HSPE/High Speed Enable bit in HCTL. scsibus0 at sdmmc0: 2 targets, initiator 0 sd0 at scsibus0 targ 1 lun 0: <SD/MMC, Drive #01, > SCSI2 0/direct fixed sd0: 15271MB, 512 bytes/sector, 31275008 sectors scsibus1 at sdmmc1: 2 targets, initiator 0 sd1 at scsibus1 targ 1 lun 0: <SD/MMC, Drive #01, > SCSI2 0/direct fixed sd1: 3688MB, 512 bytes/sector, 7553024 sectors Index: ommmc.c =================================================================== RCS file: /cvs/src/sys/arch/armv7/omap/ommmc.c,v retrieving revision 1.12 diff -u -p -r1.12 ommmc.c --- ommmc.c 4 Dec 2013 12:31:14 -0000 1.12 +++ ommmc.c 2 Nov 2014 09:45:39 -0000 @@ -300,11 +300,8 @@ ommmc_attach(struct device *parent, stru goto err; } -#if 0 - /* XXX - IIRC firmware should set this */ /* Controller Voltage Capabilities Initialization */ HSET4(sc, MMCHS_CAPA, MMCHS_CAPA_VS18 | MMCHS_CAPA_VS30); -#endif #ifdef SDHC_DEBUG ommmc_dump_regs(sc);