From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (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 5B8D321A00AF6 for ; Mon, 3 Jul 2017 02:38:41 -0700 (PDT) Received: by mail-it0-x22a.google.com with SMTP id m68so85314368ith.1 for ; Mon, 03 Jul 2017 02:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5Mee7/9k+izfkNqHlVzSUsFvxxjuEB1Q79wLGKprEqk=; b=L1Em5/d8Nz94Va1W7JNpt6Ek8rlZxv2geuRoNXOOP4xT2qDaeMg+TdnMJ2RRyohtrX L68jIn+E6EnDStbiLoOG6sNb0gnIIbDsKB8K+LMMKA6xJq+iCAdM0VCATBmOWTs0qLBY abaiW+6PYcmfPSlmz/hCXRxhwgJCZWEvs6ppE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5Mee7/9k+izfkNqHlVzSUsFvxxjuEB1Q79wLGKprEqk=; b=OVCpqlVIQ/jkzFQJvu3ajR9iY46Bv9+JbDbMFmfoOGZdrhVEigDrMEsv0dmQqiCync PHaHzUZv1wu6EIrmYQaDrj5pABpVlZ5J+vhLPDQtIEVFTU3OuBnIIDVbSFCzMdGxRR+e ODvJwOQE8Qa3LaU7PptoP3VfGpnaJnOBKZdrRs5IKKYJpt/WNwmqIsHwoDRZPVJHU3vh RyLB31/J4paH4bysODtAjx3iPzCWHTYUPiJqLHc+vYIjMYQWNYGkw0KoOXbo3RYrvzpH k3SZW94Yda2JyTpsoy2mBT2ixwgNuBoIYYADemKwKbLdYhZx5fUiT+LuqcjUpQMXoynN QfrA== X-Gm-Message-State: AKS2vOy0LFclwf0nzqLJ+/DEHt+wmcWBOz8geN3jxZoFJOfO5iIeFlpv InbUI+k7j556z12W+UGDehiQN+evn/Yi X-Received: by 10.36.4.4 with SMTP id 4mr32080203itb.73.1499074817681; Mon, 03 Jul 2017 02:40:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.134.134 with HTTP; Mon, 3 Jul 2017 02:40:17 -0700 (PDT) In-Reply-To: <1499054517-22398-1-git-send-email-jun.nie@linaro.org> References: <1499054517-22398-1-git-send-email-jun.nie@linaro.org> From: Ard Biesheuvel Date: Mon, 3 Jul 2017 10:40:17 +0100 Message-ID: To: Jun Nie Cc: Leif Lindholm , Haojian Zhuang , "edk2-devel@lists.01.org" , Shawn Guo , jason.liu@linaro.org Subject: Re: [PATCH] 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: Mon, 03 Jul 2017 09:38:41 -0000 Content-Type: text/plain; charset="UTF-8" On 3 July 2017 at 05:01, 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 > --- > 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..308f3a7 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 (BusClockFreq > PcdGet32 (PcdDwEmmcDxeMaxClockFrequencyInHz)) { > + 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..3582997 100644 > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf > @@ -48,6 +48,7 @@ > [Pcd] > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz > + gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeMaxClockFrequencyInHz > > [Depex] > TRUE > diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec > index 0d4a062..aec8259 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -167,6 +167,7 @@ > # DwEmmc Driver PCDs > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress|0x0|UINT32|0x00000035 > gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x00000036 > + gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeMaxClockFrequencyInHz|0x0|UINT32|400000000 > Please use the correct token space guid, or add it to the correct .dec file.