Hi, Jan

EDKII SD stack only supports PIO data transfer for sample clock tuning command. 
Why I didn't add formal PIO support for all cmds is because the 
SD_MMC_PASS_THRU interface has no such field to specify the transfer method. So 
I by default uses ADMA2 mode.

If you want to add PIO support, you just need modify two places:
1. line 1272 to line 1276 of SdMmcCreateTrb() to assign PIO mode for your cmds 
besides clock tuning cmd.
2. line 1815 to line 1839 of SdMmcCheckTrbResult() to read data till all blocks 
get read out. (see SD Host controller spec 3.0 figure 3-13)

For DMA cache coherence issue, it's abstracted by PciIo.AllocateBuffer() & 
Map() & Unmap() interface to provide a consistent memory.

Thanks
Feng

-----Original Message-----
From: Jan Dąbroś [mailto:[email protected]] 
Sent: Tuesday, May 17, 2016 11:07 PM
To: Tian, Feng <[email protected]>
Cc: [email protected]; Neta Zur Hershkovits <[email protected]>; Yehuda 
Yitschak <[email protected]>; Marcin Wojtas <[email protected]>
Subject: Problem with SD stack

Hi Feng,

I am writing UEFI driver for SD/MMC controller on my platform.
Unfortunately, I have a problem with communication between card and controller.

I implement SdMmcPassThru protocol (mainly based on your implementation, only 
bigger changes in initialization sequence) and want to use your SD driver. My 
situation is as follow:

I am trying to use PIO mode for data transfer.
Commands are transfered between controller and SD card (e.g. CMD8, ACMD41, 
ACMD6,  and so on), What's more responses are correct (e.g CSD register).
Problems start when generic UEFI stack tries to read block of data from card. 
My driver sends CMD17 to card but when we check 
NORMAL_INTERRUPT_STATUS_REGISTER there is BIT15 set (what indicates error). 
ERROR_INTERRUPT_STATUS_REGISTER has set BIT6
(RD_DATA_END_BIT_ERROR) - do you know what may cause such error?

Do you have any tips, what should I try to do?

Does UEFI SD stack support PIO data transfer? Was it tested on any platform? 
And if DMA will be used, what about cache maintanance in your driver?

If any additional information are neccesary, please ask.

Best Regards,
Jan
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to