From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.6332.1593074750841641706 for ; Thu, 25 Jun 2020 01:45:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gNumiQLc; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593074749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=XzpxYuFYYDGCoFkMnbvS88PkabDac6nDqsWr97Hpnwc=; b=gNumiQLclPhopS1GdKfm5ATSV+12Thad8kcG6R73NrRWb5p7g9DA1pJRpgkO0VJaueczUQ lJsqB75Nagm2Cgvuv56Imw1T8jMbOQkXkXnXo7yWh9pqu24lGQfzfGiKsXUt0A2bbTswlX BWlXNdg6cBtULwthmzc0nix83fobG5M= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-OyLCKKAMMQKL-ilZoPfcNQ-1; Thu, 25 Jun 2020 04:45:44 -0400 X-MC-Unique: OyLCKKAMMQKL-ilZoPfcNQ-1 Received: by mail-wr1-f72.google.com with SMTP id i12so6324028wrx.11 for ; Thu, 25 Jun 2020 01:45:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=XzpxYuFYYDGCoFkMnbvS88PkabDac6nDqsWr97Hpnwc=; b=HJE19u6tqP6oIMlwB9imfUU4Tbv92OCyudyKH6MNqXUmMI7I+iU1U3E9/gDqznNTJc kupY8sayMmN4R72eIl2pHcfT+q9IyxC1jwlY6yn5KsS94LQl3WU3mX35ncOLUAlieb09 mOjrWjt4RCQHQnb/f5UNym+e4RuPNa7t0Zw/Yzr41/0ClWIvcPDi2b7fIVaO51fwWmcc H5duzKMLVoJEIce6BT5AIGmiQYfbAi4cMn7jIq8xSyI/WkBZISgu48/4wF/Bq5vOyOYY rG9g57EupVMW775g2yk0HtfgYtxVjBV21bn8kWMnyn6o61y7C6Xy5ZwD9n5ltyt+3Vl7 bwvw== X-Gm-Message-State: AOAM531+4e2ijds5AAWPUAQRZXytfuPrjIIwmGgNUXKKmXa8D0dv2i7Q IrITNzjevaIfp/8TR9go+JlzCrD/ZXRG1PvM/lX6aTKDqCPFZm4GtskjGmXkd7z+FhsCZdC1G+2 wpGv513fbdySiOA== X-Received: by 2002:a1c:2349:: with SMTP id j70mr2137788wmj.22.1593074742285; Thu, 25 Jun 2020 01:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvrF1U3VtQIX4f7uEB6wPnXGTGHDJ9/AUd53KgsnKSIrrwIMgdxlpSBTux2Cu/bZQb3QmpNg== X-Received: by 2002:a1c:2349:: with SMTP id j70mr2137749wmj.22.1593074741888; Thu, 25 Jun 2020 01:45:41 -0700 (PDT) Return-Path: Received: from [192.168.1.40] (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id l1sm32153273wrb.31.2020.06.25.01.45.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2020 01:45:41 -0700 (PDT) Subject: Re: [PATCH v3 06/15] ArmVirtPkg: Add Kvmtool NOR flash lib To: Sami Mujawar , devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, lersek@redhat.com, Alexandru.Elisei@arm.com, Andre.Przywara@arm.com, Matteo.Carlini@arm.com, Laura.Moretta@arm.com, nd@arm.com References: <20200624133458.61920-1-sami.mujawar@arm.com> <20200624133458.61920-7-sami.mujawar@arm.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Autocrypt: addr=philmd@redhat.com; keydata= mQINBDXML8YBEADXCtUkDBKQvNsQA7sDpw6YLE/1tKHwm24A1au9Hfy/OFmkpzo+MD+dYc+7 bvnqWAeGweq2SDq8zbzFZ1gJBd6+e5v1a/UrTxvwBk51yEkadrpRbi+r2bDpTJwXc/uEtYAB GvsTZMtiQVA4kRID1KCdgLa3zztPLCj5H1VZhqZsiGvXa/nMIlhvacRXdbgllPPJ72cLUkXf z1Zu4AkEKpccZaJspmLWGSzGu6UTZ7UfVeR2Hcc2KI9oZB1qthmZ1+PZyGZ/Dy+z+zklC0xl XIpQPmnfy9+/1hj1LzJ+pe3HzEodtlVA+rdttSvA6nmHKIt8Ul6b/h1DFTmUT1lN1WbAGxmg CH1O26cz5nTrzdjoqC/b8PpZiT0kO5MKKgiu5S4PRIxW2+RA4H9nq7nztNZ1Y39bDpzwE5Sp bDHzd5owmLxMLZAINtCtQuRbSOcMjZlg4zohA9TQP9krGIk+qTR+H4CV22sWldSkVtsoTaA2 qNeSJhfHQY0TyQvFbqRsSNIe2gTDzzEQ8itsmdHHE/yzhcCVvlUzXhAT6pIN0OT+cdsTTfif MIcDboys92auTuJ7U+4jWF1+WUaJ8gDL69ThAsu7mGDBbm80P3vvUZ4fQM14NkxOnuGRrJxO qjWNJ2ZUxgyHAh5TCxMLKWZoL5hpnvx3dF3Ti9HW2dsUUWICSQARAQABtDJQaGlsaXBwZSBN YXRoaWV1LURhdWTDqSAoUGhpbCkgPHBoaWxtZEByZWRoYXQuY29tPokCVQQTAQgAPwIbDwYL CQgHAwIGFQgCCQoLBBYCAwECHgECF4AWIQSJweePYB7obIZ0lcuio/1u3q3A3gUCXsfWwAUJ KtymWgAKCRCio/1u3q3A3ircD/9Vjh3aFNJ3uF3hddeoFg1H038wZr/xi8/rX27M1Vj2j9VH 0B8Olp4KUQw/hyO6kUxqkoojmzRpmzvlpZ0cUiZJo2bQIWnvScyHxFCv33kHe+YEIqoJlaQc JfKYlbCoubz+02E2A6bFD9+BvCY0LBbEj5POwyKGiDMjHKCGuzSuDRbCn0Mz4kCa7nFMF5Jv piC+JemRdiBd6102ThqgIsyGEBXuf1sy0QIVyXgaqr9O2b/0VoXpQId7yY7OJuYYxs7kQoXI 6WzSMpmuXGkmfxOgbc/L6YbzB0JOriX0iRClxu4dEUg8Bs2pNnr6huY2Ft+qb41RzCJvvMyu gS32LfN0bTZ6Qm2A8ayMtUQgnwZDSO23OKgQWZVglGliY3ezHZ6lVwC24Vjkmq/2yBSLakZE 6DZUjZzCW1nvtRK05ebyK6tofRsx8xB8pL/kcBb9nCuh70aLR+5cmE41X4O+MVJbwfP5s/RW 9BFSL3qgXuXso/3XuWTQjJJGgKhB6xXjMmb1J4q/h5IuVV4juv1Fem9sfmyrh+Wi5V1IzKI7 RPJ3KVb937eBgSENk53P0gUorwzUcO+ASEo3Z1cBKkJSPigDbeEjVfXQMzNt0oDRzpQqH2vp apo2jHnidWt8BsckuWZpxcZ9+/9obQ55DyVQHGiTN39hkETy3Emdnz1JVHTU0Q== Message-ID: Date: Thu, 25 Jun 2020 10:45:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200624133458.61920-7-sami.mujawar@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Sami, On 6/24/20 3:34 PM, Sami Mujawar wrote: > Kvmtool places the base address of the CFI flash in > the device tree it passes to UEFI. This library > parses the kvmtool device tree to read the CFI base > address and initialise the PCDs use by the NOR flash > driver and the variable storage. > > UEFI takes ownership of the CFI flash hardware, and > exposes its functionality through the UEFI Runtime > Variable Service. Therefore, disable the device tree > node for the CFI flash used for storing the UEFI > variables, to prevent the OS from attaching its device > driver as well. > > Signed-off-by: Sami Mujawar > Acked-by: Laszlo Ersek > --- > > Notes: > v3: > - ASSERT is sufficient to test Locating [Ard] > gFdtClientProtocolGuid as DEPEX ensures that this is > guaranteed to succeed. > - Removed additional error handling based on review [Sami] > feedback. > - Fix confusion caused by use of macro MAX_FLASH_BANKS. [Philippe] > - Renamed MAX_FLASH_BANKS to MAX_FLASH_DEVICES. [Sami] > - Use macro to define block size for flash. [Philippe] > - Defined macro KVMTOOL_NOR_BLOCK_SIZE and also configured [Sami] > to reflect the correct block size 64KB. > - Disable the DT flash node used for UEFI variable storage [Sami] > as UEFI takes ownership of the flash device. > Ref: https://edk2.groups.io/g/devel/topic/74200914#60341 > > v2: > - Library to read CFI flash base address from DT and initialise [Sami] > PCDs used for NOR flash variables. > > ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c | 330 ++++++++++++++++++++ > ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 49 +++ > 2 files changed, 379 insertions(+) > > diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c > new file mode 100644 > index 0000000000000000000000000000000000000000..8e9dcf31691b4b12b9c7bac1ad4ba8d3a534a1d8 > --- /dev/null > +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c > @@ -0,0 +1,330 @@ > +/** @file > + An instance of the NorFlashPlatformLib for Kvmtool platform. > + > + Copyright (c) 2020, ARM Ltd. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + **/ > + > +#include > +#include > +#include > +#include > +#include > + > +/** Macro defining the NOR block size configured in Kvmtool. > +*/ > +#define KVMTOOL_NOR_BLOCK_SIZE SIZE_64KB > + > +/** Macro defining the maximum number of Flash devices. > +*/ > +#define MAX_FLASH_DEVICES 4 I am sorry but I am still confused... This is about the QEMU Virt machine, right? This machine was supposed to have 1 single flash, see QEMU commit f5fdcd6e58 ("hw/arm: Add 'virt' platform") from Nov 2013: /* Addresses and sizes of our components. * 0..128MB is space for a flash device so we can run bootrom code such as UEFI. ... Due to limitations in the QEMU cfi-flash model, instead of using a single flash device (with proper sector/bank protection), two devices were added in QEMU commit acf82361c6 ("hw/arm/virt: Provide flash devices for boot ROMs") Sep 2014: Add two flash devices to the virt board, so that it can be used for running guests which want a bootrom image such as UEFI. We provide two flash devices to make it more convenient to provide both a read-only UEFI image and a read-write place to store guest-set UEFI config variables. The '-bios' command line option is set up to provide an image for the first of the two flash devices. What do you declare maximum 4 devices? Thanks, Phil. > + > +/** Macro defining the cfi-flash label describing the UEFI variable store. > +*/ > +#define LABEL_UEFI_VAR_STORE "System-firmware" > + > +STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_DEVICES]; > +STATIC UINTN mNorFlashDeviceCount = 0; > +STATIC INT32 mUefiVarStoreNode = MAX_INT32; > +STATIC FDT_CLIENT_PROTOCOL *mFdtClient; > + > +/** This function performs platform specific actions to initialise > + the NOR flash, if required. > + > + @retval EFI_SUCCESS Success. > +**/ > +EFI_STATUS > +NorFlashPlatformInitialization ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + > + DEBUG ((DEBUG_INFO, "NorFlashPlatformInitialization\n")); > + > + if ((mNorFlashDeviceCount > 0) && (mUefiVarStoreNode != MAX_INT32)) { > + // > + // UEFI takes ownership of the cfi-flash hardware, and exposes its > + // functionality through the UEFI Runtime Variable Service. This means we > + // need to disable it in the device tree to prevent the OS from attaching > + // its device driver as well. > + // Note: This library is loaded by the FaultTolerantWriteDxe to setup the > + // Ftw PCDs and later by the NorFlashDxe to provide the NorFlashPlatformLib > + // interfaces. Therefore the FDT node used for UEFI storage variable is > + // disabled here. > + // > + Status = mFdtClient->SetNodeProperty ( > + mFdtClient, > + mUefiVarStoreNode, > + "status", > + "disabled", > + sizeof ("disabled") > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_WARN, "Failed to set cfi-flash status to 'disabled'\n")); > + } > + } else { > + Status = EFI_NOT_FOUND; > + DEBUG ((DEBUG_ERROR, "Flash device for UEFI variable storage not found\n")); > + } > + > + return Status; > +} > + > +/** Initialise Non volatile Flash storage variables. > + > + @param [in] FlashDevice Pointer to the NOR Flash device. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > + @retval EFI_OUT_OF_RESOURCES Insufficient flash storage space. > +**/ > +EFI_STATUS > +SetupVariableStore ( > + IN NOR_FLASH_DESCRIPTION * FlashDevice > + ) > +{ > + UINTN FlashRegion; > + UINTN FlashNvStorageVariableBase; > + UINTN FlashNvStorageFtwWorkingBase; > + UINTN FlashNvStorageFtwSpareBase; > + UINTN FlashNvStorageVariableSize; > + UINTN FlashNvStorageFtwWorkingSize; > + UINTN FlashNvStorageFtwSpareSize; > + > + FlashNvStorageVariableSize = PcdGet32 (PcdFlashNvStorageVariableSize); > + FlashNvStorageFtwWorkingSize = PcdGet32 (PcdFlashNvStorageFtwWorkingSize); > + FlashNvStorageFtwSpareSize = PcdGet32 (PcdFlashNvStorageFtwSpareSize); > + > + if ((FlashNvStorageVariableSize == 0) || > + (FlashNvStorageFtwWorkingSize == 0) || > + (FlashNvStorageFtwSpareSize == 0)) { > + DEBUG ((DEBUG_ERROR, "FlashNvStorage size not defined\n")); > + return EFI_INVALID_PARAMETER; > + } > + > + // Setup the variable store > + FlashRegion = FlashDevice->DeviceBaseAddress; > + > + FlashNvStorageVariableBase = FlashRegion; > + FlashRegion += PcdGet32 (PcdFlashNvStorageVariableSize); > + > + FlashNvStorageFtwWorkingBase = FlashRegion; > + FlashRegion += PcdGet32 (PcdFlashNvStorageFtwWorkingSize); > + > + FlashNvStorageFtwSpareBase = FlashRegion; > + FlashRegion += PcdGet32 (PcdFlashNvStorageFtwSpareSize); > + > + if (FlashRegion > (FlashDevice->DeviceBaseAddress + FlashDevice->Size)) { > + DEBUG ((DEBUG_ERROR, "Insufficient flash storage size\n")); > + return EFI_OUT_OF_RESOURCES; > + } > + > + PcdSet32S ( > + PcdFlashNvStorageVariableBase, > + FlashNvStorageVariableBase > + ); > + > + PcdSet32S ( > + PcdFlashNvStorageFtwWorkingBase, > + FlashNvStorageFtwWorkingBase > + ); > + > + PcdSet32S ( > + PcdFlashNvStorageFtwSpareBase, > + FlashNvStorageFtwSpareBase > + ); > + > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageVariableBase = 0x%x\n", > + FlashNvStorageVariableBase > + )); > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageVariableSize = 0x%x\n", > + FlashNvStorageVariableSize > + )); > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageFtwWorkingBase = 0x%x\n", > + FlashNvStorageFtwWorkingBase > + )); > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageFtwWorkingSize = 0x%x\n", > + FlashNvStorageFtwWorkingSize > + )); > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageFtwSpareBase = 0x%x\n", > + FlashNvStorageFtwSpareBase > + )); > + DEBUG (( > + DEBUG_INFO, > + "PcdFlashNvStorageFtwSpareSize = 0x%x\n", > + FlashNvStorageFtwSpareSize > + )); > + > + return EFI_SUCCESS; > +} > + > +/** Return the Flash devices on the platform. > + > + @param [out] NorFlashDescriptions Pointer to the Flash device description. > + @param [out] Count Number of Flash devices. > + > + @retval EFI_SUCCESS Success. > + @retval EFI_NOT_FOUND Flash device not found. > +**/ > +EFI_STATUS > +NorFlashPlatformGetDevices ( > + OUT NOR_FLASH_DESCRIPTION **NorFlashDescriptions, > + OUT UINT32 *Count > + ) > +{ > + if (mNorFlashDeviceCount > 0) { > + *NorFlashDescriptions = mNorFlashDevices; > + *Count = mNorFlashDeviceCount; > + return EFI_SUCCESS; > + } > + return EFI_NOT_FOUND; > +} > + > +/** Entrypoint for NorFlashPlatformLib. > + > + @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 > +NorFlashPlatformLibConstructor ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE * SystemTable > + ) > +{ > + INT32 Node; > + EFI_STATUS Status; > + EFI_STATUS FindNodeStatus; > + CONST UINT32 *Reg; > + UINT32 PropSize; > + UINT64 Base; > + UINT64 Size; > + UINTN UefiVarStoreIndex; > + CONST CHAR8 *Label; > + UINT32 LabelLen; > + > + if (mNorFlashDeviceCount != 0) { > + return EFI_SUCCESS; > + } > + > + Status = gBS->LocateProtocol ( > + &gFdtClientProtocolGuid, > + NULL, > + (VOID **)&mFdtClient > + ); > + ASSERT_EFI_ERROR (Status); > + > + UefiVarStoreIndex = MAX_UINTN; > + for (FindNodeStatus = mFdtClient->FindCompatibleNode ( > + mFdtClient, > + "cfi-flash", > + &Node > + ); > + !EFI_ERROR (FindNodeStatus) && > + (mNorFlashDeviceCount < MAX_FLASH_DEVICES); > + FindNodeStatus = mFdtClient->FindNextCompatibleNode ( > + mFdtClient, > + "cfi-flash", > + Node, > + &Node > + )) { > + Status = mFdtClient->GetNodeProperty ( > + mFdtClient, > + Node, > + "label", > + (CONST VOID **)&Label, > + &LabelLen > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "%a: GetNodeProperty ('label') failed (Status == %r)\n", > + __FUNCTION__, > + Status > + )); > + } else if (AsciiStrCmp (Label, LABEL_UEFI_VAR_STORE) == 0) { > + UefiVarStoreIndex = mNorFlashDeviceCount; > + mUefiVarStoreNode = Node; > + } > + > + Status = mFdtClient->GetNodeProperty ( > + mFdtClient, > + Node, > + "reg", > + (CONST VOID **)&Reg, > + &PropSize > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n", > + __FUNCTION__, Status)); > + continue; > + } > + > + ASSERT ((PropSize % (4 * sizeof (UINT32))) == 0); > + > + while ((PropSize >= (4 * sizeof (UINT32))) && > + (mNorFlashDeviceCount < MAX_FLASH_DEVICES)) { > + Base = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[0])); > + Size = SwapBytes64 (ReadUnaligned64 ((VOID *)&Reg[2])); > + Reg += 4; > + > + PropSize -= 4 * sizeof (UINT32); > + > + // > + // Disregard any flash devices that overlap with the primary FV. > + // The firmware is not updatable from inside the guest anyway. > + // > + if ((PcdGet64 (PcdFvBaseAddress) + PcdGet32 (PcdFvSize) > Base) && > + (Base + Size) > PcdGet64 (PcdFvBaseAddress)) { > + continue; > + } > + > + DEBUG (( > + DEBUG_INFO, > + "NOR%d : Base = 0x%lx, Size = 0x%lx\n", > + mNorFlashDeviceCount, > + Base, > + Size > + )); > + > + mNorFlashDevices[mNorFlashDeviceCount].DeviceBaseAddress = (UINTN)Base; > + mNorFlashDevices[mNorFlashDeviceCount].RegionBaseAddress = (UINTN)Base; > + mNorFlashDevices[mNorFlashDeviceCount].Size = (UINTN)Size; > + mNorFlashDevices[mNorFlashDeviceCount].BlockSize = KVMTOOL_NOR_BLOCK_SIZE; > + mNorFlashDeviceCount++; > + } > + } // for > + > + // Setup the variable store in the last device > + if (mNorFlashDeviceCount > 0) { > + if (UefiVarStoreIndex == MAX_UINTN) { > + // We did not find a label matching the UEFI Variable store. Default to > + // using the last cfi-flash device as the variable store. > + UefiVarStoreIndex = mNorFlashDeviceCount - 1; > + mUefiVarStoreNode = Node; > + } > + if (mNorFlashDevices[UefiVarStoreIndex].DeviceBaseAddress != 0) { > + return SetupVariableStore (&mNorFlashDevices[UefiVarStoreIndex]); > + } > + } > + > + return EFI_NOT_FOUND; > +} > + > diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf > new file mode 100644 > index 0000000000000000000000000000000000000000..a3230e4b2be668904322103825b93e867503984e > --- /dev/null > +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf > @@ -0,0 +1,49 @@ > +#/** @file > +# > +# Copyright (c) 2020, ARM Ltd. All rights reserved.
> +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#**/ > + > +[Defines] > + INF_VERSION = 0x0001001B > + BASE_NAME = NorFlashKvmtoolLib > + FILE_GUID = E75F07A1-B160-4893-BDD4-09E32FF847DC > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = NorFlashPlatformLib > + CONSTRUCTOR = NorFlashPlatformLibConstructor > + > +[Sources.common] > + NorFlashKvmtool.c > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + ArmVirtPkg/ArmVirtPkg.dec > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + > +[LibraryClasses] > + BaseLib > + DebugLib > + PcdLib > + UefiBootServicesTableLib > + > +[Protocols] > + gFdtClientProtocolGuid ## CONSUMES > + > +[Pcd] > + gArmTokenSpaceGuid.PcdFvBaseAddress > + gArmTokenSpaceGuid.PcdFvSize > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > + > +[Depex] > + gFdtClientProtocolGuid > + >