From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web09.3882.1577803779770090837 for ; Tue, 31 Dec 2019 06:49:40 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=rzb0pa83; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: mateusz.albecki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Dec 2019 06:49:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,379,1571727600"; d="scan'208";a="231314649" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga002.jf.intel.com with ESMTP; 31 Dec 2019 06:49:38 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Dec 2019 06:49:38 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Dec 2019 06:49:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qd3rsxN31SbfMQObnSWU1GcqjEhen6bx5mX1gPILClM8mCfoBr3URyQrzBv4zmENpR0VQaEtIm/+foBMMCIYjpj5dfUpdLsnQPqDQWANKxa2pjjSEn84Oig5OfnXUwOHBnOvVo0weWadiqTsovnRusSBlyR3oqgk4XHFPrCYjHeD8RPhNntGSVRYhbO7qMrml69wxmMPfSDNRPrSIdq2wPTwBXtPnV2ZA3ol5q42yMrEbWDg1/FvlU37jjxt6AfABXSe0Ezzh2JOETVLRXX23zFPEo8doSQJJCYhhPQxJ/2zpFBq3gum9ANS7AMWAau40qkiVQGkVo/LFUENUz4FvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MnayryUlYRuva0TP998MkFG+xhMVbAAOiPyXYtl/jnU=; b=U4aMSWKmUcR+MW1QW0S/VjgO9+0naixpzKKMyp76JEe1GiQzVGYV7Nma7xMm52dQNmATDKtgdabxWauILrzyg3njCm8/Pio28VOn/WjmAzBsvVIJwsHAPYaICkrcFHdyskVGjPlimZRt0r0WwZr6w1GbDJtu0s55qZbGdNVfcWudT96p4EqaV/qCWK+LemT8b9DdgEMUuuaDoYwcdgiLfjQD36ERz6UP288ZOJYjTkVbTRMK+wsUFK5yDm5aTPFRmVoyVZrKJ5+1CV2fdGRcfh094vjGUbfr15DHFzQWNqxwwj+R/xc5ejkN+ExGop2PEAeutgLdbZt/sjOvxfYBgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MnayryUlYRuva0TP998MkFG+xhMVbAAOiPyXYtl/jnU=; b=rzb0pa83GpZgUin9WnN9NXnzTovkOsP+DHHcjIryaWVFIVH8SFIT8eJws/6WpprRsiDvKtdKhrIwQYfSaUEwuTbBR8e8JUdOldzMWADT9I72QF2sZ5p/AKE1JziW/WOTSQmQmHlVfsLtEh3/BXSdFAvuAFFGKRP3TRk0kRohJnI= Received: from BYAPR11MB3591.namprd11.prod.outlook.com (20.178.206.158) by BYAPR11MB3045.namprd11.prod.outlook.com (20.177.225.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.12; Tue, 31 Dec 2019 14:49:36 +0000 Received: from BYAPR11MB3591.namprd11.prod.outlook.com ([fe80::e6:346:1f45:d74b]) by BYAPR11MB3591.namprd11.prod.outlook.com ([fe80::e6:346:1f45:d74b%6]) with mapi id 15.20.2602.010; Tue, 31 Dec 2019 14:49:36 +0000 From: "Albecki, Mateusz" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: Marcin Wojtas , "Gao, Zhichao" , "Gao, Liming" , Ard Biesheuvel Subject: Re: [PATCH 1/2] SdMmcPciHcDxe: Send EdkiiSdMmcSwitchClockFreq after SD clock start Thread-Topic: [PATCH 1/2] SdMmcPciHcDxe: Send EdkiiSdMmcSwitchClockFreq after SD clock start Thread-Index: AQHVt1kNANGK1Ob0X0KJVB31WxHbx6fIm6EAgAvIQeA= Date: Tue, 31 Dec 2019 14:49:36 +0000 Message-ID: References: <20191220171312.3120-1-mateusz.albecki@intel.com> <20191220171312.3120-2-mateusz.albecki@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDc1NDRhMWEtYzM5Yi00N2VjLWJiYmYtNTkzYjk4NTc1ZWY5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ3dmbmhrTkFOSThhbFZBVWpIZ2NKY2t3YktQeU5vUzVsckljbHVjeVZGSFl2M0FLc0F1ZllLYUM2MDVnK01SbSJ9 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=mateusz.albecki@intel.com; x-originating-ip: [134.191.221.121] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c5c75d3d-4a19-4186-8616-08d78e00a7ee x-ms-traffictypediagnostic: BYAPR11MB3045: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:256; x-forefront-prvs: 0268246AE7 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6029001)(39860400002)(366004)(346002)(376002)(396003)(136003)(189003)(199004)(13464003)(2906002)(55016002)(9686003)(86362001)(53546011)(6506007)(478600001)(71200400001)(186003)(4326008)(33656002)(26005)(316002)(7696005)(66556008)(66476007)(5660300002)(66446008)(52536014)(64756008)(81156014)(19627235002)(66946007)(8936002)(81166006)(8676002)(30864003)(110136005)(54906003)(76116006);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR11MB3045;H:BYAPR11MB3591.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RAR+4IsjHv8U4FT4ikdKidO4ZWdmTrXEaraLLl+U6Gz5Q0M0t51JrVXObFNUBpLLefc1tw+Ceoes4F6gIsFiMFuP2khHGX8PfCYI3BinOsdIIRAL7dEjiOunWj8W79TtIeslvin9p0nIRAQnm9+MUXG2pAloUZRxXE5U1yi0mW5XulFbrz1QnAYr3NpAbt2LhQ8G6IO406yr36SY0DoJXCBMyc9A7E3OHA8/imonMUTBUV9NKqXB8RWv748yDV7gYUiDuxbSZbobzNMiMxgmBYl0Jfg+c7x3XrGVFy+zet/btd8CJCdoVdyiBYBJh4L9MM+o4gqNt7SIVF50gBQUT5BoXkr8/Cf51OpacNitg/i0FxkxCl6j4Qx2Bv5AQ1wRZYS/lOXxApWZZZZYqo1Jg3g0SMv79I8h+EnMFBj4jrqNzUayAmba+b3k2lc7AyZ0Djajp+BNMQGU1+MRVPRE/VzIJR+c7TMWDTc2lbJrC9f80CRob/BEqrLFUALY7cOI MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c5c75d3d-4a19-4186-8616-08d78e00a7ee X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Dec 2019 14:49:36.0698 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3U2b0HySrmAa2I1bxG1ogLEqhHbEAunrwJH5p0RG3L7gYGkM+lNbzMfG7BsEm/WmFLiibZAquA5qMV/IKrUz79BdPutQQIwCbjw5UOlzDO0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3045 Return-Path: mateusz.albecki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable No problem with new subject from my side. > -----Original Message----- > From: Wu, Hao A > Sent: Tuesday, December 24, 2019 3:52 AM > To: Albecki, Mateusz ; devel@edk2.groups.io > Cc: Marcin Wojtas ; Gao, Zhichao > ; Gao, Liming ; Ard > Biesheuvel > Subject: RE: [PATCH 1/2] SdMmcPciHcDxe: Send EdkiiSdMmcSwitchClockFreq > after SD clock start > = > > -----Original Message----- > > From: Albecki, Mateusz > > Sent: Saturday, December 21, 2019 1:13 AM > > To: devel@edk2.groups.io > > Cc: Albecki, Mateusz; Wu, Hao A; Marcin Wojtas; Gao, Zhichao; Gao, > > Liming > > Subject: [PATCH 1/2] SdMmcPciHcDxe: Send EdkiiSdMmcSwitchClockFreq > > after SD clock start > = > = > Hello Mateusz, > = > Just a minor format comment, how about changing the subject to: > MdeModulePkg/SdMmcPciHcDxe: Hook SwitchClockFreq after SD clock start > = > If there is no other major concern from other reviewers for the patch, I = will > handle this when pushing the patch. > = > Reviewed-by: Hao A Wu > = > Best Regards, > Hao Wu > = > = > > > > For eMMC modules we used to notify the platform about frequency > change > > only after sending CMD13 which meant that platform might not get a > > chance to apply required post frequency change fixes to get the clock > > stable. To fix this notification has been moved to SdMmcHcClockSupply > > function just after we start the SD clock. During first time setup the > > notification won't be sent to avoid changing old behavior. > > > > Cc: Hao A Wu > > Cc: Marcin Wojtas > > Cc: Zhichao Gao > > Cc: Liming Gao > > > > Signed-off-by: Mateusz Albecki > > --- > > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c | 20 +--- > > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 28 ++---- > > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h | 24 +++++ > > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 107 > +++++++++-- > > ---------- > > MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h | 44 --------- > > 5 files changed, 81 insertions(+), 142 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c > > index 082904ccc5..776c0e796c 100644 > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c > > @@ -727,7 +727,7 @@ EmmcSwitchBusTiming ( > > // > > // Convert the clock freq unit from MHz to KHz. > > // > > - Status =3D SdMmcHcClockSupply (PciIo, Slot, ClockFreq * 1000, > > Private- > > >BaseClkFreq[Slot], Private->ControllerVersion[Slot]); > > + Status =3D SdMmcHcClockSupply (Private, Slot, BusTiming, FALSE, > > + ClockFreq * > > 1000); > > if (EFI_ERROR (Status)) { > > return Status; > > } > > @@ -745,24 +745,6 @@ EmmcSwitchBusTiming ( > > return EFI_DEVICE_ERROR; > > } > > > > - if (mOverride !=3D NULL && mOverride->NotifyPhase !=3D NULL) { > > - Status =3D mOverride->NotifyPhase ( > > - Private->ControllerHandle, > > - Slot, > > - EdkiiSdMmcSwitchClockFreqPost, > > - &BusTiming > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "%a: SD/MMC switch clock freq post notifier callback failed - = %r\n", > > - __FUNCTION__, > > - Status > > - )); > > - return Status; > > - } > > - } > > - > > return Status; > > } > > > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c > > index 336baade9e..d63dc54e8c 100644 > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c > > @@ -1145,29 +1145,11 @@ SdCardSetBusMode ( > > return Status; > > } > > > > - Status =3D SdMmcHcClockSupply (PciIo, Slot, BusMode.ClockFreq * 1000, > > Private->BaseClkFreq[Slot], Private->ControllerVersion[Slot]); > > + Status =3D SdMmcHcClockSupply (Private, Slot, BusMode.BusTiming, > > + FALSE, > > BusMode.ClockFreq * 1000); > > if (EFI_ERROR (Status)) { > > return Status; > > } > > > > - if (mOverride !=3D NULL && mOverride->NotifyPhase !=3D NULL) { > > - Status =3D mOverride->NotifyPhase ( > > - Private->ControllerHandle, > > - Slot, > > - EdkiiSdMmcSwitchClockFreqPost, > > - &BusMode.BusTiming > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "%a: SD/MMC switch clock freq post notifier callback failed - = %r\n", > > - __FUNCTION__, > > - Status > > - )); > > - return Status; > > - } > > - } > > - > > if ((BusMode.BusTiming =3D=3D SdMmcUhsSdr104) || ((BusMode.BusTiming > =3D=3D > > SdMmcUhsSdr50) && (Capability->TuningSDR50 !=3D 0))) { > > Status =3D SdCardTuningClock (PciIo, PassThru, Slot); > > if (EFI_ERROR (Status)) { > > @@ -1345,7 +1327,13 @@ SdCardIdentification ( > > goto Error; > > } > > > > - SdMmcHcInitClockFreq (PciIo, Slot, Private->BaseClkFreq[Slot], P= rivate- > > >ControllerVersion[Slot]); > > + // > > + // Restart the clock with first time parameters. > > + // NOTE: it is not required to actually restart the clock > > + // and go through internal clock setup again. Some time > > + // could be saved if we simply started the SD clock. > > + // > > + SdMmcHcClockSupply (Private, Slot, 0, TRUE, 400); > > > > gBS->Stall (1000); > > > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h > > index c29e48767e..0304960132 100644 > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h > > @@ -796,6 +796,30 @@ SdCardIdentification ( > > IN UINT8 Slot > > ); > > > > +/** > > + SD/MMC card clock supply. > > + > > + Refer to SD Host Controller Simplified spec 3.0 Section 3.2.1 for de= tails. > > + > > + @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA > > instance. > > + @param[in] Slot The slot number of the SD card to send the > command > > to. > > + @param[in] BusTiming BusTiming at which the frequency change is > done. > > + @param[in] FirstTimeSetup Flag to indicate whether the clock is > > + being setup > > for the first time. > > + @param[in] ClockFreq The max clock frequency to be set. The un= it is > KHz. > > + > > + @retval EFI_SUCCESS The clock is supplied successfully. > > + @retval Others The clock isn't supplied successfully. > > + > > +**/ > > +EFI_STATUS > > +SdMmcHcClockSupply ( > > + IN SD_MMC_HC_PRIVATE_DATA *Private, > > + IN UINT8 Slot, > > + IN SD_MMC_BUS_MODE BusTiming, > > + IN BOOLEAN FirstTimeSetup, > > + IN UINT64 ClockFreq > > + ); > > + > > /** > > Software reset the specified SD/MMC host controller. > > > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c > > index b9d04e0f17..f667264c5e 100644 > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c > > @@ -763,11 +763,11 @@ SdMmcHcStopClock ( > > > > Refer to SD Host Controller Simplified spec 3.0 Section 3.2.1 for de= tails. > > > > - @param[in] PciIo The PCI IO protocol instance. > > - @param[in] Slot The slot number of the SD card to send the > command > > to. > > - @param[in] ClockFreq The max clock frequency to be set. The uni= t is > KHz. > > - @param[in] BaseClkFreq The base clock frequency of host controlle= r in > > MHz. > > - @param[in] ControllerVer The version of host controller. > > + @param[in] Private A pointer to the SD_MMC_HC_PRIVATE_DATA > > instance. > > + @param[in] Slot The slot number of the SD card to send the > command > > to. > > + @param[in] BusTiming BusTiming at which the frequency change is > done. > > + @param[in] FirstTimeSetup Flag to indicate whether the clock is > > + being setup > > for the first time. > > + @param[in] ClockFreq The max clock frequency to be set. The un= it is > KHz. > > > > @retval EFI_SUCCESS The clock is supplied successfully. > > @retval Others The clock isn't supplied successfully. > > @@ -775,11 +775,11 @@ SdMmcHcStopClock ( **/ EFI_STATUS > > SdMmcHcClockSupply ( > > - IN EFI_PCI_IO_PROTOCOL *PciIo, > > - IN UINT8 Slot, > > - IN UINT64 ClockFreq, > > - IN UINT32 BaseClkFreq, > > - IN UINT16 ControllerVer > > + IN SD_MMC_HC_PRIVATE_DATA *Private, > > + IN UINT8 Slot, > > + IN SD_MMC_BUS_MODE BusTiming, > > + IN BOOLEAN FirstTimeSetup, > > + IN UINT64 ClockFreq > > ) > > { > > EFI_STATUS Status; > > @@ -787,13 +787,15 @@ SdMmcHcClockSupply ( > > UINT32 Divisor; > > UINT32 Remainder; > > UINT16 ClockCtrl; > > + UINT32 BaseClkFreq; > > + UINT16 ControllerVer; > > + EFI_PCI_IO_PROTOCOL *PciIo; > > > > - // > > - // Calculate a divisor for SD clock frequency > > - // > > - ASSERT (BaseClkFreq !=3D 0); > > + PciIo =3D Private->PciIo; > > + BaseClkFreq =3D Private->BaseClkFreq[Slot]; ControllerVer =3D > > + Private->ControllerVersion[Slot]; > > > > - if (ClockFreq =3D=3D 0) { > > + if (BaseClkFreq =3D=3D 0 || ClockFreq =3D=3D 0) { > > return EFI_INVALID_PARAMETER; > > } > > > > @@ -883,6 +885,29 @@ SdMmcHcClockSupply ( > > ClockCtrl =3D BIT2; > > Status =3D SdMmcHcOrMmio (PciIo, Slot, SD_MMC_HC_CLOCK_CTRL, sizeof > > (ClockCtrl), &ClockCtrl); > > > > + // > > + // We don't notify the platform on first time setup to avoid > > + changing // legacy behavior. During first time setup we also don't > > + know what type // of the card slot it is and which enum value of > BusTiming applies. > > + // > > + if (!FirstTimeSetup && mOverride !=3D NULL && mOverride->NotifyPhase > > + !=3D > > NULL) { > > + Status =3D mOverride->NotifyPhase ( > > + Private->ControllerHandle, > > + Slot, > > + EdkiiSdMmcSwitchClockFreqPost, > > + &BusTiming > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "%a: SD/MMC switch clock freq post notifier callback failed - = %r\n", > > + __FUNCTION__, > > + Status > > + )); > > + return Status; > > + } > > + } > > + > > return Status; > > } > > > > @@ -1038,49 +1063,6 @@ SdMmcHcInitV4Enhancements ( > > return EFI_SUCCESS; > > } > > > > -/** > > - Supply SD/MMC card with lowest clock frequency at initialization. > > - > > - @param[in] PciIo The PCI IO protocol instance. > > - @param[in] Slot The slot number of the SD card to send the > command > > to. > > - @param[in] BaseClkFreq The base clock frequency of host controlle= r in > > MHz. > > - @param[in] ControllerVer The version of host controller. > > - > > - @retval EFI_SUCCESS The clock is supplied successfully. > > - @retval Others The clock isn't supplied successfully. > > - > > -**/ > > -EFI_STATUS > > -SdMmcHcInitClockFreq ( > > - IN EFI_PCI_IO_PROTOCOL *PciIo, > > - IN UINT8 Slot, > > - IN UINT32 BaseClkFreq, > > - IN UINT16 ControllerVer > > - ) > > -{ > > - EFI_STATUS Status; > > - UINT32 InitFreq; > > - > > - // > > - // According to SDHCI specification ver. 4.2, BaseClkFreq field > > value of > > - // the Capability Register 1 can be zero, which means a need for > > obtaining > > - // the clock frequency via another method. Fail in case it is not > > updated > > - // by SW at this point. > > - // > > - if (BaseClkFreq =3D=3D 0) { > > - // > > - // Don't support get Base Clock Frequency information via another > method > > - // > > - return EFI_UNSUPPORTED; > > - } > > - // > > - // Supply 400KHz clock frequency at initialization phase. > > - // > > - InitFreq =3D 400; > > - Status =3D SdMmcHcClockSupply (PciIo, Slot, InitFreq, BaseClkFreq, > > ControllerVer); > > - return Status; > > -} > > - > > /** > > Supply SD/MMC card with maximum voltage at initialization. > > > > @@ -1216,7 +1198,14 @@ SdMmcHcInitHost ( > > return Status; > > } > > > > - Status =3D SdMmcHcInitClockFreq (PciIo, Slot, > > Private->BaseClkFreq[Slot], > > Private->ControllerVersion[Slot]); > > + // > > + // Perform first time clock setup with 400 KHz frequency. > > + // We send the 0 as the BusTiming value because at this time // we > > + still do not know the slot type and which enum value will apply. > > + // Since it is a first time setup SdMmcHcClockSupply won't notify > > + // the platofrm driver anyway so it doesn't matter. > > + // > > + Status =3D SdMmcHcClockSupply (Private, Slot, 0, TRUE, 400); > > if (EFI_ERROR (Status)) { > > return Status; > > } > > diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h > > b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h > > index 088c70451c..826e851b04 100644 > > --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h > > +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h > > @@ -478,30 +478,6 @@ SdMmcHcStopClock ( > > IN UINT8 Slot > > ); > > > > -/** > > - SD/MMC card clock supply. > > - > > - Refer to SD Host Controller Simplified spec 3.0 Section 3.2.1 for de= tails. > > - > > - @param[in] PciIo The PCI IO protocol instance. > > - @param[in] Slot The slot number of the SD card to send the > command > > to. > > - @param[in] ClockFreq The max clock frequency to be set. The uni= t is > KHz. > > - @param[in] BaseClkFreq The base clock frequency of host controlle= r in > > MHz. > > - @param[in] ControllerVer The version of host controller. > > - > > - @retval EFI_SUCCESS The clock is supplied successfully. > > - @retval Others The clock isn't supplied successfully. > > - > > -**/ > > -EFI_STATUS > > -SdMmcHcClockSupply ( > > - IN EFI_PCI_IO_PROTOCOL *PciIo, > > - IN UINT8 Slot, > > - IN UINT64 ClockFreq, > > - IN UINT32 BaseClkFreq, > > - IN UINT16 ControllerVer > > - ); > > - > > /** > > SD/MMC bus power control. > > > > @@ -542,26 +518,6 @@ SdMmcHcSetBusWidth ( > > IN UINT16 BusWidth > > ); > > > > -/** > > - Supply SD/MMC card with lowest clock frequency at initialization. > > - > > - @param[in] PciIo The PCI IO protocol instance. > > - @param[in] Slot The slot number of the SD card to send the > command > > to. > > - @param[in] BaseClkFreq The base clock frequency of host controlle= r in > > MHz. > > - @param[in] ControllerVer The version of host controller. > > - > > - @retval EFI_SUCCESS The clock is supplied successfully. > > - @retval Others The clock isn't supplied successfully. > > - > > -**/ > > -EFI_STATUS > > -SdMmcHcInitClockFreq ( > > - IN EFI_PCI_IO_PROTOCOL *PciIo, > > - IN UINT8 Slot, > > - IN UINT32 BaseClkFreq, > > - IN UINT16 ControllerVer > > - ); > > - > > /** > > Supply SD/MMC card with maximum voltage at initialization. > > > > -- > > 2.14.1.windows.1 > = -------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydz= ial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-31= 6 | Kapital zakladowy 200.000 PLN. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata= i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wi= adomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiek= olwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the s= ole use of the intended recipient(s). If you are not the intended recipient= , please contact the sender and delete all copies; any review or distributi= on by others is strictly prohibited.