From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.52]) by mx.groups.io with SMTP id smtpd.web11.13568.1593005720210673353 for ; Wed, 24 Jun 2020 06:35:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=85SIaTwA; spf=pass (domain: arm.com, ip: 40.107.21.52, 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=t4p8/JTfji+dTaJ3KeTTKkeIjAjaQf1fYpabvg9n/Ng=; b=85SIaTwAYK8vvm28+QdNgSnvTQHwvYmPM3z0RT4Y9avS1aSVve+0r5ZSyUPU28iEH0GYc9IzZ3LsoUugBJ8OghQF2p2SXR3BihwUbbKOeZdahk4KLQKP/3fYC2nQ0bswCNuK8GUu+r7y9Lp7jjhqPXpUAF+6OUitAJFHhQNm688= Received: from AM5PR0202CA0018.eurprd02.prod.outlook.com (2603:10a6:203:69::28) by VI1PR0802MB2557.eurprd08.prod.outlook.com (2603:10a6:800:b1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Wed, 24 Jun 2020 13:35:16 +0000 Received: from AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:69:cafe::56) by AM5PR0202CA0018.outlook.office365.com (2603:10a6:203:69::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 24 Jun 2020 13:35:16 +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 AM5EUR03FT024.mail.protection.outlook.com (10.152.16.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:16 +0000 Received: ("Tessian outbound 8fb20e43acb7:v59"); Wed, 24 Jun 2020 13:35:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 32e2d332a0b52ff9 X-CR-MTA-TID: 64aa7808 Received: from 40b7ab3dd150.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 01DD39F1-7A2B-46AE-B9F6-921D7741F4EF.1; Wed, 24 Jun 2020 13:35:16 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40b7ab3dd150.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Jun 2020 13:35:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ARBMxS93jkDg0UufPMCz/81TxGaAMswWxmKfMKR0j69c72xyHuVDl4Tfsb5hOISykiJTaXx6AMMrQj9xWyoXDUTThMsbiXR7b1veUTXYPILqox8RymZFhLInh9MZed+ZPWXE98GHRgGt5LyjVR8o4WkaCglfiTLkBdqhPTebQvIfHuQiYkOItxAsFiuf9CceNqH7BClpe1k4htYJtB7lnEa7XjA6mRtXTGd47FtXMnvqfzdUbcGPag463Agya2EICjxaDw8iVQU+MX46AII5CZrJ7Fl8zosWsG/DDfFI8aOz+QmjvesxxmtBBPNfYnd8IkzM5KmkPd7bTEEdx1RfWQ== 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=t4p8/JTfji+dTaJ3KeTTKkeIjAjaQf1fYpabvg9n/Ng=; b=b/V64fttJFmIgz4pQhdVQvwFLcHKW5TU6PTqpRsuHqHcwIrSrRviQyYMhnh0jnizRyOgxvqeJGT5oy7T8A5Oe0FNB4AwGFOD7BZPm4i5J9SAh2N12b+bb+n5hJJ8U2AOBc8kZa0wQs2l9e+DKfQu1rwqErR12xf0LzN7FJDpez3zTw5OaTu/Pdtve/z5Wk9dMF7eAbdqZLgjJq/KbGVIe5b2QIRQpUCwtNF+8DLOLWzqyShzwoJ88chCoq0JCp7xLObZ/yIOcqhuOK1PxheBKhhixfMQEnaxQBwJDHLtfLTPrLGYt4TXJFluu4kr4scfycMJ5ky0ZIU38DU7njkb/A== 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=t4p8/JTfji+dTaJ3KeTTKkeIjAjaQf1fYpabvg9n/Ng=; b=85SIaTwAYK8vvm28+QdNgSnvTQHwvYmPM3z0RT4Y9avS1aSVve+0r5ZSyUPU28iEH0GYc9IzZ3LsoUugBJ8OghQF2p2SXR3BihwUbbKOeZdahk4KLQKP/3fYC2nQ0bswCNuK8GUu+r7y9Lp7jjhqPXpUAF+6OUitAJFHhQNm688= Received: from AM6PR04CA0070.eurprd04.prod.outlook.com (2603:10a6:20b:f0::47) by VI1PR0802MB2430.eurprd08.prod.outlook.com (2603:10a6:800:b1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.23; Wed, 24 Jun 2020 13:35:13 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::74) 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.3109.22 via Frontend Transport; Wed, 24 Jun 2020 13:35:13 +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 AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3131.20 via Frontend Transport; Wed, 24 Jun 2020 13:35:13 +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.1415.2; Wed, 24 Jun 2020 13:35:02 +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; Wed, 24 Jun 2020 13:35:01 +0000 Received: from E107187.Arm.com (10.57.22.181) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 24 Jun 2020 13:35:00 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [PATCH v3 02/15] ArmVirtPkg: Add Kvmtool RTC Fdt Client Library Date: Wed, 24 Jun 2020 14:34:45 +0100 Message-ID: <20200624133458.61920-3-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20200624133458.61920-1-sami.mujawar@arm.com> References: <20200624133458.61920-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)(136003)(396003)(346002)(39860400002)(376002)(46966005)(1076003)(44832011)(356005)(81166007)(5660300002)(6916009)(8936002)(82310400002)(2616005)(336012)(316002)(426003)(8676002)(47076004)(82740400003)(6666004)(70206006)(70586007)(26005)(7696005)(54906003)(186003)(2906002)(36756003)(478600001)(83380400001)(4326008)(86362001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea043509-8114-4610-fcee-08d818436e20 X-MS-TrafficTypeDiagnostic: VI1PR0802MB2430:|VI1PR0802MB2557: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-Forefront-PRVS: 0444EB1997 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: QI/+q2X7M/+TlQOfWhrSBdWuvK2fxHTtJq/qQLtiKeuRX9xRxKG71bPkyiUokhBtJ0IFEnA5bz4/5/xIBq4Xzmnpa5qkhFWlGChnTGhP7aRhSZd23kl1XyzhRNNXJTEuJE91gsD+XSWH1VY+jR8RJ2x6WwRgS9U6yA2noP2OSZZOYp6ZUr9SFzBrVVuayafhuV1nXiw+a4kEtZOKI29AJUCg+1XYkdGA04TIy0Z/MjTbReAJW118GCIq2Bqq58g2cVqv8wt5pKlh/XddYYtDN/Oc67VpEJOjnKHzbPNpHPv+0DqNz9+PnefPFJmCcyTjw3QTA5iRV4fDjWdAj8VTuvrfEQGsCYOWkx1pvzZY1MxE4/2H7s8xIvnVWRobQNrEZogX8a7zmQcZ6EhDRBinfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2430 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT024.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)(396003)(39860400002)(346002)(376002)(136003)(46966005)(70586007)(47076004)(70206006)(5660300002)(54906003)(316002)(7696005)(36756003)(6666004)(82310400002)(86362001)(1076003)(83380400001)(82740400003)(81166007)(44832011)(336012)(8676002)(2906002)(478600001)(26005)(4326008)(8936002)(426003)(6916009)(2616005)(186003)(36906005);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 2b146275-10da-4d71-f8c1-08d818436c91 X-Forefront-PRVS: 0444EB1997 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VDbzJd4JJQHSiHwAP24pxEeBiXmsGBt+coSJt9ny6l/4pXXd1VoP5t1aq4DXz9BSsFCvK+bS5046Kbf8EYcakKqXjWNd/rXBbf0nKKhN7Uif/MHXbNHIAHvlQcP8KZ5Z9vjJap33fyzd2ROuXsEoyJmVk68qUgVUrhym21lmz8M0N/w+hnrGJNI8SHDYrufK6D+AkxnRHG7BXBwNkl20t8Xi0tTlyWlskf8i1nwobsj76YgCaZ8OPZgLi76kyJ4djU2eFwHlQPrk+BVVze+zjj+sOnVjcni3Zr4pOWrjtT9ScXh2al5idkPBN1nI64umwi8JTs5aGTHzUnNDLe3++svO1nwNJ7IZjlsshiONlCvM040ND4GworJEwINHde2kU2nJDopexWFLHMjrGzmZ0w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2020 13:35:16.1857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea043509-8114-4610-fcee-08d818436e20 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2557 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: 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 | 255 ++++++++++++++++++++ ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf | 42 ++++ 2 files changed, 297 insertions(+) diff --git a/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c new file mode 100644 index 0000000000000000000000000000000000000000..2f38923187c1a621578413be9c39fa425bde2ed1 --- /dev/null +++ b/ArmVirtPkg/Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.c @@ -0,0 +1,255 @@ +/** @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 +#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. +**/ +EFI_STATUS +EFIAPI +KvmtoolRtcMapMemory ( + IN EFI_HANDLE ImageHandle, + IN EFI_PHYSICAL_ADDRESS RtcPageBase + ) +{ + EFI_STATUS Status; + EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor; + BOOLEAN MemorySpaceAdded; + + MemorySpaceAdded = FALSE; + + Status = gDS->GetMemorySpaceDescriptor (RtcPageBase, &Descriptor); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, "Failed to get memory space descriptor. Status = %r\n", + Status + )); + return Status; + } + + if (Descriptor.GcdMemoryType == EfiGcdMemoryTypeNonExistent) { + 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; + } + MemorySpaceAdded = TRUE; + } + + 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 + )); + if (MemorySpaceAdded) { + 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 + ); + if (MemorySpaceAdded) { + 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 UINT64 *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 (Reg[0]); + Range = SwapBytes64 (Reg[1]); + 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_SIZE - 1))); + 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)'