From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.43]) by mx.groups.io with SMTP id smtpd.web11.5734.1601673266344568195 for ; Fri, 02 Oct 2020 14:14:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VzeWlTem; spf=pass (domain: arm.com, ip: 40.107.15.43, 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=tJf7xAf9OcjxhkqeYFpOGLEbQGjW08mlB5kLcv1IW/I=; b=VzeWlTemwpnVN6YfiPeFFRI7UZbSn5jEan9f+8qM97BLMCn+O0/cBHkU6GWVcRjx7Llnw8iUTUs+P1eEt8VxwdUJK8k5/Vyz1vO28/3xMxRpL3K7kO0xpaxTv4e/tXB0GfhuHl7iiwFZChz3VZd9UE2rk+hNFrLMpMayYHhC+pk= Received: from AM5PR0602CA0020.eurprd06.prod.outlook.com (2603:10a6:203:a3::30) by DB7PR08MB3835.eurprd08.prod.outlook.com (2603:10a6:10:75::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38; Fri, 2 Oct 2020 21:14:23 +0000 Received: from VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::2b) by AM5PR0602CA0020.outlook.office365.com (2603:10a6:203:a3::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.35 via Frontend Transport; Fri, 2 Oct 2020 21:14:23 +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=pass 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 VE1EUR03FT010.mail.protection.outlook.com (10.152.18.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:23 +0000 Received: ("Tessian outbound 7fc8f57bdedc:v64"); Fri, 02 Oct 2020 21:14:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8ddf6cf7bc2ac4e3 X-CR-MTA-TID: 64aa7808 Received: from fcdbb084d6ec.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E6D77E0E-A9B5-495E-A035-CFCF9EA74297.1; Fri, 02 Oct 2020 21:14:17 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fcdbb084d6ec.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 02 Oct 2020 21:14:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h5tEjUgU9X9ACSINndEpK0UpzxCKEJOeB9yzsrsHUaU1SjuqxqbnrTZIqj3yb5qklp9XSKZB0j7xt8ewSCo7sF8TLlF/1BCcMMZwy1qo9xM2kERHAT2HboJC1GetaqNoPQVbJS+kgNac3r7qzW1gY/XnXvFF7Tml/TWRq7zXUnke+vQNS08D2b2he1ti/6lkECVJlZtAyFsJMwffnTGcVbZqeA/KOh0yMSK5MCWfDRkmyA/kmTosW66KrrkVY1QZQQTkYNzoH7jebg9nv31mCRsFhyZ4Wol5BxEoo4aDZmRvOx9k1pvbzz2CejXyj6RkU7UENrp4V57R5KomUSi7Mg== 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=tJf7xAf9OcjxhkqeYFpOGLEbQGjW08mlB5kLcv1IW/I=; b=QsuqS6ZNOzIwSfzs5fu2fgOZfJbuUtXTtZM82Pys4a3lMoXx52tJiHRLcoq/qWzLI7o0A5j06N/USS73uQ6c5m5dX8+U4YzCYb8vrjuDoTWrL4NW7ijELclNgRjnb42OWGPgHY83idtbATxztX0fcyWqGyF3ZwylqiAeVCX5XTBYjXvWNGzdBTNLpSu3orFnYUeOv/IdsDjVNiJK/t1Q07ybIlDq9YeI/OKte+X+X3GCFN1mPrO7X7gsk5MA51l5mpc938zFzBviau3IDGEivvel3d3NzelivX1foU07hmlAQI4ZzVR2v2twN6buGDKwj3IGLLKBjLVzCz9a8bfCDg== 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=pass (p=none sp=none pct=100) 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=tJf7xAf9OcjxhkqeYFpOGLEbQGjW08mlB5kLcv1IW/I=; b=VzeWlTemwpnVN6YfiPeFFRI7UZbSn5jEan9f+8qM97BLMCn+O0/cBHkU6GWVcRjx7Llnw8iUTUs+P1eEt8VxwdUJK8k5/Vyz1vO28/3xMxRpL3K7kO0xpaxTv4e/tXB0GfhuHl7iiwFZChz3VZd9UE2rk+hNFrLMpMayYHhC+pk= Received: from AM6P194CA0045.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::22) by VI1PR08MB4479.eurprd08.prod.outlook.com (2603:10a6:803:fc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.23; Fri, 2 Oct 2020 21:14:15 +0000 Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::27) by AM6P194CA0045.outlook.office365.com (2603:10a6:209:84::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32 via Frontend Transport; Fri, 2 Oct 2020 21:14:15 +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=pass 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 AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3433.34 via Frontend Transport; Fri, 2 Oct 2020 21:14:15 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2044.4; Fri, 2 Oct 2020 21:14:13 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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; Fri, 2 Oct 2020 21:14:13 +0000 Received: from E107187.Arm.com (10.57.53.44) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2044.4 via Frontend Transport; Fri, 2 Oct 2020 21:14:12 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [PATCH v5 02/15] ArmVirtPkg: Add Kvmtool RTC Fdt Client Library Date: Fri, 2 Oct 2020 22:13:56 +0100 Message-ID: <20201002211409.43888-3-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20201002211409.43888-1-sami.mujawar@arm.com> References: <20201002211409.43888-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15446c0f-84e4-49ad-16e9-08d8671822cf X-MS-TrafficTypeDiagnostic: VI1PR08MB4479:|DB7PR08MB3835: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ToQndQNircexrQo6897afHXEk4uMbZSwXJXOl/V1jvJez/eJtq9zNJSY8qo/ooe+8YI89OhA06s4vnJmD4hvJIIKxnZtaFN7W3sbiHUDT0yLFZ00c1hwVXeRxUEizaLuydh9ddlZkNi3ybjhLtg+DswRiy9fDK1ZRYleKaz27k/eLZqOWxMVxIdTXVvAARvW/xgfYc5g/L2+5zYeUO7uVwf+43n/YyQpPIkW94YKGHj3rQJl2QoIHGjrPPifEMDm4+NOBms5mOwAegeV5isnxUBXs+8+3KnPqu0NZCk9TDIf6SLjO+qMGxCBFobm9xh4pWifBB/T2YQ4lyrMfPLQHPDuE7ACIVVaaydKzG168Tl7ivtqBcC210G8Zp8ZWvJsScxj6HnU6IDQ7RHOSQ8oe3InMfsCMSKKqF5lxEOkhxvT053vXSsg0TgPb9uUqpsPkU8R4Txk3ciQ8LPPFI9wD556qcrWE8NppTzQceEbhyv8QOLcULeN6BMTGzIb74ROsikh/ppAU4F+pV+LMNDpUQ== 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;SFS:(4636009)(136003)(376002)(346002)(39850400004)(396003)(46966005)(2906002)(82310400003)(70206006)(70586007)(36756003)(966005)(6916009)(82740400003)(316002)(4326008)(426003)(478600001)(54906003)(83380400001)(47076004)(81166007)(7696005)(44832011)(336012)(6666004)(186003)(2616005)(356005)(8676002)(26005)(8936002)(86362001)(5660300002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4479 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3856a2d1-147a-4859-7250-08d867181dde X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: csFwAc9gGuUcJsrCGf94ktIvzX166MEkcSIbV/Qz25TUYjiYAvL5Edrj4UlxH8Uifm4OavRB657J9NA3LHCBNum1kQ1R6fVTvMoaa/W2mq0ONyOX2ouxwGSuQX7eo1Bo/Sb/ykDS7mfAwX2UYpBWJRX57gzRkDx3WBorLpQjcGMyedJWoed3L7YSPQ1F/UAun6liQo59CTFlyxXyd4ycbK6saQu0cSLB371l79w2asWjUX5lbZ8vsM5odCaTfgMNj/FhpR2zo3+ifAYHm64yswdJz6zYP3dt9oj6JvE9Ce49rZcnttuaSwWTtM1eAaECER8N/+b9OMJHJcU9we0ICXIZdJWN/up1coMm0H0QCu3pEmkneF04/TQDZyEcZbWshPqR3Pu/Xuzkx8kbPvkK+0WslLIFwgKEt8fOkGIx0bL0XSydbqFZuH5noPQWSLuL1zmWQtSD6NWAbvb2KDZvpwmVL8QIQvcmY2jZsLvfChw= 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;SFS:(4636009)(396003)(346002)(136003)(376002)(39850400004)(46966005)(966005)(82740400003)(5660300002)(83380400001)(4326008)(26005)(2906002)(47076004)(70586007)(82310400003)(478600001)(6666004)(70206006)(7696005)(36756003)(6916009)(8936002)(44832011)(1076003)(86362001)(81166007)(54906003)(2616005)(83080400001)(8676002)(186003)(316002)(36906005)(426003)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2020 21:14:23.2339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15446c0f-84e4-49ad-16e9-08d8671822cf 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: VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3835 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: v5: - Fixed minor ECC reported issues in file header. [Sami] Ref: https://edk2.groups.io/g/devel/topic/75354087 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..deb3bf635c1e89433832c4801328087c5b9daddc --- /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)'