From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8FE8B21CE73F4 for ; Thu, 6 Jul 2017 08:22:23 -0700 (PDT) Received: by mail-wr0-x22e.google.com with SMTP id c11so7349360wrc.3 for ; Thu, 06 Jul 2017 08:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lOTjf5AzsBf7WylgePnCDcHA9ThBS3wOVBC42Y9WNcI=; b=GYDldo/gn89A3Qh97wvyCAFti6IbKltkKfNd3pyVPoBHDhkblVhQj30UwSq58zSCXs MW/Q0toQL1ed5yzyWk1MSo0hRrwfzW5a5Gyix5fQ81IDGx60m55HaoHFrpCImkC7Cz71 xLcxLV8MpiEm6ZjJ5WD0P7MTycMPcaNwo9j2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lOTjf5AzsBf7WylgePnCDcHA9ThBS3wOVBC42Y9WNcI=; b=TT0NCFl9HES3swai3CXlfPn5Diqz90vUkz9Y9HVIB7mRJfp/TBUgB8U4izwjOFHtwD 8h2pp3QhJXhigfm/A+3UBGlyhlMtuo4ZTDhJg2EqzBAZyNzlWfSuUklLvM5floEIHjv0 tozL5OvYs6LUhmWmYSiHxuArMphfml2w49otHovA2pmUk3Dhhi8giGgXEAZoAWjuF+4W /cOPXTUFvaITbuNtkTU0fp+7U7mpVPPkypvatuM2kSM96y4v2UYndkBCbKyCRCVSXQKD JLVvOWRvCzbC/YvgwLr0bygFyitoepBuhEHzAOPLCD4r6sLQiWBDc071X5oSmNp5TeBD Tyeg== X-Gm-Message-State: AKS2vOyQ8viw/kYNv+OfHTuf7XWMFx1zw0FfNipGVhmsDJHntqZVSeTq NVdD6fcXPgc9Mh+H X-Received: by 10.28.105.28 with SMTP id e28mr26633587wmc.42.1499354642466; Thu, 06 Jul 2017 08:24:02 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j190sm623227wmd.22.2017.07.06.08.24.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jul 2017 08:24:01 -0700 (PDT) Date: Thu, 6 Jul 2017 16:24:00 +0100 From: Leif Lindholm To: Jun Nie Cc: ard.biesheuvel@linaro.org, haojian.zhuang@linaro.org, edk2-devel@lists.01.org, shawn.guo@linaro.org, jason.liu@linaro.org Message-ID: <20170706152400.GR26676@bivouac.eciton.net> References: <1499243228-1225-1-git-send-email-jun.nie@linaro.org> MIME-Version: 1.0 In-Reply-To: <1499243228-1225-1-git-send-email-jun.nie@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH v2 1/2] EmbeddedPkg/DwEmmcDxe: limit max clock for platform X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jul 2017 15:22:24 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 05, 2017 at 04:27:07PM +0800, Jun Nie wrote: > Some boards may have max clock limitation. Add a Pcd to notify > driver. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jun Nie Reviewed-by: Leif Lindholm (I'll hold off on pushing this one until 2/2 is ready. No need to resend this.) > --- > EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 4 ++++ > EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf | 1 + > EmbeddedPkg/EmbeddedPkg.dec | 1 + > 3 files changed, 6 insertions(+) > > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > index fe23d11..bb26b69 100644 > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > @@ -560,6 +560,10 @@ DwEmmcSetIos ( > EFI_STATUS Status = EFI_SUCCESS; > UINT32 Data; > > + if ((PcdGet32 (PcdDwEmmcDxeMaxClockFreqInHz) != 0) && > + (BusClockFreq > PcdGet32 (PcdDwEmmcDxeMaxClockFreqInHz))) { > + return EFI_UNSUPPORTED; > + } > if (TimingMode != EMMCBACKWARD) { > Data = MmioRead32 (DWEMMC_UHSREG); > switch (TimingMode) { > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf > index e3c8313..99b4f99 100644 > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf > @@ -48,6 +48,7 @@ > [Pcd] > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz > + gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz > > [Depex] > TRUE > diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec > index 5ea2f22..2da9b2f 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -169,6 +169,7 @@ > # DwEmmc Driver PCDs > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress|0x0|UINT32|0x00000035 > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x00000036 > + gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz|0x0|UINT32|0x00000037 > > # > # Android FastBoot > -- > 1.9.1 >