From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.36.66; helo=nam02-sn1-obe.outbound.protection.outlook.com; envelope-from=leo.duran@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0066.outbound.protection.outlook.com [104.47.36.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E0AD4202E5CFC for ; Tue, 31 Oct 2017 10:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4GzFAUdPUMG2ZB3tQwj8jEwuS8ujz3T36f5x2ii21SU=; b=m4kIxi4iwBOi0hG1bORZme5gN5lGHsm2MASMGIFN7QP8f/8KKmN6NZeHkwzquAWDbVcylQyNbNBfjxQwEMdPMiJ4AZOe+bj3XY4GzfH+RxGgpJTON9B9/MwzqbrdUFGKJAE0TUzNTkq8Ai3MSlE4oMvCaJMZ7sphX5/V2l5moOk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by BN6PR12MB1236.namprd12.prod.outlook.com (10.168.227.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Tue, 31 Oct 2017 17:55:06 +0000 From: Leo Duran To: edk2-devel@lists.01.org Cc: Leo Duran , Ruiyu Ni Date: Tue, 31 Oct 2017 12:54:53 -0500 Message-Id: <1509472493-19062-3-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509472493-19062-1-git-send-email-leo.duran@amd.com> References: <1509472493-19062-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR14CA0005.namprd14.prod.outlook.com (10.173.227.15) To BN6PR12MB1236.namprd12.prod.outlook.com (10.168.227.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8e7cb0a-be9f-4266-37e3-08d52088854a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(48565401081)(2017052603199); SRVR:BN6PR12MB1236; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1236; 3:nlPy1aXE1LPLgEQnBM6spEldaF0pMWpeu5P+m+rsoRdTVKRVBVnx+11rr9TWAJS2dIoOPqBSKz/8cxlaFyb4uGGiyy9l2l2O+FTxIbkYhQGTnU2KnrpCT7RnTK9OmBms+4msBToxRJ3csEQvV+0Tsxj5OPEej4VcYYt1PXvQ47G/LWMIOVsLUgKpzSEfjwyrxr5RrA45TlDG2mJqNiC30e6V2VqBn9bczw+Ew4BUq8V0Un3j/mymXpCvM8oEPFe3; 25:Aj+w9ZX3m+0UhvrV1zsoKvejzWYredjz7BRmQGBcimf/Hp2he6XXtxSLKJ06jx8MPNTtiLVTpk0de5rtRNcWNmQAlRhxPYTKHxahmYuplB8S/15eMtVxlh+Hhe/lSayXYhO6VRijp+8M+ASa/Ey7Mz6LBrz+gQEMzFNEN1H64jTrf9VN0TPYVES2Z3mq0gT3ciuvFkM6XtIy12Q9g/jGommaSklG8s9jgbaROWX9Q79oCCm94jFI2UxLszjBhE/Zok5gY2aSp3VRo5Z6sVuQoLwulUYDq1gVYZqY7v35ffAfmZrB+xvtOLfNlq6gzUNp6RlNmtDVdfCdR38AhQqNkw==; 31:Fqw+dD1Ok10cwwZKfIBvhPio50yzIGiIbwaB9oGkZjFS1KrKC4K6uMZYkaPTNNM0uSq4uqo0zoHhmUjm3TlhtKtD6iCi0/5iSHgjN2iYXOj7nq75IDjtqG2iQKFleWrT8YbMNGHvH0twtH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-Antispam-Report-Test: UriScan:(767451399110)(788757137089)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(3231020)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1236; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1236; X-Forefront-PRVS: 04772EA191 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6029001)(39860400002)(346002)(376002)(189002)(199003)(105586002)(5003940100001)(97736004)(6486002)(50466002)(4326008)(33646002)(316002)(86362001)(6116002)(3846002)(48376002)(478600001)(2950100002)(7736002)(6666003)(6916009)(76176999)(50986999)(189998001)(5660300001)(101416001)(25786009)(68736007)(16526018)(305945005)(50226002)(8936002)(47776003)(81156014)(81166006)(8676002)(36756003)(2906002)(53936002)(2351001)(16586007)(66066001)(53416004)(54906003)(2361001)(106356001)(213903007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1236; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1236; 23:R1Y5zlhngfWNCb+cdprSIP1LwAdFN9Gc1vFBIfpVV?= =?us-ascii?Q?pLRnLVncYY2dAZI7Rq27BahCWarJwHnV1Nuy41Nq2zah6rwBQ14IArBriDIG?= =?us-ascii?Q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vWaM11lk/CfJn1El/z7bee3Mljn6UWfUMAZ0BhOiKzHGqdwO3J/Eh3068zaYMJlPxXfsS9lZe9Zg3iZKjQNR10n+LJNIK+hVtGwvsJqoB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1236; 20:4W6WfSdOtQ7pqSw1PWZCNQXgWN5xvSIAhHOWO7hn8plrbEwH+rxHrCItTc6NrhsR4sngFEUrQ9yTlMpbpf9kHl853cEYxD1m4qT/tugapP/FUPDI8q89ufAL5E0AlfyoJevjbDfPkUs0ha74eYvhqBH2dbA13Wd4ngrF8i/5ld72iWNjjMYHjMrVJgKm8ZnmgQ7sKfymVjo5GS81kjm4ze5mBif3Zm3+cMDj6BBhdvlDs1KKDynocR0OWf7T4dd3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2017 17:55:06.0418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8e7cb0a-be9f-4266-37e3-08d52088854a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1236 Subject: [PATCH 2/2] PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe: Replace RTC macros 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: Tue, 31 Oct 2017 17:51:16 -0000 Content-Type: text/plain Use FixedPCD's to set platform-specific values for RTC registers. Specifically, the replaced macros are: 1) RTC_INIT_REGISTER_A 2) RTC_INIT_REGISTER_B 3) RTC_INIT_REGISTER_D Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leo Duran --- PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 8 +++++--- PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h | 9 ++------- .../PcatRealTimeClockRuntimeDxe.inf | 11 +++++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c index 857918d..c032e16 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -2,6 +2,8 @@ RTC Architectural Protocol GUID as defined in DxeCis 0.96. Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Inc. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -128,7 +130,7 @@ PcRtcInit ( // Make sure Division Chain is properly configured, // or RTC clock won't "tick" -- time won't increment // - RegisterA.Data = RTC_INIT_REGISTER_A; + RegisterA.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterA); RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data); // @@ -144,7 +146,7 @@ PcRtcInit ( // // Clear RTC register D // - RegisterD.Data = RTC_INIT_REGISTER_D; + RegisterD.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterD); RtcWrite (RTC_ADDRESS_REGISTER_D, RegisterD.Data); // @@ -176,7 +178,7 @@ PcRtcInit ( // Set RTC configuration after get original time // The value of bit AIE should be reserved. // - RegisterB.Data = RTC_INIT_REGISTER_B | (RegisterB.Data & BIT5); + RegisterB.Data = FixedPcdGet8 (PcdInitialValueRtcRegisterB) | (RegisterB.Data & BIT5); RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data); // diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h index ba6092d..8aeb12c 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h @@ -2,6 +2,8 @@ Header file for real time clock driver. Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Inc. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -75,13 +77,6 @@ extern PC_RTC_MODULE_GLOBALS mModuleGlobal; #define RTC_INIT_DAY 1 #define RTC_INIT_MONTH 1 -// -// Register initial values -// -#define RTC_INIT_REGISTER_A 0x26 -#define RTC_INIT_REGISTER_B 0x02 -#define RTC_INIT_REGISTER_D 0x0 - #pragma pack(1) // // Register A diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf index dd746a2..1b2b063 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf @@ -5,6 +5,8 @@ # It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid. # # Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Inc. All rights reserved.
+# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -66,13 +68,18 @@ ## SOMETIMES_CONSUMES ## SystemTable gEfiAcpiTableGuid -[Depex] - gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid +[FixedPcd] + gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterA ## CONSUMES + gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterB ## CONSUMES + gPcAtChipsetPkgTokenSpaceGuid.PcdInitialValueRtcRegisterD ## CONSUMES [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout ## CONSUMES gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear ## CONSUMES gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear ## CONSUMES +[Depex] + gEfiVariableArchProtocolGuid AND gEfiVariableWriteArchProtocolGuid + [UserExtensions.TianoCore."ExtraFiles"] PcRtcExtra.uni -- 2.7.4