[edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

Wu, Hao A hao.a.wu at intel.com
Fri Jun 28 08:14:11 UTC 2019


Hello Marcin,

I just realized that the series added 2 new bus modes (SdMmcSdDs and SdMmcSdHs) for 3.3V signaling SD card:

Judging from your log:
SdCardSetBusMode: Target bus mode: bus timing = 1, bus width = 4, clock freq[MHz] = 50, driver strength = 255
which “bus timing = 1” means SdMmcSdHs (3.3V High Speed mode) is selected by the SdMmcPciHcDxe driver.

So I have attached a patch to handle the 2 added bus modes in Silicon/Marvell/Drivers/SdMmc/XenonDxe/.
Or you can get the patch at https://github.com/hwu25/edk2-platforms/tree/Marvell_XenonDxe

Please help to see if this solve your issue, thanks in advance.

Best Regards,
Hao Wu

From: Marcin Wojtas [mailto:mw at semihalf.com]
Sent: Friday, June 28, 2019 3:42 PM
To: Wu, Hao A
Cc: Albecki, Mateusz; Sumit Garg; Ard Biesheuvel; edk2-devel-groups-io
Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

Hi Hao,

pt., 28 cze 2019 o 09:23 Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>> napisał(a):
Hello Marcin,

Do you mean by only reverting as below:
-  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((CommandSystem & 0xF) << 4) | \
-                                ((DriverStrength & 0xF) << 8) | ((PowerLimit & 0xF) << 12) | \
+  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((PowerLimit & 0xF) << 4) | \^M
+                                ((DriverStrength & 0xF) << 8) | ((DriverStrength & 0xF) << 12) | \^M
                                 ModeValue;

All your devices work fine?

Since the origin code is clearly not correct (DriveStrength used 2 times,
the offset of PowerLimit is not 4, should be 12 according to SD spec).

Ok, just rechecked. It doesn't help for my 1 problematic case. Anyway for the next time I think it may be worth to split some improvements out of such big patches.

I won't be able to debug my board until second week of July (at best), so in order not to block you please go ahead with merging (the most important board (MacchiatoBin) seems not suffer any regression).

Best regards,
Marcin


Best Regards,
Hao Wu

From: Marcin Wojtas [mailto:mw at semihalf.com<mailto:mw at semihalf.com>]
Sent: Friday, June 28, 2019 2:33 PM
To: Wu, Hao A; Albecki, Mateusz
Cc: Sumit Garg; Ard Biesheuvel; edk2-devel-groups-io
Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol

Hi,

I was almost happily sending you email with 'tested-by' information, but I checked 3 boards:
Board 1 (out of tree): SD - OK, MMC - OK
Board 2: (Armada80x0McBin): SD - OK, MMC - OK
Board 3: (Armada70x0Db): SD - problems, MMC - OK

In the latter case I get stall and booting takes around 3 minutes.
Without "MdeModulePkg/SdMmcHcDxe: Implement revision 3 of SdMmcOverrideProtocol" patch it works as before.

I enabled debugs, and in theory everything seems fine, the DriverStrength is set to EDKII_SD_MMC_DRIVER_STRENGTH_IGNORE.
SdCardIdentification: Found a SD device at slot [0]
SdCardSetBusMode: Target bus mode: bus timing = 1, bus width = 4, clock freq[MHz] = 50, driver strength = 255

However right after Csd register dump the booting stalls until printing following and continuing:
FatOpenDevice: read of part_lba failed Time out

This is absent from the prints I dumped from vanilla kernel. Despite I currently really have no time to additional debug, I checked and with following diff, everything works as before:

--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -536,8 +536,8 @@ SdCardSwitch (
       AccessMode = 0xF;
   }

-  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((CommandSystem & 0xF) << 4) | \
-                                ((DriverStrength & 0xF) << 8) | ((PowerLimit & 0xF) << 12) | \
+  SdMmcCmdBlk.CommandArgument = (AccessMode & 0xF) | ((PowerLimit & 0xF) << 4) | \^M
+                                ((DriverStrength & 0xF) << 8) | ((DriverStrength & 0xF) << 12) | \^M
                                 ModeValue;

Above is restoring SdMmcCmdBlk.CommandArgument to the state from before the patch in question. Now the question - why the layout of the command changed? CommandSystem was unused before, and PowerLimit changed its position. Is this change really related to the rest of the patch? What is the justification?

Best regards,
Marcin


pt., 28 cze 2019 o 02:57 Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>> napisał(a):
> -----Original Message-----
> From: Sumit Garg [mailto:sumit.garg at linaro.org<mailto:sumit.garg at linaro.org>]
> Sent: Thursday, June 27, 2019 9:39 PM
> To: Ard Biesheuvel
> Cc: edk2-devel-groups-io; Wu, Hao A; Marcin Wojtas; Albecki, Mateusz
> Subject: Re: [edk2-devel] [PATCH v4 0/2] MdeModulePkg/SdMmcHcDxe:
> Implement revision 3 of SdMmcOverrideProtocol
>
> On Thu, 27 Jun 2019 at 13:40, Ard Biesheuvel <ard.biesheuvel at linaro.org<mailto:ard.biesheuvel at linaro.org>>
> wrote:
> >
> > (+ Sumit)
> >
> > On Thu, 27 Jun 2019 at 08:29, Wu, Hao A <hao.a.wu at intel.com<mailto:hao.a.wu at intel.com>> wrote:
> > >
> > > > -----Original Message-----
> > > > From: Marcin Wojtas [mailto:mw at semihalf.com<mailto:mw at semihalf.com>]
> > > > Sent: Thursday, June 27, 2019 2:25 PM
> > > > To: Albecki, Mateusz
> > > > Cc: edk2-devel-groups-io; Wu, Hao A
> > > > Subject: Re: [edk2-devel] [PATCH v4 0/2]
> MdeModulePkg/SdMmcHcDxe:
> > > > Implement revision 3 of SdMmcOverrideProtocol
> > > >
> > > > Hi Mateusz,
> > > >
> > > > Can you please push those patches somewhere (github?) so that I can
> > > > easily do a quick check for regression?
> > > >
> > > > Thanks,
> > > > Marcin
> > >
> > >
> > > Hello Marcin,
> > >
> > > I have just pushed the series at:
> > > https://github.com/hwu25/edk2/tree/sdmmc_override_extend_v4
> > >
> > > Please help to check.
> > >
> >
> > I have cc'ed my colleague Sumit, who has kindly agreed to regression
> > test this branch on Socionext SynQuacer, which also uses the SD/MMC
> > override infrastructure.
> >
> > Sumit, please reply here with your results. And thanks again!
>
> I did picked this patch-set and applied on top of edk2 master branch.
> It works well on SynQuacer with eMMC device enumerated properly and
> all three eMMC partitions are visible:
>
>      BLK4: Alias(s):
>           VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,000030520000000000)/eMMC(0x
> 0)/Ctrl(0x0)
>      BLK5: Alias(s):
>           VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,000030520000000000)/eMMC(0x
> 0)/Ctrl(0x1)
>      BLK6: Alias(s):
>           VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,000030520000000000)/eMMC(0x
> 0)/Ctrl(0x2)
>
> Shell> devices
> <snip>
>   E9 D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,0000305200000000
> 00)/eMMC(0x0)/Ctrl(0x0)
>   EA D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,0000305200000000
> 00)/eMMC(0x0)/Ctrl(0x1)
>   EB D - -  1  1   0 VenHw(0D51905B-B77E-452A-A2C0-
> ECA0CC8D514A,0000305200000000
> 00)/eMMC(0x0)/Ctrl(0x2)
>
> So you can add following:
>
> Regression-tested-by: Sumit Garg <sumit.garg at linaro.org<mailto:sumit.garg at linaro.org>>


Thanks a lot for the testing.

Best Regards,
Hao Wu


>
> -Sumit



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42995): https://edk2.groups.io/g/devel/message/42995
Mute This Topic: https://groups.io/mt/32214570/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190628/5e05424d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Marvell-XenonDxe-Add-handles-for-SD-3.3V-bus-modes.patch
Type: application/octet-stream
Size: 1803 bytes
Desc: 0001-Marvell-XenonDxe-Add-handles-for-SD-3.3V-bus-modes.patch
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190628/5e05424d/attachment.obj>


More information about the edk2-devel-archive mailing list