From nobody Fri Dec 27 18:30:47 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; dkim=fail spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1499054534291339.1815061474588; Sun, 2 Jul 2017 21:02:14 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5A03621CAD9BC; Sun, 2 Jul 2017 21:00:35 -0700 (PDT) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (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 35D8621CAD9B0 for ; Sun, 2 Jul 2017 21:00:34 -0700 (PDT) Received: by mail-pf0-x22f.google.com with SMTP id c73so93566317pfk.2 for ; Sun, 02 Jul 2017 21:02:11 -0700 (PDT) Received: from localhost.localdomain ([113.53.228.63]) by smtp.gmail.com with ESMTPSA id l85sm5761583pfi.53.2017.07.02.21.02.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Jul 2017 21:02:10 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=vU5BbZGC7JEL18TROVTBdBaHn3pO5Vw4BkhGitq8rdg=; b=Tk6gon+HItLAmVaUd+IBszaOzXuNgqJRYTaqsP4Q0sWm4TULrKsGvxk+FQP/Uohgnh 8t6YZXqBS7UIoghoVnv9RBUCOPDY/OttVsz1wX4qijTnmT6Lg6KyhTpXrVHE7StAjwP0 VYRXpV5gJlw+fu7ElAD6yu6RNpC7tsY8Q88Ms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vU5BbZGC7JEL18TROVTBdBaHn3pO5Vw4BkhGitq8rdg=; b=U66B3Z0mGtuETShF6lrSRQjJLjW6y25TmMF2trVZMDYj4sL/pPfDvnObFsx4wMiefE Y/nOGVRqUxrbQGh5mea+7RGk23yYMod1Y2E1BlQ4wHDhiE+k2GS1k6pe6eglmiXovlYI 2/M2x4uZ7hNlcADhINO5P0gEpAtdxaOZW8nJ857oShd9Fwz1HxHXun076W2uVcsnSY3R prcrWofLK13u7VGTAle4y4zRN5ioY42VnhlLkd3iHMkMytTdy4e8nxFPcmwtjuTa+Cna iwL3E0RA+SAiW5rSNzp+UoDfUU0Dqb+dp0KxV2mzu/IhTQtbIfzsuKq4pf6GBnvg1tNh ptkQ== X-Gm-Message-State: AIVw112z6yvYZ4LBqX3fgJ/PX6EOSD7FT+/ENf40ylQF2lN28Tqxu511 nlvN7uQtdeBhIwsO X-Received: by 10.98.163.203 with SMTP id q72mr7787966pfl.97.1499054530677; Sun, 02 Jul 2017 21:02:10 -0700 (PDT) From: Jun Nie To: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org, haojian.zhuang@linaro.org, edk2-devel@lists.01.org Date: Mon, 3 Jul 2017 12:01:56 +0800 Message-Id: <1499054517-22398-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [edk2] [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: , Cc: jason.liu@linaro.org, shawn.guo@linaro.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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/Driver= s/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 =3D EFI_SUCCESS; UINT32 Data; =20 + if (BusClockFreq > PcdGet32 (PcdDwEmmcDxeMaxClockFrequencyInHz)) { + return EFI_UNSUPPORTED; + } + if (TimingMode !=3D EMMCBACKWARD) { Data =3D MmioRead32 (DWEMMC_UHSREG); switch (TimingMode) { diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf b/EmbeddedPkg/Driv= ers/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 =20 [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|0x0000= 0036 + gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeMaxClockFrequencyInHz|0x0|UINT32|40= 0000000 =20 # # Android FastBoot --=20 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel