From patchwork Fri Feb 1 13:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Huang X-Patchwork-Id: 157215 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp437453jaa; Fri, 1 Feb 2019 05:35:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFVSZQ1lOFBK97POEJNkOAP+dEEOHD6K4Xu4YjVpO4z/enRgZtLZfY0SPAmTrq2lJUmCIS X-Received: by 2002:a63:5c41:: with SMTP id n1mr2225617pgm.1.1549028139136; Fri, 01 Feb 2019 05:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549028139; cv=none; d=google.com; s=arc-20160816; b=myK5IfGZOb8WixDXGdkJ0S5SR92QTamJCzVvw++CQojlI06nQcLb/NMj+xFi/PvdxN wIeXDCIrxq7891YMdIqjR8dKRMKLYPiZ6k+fujcWmzhsghpHObpSONcebgSIXW0+JQJf CEqFwkKzcDWG5eHT+HyyviFKD6F/L3OBD62Hkynk8G6isw/T18dzCp1C4bb79C4QF0Vt P4fnPrLHKu7ohdCble8GL9215C7lFScMn3OIlt0Kjeybmk8K4ec2wTmFW7lQXg8beBsB QFq8RGSB0/EAdB7H8zlzr2jETnIoghamvHwMvMSz7QMzdHaVzsso+DmczglDy2QsvvWR iJWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=wQ8xXjuIuyjVC4/c2AH+GlIbu3Njhhxn8b0n6ZSo21o=; b=bUWjQLTb2hr+rOg+sGjcsOsmOBxqkqxT9L0Xmh2J9M3INezicf25ZNlY4f2LB+wKsS zRFFwAr7pGl4N7zOXfyw65krSfTXfZWv+eq6MwjxvNbvFKFkfoxlQ2+34CIKs7tO1rRV 4eYg063OW+Q4vpsVYl/G73MYQndY1VPlDwwG616tdo9ZqspILWtj7VZGWQwsEGMa75Zg e+ot2ryuZwGkvonyH+/Pks6475cRiW9mB4WD9DFvQPHBizCSqjyIKuJjiAb5NaNxejvi KmaByUMmE3pvU46vBIp5LvQhyCcQ82NTKwA2Nmm19EYCI4L1hLT7YsWa1BkDs79shF7f u9hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NQx7JFSV; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 14si3028398pga.219.2019.02.01.05.35.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 05:35:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NQx7JFSV; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BD71A211C607B; Fri, 1 Feb 2019 05:35:38 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=ming.huang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 315ED211C5729 for ; Fri, 1 Feb 2019 05:35:37 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id r11so2964471pgp.6 for ; Fri, 01 Feb 2019 05:35:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7/46UVcRGojHSW9xzs/IJggzaof8BpRjrzIKbO67x0c=; b=NQx7JFSVz8TKemMrDflrR1ls+I0tdYvLy1ENptMlmpYoZR+wh9eviZafcWghKslIZ/ ZuHm42BgTkl8YuL8yGinAVUeX3vV2w3RZqA61c7HYs9Sk5hetN2gExULYB9v3oB6m7TA bK+RnqmIXtC+jyObthBrRXX87ZA+AKxNdtqAI= 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:in-reply-to :references; bh=7/46UVcRGojHSW9xzs/IJggzaof8BpRjrzIKbO67x0c=; b=XsHIjJ01SqyLgLrGaWHeY1VhlWc803mI0gU6IyFZO4c93wGzF/yczskCNwXc3uATnB XZl098n5uSKI5tRReZU/aYQWld2INahzb3+3qm4IJHzg8RgEHG476KfqdZXXRUyX2YYK +oEAiDE7H+sq8PPdYAXNSgyxTQyMURdL9XjNHsgVKquNOTwo6ReChIaMC6AoS437ee7+ AQPQFvY0DAg/K1wwdhilcUU2gjGl/R3PtLG/YtZldEZchSYp053q1J7N95KG95j5dl4V /O8HoUxmdfUEc4gIOb5gOVqc70QQLbkknZee/W/Yd4Ifx0S/yAKpYrNvhD91kW8fAYro ctIQ== X-Gm-Message-State: AJcUukcHASz9kroY+98uLEB+Rq4AFAM4z+TH2yDAM5+/pGTC0IsZRMA8 7GhMnFvxeCAkaTs26waCXgUPog== X-Received: by 2002:a62:5797:: with SMTP id i23mr26583870pfj.162.1549028136687; Fri, 01 Feb 2019 05:35:36 -0800 (PST) Received: from localhost.localdomain ([114.119.4.74]) by smtp.gmail.com with ESMTPSA id s21sm11134073pfk.133.2019.02.01.05.35.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Feb 2019 05:35:36 -0800 (PST) From: Ming Huang To: leif.lindholm@linaro.org, linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org, graeme.gregory@linaro.org Date: Fri, 1 Feb 2019 21:34:26 +0800 Message-Id: <20190201133436.10500-7-ming.huang@linaro.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190201133436.10500-1-ming.huang@linaro.org> References: <20190201133436.10500-1-ming.huang@linaro.org> Subject: [edk2] [PATCH edk2-platforms v1 06/16] Hisilicon/D06: Add OemGetCpuFreq to encapsulate difference X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangming23@huawei.com, xinliang.liu@linaro.org, john.garry@huawei.com, zhangjinsong2@huawei.com, xingjiang tang , huangdaode@hisilicon.com, zhangfeng56@huawei.com, michael.d.kinney@intel.com, lersek@redhat.com, wanghuiqiang@huawei.com MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: xingjiang tang Implementation OemGetCpuFreq() to get cpu frequency from cpld to encapsulate project difference, for some projects don't support get cpu frequency by this way. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ming Huang --- Platform/Hisilicon/D06/Include/Library/CpldD06.h | 4 ++++ Silicon/Hisilicon/Include/Library/OemMiscLib.h | 2 ++ Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) -- 2.9.5 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/Hisilicon/D06/Include/Library/CpldD06.h b/Platform/Hisilicon/D06/Include/Library/CpldD06.h index ec9b49f4e70d..4d07a8ab3741 100644 --- a/Platform/Hisilicon/D06/Include/Library/CpldD06.h +++ b/Platform/Hisilicon/D06/Include/Library/CpldD06.h @@ -36,4 +36,8 @@ #define CPLD_X8_X8_X8_BOARD_ID 0x92 #define CPLD_X16_X8_BOARD_ID 0x93 +#define CPLD_CLOCK_FLAG 0xFD +#define CPLD_BOM_VER_FLAG 0x0B +#define BRD_VER_4TH 0x4 + #endif /* __CPLDD06_H__ */ diff --git a/Silicon/Hisilicon/Include/Library/OemMiscLib.h b/Silicon/Hisilicon/Include/Library/OemMiscLib.h index 86ea6a1b3deb..dfac87d635d9 100644 --- a/Silicon/Hisilicon/Include/Library/OemMiscLib.h +++ b/Silicon/Hisilicon/Include/Library/OemMiscLib.h @@ -53,4 +53,6 @@ BOOLEAN OemIsNeedDisableExpanderBuffer(VOID); extern EFI_STRING_ID gDimmToDevLocator[MAX_SOCKET][MAX_CHANNEL][MAX_DIMM]; EFI_HII_HANDLE EFIAPI OemGetPackages (); +UINTN OemGetCpuFreq (UINT8 Socket); + #endif diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c index 2a9db46d1ff9..8f2ac308c7b9 100644 --- a/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c +++ b/Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c @@ -207,3 +207,19 @@ OemIsNeedDisableExpanderBuffer ( { return TRUE; } + +UINTN OemGetCpuFreq (UINT8 Socket) +{ + UINT8 BrdVerData; + + BrdVerData = MmioRead8(CPLD_BASE_ADDRESS + CPLD_BOM_VER_FLAG); + + if (BrdVerData >= BRD_VER_4TH){ //2.5G + return 2500000000; + } + else + { + return 2000000000; + } +} +