From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.41]) by mx.groups.io with SMTP id smtpd.web11.15379.1594126112739085089 for ; Tue, 07 Jul 2020 05:48:33 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=RApWsctx; spf=pass (domain: arm.com, ip: 40.107.3.41, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3F+aLkSO/yDWtYzEHd9MiGwFrsc70tSNjdj8jRjBIVI=; b=RApWsctxZWDugF45yqEe9of4/ueH6ik1OvpGedZA2Lj23GLkMQnPdJDw/bFXGwMnOkl7IWqZqm9AB8OcFZDNwZ+V4LSmy8aDsIjKRXhmfrX2c2hUUpSAnVGSDVlyLAQssgtNSDZD0W43KIDu4+eYxerCMKX5X40X0Q4mbtAyRWc= Received: from AM6PR04CA0070.eurprd04.prod.outlook.com (2603:10a6:20b:f0::47) by AM6PR08MB3608.eurprd08.prod.outlook.com (2603:10a6:20b:51::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Tue, 7 Jul 2020 12:48:29 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::fc) by AM6PR04CA0070.outlook.office365.com (2603:10a6:20b:f0::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.27 via Frontend Transport; Tue, 7 Jul 2020 12:48:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Tue, 7 Jul 2020 12:48:29 +0000 Received: ("Tessian outbound 8239f48e56bd:v62"); Tue, 07 Jul 2020 12:48:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fed2551576e27658 X-CR-MTA-TID: 64aa7808 Received: from 115c847bc483.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5D6D0BCC-CA43-4391-B703-31FA4ED232C9.1; Tue, 07 Jul 2020 12:48:23 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 115c847bc483.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Jul 2020 12:48:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WERFsPfZukuabTht4d9WxwOCd8ClBxm7AlifqQA6qTrzLsa6lHfvAInca9HaCpFLsEBycNez25ll8mB+BkzIj9kw1wUni/RkBYj42rPzlvz9JPn5pWcCQFJJhFkIbvvKDn0FgCYg0s4yBHxzS2OLTHjbJ0kOPpRS5mCqTXrk8FYkYv23BBgD6q97AMdQwGAKey2VxEEuPWg8mqB5qYhPzXm7ZOIELzGBMpncJxTy1Tm5rWnO09LAyFPsyKxl1GrBHmNW0bQXbcDT8A4O5fyhlQyqHXFdPMKNjueAR7M9wDVNsGIHH7/ZJCwjhRlPZXzcHERitKXGr9VballkXycVdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3F+aLkSO/yDWtYzEHd9MiGwFrsc70tSNjdj8jRjBIVI=; b=CDNHVRlF3+/e2z5LEgVASqfeRVcdUDs0GNKCabH20KSJbtiJYIdg7ZnsD7IJ9y2V9cRqS0sY9me5bB4+Jv1mxeYYeumVRAjp6yWiw7/9B0/LJLEFc3WoQkQulWa2wtqYzgDtYthjcjXR7WGvqSQPMGmMeuqbKwPGZjjD7Y0xgusXnxhvKDcmp1cxVmOD3Lh9SVJXTMbYqbF1QEKxebrV/jkUomtlkdiZaQNwjH5OW3crTgKoShcMx7DhC4LrwvR81eq+MchIqU6aIEVQJYI7MrtLcGMCdE/Rbr1mxEPBylLoQevyLGLOmXMyGNYBVYgxsTQB5Cp7oqTjjYm5KmkiIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3F+aLkSO/yDWtYzEHd9MiGwFrsc70tSNjdj8jRjBIVI=; b=RApWsctxZWDugF45yqEe9of4/ueH6ik1OvpGedZA2Lj23GLkMQnPdJDw/bFXGwMnOkl7IWqZqm9AB8OcFZDNwZ+V4LSmy8aDsIjKRXhmfrX2c2hUUpSAnVGSDVlyLAQssgtNSDZD0W43KIDu4+eYxerCMKX5X40X0Q4mbtAyRWc= Received: from DB6PR0501CA0008.eurprd05.prod.outlook.com (2603:10a6:4:8f::18) by DB8PR08MB5260.eurprd08.prod.outlook.com (2603:10a6:10:e6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Tue, 7 Jul 2020 12:48:21 +0000 Received: from DB5EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::90) by DB6PR0501CA0008.outlook.office365.com (2603:10a6:4:8f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22 via Frontend Transport; Tue, 7 Jul 2020 12:48:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT047.mail.protection.outlook.com (10.152.21.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3153.24 via Frontend Transport; Tue, 7 Jul 2020 12:48:21 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Tue, 7 Jul 2020 12:48:15 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Tue, 7 Jul 2020 12:48:14 +0000 Received: from E107187.Arm.com (10.57.21.15) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 7 Jul 2020 12:48:13 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [PATCH v4 02/15] ArmVirtPkg: Add Kvmtool RTC Fdt Client Library Date: Tue, 7 Jul 2020 13:47:56 +0100 Message-ID: <20200707124810.50668-3-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200707124810.50668-1-sami.mujawar@arm.com> References: <20200707124810.50668-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(376002)(396003)(346002)(39860400002)(136003)(46966005)(82310400002)(5660300002)(54906003)(186003)(81166007)(2906002)(336012)(316002)(82740400003)(70206006)(70586007)(86362001)(6666004)(1076003)(2616005)(426003)(8936002)(44832011)(356005)(4326008)(6916009)(47076004)(83380400001)(7696005)(966005)(478600001)(8676002)(26005)(36756003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19de731e-c910-444f-1c55-08d822740cac X-MS-TrafficTypeDiagnostic: DB8PR08MB5260:|AM6PR08MB3608: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-Forefront-PRVS: 0457F11EAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XNIP76BgGvMuRPrb1oi8GzihJzNINf35eGuW4B+x8YwW9vaE8fRx0BGoSRGHbZuwDwDsQM9MH+Ry/DW86z4Bgy0DaepgC1U24d6OoHyAYdisDY1+7tEpcMOsBKYnpDN/uhRZeofkw6W1Wv9NgIX9SztMffLKk0bhgDB7CXDe26/0LTNm4rlEd9bQtXdJBn9EfaHooXTKMIP04ivFuj8IxMiSeDOYHE13iIkpEu1ShrwXRmcn3NUwgFlHdPsrtRTJY5E8jJC4e0fNqMHF5pNtytXsdqW1Stlf4LN997Vx2YeqD6s+JI7RjKVvUlpwclFIVH47NEdQlqjhN4hsalmnK1h6BwQZHa4LljbpRlhhH1rHatNTeCbhuzs9QzfL4DPvaPGrEkpEIhd59hIo5Ku7U10h9gkxqKyc5lk7uN3XSJ0bmRiIFgFKJ6Tqr/deiYNhUU2cxID7nBeYgmdLF53nUf+qn8a2Bjs9RJ7KL5omjv8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5260 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(346002)(39860400002)(396003)(46966005)(8936002)(426003)(5660300002)(8676002)(81166007)(86362001)(82740400003)(7696005)(6916009)(70206006)(47076004)(4326008)(186003)(82310400002)(83380400001)(336012)(2906002)(478600001)(26005)(966005)(36906005)(70586007)(36756003)(1076003)(44832011)(2616005)(6666004)(316002)(54906003);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: ebc755a9-b32e-4ba4-e260-08d8227407b6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVfVC7NkvWK7KTyhqaDjnO322U/p2JhiGhuWl4hKIOSSEL5KkUpZlLQtDglnbBZ69Ksz0mbrd8RBmJkA2EmveqSIMadyx8tlTDel+XiTBWOxT+81h06xfeLh1f4/F+8/ntCG40MtEKAW+Ga54F7DAgt8YL+gV0IOpxqTsESovr7vZvM2xhvy2qlCYqtErff5hLfsTE70snhIgRMcARTRdlycDY8gWM7iyKlYWGO9NUlNfxLtLT2agt8W3w4jeRtnbustLlPeQEpqYYathvGlWpDQAXMkMVpvowJPrFgdrpr3GhqFjljk5W67+lpEbvhAV9Z7liLBKI7jhXm8OiZ1o6CXysVRxNhz6+YS+4Z7QmEz0X6WqFY9YdoLkCX1ungruLVUSNUyeIrutkHZls6ikGBdgbqY6TT8Njh9ffrcBO04FnGhQEyOI+MK96XRCXjUPVZBbfNAUm0AKNDEqn/Bn5nF7/Ewgq21FFM59yWecrU= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2020 12:48:29.6283 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19de731e-c910-444f-1c55-08d822740cac X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3608 Content-Type: text/plain Add library that parses the Kvmtool device tree and updates the dynamic PCDs describing the RTC Memory map. It also maps the MMIO region used by the RTC as runtime memory so that the RTC registers are accessible post ExitBootServices. Since UEFI takes ownership of the RTC hardware disable the RTC node in the DT to prevent the OS from attaching its device driver as well. Signed-off-by: Sami Mujawar --- Notes: v4: - Updated based on review comments. [Sami] - Cleanup include file list, make local functions static, [Ard] drop EFIAPI, use EFI_PAGE_MASK and use ReadUnaligned64. Ref: https://edk2.groups.io/g/devel/topic/75081472 v3: - Introduce library to read and map the MMIO base addresses [Sami] for the RTC registers from the DT and configure the Index and Target register PCDs. ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c | 230 ++++++++++++++++++++ ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf | 42 ++++ 2 files changed, 272 insertions(+) diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c new file mode 100644 index 0000000000000000000000000000000000000000..93715958952f933007ff143a22cbe81606cc539e --- /dev/null +++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c @@ -0,0 +1,230 @@ +/** @file + FDT client library for motorola,mc146818 RTC driver + + Copyright (c) 2020, ARM Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include + +/** RTC Index register is at offset 0x0 +*/ +#define RTC_INDEX_REG_OFFSET 0x0ULL + +/** RTC Target register is at offset 0x1 +*/ +#define RTC_TARGET_REG_OFFSET 0x1ULL + +/** Add the RTC controller address range to the memory map. + + @param [in] ImageHandle The handle to the image. + @param [in] RtcPageBase Base address of the RTC controller. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND Flash device not found. +**/ +STATIC +EFI_STATUS +KvmtoolRtcMapMemory ( + IN EFI_HANDLE ImageHandle, + IN EFI_PHYSICAL_ADDRESS RtcPageBase + ) +{ + EFI_STATUS Status; + + Status = gDS->AddMemorySpace ( + EfiGcdMemoryTypeMemoryMappedIo, + RtcPageBase, + EFI_PAGE_SIZE, + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, "Failed to add memory space. Status = %r\n", + Status + )); + return Status; + } + + Status = gDS->AllocateMemorySpace ( + EfiGcdAllocateAddress, + EfiGcdMemoryTypeMemoryMappedIo, + 0, + EFI_PAGE_SIZE, + &RtcPageBase, + ImageHandle, + NULL + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "Failed to allocate memory space. Status = %r\n", + Status + )); + gDS->RemoveMemorySpace ( + RtcPageBase, + EFI_PAGE_SIZE + ); + return Status; + } + + Status = gDS->SetMemorySpaceAttributes ( + RtcPageBase, + EFI_PAGE_SIZE, + EFI_MEMORY_UC | EFI_MEMORY_RUNTIME + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "Failed to set memory attributes. Status = %r\n", + Status + )); + gDS->FreeMemorySpace ( + RtcPageBase, + EFI_PAGE_SIZE + ); + gDS->RemoveMemorySpace ( + RtcPageBase, + EFI_PAGE_SIZE + ); + } + + return Status; +} + +/** Entrypoint for KvmtoolRtcFdtClientLib. + + Locate the RTC node in the DT and update the Index and + Target register base addresses in the respective PCDs. + Add the RTC memory region to the memory map. + Disable the RTC node as the RTC is owned by UEFI. + + @param [in] ImageHandle The handle to the image. + @param [in] SystemTable Pointer to the System Table. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND Flash device not found. +**/ +EFI_STATUS +EFIAPI +KvmtoolRtcFdtClientLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + FDT_CLIENT_PROTOCOL *FdtClient; + INT32 Node; + CONST UINT32 *Reg; + UINT32 RegSize; + UINT64 RegBase; + UINT64 Range; + RETURN_STATUS PcdStatus; + + Status = gBS->LocateProtocol ( + &gFdtClientProtocolGuid, + NULL, + (VOID **)&FdtClient + ); + ASSERT_EFI_ERROR (Status); + + Status = FdtClient->FindCompatibleNode ( + FdtClient, + "motorola,mc146818", + &Node + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: No 'motorola,mc146818' compatible DT node found\n", + __FUNCTION__ + )); + return Status; + } + + Status = FdtClient->GetNodeProperty ( + FdtClient, + Node, + "reg", + (CONST VOID **)&Reg, + &RegSize + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: No 'reg' property found in 'motorola,mc146818' compatible DT node\n", + __FUNCTION__ + )); + return Status; + } + + ASSERT (RegSize == 16); + + RegBase = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[0])); + Range = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2])); + DEBUG (( + DEBUG_INFO, + "Found motorola,mc146818 RTC @ 0x%Lx Range = 0x%x\n", + RegBase, + Range + )); + + // The address range must cover the RTC Index and the Target registers. + ASSERT (Range >= 0x2); + + // RTC Index register is at offset 0x0 + PcdStatus = PcdSet64S ( + PcdRtcIndexRegister64, + (RegBase + RTC_INDEX_REG_OFFSET) + ); + ASSERT_RETURN_ERROR (PcdStatus); + + // RTC Target register is at offset 0x1 + PcdStatus = PcdSet64S ( + PcdRtcTargetRegister64, + (RegBase + RTC_TARGET_REG_OFFSET) + ); + ASSERT_RETURN_ERROR (PcdStatus); + + Status = KvmtoolRtcMapMemory (ImageHandle, (RegBase & ~EFI_PAGE_MASK)); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "Failed to map memory for motorola,mc146818. Status = %r\n", + Status + )); + return Status; + } + + // + // UEFI takes ownership of the RTC hardware, and exposes its functionality + // through the UEFI Runtime Services GetTime, SetTime, etc. This means we + // need to disable it in the device tree to prevent the OS from attaching + // its device driver as well. + // + Status = FdtClient->SetNodeProperty ( + FdtClient, + Node, + "status", + "disabled", + sizeof ("disabled") + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_WARN, + "Failed to set motorola,mc146818 status to 'disabled', Status = %r\n", + Status + )); + } + + return EFI_SUCCESS; +} diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf new file mode 100644 index 0000000000000000000000000000000000000000..0d1b27997ed00d7c1be3578cab4d1d2eba663a90 --- /dev/null +++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf @@ -0,0 +1,42 @@ +#/** @file +# FDT client library for motorola,mc146818 RTC driver +# +# Copyright (c) 2020, ARM Limited. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = KvmtoolRtcFdtClientLib + FILE_GUID = 3254B4F7-30B5-48C6-B06A-D8FF97F3EF95 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = KvmtoolRtcFdtClientLib|DXE_DRIVER DXE_RUNTIME_DRIVER + CONSTRUCTOR = KvmtoolRtcFdtClientLibConstructor + +[Sources] + KvmtoolRtcFdtClientLib.c + +[Packages] + ArmVirtPkg/ArmVirtPkg.dec + MdePkg/MdePkg.dec + PcAtChipsetPkg/PcAtChipsetPkg.dec + +[LibraryClasses] + BaseLib + DebugLib + PcdLib + UefiBootServicesTableLib + DxeServicesTableLib + +[Protocols] + gFdtClientProtocolGuid ## CONSUMES + +[Pcd] + gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister64 + gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister64 + +[Depex] + gFdtClientProtocolGuid -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'