public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: hao.a.wu@intel.com
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	 "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	nadavh@marvell.com,  "jsd@semihalf.com" <jsd@semihalf.com>,
	Tomasz Michalec <tm@semihalf.com>
Subject: Re: [PATCH v3 1/3] MdeModulePkg/SdMmcPciHcDxe: Adjust eMMC clock and bus width sequence
Date: Tue, 18 Sep 2018 00:43:57 +0200	[thread overview]
Message-ID: <CAPv3WKeSLGCF8czxUNK8R-mE5w-VNBfdMOXDz1xN6BC2zn_gow@mail.gmail.com> (raw)
In-Reply-To: <B80AF82E9BFB8E4FBD8C89DA810C6A0931E44106@SHSMSX104.ccr.corp.intel.com>

Hi Hao,

pon., 17 wrz 2018 o 09:18 Wu, Hao A <hao.a.wu@intel.com> napisał(a):
>
> > -----Original Message-----
> > From: Marcin Wojtas [mailto:mw@semihalf.com]
> > Sent: Sunday, September 16, 2018 6:26 AM
> > To: edk2-devel@lists.01.org
> > Cc: Tian, Feng; Kinney, Michael D; Gao, Liming; leif.lindholm@linaro.org; Wu,
> > Hao A; ard.biesheuvel@linaro.org; nadavh@marvell.com; mw@semihalf.com;
> > jsd@semihalf.com; tm@semihalf.com
> > Subject: [PATCH v3 1/3] MdeModulePkg/SdMmcPciHcDxe: Adjust eMMC clock
> > and bus width sequence
> >
> > According to JESD84-B50-1 chapter A.6 (documentation about eMMC4.5
> > standard) step "Changing the data bus width" (A.6.3) should be
> > executed after step "Switching to high-speed mode" (A.6.2).
>
> Hi,
>
> My understanding to the spec is that the spec seems do not impose a
> sequence for 'Switching to high-speed mode' and 'Changing the data bus
> width'.
>
> My find is that both operation (A.6.2 & A.6.3 of JESD84-B50-1 ) requires:
>
> * Do these steps after the bus is initialized according to A.6.1, Bus
> * initialization.
>
> Also, for HS200 mode selection, the flow chart in Section 6.6.4 shows the
> bus width set before bus mode switch. So I think the current code is
> taking this as a reference when switching the 'High Speed' mode.
>
> I tried the eMMC device on my side, the current code implementation and
> codes after applying your patch both work. So do you met with issues with
> certain device with this sequence? If not, I prefer to keep the current
> logic.
>

I re-checked on my boards with unchanged logic - all 3 can work in
High Speed. Patch is pretty old, I can't recall exact circumstances.
I'll drop it in v4.

Best regards,
Marcin

> Best Regards,
> Hao Wu
>
> >
> > This patch fixes the bus-width/clock-setting sequence
> > in EmmcSwitchToHighSpeed ().
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> > ---
> >  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > index c5fd214..12935ef 100755
> > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> > @@ -745,10 +745,6 @@ EmmcSwitchToHighSpeed (
> >    UINT8               HostCtrl1;
> >    UINT8               HostCtrl2;
> >
> > -  Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusWidth);
> > -  if (EFI_ERROR (Status)) {
> > -    return Status;
> > -  }
> >    //
> >    // Set to Hight Speed timing
> >    //
> > @@ -783,6 +779,11 @@ EmmcSwitchToHighSpeed (
> >
> >    HsTiming = 1;
> >    Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming,
> > ClockFreq);
> > +  if (EFI_ERROR (Status)) {
> > +    return Status;
> > +  }
> > +
> > +  Status = EmmcSwitchBusWidth (PciIo, PassThru, Slot, Rca, IsDdr, BusWidth);
> >
> >    return Status;
> >  }
> > --
> > 2.7.4
>


  reply	other threads:[~2018-09-17 22:44 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 [this message]
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
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=CAPv3WKeSLGCF8czxUNK8R-mE5w-VNBfdMOXDz1xN6BC2zn_gow@mail.gmail.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