Message ID | CAD0U-h+7AmMXnPVj+TugFv2EmQ2+fHa-5p7FcbnyQgZe4V8ZEQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 5 April 2016 at 17:49, Ryan Harkin <ryan.harkin@linaro.org> wrote: > On 5 April 2016 at 09:37, Ryan Harkin <ryan.harkin@linaro.org> wrote: >> On 5 April 2016 at 03:57, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: >>> On 5 April 2016 at 01:17, Ryan Harkin <ryan.harkin@linaro.org> wrote: >>>> Hi Haojian, >>>> >>>> I've had time to investigate where TC2 is hanging with your patches >>>> applied and narrowed it down to the single line of code marked below. >>>> >>>> I'm going to read the code now and see if I can work out what it's >>>> trying to do, but I thought I'd tell you sooner because you might have >>>> a better idea. >>>> >>>> On 22 March 2016 at 12:48, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: >>>>> Add more SD commands to support 4-bit bus width & iospeed. It's not >>>>> formal code. And it needs to be updated later. >>>>> >>>>> Contributed-under: TianoCore Contribution Agreement 1.0 >>>>> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> >>>>> --- >>>>> EmbeddedPkg/Include/Protocol/MmcHost.h | 3 + >>>>> EmbeddedPkg/Universal/MmcDxe/Mmc.h | 17 +++ >>>>> EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 138 ++++++++++++++++++++--- >>>>> 3 files changed, 142 insertions(+), 16 deletions(-) >>>>> >>>>> diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h b/EmbeddedPkg/Include/Protocol/MmcHost.h >>>>> index 5e3a2b7..e9a74f0 100644 >>>>> --- a/EmbeddedPkg/Include/Protocol/MmcHost.h >>>>> +++ b/EmbeddedPkg/Include/Protocol/MmcHost.h >>>>> + >>>>> + /* SCR */ >>>>> + Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); >>>>> + if (EFI_ERROR (Status)) { >>>>> + DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status)); >>>>> + return Status; >>>>> + } else { >>>>> + Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer); >>>> >>>> ^^ TC2 hangs at this line >>>> >>> >>> Ryan, >>> >>> Could you help to check where it hangs in >>> ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c? >>> >> >> I guess you mean, "where in function MciReadBlockData does it hang?". >> >> I'll have a look this asap. >> > > I made this mod to the code to add DEBUG: > > diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c > b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c > index 5526aac..7ddcf46 100644 > --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c > +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c > @@ -231,6 +231,7 @@ MciReadBlockData ( > do { > // Read the Status flags > Status = MmioRead32 (MCI_STATUS_REG); > +DEBUG ((EFI_D_ERROR, "RMH: MciReadBlockData(%d): 0x%x\n", __LINE__, Status));^M > > // Do eight reads if possible else a single read > if (Status & MCI_STATUS_CMD_RXFIFOHALFFULL) { > > > And after the InitializeSdMmcDevice debug, I see this output continuously: > > RMH: MciReadBlockData(234): 0x40 > > If I add an MmioWrite32 to clear the flags at the start of the read > block function, I see the same behaviour, except it reads 0x00 > continuously instead of 0x40. > There's a loop count in MciReadBlockData(). Could you print the value of variable Loop and variable Finish? Then I could know whether it reads any data from FIFO. Regards Haojian _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
On 5 April 2016 at 11:18, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: > On 5 April 2016 at 17:49, Ryan Harkin <ryan.harkin@linaro.org> wrote: >> On 5 April 2016 at 09:37, Ryan Harkin <ryan.harkin@linaro.org> wrote: >>> On 5 April 2016 at 03:57, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: >>>> On 5 April 2016 at 01:17, Ryan Harkin <ryan.harkin@linaro.org> wrote: >>>>> Hi Haojian, >>>>> >>>>> I've had time to investigate where TC2 is hanging with your patches >>>>> applied and narrowed it down to the single line of code marked below. >>>>> >>>>> I'm going to read the code now and see if I can work out what it's >>>>> trying to do, but I thought I'd tell you sooner because you might have >>>>> a better idea. >>>>> >>>>> On 22 March 2016 at 12:48, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: >>>>>> Add more SD commands to support 4-bit bus width & iospeed. It's not >>>>>> formal code. And it needs to be updated later. >>>>>> >>>>>> Contributed-under: TianoCore Contribution Agreement 1.0 >>>>>> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> >>>>>> --- >>>>>> EmbeddedPkg/Include/Protocol/MmcHost.h | 3 + >>>>>> EmbeddedPkg/Universal/MmcDxe/Mmc.h | 17 +++ >>>>>> EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 138 ++++++++++++++++++++--- >>>>>> 3 files changed, 142 insertions(+), 16 deletions(-) >>>>>> >>>>>> diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h b/EmbeddedPkg/Include/Protocol/MmcHost.h >>>>>> index 5e3a2b7..e9a74f0 100644 >>>>>> --- a/EmbeddedPkg/Include/Protocol/MmcHost.h >>>>>> +++ b/EmbeddedPkg/Include/Protocol/MmcHost.h > >>>>>> + >>>>>> + /* SCR */ >>>>>> + Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); >>>>>> + if (EFI_ERROR (Status)) { >>>>>> + DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status)); >>>>>> + return Status; >>>>>> + } else { >>>>>> + Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer); >>>>> >>>>> ^^ TC2 hangs at this line >>>>> >>>> >>>> Ryan, >>>> >>>> Could you help to check where it hangs in >>>> ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c? >>>> >>> >>> I guess you mean, "where in function MciReadBlockData does it hang?". >>> >>> I'll have a look this asap. >>> >> >> I made this mod to the code to add DEBUG: >> >> diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c >> b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c >> index 5526aac..7ddcf46 100644 >> --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c >> +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c >> @@ -231,6 +231,7 @@ MciReadBlockData ( >> do { >> // Read the Status flags >> Status = MmioRead32 (MCI_STATUS_REG); >> +DEBUG ((EFI_D_ERROR, "RMH: MciReadBlockData(%d): 0x%x\n", __LINE__, Status));^M >> >> // Do eight reads if possible else a single read >> if (Status & MCI_STATUS_CMD_RXFIFOHALFFULL) { >> >> >> And after the InitializeSdMmcDevice debug, I see this output continuously: >> >> RMH: MciReadBlockData(234): 0x40 >> >> If I add an MmioWrite32 to clear the flags at the start of the read >> block function, I see the same behaviour, except it reads 0x00 >> continuously instead of 0x40. >> > > There's a loop count in MciReadBlockData(). Could you print the value > of variable Loop and > variable Finish? Then I could know whether it reads any data from FIFO. > Sorry for the delay. I added those two variables to the output and they never change; no data is read: RMH: MciReadBlockData(237): Status 0x0 Loop 0 Finish 128 > Regards > Haojian _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c index 5526aac..7ddcf46 100644 --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c @@ -231,6 +231,7 @@ MciReadBlockData ( do { // Read the Status flags Status = MmioRead32 (MCI_STATUS_REG); +DEBUG ((EFI_D_ERROR, "RMH: MciReadBlockData(%d): 0x%x\n", __LINE__, Status));^M // Do eight reads if possible else a single read if (Status & MCI_STATUS_CMD_RXFIFOHALFFULL) {