public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: Marcin Wojtas <mw@semihalf.com>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	Tomasz Michalec <tm@semihalf.com>,
	"nadavh@marvell.com" <nadavh@marvell.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH v3 2/3] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits
Date: Tue, 18 Sep 2018 01:34:16 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A0931E444AD@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <CAPv3WKd_N5_8hPYMXLG4ZHO2zbzKi44B-3S9t5Y=+MzokWpCcg@mail.gmail.com>

> -----Original Message-----
> From: Marcin Wojtas [mailto:mw@semihalf.com]
> Sent: Monday, September 17, 2018 11:00 PM
> To: Wu, Hao A
> Cc: edk2-devel-01; Tomasz Michalec; nadavh@marvell.com; Gao, Liming;
> Kinney, Michael D
> Subject: Re: [edk2] [PATCH v3 2/3] MdeModulePkg/SdMmcPciHcDxe: Fix
> SdMmcHcReset to set only necesery bits
> 
> Hi Hao,
> 
> pon., 17 wrz 2018 o 09:17 Wu, Hao A <hao.a.wu@intel.com> napisał(a):
> >
> > > -----Original Message-----
> > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> > > Marcin Wojtas
> > > Sent: Sunday, September 16, 2018 6:26 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Tian, Feng; tm@semihalf.com; Wu, Hao A; nadavh@marvell.com; Gao,
> > > Liming; Kinney, Michael D
> > > Subject: [edk2] [PATCH v3 2/3] MdeModulePkg/SdMmcPciHcDxe: Fix
> > > SdMmcHcReset to set only necesery bits
> > >
> > > From: Tomasz Michalec <tm@semihalf.com>
> > >
> > > SdMmcHcReset used to set all bits of Software Reset Register to 1
> > > including reserved ones.
> >
> > Hi,
> >
> > I did a quick search of the SD Host Controller Simplified Specification, I
> > do not find the spec prohibit setting all the bits when performing a reset
> > for the host controller.
> >
> > Do you met with issues during the controller reset with the current logic?
> >
> 
> Yes, with SwResetMask = 0xFF, on all my boards (regardless speed),
> SdMmcHcWaitMmioSet times out on each interface. With
> SwReset = SD_MMC_HC_SW_RST_ALL it's all ok.

Thanks Marcin,

Got it. Could you help to file a EDK2 Bugzilla tracker as well? Thanks in
advance.

Also some minor comments below:

> 
> Best regards,
> Marcin
> 
> > Best Regards,
> > Hao Wu
> >
> > >
> > > Now only first bit is set which means "Software Reset for All".
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> > > ---
> > >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 5 +++++
> > >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 6 +++---
> > >  2 files changed, 8 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > > index e389d52..bcc31bd 100644
> > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> > > @@ -63,6 +63,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF
> ANY
> > > KIND, EITHER EXPRESS OR IMPLIED.
> > >  #define SD_MMC_HC_CTRL_VER            0xFE
> > >
> > >  //
> > > +// SD Software Reset Register bits description
> > > +//
> > > +#define SD_MMC_HC_SW_RST_ALL          BIT0

I think you can directly use BIT0 in .c file rather than introducing a new
macro here when performing "Software Reset for All".

> > > +
> > > +//
> > >  // The transfer modes supported by SD Host Controller
> > >  // Simplified Spec 3.0 Table 1-2
> > >  //
> > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > index 9672b5b..9d9bca8 100644
> > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c
> > > @@ -454,8 +454,8 @@ SdMmcHcReset (
> > >    }
> > >
> > >    PciIo   = Private->PciIo;
> > > -  SwReset = 0xFF;
> > > -  Status  = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_SW_RST, FALSE,
> sizeof
> > > (SwReset), &SwReset);
> > > +  SwReset = SD_MMC_HC_SW_RST_ALL;
> > > +  Status  = SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_SW_RST, sizeof
> > > (SwReset), &SwReset);
> > >
> > >    if (EFI_ERROR (Status)) {
> > >      DEBUG ((DEBUG_ERROR, "SdMmcHcReset: write full 1 fails: %r\n",
> Status));

Could you help to refine the debug message above to reflect the change?

Best Regards,
Hao Wu

> > > @@ -467,7 +467,7 @@ SdMmcHcReset (
> > >               Slot,
> > >               SD_MMC_HC_SW_RST,
> > >               sizeof (SwReset),
> > > -             0xFF,
> > > +             SD_MMC_HC_SW_RST_ALL,
> > >               0x00,
> > >               SD_MMC_HC_GENERIC_TIMEOUT
> > >               );
> > > --
> > > 2.7.4
> > >
> > > _______________________________________________
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel

  reply	other threads:[~2018-09-18  1:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-15 22:25 [PATCH v3 0/3] SdMmc fixes Marcin Wojtas
2018-09-15 22:25 ` [PATCH v3 1/3] MdeModulePkg/SdMmcPciHcDxe: Adjust eMMC clock and bus width sequence Marcin Wojtas
2018-09-17  7:17   ` Wu, Hao A
2018-09-17 22:43     ` Marcin Wojtas
2018-09-15 22:25 ` [PATCH v3 2/3] MdeModulePkg/SdMmcPciHcDxe: Fix SdMmcHcReset to set only necesery bits Marcin Wojtas
2018-09-17  7:17   ` Wu, Hao A
2018-09-17 15:00     ` Marcin Wojtas
2018-09-18  1:34       ` Wu, Hao A [this message]
2018-09-15 22:25 ` [PATCH v3 3/3] MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot Marcin Wojtas
2018-09-17  7:17   ` Wu, Hao A
2018-09-17 15:13     ` Marcin Wojtas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B80AF82E9BFB8E4FBD8C89DA810C6A0931E444AD@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox