Compare commits

..

100 Commits

Author SHA1 Message Date
Sravan Balaji
9ca522ba15 New fallout vault boy logo 2024-10-06 16:59:55 -04:00
Sravan Balaji
3005ff4237 Change logo to fallout vault boy 2024-10-06 16:59:55 -04:00
Sravan Balaji
d3bcf7e60e Add stylized name as logo 2024-10-06 16:59:55 -04:00
Jeremy Soller
85f3fc6654 Only check webcam status on laptops 2024-08-30 12:35:45 -06:00
Gerd Hoffmann
88f5720e16 MdeModulePkg/UsbBusDxe: fix NOOPT build error
gcc-11 (fedora 35):

/home/kraxel/projects/edk2/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c: In function ?UsbIoBulkTransfer?:
/home/kraxel/projects/edk2/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c:277:12: error: ?UsbHcBulkTransfer? accessing 80 bytes in a region of size 8 [-Werror=stringop-overflow=]

Upstream commit ae8272ef78

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2024-02-21 09:11:18 -07:00
Tim Crawford
27585e73da Update DBX to 2023-05-09
Ref: https://uefi.org/revocationlistfile
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-27 08:16:14 -06:00
Tim Crawford
42a443d5cd SecurityPkg: Fix debug build
For some reason only DEBUG builds fail because of the unused variable.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-22 13:41:43 -06:00
Tim Crawford
c466cc2ca5 Add System76 Secure Boot keys
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 18:10:00 -07:00
Tim Crawford
5c49aca613 Update DBX to 2022-09-07
Ref: https://uefi.org/revocationlistfile
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 18:10:00 -07:00
Tim Crawford
99891bd41e SecureBootConfig: Remove blank line
Remove the blank between "Delete..." and "Restore...".

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
3485d55709 SecureBootConfig: Split long strings
firmware-setup does not wrap long lines, so manually split long strings.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
c1a7127e01 SecureBootConfig: Clear PK and reset
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
2f21eddfb8 SecureBootConfig: Restore keys and reset
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
860c29c923 SecureBootConfig: Update variable and perform reset
Update the `SecureBootEnable` variable and perform a platform reset when
the enable/disable button is pressed.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
8cfead2839 SecureBootConfig: Add text key to perform the actions
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
30f6b2f3c7 SecureBootConfig: Modify UI
Rewrite the UI based on feedback from enabling the module.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Tim Crawford
4de32568fa UiApp: Link to SecureBootConfig
Shoehorn in logic from Device Manager to show only the Secure Boot
Config entry under the firmware config form.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-03-07 10:10:35 -07:00
Jeremy Soller
ff91020528 Notify System76 security callback prior to loading boot options 2023-03-06 15:01:34 -07:00
Feng, Bob C
943773983d BaseTools: Fix DevicePath tool build failure issue
Fix the DevicePath tool build failure that was introduced by
the fixes: 22130dcd98 ("Basetools: turn off gcc12 warning").
Failure cases are:
1. clang 13.1.6 on macOS
2. gcc5.4

Reported-by: Rebecca Cran <rebecca@bsdio.com>
Reported-by: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
2022-08-17 11:40:12 -06:00
Gerd Hoffmann
e91ea5561d Basetools: turn off gcc12 warning
In function ?SetDevicePathEndNode?,
    inlined from ?FileDevicePath? at DevicePathUtilities.c:857:5:
DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 [-Werror=stringop-overflow=]
  321 |   memcpy (Node, &mUefiDevicePathLibEndDevicePath, sizeof (mUefiDevicePathLibEndDevicePath));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from UefiDevicePathLib.h:22,
                 from DevicePathUtilities.c:16:
../Include/Protocol/DevicePath.h: In function ?FileDevicePath?:
../Include/Protocol/DevicePath.h:51:9: note: destination object ?Type? of size 1
   51 |   UINT8 Type;       ///< 0x01 Hardware Device Path.
      |         ^~~~

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2022-08-17 11:40:12 -06:00
Gerd Hoffmann
5e86b202de BaseTools: fix gcc12 warning
Sdk/C/LzmaEnc.c: In function ?LzmaEnc_CodeOneMemBlock?:
Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*p.rc.outStream? [-Werror=dangling-pointer=]
 2828 |   p->rc.outStream = &outStream.vt;
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here
 2811 |   CLzmaEnc_SeqOutStreamBuf outStream;
      |                            ^~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here
Sdk/C/LzmaEnc.c:2828:19: error: storing the address of local variable ?outStream? in ?*(CLzmaEnc *)pp.rc.outStream? [-Werror=dangling-pointer=]
 2828 |   p->rc.outStream = &outStream.vt;
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?outStream? declared here
 2811 |   CLzmaEnc_SeqOutStreamBuf outStream;
      |                            ^~~~~~~~~
Sdk/C/LzmaEnc.c:2811:28: note: ?pp? declared here
cc1: all warnings being treated as errors

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2022-08-17 11:40:12 -06:00
Gerd Hoffmann
b764882195 BaseTools: fix gcc12 warning
GenFfs.c:545:5: error: pointer ?InFileHandle? used after ?fclose? [-Werror=use-after-free]
  545 |     Error(NULL, 0, 4001, "Resource", "memory cannot be allocated  of %s", InFileHandle);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GenFfs.c:544:5: note: call to ?fclose? here
  544 |     fclose (InFileHandle);
      |     ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2022-08-17 11:40:12 -06:00
Tim Crawford
a2abc5e15f UefiPayloadPkg: Add Pop!_OS Recovery to boot text
Preserve existing UI and add the note about pressing Space to go to
the systemd-boot menu for Pop!_OS Recovery.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 15:25:08 -07:00
Tim Crawford
a618e43977 MdeModulePkg/BmBootDesciption: Remove device prefixes
Remove the device prefixes to match current System76 firmware UI in the
One Time Boot menu.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-16 10:10:20 -07:00
Tim Crawford
bbc04972bc UefiPayloadPkg: Add PCI support from DuetPkg
In coreboot, we mark GPU prefmem above 4GB, because NVIDIA wants a lot
(16GB region on the 30 series), otherwise coreboot will obviously fail
to allocate the resources.

In EDK2, we then end up hitting this assert:

    InitRootBridge: populated root bus 0, with room for 36 subordinate bus(es)
    RootBridge: PciRoot(0x0)
      Support/Attr: 7001F / 7001F
        DmaAbove4G: No
    NoExtConfSpace: No
         AllocAttr: 0 ()
               Bus: 0 - 24 Translation=0
                Io: 1000 - EFFF Translation=0
               Mem: 80400000 - 1001FFFFFF Translation=0
        MemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
              PMem: FFFFFFFFFFFFFFFF - 0 Translation=0
       PMemAbove4G: FFFFFFFFFFFFFFFF - 0 Translation=0
    ASSERT [PciHostBridgeDxe] .../edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c(120): Bridge->Mem.Limit < 0x0000000100000000ULL

So, bring back Pci*NoEnumerationDxe from the deleted DuetPkg, which
doesn't check anything and let's us boot.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-11 17:49:07 -07:00
Jeremy Soller
61a7f360d9 UefiPayloadPkg: Add Intel GOP driver 2021-11-11 17:49:07 -07:00
Jeremy Soller
fc1c47ccad UefiPayloadPkg: Add System76 Setup menu 2021-11-11 17:49:07 -07:00
Tim Crawford
fec64b04eb Update brotli to fix compiling with GCC 11 2021-11-11 17:49:07 -07:00
Tim Crawford
05aa27ef23 MdeModulePkg/BM: Update boot options on device change
Register an event to trigger when a block device is added or removed
that will update the list of boot options. Use a refreshguid to force
the form to display the changes if it already open.
2021-11-11 17:49:07 -07:00
Tim Crawford
06cc698885 MdeModulePkg/Core: Signal notify events on protocol removal
In order for BootManager to maintain a valid list of boot options, it
must know when the BlockIo protocol is also removed, not just added.
2021-11-11 17:49:07 -07:00
Jeremy Soller
cb870a1ce9 UiApp: Dynamically generated firmware configuration information page
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-11 17:49:07 -07:00
Tim Crawford
90e04a7e31 MdeModulePkg/BMM: Unregister F9 and F10 hotkeys 2021-11-11 17:49:07 -07:00
Tim Crawford
1d01d2a9a7 MdeModulePkg/BMM: Remove Commit/Discard buttons 2021-11-11 17:49:07 -07:00
Tim Crawford
70e9b22f5c MdeModulePkg/BMM: Save BootOrder on list update 2021-11-11 17:49:07 -07:00
Tim Crawford
e9d6369050 MdeModulePkg/BMM: Add some debug logging 2021-11-11 17:49:07 -07:00
Tim Crawford
58d6aae969 MdeModulePkg/UiApp: Add warning if no bootable options found 2021-11-11 17:49:07 -07:00
Tim Crawford
4e0fcaba18 MdeModulePkg/BootMaintenanceManagerUiLib: Make it look like current BMM 2021-11-11 17:49:07 -07:00
Tim Crawford
2d04a62512 MdeModulePkg/UiApp: Make it look like current FrontPage
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-11 17:49:07 -07:00
Tim Crawford
8a0955dfa8 MdeModulePkg/BM: Make it look like current BootMngr 2021-11-11 17:49:07 -07:00
Tim Crawford
06f4583ea5 UefiPayloadPkg: Disable EFI shell 2021-11-02 19:24:49 -06:00
Jeremy Soller
9daa69a59e UefiPayloadPkg: Add library for logging to EC
Make use of the SMFI command interface to forward logs from edk2 to
System76 EC.

Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
9030464a1b fix secureboot
TODO: Proper integration
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
bcfe7a54aa UefiPayloadPkg/Include/Coreboot.h: Remove __packed
The keyword is not defined and will end as public variable beeing declared
in every source that includes the header.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
600c565eb2 Revert "UefiPayloadPkg: Add FV Guid for DXEFV and PLDFV"
This reverts commit 4bac086e8e.
Breaks coreboot integration.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
aae506ce44 UefiPayloadPkg/BlSMMStoreDxe: Support Secureboot
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
bf2ca74bb6 UefiPayloadPkg: Update APRIORI
Make sure that:
* FaultTolerantDxe is started before VariableRuntimeDxe
  This ensures that FailedTolerantPei is not required and faults when writing
  the variable store are discovered
* SMBUSConfigLoader is started right after VariableRuntimeDxe
  This ensured that the board specific variables are updated as soon as possible
* Start SmbiosDxe and BlSupportDxeSmbios early to install board specific NULL protocols
* Start SecureBootConfigDxe right after VariableRuntimeDxe to update SecureBootKeys before
  Tcg2Dxe starts

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
654e5958cd Fix TPM detection
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
9657bbe08f MdeModulePkg: Be more verbose about SecureBoot and the reason why the boot failed
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
10cbbe06d3 [HACK]UefiPayloadPkg: Fix TPM2 support without PEI
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Christian Walter
802391f1fe UefiPayloadPkg/SecureBootEnrollDefaultKeys: Make SecureBoot configurable
Signed-off-by: Christian Walter <christian.walter@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
db04386fd9 UefiPayloadPkg: Check TPM PPI requests in PlatformBootManager
Test if the user need to confirm TPM Physical presence commands.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
7d5abcd016 UefiPayloadPkg: Parse coreboot's TPM PPI handoff buffer
Read the coreboot table containing the TPM PPI handoff buffer and
place it in gEfiTcgPhysicalPresenceInfoHob.

coreboot uses the same PPI interface as QEMU does and installs the
corresponding ACPI code to provide a full PPI interface to the OS.
The OS must reboot in order to execute the requests.

The corresponding coreboot patch can be found here:
https://review.coreboot.org/c/coreboot/+/45568

In a follow up commit the OvmfPkg PhysicalPresence library will be used
to confirm TPM PPI request. This is necessary as coreboot doesn't have
input drivers or a graphical UI that could be used.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
d296a36cc4 OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu: Add timeout
Instead of waiting and infinite time, abort the TPM PPI request after
3 minutes. This allow to boot headless platforms where no keyboard is
attached or the user didn't made it in time.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
bdb15bf9ba OvmfPkg: Introduce Tcg2PhysicalPresencePlatformLib
Put the PPI configuration retriveal into an own library.
That will allow to reuse the code in the UefipayloadPkg, where the
firmware provides the ACPI tables, like QEMU does on OvmfPkg.

However one major difference is that the PPI interface in UefiPayloadPkg
is not backed by a MMIO device, but resides in DRAM and is shared with ACPI code.

Add an additional parameter to provide the location of the PPI and
test if the memory region has the correct attributes.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Christian Walter
25af751320 UefiPayloadPkg: Add TPM support
* Add support for TPM1.2 and TPM2.

This adds measured boot support and will be extended with Secureboot.

Signed-off-by: Christian Walter <christian.walter@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
7f99fae217 UefiPayloadPkg: Advertise TPM support in BlSupportDxe
In BlSupportDxe read the AcpiBoardInfo and set PcdTpmInstanceGuid
to indicate that a TPM is likely present as TPM tables had been installed
by the bootloader.

The Tcg*Dxes will probe for the TPM, so no need to do it here as well.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
c134065066 UefiPayloadPkg: Check more ACPI tables
Probe for ACPI tables
* TPM2
* TCPA
and store the result in AcpiBoardInfo.

Will be used to determine if a TPM1.2 or TPM2.0 is present.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
eec38fd383 UefiPayloadPkg: Add Secureboot support
Must use RuntimeVariableDxe instead of EmuVariableDxe.
Currently doesn't boot on qemu.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
b9564773f1 UefiPayloadPkg: Scan for Option ROMs
Install the gPciPlatformProtocol to scan for Option ROMs.

For every device we probe the Option ROM and provide a pointer
to the activated BAR if found.

It's safe to assume that all ROM bars have been enumerated,
reserved in the bridge resources and are disabled by default.
This is made a mandatory bootloader requirement in the next commit.

Enabling them and leaving them enabled will do no harm.

This can easily be tested on qemu, where it will start finding Option ROMs
for VGA and network cards.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Marcello Sylvester Bauer <marcello.bauer@9elements.com>
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>
Cc: Christian Walter <christian.walter@9elements.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
8c767bb014 Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal
Recent model Chromebooks only return ACK, but not
BAT_SUCCESS, which causes hanging and failed ps2k init.
To mitigate this, make the absence of BAT_SUCCESS reply
non-fatal, and reduce the no-reply timeout from 4s to 1s.

Tested on google/dracia and purism/librem_14

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
7386ad5ae3 UefiPayloadPkg: don't set PcdDebugPropertyMask for release builds
Don't set PcdDebugPropertyMask for release builds, and properly set it
for debug builds based on SOURCE_DEBUG_ENABLE.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
e727453a97 SdMmcPciDxe: Reduce timeout for SD card reset
Previous 1s timeout causeed stalls on boot splash with no benefit.
Reduced to 100ms and no interruptions to boot when no SD card inserted.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
553bda4d8e BaseTools: array.fromstring and array.tostring removed in python 3.9
array.fromstring and array.tostring deprecated, and alias for
array.frombytes and array.tobytes. Deprecated since version 3.2,
have been removed in version python 3.9.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yunhua Feng <fengyunhua@byosoft.com.cn>
2021-11-02 19:24:49 -06:00
Matt DeVillier
3e7febc83c BlSMMStoreDxe: make error msgs unique
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
b664a5352c UefiPayloadPkg: Allow boot timeout to be set via cmd line
Allows for devices w/o internal display to set a longer timeout
via coreboot Kconfig

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
b376a7d60f ShellPkg: disable startup script, show welcome banner
Startup script does nothing other than confuse users.
Show a welcome banner and tell users how to exit.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
3fb944f925 UefiPayloadPkg: Update APRIORI
Make sure that:
* FaultTolerantDxe is started before VariableRuntimeDxe
  This ensures that FailedTolerantPei is not required and faults when writing
  the variable store are discovered
* Start BlSupportDxeSmbios early to install board specific NULL protocols

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
1d70aa7a9b UefiCpuPkg: Disable MTRR programming for UefiPayloadPkg
The MTRRs have already been programmed by FSB.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
0bef9ccd43 UefiPayloadPkg: Add support for Firmware Volume Block Protocol
This adds support for FVB in order to support a platform independent
and non-volatile variable store on UefiPayloadPkg. It is required for
non-volatile variable support, TPM support, Secureboot support and more.

Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements a SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The communication is done using a fixed communication buffer that is
allocated in CBMEM. The existence of this optional feature is advertised
by a coreboot table.
When the SMMSTORE feature is not available the variable emulation is used
by setting PcdEmuVariableNvModeEnable to TRUE.

Add a library for SMMStore to be used in DXE.

The DXE component provides runtime services and takes care of virtual to
physical mapping the communication buffers between SMM and OS.

Make use of the APRIORI DXE to initialize an empty store on the first boot
and set the PCDs to sane values before the variable driver is loaded.

Tests on Intel(R) Xeon(R) E-2288G CPU @ 3.70G showed that the SMI isn't
triggered with a probability of 1:40 of all cases when called in a tight
loop. The CPU continues running and the SMI is triggeres asynchronously
a few clock cycles later. coreboot only handels synchronous APM request
and does nothing on asynchronous APM triggers.

As there's no livesign from SMM it's impossible to tell if the handler
has run. Just wait a bit and try again to trigger a synchronous SMI.

Tests confirmed that out of 5 million tries the SMI is now always handled.

Tested on Linux and Windows 10 on real hardware.
Currently this cannot be tested on coreboot and qemu as it doesn't support
the SMMSTORE on qemu.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
d3b38ea28a UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection
This fixes an issue where the framebuffer provided by coreboot or
slimbootloader will only work on the primary VGA device. If the
framebuffer corresponds to a different device the screen will stay black.
In addition, the code doesn't work for multiple graphic cards, has
reference to non existing functions, and is a duplication of common code.

Call EfiBootManagerConnectVideoController on every display device found,
not only the legacy VGA device. This is the same as OvmfPkg does.

Allows to display output on the framebuffer set up by firmware, which might
not be the VGA device.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
69ae47ba5d UefiPayloadPkg: Add RNG support
Uses the RDRAND instruction if available and install EfiRngProtocol.
The protocol may be used by iPXE or the Linux kernel to gather entropy.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Patrick Rudolph
95c492569f UefiPayloadPkg: Use new filesystem drivers
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
CoolStar
d996a4bc9f Add filesystem drivers
Add EXT2/EXT4, exFAT, NTFS filesystem drivers.
Do not add ISO9115 drivers as it breaks El Torito boot.
2021-11-02 19:24:49 -06:00
Matt DeVillier
9f528fb4c0 MdeModulePkg/Usb/Keyboard.c: don't request protocol before setting
No need to check the interface protocol then conditionally setting,
just set it to BOOT_PROTOCOL and check for error.

This is what Linux does for HID devices as some don't follow the USB spec.
One example is the Aspeed BMC HID keyboard device, which adds a massive
boot delay without this patch as it doesn't respond to 'GetProtocolRequest'.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-11-02 19:24:49 -06:00
Matt DeVillier
bbab5b95b4 MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls
SetConfig is already called during device enumeration,
no need to do it again here.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:49 -06:00
Tim Crawford
5e84cc0714 UefiPayloadPkg: Reduce timeout to 2s
Current firmware does not honor PcdPlatformBootTimeOut and hard-codes a
timeout of 2s.
2021-11-02 19:24:48 -06:00
Tim Crawford
2af54dd5bd UefiPayloadPkg: Stall before connecting devices
USB devices are not being detected when booting. Pause a bit for them to
be initialized and detected by EfiBootManagerConnectAll().
2021-11-02 19:24:48 -06:00
Tim Crawford
00283317d8 MdeModulePkg/BdsDxe: Forward any key for booting
Pressing escape will bring a user to the boot manager. Pressing any
other key will continue booting, forwarding the key to systemd-boot.
2021-11-02 19:24:48 -06:00
Matt DeVillier
232f661f99 MdeModulePkg: Wait for input after boot failure
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Tim Crawford
552ca5cc88 UefiPayloadPkg: Clear screen on boot error 2021-11-02 19:24:48 -06:00
Tim Crawford
94e7cfc7e7 UefiPayloadPkg: Copy PlatformBootManagerUnableToBoot() from OvmfPkg 2021-11-02 19:24:48 -06:00
Matt DeVillier
de7030ed26 UefiPayloadPkg: Set ResetOnMemoryTypeInformationChange to FALSE
the default value, TRUE, causes reboots if a device boots to the
shell, exits, and then attempts to boot from another source.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
587653cd8b MdeModulePkg/SdMmcPciHcDxe: add Bayhub support
Add support for Bayhub eMMC controller found on AMD
Stoneyridge Chromebooks.

Test: build/boot various google/kahlee-based devices

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
e167ed1a3d MdeModulePkg/GraphicsConsole: don't draw cursor at 0,0
Prevents cursor from flashing on screen when
changing modes or clearing the screen.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
003534f8f0 MdeModulePkg/BmBootDesciption: Improve device descriptions
Add device type prefixes for USB, IDE, SATA, and NVMe drives.
Remove UEFI prefix, remove serial numbers.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
a363907bc9 MdeModulePkg/BmBoot: skip secondary eMMC entries
Internal eMMC devices often show multiple entries, so skip
any after the initial entry.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
530cc53f96 MdeModulePkg/Frontpage: get SMBIOS Data from table directly
rather than getting it from the EFI SMBIOS protocol

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
112268c70d MdeModulePkg/GraphicsConsole: Don't re-set video output mode
Fixes display resolution issues with booting OS X

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Tim Crawford
726280b214 UefiPayloadPkg: Disable Device Manager 2021-11-02 19:24:48 -06:00
Matt DeVillier
b1ab82d4c8 BmpSupportLib: fix BMP validation
BMP files by tools other than MS paint can have a
variable number of padding bytes, which results in
the DataSize being less than (ImageSize - HeaderSize).
Fix the check to be less stringent.

Test: use BMP created by/saved by Photoshop

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
2e16857f3d MdeModulePkg: load boot logo into BGRT table
This is a shoehorned-in implementation of an ACPI BGRT
table, ported pretty much directly from the version used
under CorebootPayloadPkg.

EDK2 provides a facility to do this already, but it assumes
the ACPI tables already exist as EFI structures, so would need
to write code to populate those using the tables already in RAM
created by coreboot. This seemed like the easier option ATM.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Tim Crawford
308f9a49b0 MdeModulePkg/BootLogoLib: Center logo 38.2% from top of screen
Use Microsoft's recommended positioning [1] for the boot logo.

> We recommend that the logo is placed with its center at 38.2% from the
> screen's top edge. This positioning is based on the golden ratio's
> visual aesthetics and matches the Windows 10 design proportions.

[1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components#position-the-logo-during-post
2021-11-02 19:24:48 -06:00
Tim Crawford
7ab09015b1 MdeModulePkg/Logo: Use System76 boot logo 2021-11-02 19:24:48 -06:00
Tim Crawford
d1c0828262 UefiPayloadPkg: Enable boot logo 2021-11-02 19:24:48 -06:00
Tim Crawford
b4dd94c217 UefiPayloadPkg: Show boot message as progress text
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-02 19:24:48 -06:00
Matt DeVillier
f428f538b6 UefiPayloadPkg: Map ESC to Boot Manager
Change menu key from F2 to ESC, remove extranous text
2021-11-02 19:24:48 -06:00
Tim Crawford
75b91c0b9f UefiPayloadPkg: Enable PS2 keyboard by default 2021-10-21 21:32:54 -06:00
Tim Crawford
9f1dd0acb1 UefiPayloadPkg: Default to coreboot 2021-10-21 21:32:54 -06:00
Patrick Rudolph
6db1a5555a UefiPayloadPkg: Increase FV size
The following commits need additional space.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2021-10-21 21:24:56 -06:00
duntan
72f8b9d80b UefiPayloadPkg: Fix the build error when enable Core ci for UefiPayloadPkg
V1: Add quotes when using $(ARCH) in .dsc and .fdf file.
The quotes are added due to the way by which Core ci parse the .dsc file.
Add UINTN in Hob.c to fix cast from pointer to integer of different size error.
V2: Delete lines which reference ShellBinPkg.The pkg doesn't exist in edk2.

Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: DunTan <dun.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Change-Id: I18c2027f57a4fbf291925a11226ed620b808a970
2021-10-21 21:24:48 -06:00
557 changed files with 23243 additions and 20286 deletions

View File

@@ -48,9 +48,6 @@ jobs:
TARGET_SECURITY: TARGET_SECURITY:
Build.Pkgs: 'SecurityPkg' Build.Pkgs: 'SecurityPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET' Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
TARGET_UEFIPAYLOAD:
Build.Pkgs: 'UefiPayloadPkg'
Build.Targets: 'DEBUG,RELEASE,NO-TARGET'
TARGET_PLATFORMS: TARGET_PLATFORMS:
# For Platforms only check code. Leave it to Platform CI # For Platforms only check code. Leave it to Platform CI
# to build them. # to build them.

View File

@@ -67,8 +67,7 @@ class Settings(CiBuildSettingsManager, UpdateSettingsManager, SetupSettingsManag
"CryptoPkg", "CryptoPkg",
"UnitTestFrameworkPkg", "UnitTestFrameworkPkg",
"OvmfPkg", "OvmfPkg",
"RedfishPkg", "RedfishPkg"
"UefiPayloadPkg"
) )
def GetArchitecturesSupported(self): def GetArchitecturesSupported(self):

View File

@@ -3,7 +3,6 @@
# #
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR> # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2011 - 2021, ARM Limited. All rights reserved. # Copyright (c) 2011 - 2021, ARM Limited. All rights reserved.
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
# #
@@ -338,9 +337,9 @@
# UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space # UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space
# UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space # UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space
# #
# gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - PcdPciIoBase; # PcdPciIoTranslation = IoCpuBase - PcdPciIoBase;
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base; # PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base;
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base; # PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base;
# #
# because (a) the target address space (ie. the cpu-physical space) is # because (a) the target address space (ie. the cpu-physical space) is
# 64-bit, and (b) the translation values are meant as offsets for *modular* # 64-bit, and (b) the translation values are meant as offsets for *modular*
@@ -357,11 +356,11 @@
# UINT64 TranslatedMmio64Address; // output parameter # UINT64 TranslatedMmio64Address; // output parameter
# #
# TranslatedIoAddress = UntranslatedIoAddress + # TranslatedIoAddress = UntranslatedIoAddress +
# gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation; # PcdPciIoTranslation;
# TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address + # TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address +
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation; # PcdPciMmio32Translation;
# TranslatedMmio64Address = UntranslatedMmio64Address + # TranslatedMmio64Address = UntranslatedMmio64Address +
# gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation; # PcdPciMmio64Translation;
# #
# The modular arithmetic performed in UINT64 ensures that the translation # The modular arithmetic performed in UINT64 ensures that the translation
# works correctly regardless of the relation between IoCpuBase and # works correctly regardless of the relation between IoCpuBase and
@@ -370,20 +369,16 @@
# #
gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050 gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x00000050
gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051 gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x00000051
gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x00000052
gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053 gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x00000053
gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054 gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x00000054
gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x00000055
gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056 gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x00000056
gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057 gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x00000057
gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x00000058
# #
# Inclusive range of allowed PCI buses. # Inclusive range of allowed PCI buses.
# #
gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x00000059 gArmTokenSpaceGuid.PcdPciBusMin|0x0|UINT32|0x00000059
gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x0000005A gArmTokenSpaceGuid.PcdPciBusMax|0x0|UINT32|0x0000005A
[PcdsDynamicEx]
#
# This dynamic PCD hold the GUID of a firmware FFS which contains
# the LinuxBoot payload.
#
gArmTokenSpaceGuid.PcdLinuxBootFileGuid|{0x0}|VOID*|0x0000005C

View File

@@ -5,7 +5,6 @@
# Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR> # Copyright (c) 2011 - 2021, Arm Limited. All rights reserved.<BR>
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR> # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation.<BR> # Copyright (c) Microsoft Corporation.<BR>
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved.
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
# #
@@ -151,7 +150,6 @@
ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf

View File

@@ -344,6 +344,10 @@ GicV3ExitBootServicesEvent (
GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index); GicV3DisableInterruptSource (&gHardwareInterruptV3Protocol, Index);
} }
for (Index = 0; Index < mGicNumInterrupts; Index++) {
GicV3EndOfInterrupt (&gHardwareInterruptV3Protocol, Index);
}
// Disable Gic Interface // Disable Gic Interface
ArmGicV3DisableInterruptInterface (); ArmGicV3DisableInterruptInterface ();

View File

@@ -38,7 +38,7 @@
UefiBootServicesTableLib UefiBootServicesTableLib
[Pcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation gArmTokenSpaceGuid.PcdPciIoTranslation
[Protocols] [Protocols]
gEfiCpuIo2ProtocolGuid ## PRODUCES gEfiCpuIo2ProtocolGuid ## PRODUCES

View File

@@ -1,186 +0,0 @@
/** @file
Implementation for PlatformBootManagerLib library class interfaces.
Copyright (C) 2015-2016, Red Hat, Inc.
Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Uefi.h>
#include <Guid/EventGroup.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiBootManagerLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/PlatformBootManager.h>
/**
Register a boot option using a file GUID in the FV.
@param FileGuid The file GUID name in the FV.
@param Description The description of the boot option.
@param Attributes The attributes of the boot option.
**/
STATIC
VOID
PlatformRegisterFvBootOption (
CONST EFI_GUID *FileGuid,
CHAR16 *Description,
UINT32 Attributes
)
{
EFI_STATUS Status;
INTN OptionIndex;
EFI_BOOT_MANAGER_LOAD_OPTION NewOption;
EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;
UINTN BootOptionCount;
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
Status = gBS->HandleProtocol (
gImageHandle,
&gEfiLoadedImageProtocolGuid,
(VOID **)&LoadedImage
);
ASSERT_EFI_ERROR (Status);
EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid);
DevicePath = DevicePathFromHandle (LoadedImage->DeviceHandle);
ASSERT (DevicePath != NULL);
DevicePath = AppendDevicePathNode (
DevicePath,
(EFI_DEVICE_PATH_PROTOCOL *)&FileNode
);
ASSERT (DevicePath != NULL);
Status = EfiBootManagerInitializeLoadOption (
&NewOption,
LoadOptionNumberUnassigned,
LoadOptionTypeBoot,
Attributes,
Description,
DevicePath,
NULL,
0
);
ASSERT_EFI_ERROR (Status);
FreePool (DevicePath);
BootOptions = EfiBootManagerGetLoadOptions (
&BootOptionCount,
LoadOptionTypeBoot
);
OptionIndex = EfiBootManagerFindLoadOption (
&NewOption,
BootOptions,
BootOptionCount
);
if (OptionIndex == -1) {
Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);
ASSERT_EFI_ERROR (Status);
}
EfiBootManagerFreeLoadOption (&NewOption);
EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
}
/**
Do the platform specific action before the console is connected.
Such as:
Update console variable;
Register new Driver#### or Boot####;
Signal ReadyToLock event.
**/
VOID
EFIAPI
PlatformBootManagerBeforeConsole (
VOID
)
{
//
// Signal EndOfDxe PI Event
//
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
}
/**
Do the platform specific action after the console is connected.
Such as:
Dynamically switch output mode;
Signal console ready platform customized event;
Run diagnostics like memory testing;
Connect certain devices;
Dispatch additional option roms.
**/
VOID
EFIAPI
PlatformBootManagerAfterConsole (
VOID
)
{
EFI_GUID LinuxBootFileGuid;
CopyGuid (&LinuxBootFileGuid, PcdGetPtr (PcdLinuxBootFileGuid));
if (!CompareGuid (&LinuxBootFileGuid, &gZeroGuid)) {
//
// Register LinuxBoot
//
PlatformRegisterFvBootOption (
&LinuxBootFileGuid,
L"LinuxBoot",
LOAD_OPTION_ACTIVE
);
} else {
DEBUG ((DEBUG_ERROR, "%a: PcdLinuxBootFileGuid was not set!\n", __FUNCTION__));
}
}
/**
This function is called each second during the boot manager waits the
timeout.
@param TimeoutRemain The remaining timeout.
**/
VOID
EFIAPI
PlatformBootManagerWaitCallback (
UINT16 TimeoutRemain
)
{
return;
}
/**
The function is called when no boot option could be launched,
including platform recovery options and options pointing to applications
built into firmware volumes.
If this function returns, BDS attempts to enter an infinite loop.
**/
VOID
EFIAPI
PlatformBootManagerUnableToBoot (
VOID
)
{
return;
}

View File

@@ -1,58 +0,0 @@
## @file
# Implementation for PlatformBootManagerLib library class interfaces.
#
# Copyright (C) 2015-2016, Red Hat, Inc.
# Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x0001001B
BASE_NAME = LinuxBootBootManagerLib
FILE_GUID = 1FA91547-DB23-4F6A-8AF8-3B9782A7F917
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
LIBRARY_CLASS = PlatformBootManagerLib|DXE_DRIVER
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = ARM AARCH64
#
[Sources]
LinuxBootBm.c
[Packages]
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
[LibraryClasses]
BaseLib
BaseMemoryLib
DebugLib
MemoryAllocationLib
PcdLib
PrintLib
UefiBootManagerLib
UefiBootServicesTableLib
UefiLib
UefiRuntimeServicesTableLib
[Pcd]
gArmTokenSpaceGuid.PcdLinuxBootFileGuid
[Guids]
gEfiEndOfDxeEventGroupGuid
gUefiShellFileGuid
gZeroGuid
[Protocols]
gEfiLoadedImageProtocolGuid

View File

@@ -2,10 +2,9 @@
Implementation for PlatformBootManagerLib library class interfaces. Implementation for PlatformBootManagerLib library class interfaces.
Copyright (C) 2015-2016, Red Hat, Inc. Copyright (C) 2015-2016, Red Hat, Inc.
Copyright (c) 2014 - 2021, ARM Ltd. All rights reserved.<BR> Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR> Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
Copyright (c) 2021, Semihalf All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -20,7 +19,6 @@
#include <Library/UefiBootManagerLib.h> #include <Library/UefiBootManagerLib.h>
#include <Library/UefiLib.h> #include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h> #include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/BootManagerPolicy.h>
#include <Protocol/DevicePath.h> #include <Protocol/DevicePath.h>
#include <Protocol/EsrtManagement.h> #include <Protocol/EsrtManagement.h>
#include <Protocol/GraphicsOutput.h> #include <Protocol/GraphicsOutput.h>
@@ -29,7 +27,6 @@
#include <Protocol/PciIo.h> #include <Protocol/PciIo.h>
#include <Protocol/PciRootBridgeIo.h> #include <Protocol/PciRootBridgeIo.h>
#include <Protocol/PlatformBootManager.h> #include <Protocol/PlatformBootManager.h>
#include <Guid/BootDiscoveryPolicy.h>
#include <Guid/EventGroup.h> #include <Guid/EventGroup.h>
#include <Guid/NonDiscoverableDevice.h> #include <Guid/NonDiscoverableDevice.h>
#include <Guid/TtyTerm.h> #include <Guid/TtyTerm.h>
@@ -706,113 +703,6 @@ HandleCapsules (
#define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version " #define VERSION_STRING_PREFIX L"Tianocore/EDK2 firmware version "
/**
This functions checks the value of BootDiscoverPolicy variable and
connect devices of class specified by that variable. Then it refreshes
Boot order for newly discovered boot device.
@retval EFI_SUCCESS Devices connected successfully or connection
not required.
@retval others Return values from GetVariable(), LocateProtocol()
and ConnectDeviceClass().
**/
STATIC
EFI_STATUS
BootDiscoveryPolicyHandler (
VOID
)
{
EFI_STATUS Status;
UINT32 DiscoveryPolicy;
UINT32 DiscoveryPolicyOld;
UINTN Size;
EFI_BOOT_MANAGER_POLICY_PROTOCOL *BMPolicy;
EFI_GUID *Class;
Size = sizeof (DiscoveryPolicy);
Status = gRT->GetVariable (
BOOT_DISCOVERY_POLICY_VAR,
&gBootDiscoveryPolicyMgrFormsetGuid,
NULL,
&Size,
&DiscoveryPolicy
);
if (Status == EFI_NOT_FOUND) {
DiscoveryPolicy = PcdGet32 (PcdBootDiscoveryPolicy);
Status = PcdSet32S (PcdBootDiscoveryPolicy, DiscoveryPolicy);
if (Status == EFI_NOT_FOUND) {
return EFI_SUCCESS;
} else if (EFI_ERROR (Status)) {
return Status;
}
} else if (EFI_ERROR (Status)) {
return Status;
}
if (DiscoveryPolicy == BDP_CONNECT_MINIMAL) {
return EFI_SUCCESS;
}
switch (DiscoveryPolicy) {
case BDP_CONNECT_NET:
Class = &gEfiBootManagerPolicyNetworkGuid;
break;
case BDP_CONNECT_ALL:
Class = &gEfiBootManagerPolicyConnectAllGuid;
break;
default:
DEBUG ((
DEBUG_INFO,
"%a - Unexpected DiscoveryPolicy (0x%x). Run Minimal Discovery Policy\n",
__FUNCTION__,
DiscoveryPolicy
));
return EFI_SUCCESS;
}
Status = gBS->LocateProtocol (
&gEfiBootManagerPolicyProtocolGuid,
NULL,
(VOID **)&BMPolicy
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "%a - Failed to locate gEfiBootManagerPolicyProtocolGuid."
"Driver connect will be skipped.\n", __FUNCTION__));
return Status;
}
Status = BMPolicy->ConnectDeviceClass (BMPolicy, Class);
if (EFI_ERROR (Status)){
DEBUG ((DEBUG_ERROR, "%a - ConnectDeviceClass returns - %r\n", __FUNCTION__, Status));
return Status;
}
//
// Refresh Boot Options if Boot Discovery Policy has been changed
//
Size = sizeof (DiscoveryPolicyOld);
Status = gRT->GetVariable (
BOOT_DISCOVERY_POLICY_OLD_VAR,
&gBootDiscoveryPolicyMgrFormsetGuid,
NULL,
&Size,
&DiscoveryPolicyOld
);
if ((Status == EFI_NOT_FOUND) || (DiscoveryPolicyOld != DiscoveryPolicy)) {
EfiBootManagerRefreshAllBootOption ();
Status = gRT->SetVariable (
BOOT_DISCOVERY_POLICY_OLD_VAR,
&gBootDiscoveryPolicyMgrFormsetGuid,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
sizeof (DiscoveryPolicyOld),
&DiscoveryPolicy
);
}
return EFI_SUCCESS;
}
/** /**
Do the platform specific action after the console is ready Do the platform specific action after the console is ready
Possible things that can be done in PlatformBootManagerAfterConsole: Possible things that can be done in PlatformBootManagerAfterConsole:
@@ -863,12 +753,6 @@ PlatformBootManagerAfterConsole (
} }
} }
//
// Connect device specified by BootDiscoverPolicy variable and
// refresh Boot order for newly discovered boot devices
//
BootDiscoveryPolicyHandler ();
// //
// On ARM, there is currently no reason to use the phased capsule // On ARM, there is currently no reason to use the phased capsule
// update approach where some capsules are dispatched before EndOfDxe // update approach where some capsules are dispatched before EndOfDxe

View File

@@ -65,15 +65,11 @@
[Pcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
[Guids] [Guids]
gBootDiscoveryPolicyMgrFormsetGuid
gEdkiiNonDiscoverableEhciDeviceGuid gEdkiiNonDiscoverableEhciDeviceGuid
gEdkiiNonDiscoverableUhciDeviceGuid gEdkiiNonDiscoverableUhciDeviceGuid
gEdkiiNonDiscoverableXhciDeviceGuid gEdkiiNonDiscoverableXhciDeviceGuid
gEfiBootManagerPolicyNetworkGuid
gEfiBootManagerPolicyConnectAllGuid
gEfiFileInfoGuid gEfiFileInfoGuid
gEfiFileSystemInfoGuid gEfiFileSystemInfoGuid
gEfiFileSystemVolumeLabelInfoIdGuid gEfiFileSystemVolumeLabelInfoIdGuid
@@ -83,7 +79,6 @@
[Protocols] [Protocols]
gEdkiiNonDiscoverableDeviceProtocolGuid gEdkiiNonDiscoverableDeviceProtocolGuid
gEfiBootManagerPolicyProtocolGuid
gEfiDevicePathProtocolGuid gEfiDevicePathProtocolGuid
gEfiGraphicsOutputProtocolGuid gEfiGraphicsOutputProtocolGuid
gEfiLoadedImageProtocolGuid gEfiLoadedImageProtocolGuid

View File

@@ -219,7 +219,7 @@ ConfigureCacheArchitectureInformation (
CacheSize32 = CacheSize16; CacheSize32 = CacheSize16;
} else if ((CacheSize64 / 64) < MAX_INT16) { } else if ((CacheSize64 / 64) < MAX_INT16) {
CacheSize16 = (1 << 15) | (CacheSize64 / 64); CacheSize16 = (1 << 15) | (CacheSize64 / 64);
CacheSize32 = (1 << 31) | (CacheSize64 / 64); CacheSize32 = CacheSize16;
} else { } else {
if ((CacheSize64 / 1024) <= 2047) { if ((CacheSize64 / 1024) <= 2047) {
CacheSize32 = CacheSize64; CacheSize32 = CacheSize64;
@@ -689,7 +689,7 @@ AddSmbiosProcessorTypeTable (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type04 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (Type4Record); FreePool (Type4Record);

View File

@@ -2,7 +2,6 @@
Functions for processor information common to ARM and AARCH64. Functions for processor information common to ARM and AARCH64.
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR> Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -172,7 +171,7 @@ SmbiosGetProcessorId (
if (HasSmcArm64SocId ()) { if (HasSmcArm64SocId ()) {
SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision); SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code; ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
} else { } else {
ProcessorId = ArmReadMidr (); ProcessorId = ArmReadMidr ();
} }

View File

@@ -240,12 +240,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB); SmbiosRecord->BiosSegment = (UINT16)(FixedPcdGet32 (PcdFdBaseAddress) / SIZE_64KB);
if (BiosPhysicalSize < SIZE_16MB) { if (BiosPhysicalSize < SIZE_16MB) {
SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1; SmbiosRecord->BiosSize = Base2ToByteWith64KUnit (BiosPhysicalSize) - 1;
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
} else { } else {
SmbiosRecord->BiosSize = 0xFF; SmbiosRecord->BiosSize = 0xFF;
if (BiosPhysicalSize < SIZE_16GB) { if (BiosPhysicalSize > 0x3FFF) {
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB;
SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB
} else {
SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1GB; SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1GB;
SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB
} }
@@ -271,7 +270,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor)
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -162,7 +162,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer)
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type01 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -196,7 +196,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer)
Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8 *)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type02 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -178,7 +178,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -158,7 +158,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscNumberOfInstallableLanguages)
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type13 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -68,7 +68,7 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBootInformation)
Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); Status = SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n", DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type32 Table Log Failed! %r \n",
__FUNCTION__, DEBUG_LINE_NUMBER, Status)); __FUNCTION__, __LINE__, Status));
} }
FreePool (SmbiosRecord); FreePool (SmbiosRecord);

View File

@@ -49,13 +49,12 @@
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
!include MdePkg/MdeLibs.dsc.inc !include MdePkg/MdeLibs.dsc.inc
@@ -193,7 +192,7 @@
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0 gArmTokenSpaceGuid.PcdPciIoTranslation|0
gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0
@@ -293,9 +292,9 @@
# #
# Platform Driver # Platform Driver
# #
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf ArmVirtPkg/HighMemDxe/HighMemDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/VirtioNetDxe/VirtioNet.inf OvmfPkg/VirtioNetDxe/VirtioNet.inf
@@ -342,12 +341,12 @@
# #
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -361,5 +360,5 @@
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf { ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }

View File

@@ -105,9 +105,9 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)

View File

@@ -57,9 +57,9 @@
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
@@ -184,7 +184,7 @@
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
# #
# Set video resolution for boot options and for text setup. # Set video resolution for boot options and for text setup.
@@ -291,9 +291,9 @@
# Platform Driver # Platform Driver
# #
ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf ArmVirtPkg/HighMemDxe/HighMemDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/VirtioNetDxe/VirtioNet.inf OvmfPkg/VirtioNetDxe/VirtioNet.inf
@@ -338,17 +338,17 @@
# #
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
} }
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
} }
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
} }
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf

View File

@@ -119,10 +119,10 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)

View File

@@ -35,6 +35,9 @@
gArmVirtVariableGuid = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } } gArmVirtVariableGuid = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, 0x59, 0x65, 0x16, 0xb0, 0x0a } }
[Protocols]
gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }
[PcdsFeatureFlag] [PcdsFeatureFlag]
# #
# Feature Flag PCD that defines whether TPM2 support is enabled # Feature Flag PCD that defines whether TPM2 support is enabled

View File

@@ -59,7 +59,7 @@
# Virtio Support # Virtio Support
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
@@ -77,19 +77,17 @@
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
!if $(TPM2_ENABLE) == TRUE !if $(TPM2_ENABLE) == TRUE
Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf
Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibQemu/DxeTcg2PhysicalPresenceLib.inf
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf
!else !else
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
!endif !endif
[LibraryClasses.common.PEIM] [LibraryClasses.common.PEIM]
@@ -249,7 +247,7 @@
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
# #
# Set video resolution for boot options and for text setup. # Set video resolution for boot options and for text setup.
@@ -405,9 +403,9 @@
# #
# Platform Driver # Platform Driver
# #
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf ArmVirtPkg/HighMemDxe/HighMemDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/VirtioNetDxe/VirtioNet.inf OvmfPkg/VirtioNetDxe/VirtioNet.inf
@@ -489,12 +487,12 @@
# #
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -545,5 +543,5 @@
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }

View File

@@ -40,9 +40,9 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)

View File

@@ -57,7 +57,7 @@
# Virtio Support # Virtio Support
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/BaseQemuFwCfgS3LibNull.inf
QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
@@ -75,12 +75,11 @@
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf
PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf PciHostBridgeUtilityLib|OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
[LibraryClasses.common.DXE_DRIVER] [LibraryClasses.common.DXE_DRIVER]
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
@@ -228,7 +227,7 @@
# PCD and PcdPciDisableBusEnumeration above have not been assigned yet # PCD and PcdPciDisableBusEnumeration above have not been assigned yet
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xFFFFFFFFFFFFFFFF
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 gArmTokenSpaceGuid.PcdPciIoTranslation|0x0
# #
# Set video resolution for boot options and for text setup. # Set video resolution for boot options and for text setup.
@@ -340,9 +339,9 @@
# #
# Platform Driver # Platform Driver
# #
OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf ArmVirtPkg/HighMemDxe/HighMemDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/VirtioNetDxe/VirtioNet.inf OvmfPkg/VirtioNetDxe/VirtioNet.inf
@@ -424,12 +423,12 @@
# #
ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -460,5 +459,5 @@
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf {
<LibraryClasses> <LibraryClasses>
NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
} }

View File

@@ -50,7 +50,6 @@
PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf PlatformBootManagerLib|ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
TpmPlatformHierarchyLib|SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf
[LibraryClasses.common.UEFI_DRIVER] [LibraryClasses.common.UEFI_DRIVER]
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
@@ -197,7 +196,7 @@
# Platform Driver # Platform Driver
# #
ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
# #
# FAT filesystem + GPT/MBR partitioning + UDF filesystem # FAT filesystem + GPT/MBR partitioning + UDF filesystem

View File

@@ -139,7 +139,7 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf INF ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf
INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf INF ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)

View File

@@ -19,6 +19,7 @@
FdtClientDxe.c FdtClientDxe.c
[Packages] [Packages]
ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec

View File

@@ -1,6 +1,5 @@
/** @file /** @file
* High memory node enumeration DXE driver for ARM and RISC-V * High memory node enumeration DXE driver for ARM Virtual Machines
* Virtual Machines
* *
* Copyright (c) 2015-2016, Linaro Ltd. All rights reserved. * Copyright (c) 2015-2016, Linaro Ltd. All rights reserved.
* *

View File

@@ -1,6 +1,5 @@
## @file ## @file
# High memory node enumeration DXE driver for ARM and RISC-V # High memory node enumeration DXE driver for ARM Virtual Machines
# Virtual Machines
# #
# Copyright (c) 2015-2016, Linaro Ltd. All rights reserved. # Copyright (c) 2015-2016, Linaro Ltd. All rights reserved.
# #
@@ -21,10 +20,10 @@
HighMemDxe.c HighMemDxe.c
[Packages] [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
OvmfPkg/OvmfPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
[LibraryClasses] [LibraryClasses]
BaseLib BaseLib

View File

@@ -30,7 +30,6 @@
[Packages] [Packages]
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
[Protocols] [Protocols]

View File

@@ -22,7 +22,6 @@
[Packages] [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
[LibraryClasses] [LibraryClasses]

View File

@@ -24,7 +24,6 @@
[Packages] [Packages]
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec

View File

@@ -23,7 +23,6 @@
[Packages] [Packages]
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
[LibraryClasses] [LibraryClasses]

View File

@@ -20,14 +20,15 @@
# The following information is for reference only and not required by the build # The following information is for reference only and not required by the build
# tools. # tools.
# #
# VALID_ARCHITECTURES = AARCH64 ARM RISCV64 # VALID_ARCHITECTURES = AARCH64 ARM
# #
[Sources] [Sources]
FdtPciHostBridgeLib.c FdtPciHostBridgeLib.c
[Packages] [Packages]
EmbeddedPkg/EmbeddedPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec
@@ -42,11 +43,11 @@
PciPcdProducerLib PciPcdProducerLib
[FixedPcd] [FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation gArmTokenSpaceGuid.PcdPciMmio32Translation
gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation gArmTokenSpaceGuid.PcdPciMmio64Translation
[Pcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation gArmTokenSpaceGuid.PcdPciIoTranslation
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
[Depex] [Depex]

View File

@@ -20,7 +20,8 @@
FdtPciPcdProducerLib.c FdtPciPcdProducerLib.c
[Packages] [Packages]
EmbeddedPkg/EmbeddedPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
@@ -34,7 +35,7 @@
gFdtClientProtocolGuid ## CONSUMES gFdtClientProtocolGuid ## CONSUMES
[Pcd] [Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation ## PRODUCES gArmTokenSpaceGuid.PcdPciIoTranslation ## PRODUCES
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## PRODUCES gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress ## PRODUCES
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration ## PRODUCES gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration ## PRODUCES

View File

@@ -21,7 +21,6 @@
[Packages] [Packages]
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
PcAtChipsetPkg/PcAtChipsetPkg.dec PcAtChipsetPkg/PcAtChipsetPkg.dec

View File

@@ -22,7 +22,6 @@
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec

View File

@@ -24,7 +24,6 @@
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
[LibraryClasses] [LibraryClasses]
BaseLib BaseLib

View File

@@ -16,7 +16,6 @@
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <Library/PlatformBmPrintScLib.h> #include <Library/PlatformBmPrintScLib.h>
#include <Library/QemuBootOrderLib.h> #include <Library/QemuBootOrderLib.h>
#include <Library/TpmPlatformHierarchyLib.h>
#include <Library/UefiBootManagerLib.h> #include <Library/UefiBootManagerLib.h>
#include <Protocol/DevicePath.h> #include <Protocol/DevicePath.h>
#include <Protocol/FirmwareVolume2.h> #include <Protocol/FirmwareVolume2.h>
@@ -697,11 +696,6 @@ PlatformBootManagerBeforeConsole (
// //
EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);
//
// Disable the TPM 2 platform hierarchy
//
ConfigureTpmPlatformHierarchy ();
// //
// Dispatch deferred images after EndOfDxe event. // Dispatch deferred images after EndOfDxe event.
// //

View File

@@ -33,7 +33,6 @@
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec
SecurityPkg/SecurityPkg.dec
ShellPkg/ShellPkg.dec ShellPkg/ShellPkg.dec
[LibraryClasses] [LibraryClasses]
@@ -48,7 +47,6 @@
QemuBootOrderLib QemuBootOrderLib
QemuLoadImageLib QemuLoadImageLib
ReportStatusCodeLib ReportStatusCodeLib
TpmPlatformHierarchyLib
UefiBootManagerLib UefiBootManagerLib
UefiBootServicesTableLib UefiBootServicesTableLib
UefiLib UefiLib

View File

@@ -4,7 +4,6 @@
Copyright (C) 2013 - 2014, Red Hat, Inc. Copyright (C) 2013 - 2014, Red Hat, Inc.
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@@ -240,7 +239,7 @@ MmioReadBytes (
UINT8 *Ptr; UINT8 *Ptr;
UINT8 *End; UINT8 *End;
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64) #ifdef MDE_CPU_AARCH64
Left = Size & 7; Left = Size & 7;
#else #else
Left = Size & 3; Left = Size & 3;
@@ -250,7 +249,7 @@ MmioReadBytes (
Ptr = Buffer; Ptr = Buffer;
End = Ptr + Size; End = Ptr + Size;
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64) #ifdef MDE_CPU_AARCH64
while (Ptr < End) { while (Ptr < End) {
*(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress); *(UINT64 *)Ptr = MmioRead64 (mFwCfgDataAddress);
Ptr += 8; Ptr += 8;
@@ -323,7 +322,7 @@ DmaTransferBytes (
// //
// This will fire off the transfer. // This will fire off the transfer.
// //
#if defined(MDE_CPU_AARCH64) || defined(MDE_CPU_RISCV64) #ifdef MDE_CPU_AARCH64
MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access)); MmioWrite64 (mFwCfgDmaAddress, SwapBytes64 ((UINT64)&Access));
#else #else
MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access)); MmioWrite32 ((UINT32)(mFwCfgDmaAddress + 4), SwapBytes32 ((UINT32)&Access));

View File

@@ -23,16 +23,16 @@
# The following information is for reference only and not required by the build # The following information is for reference only and not required by the build
# tools. # tools.
# #
# VALID_ARCHITECTURES = ARM AARCH64 RISCV64 # VALID_ARCHITECTURES = ARM AARCH64
# #
[Sources] [Sources]
QemuFwCfgLibMmio.c QemuFwCfgLib.c
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec
EmbeddedPkg/EmbeddedPkg.dec ArmVirtPkg/ArmVirtPkg.dec
[LibraryClasses] [LibraryClasses]
BaseLib BaseLib

View File

@@ -20,7 +20,7 @@
VirtioFdtDxe.c VirtioFdtDxe.c
[Packages] [Packages]
EmbeddedPkg/EmbeddedPkg.dec ArmVirtPkg/ArmVirtPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec

View File

@@ -26,7 +26,6 @@
[Packages] [Packages]
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec

View File

@@ -21,7 +21,6 @@
[Packages] [Packages]
ArmVirtPkg/ArmVirtPkg.dec ArmVirtPkg/ArmVirtPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec

View File

@@ -1,5 +1,5 @@
## @file ## @file
# Download GCC AARCH64 compiler from Arm's release site # Download GCC AARCH64 compiler from Linaro's release site
# Set shell variable GCC5_AARCH64_INSTALL to this folder # Set shell variable GCC5_AARCH64_INSTALL to this folder
# #
# This is only downloaded when a build activates scope gcc_aarch64_linux # This is only downloaded when a build activates scope gcc_aarch64_linux
@@ -11,11 +11,11 @@
"scope": "gcc_aarch64_linux", "scope": "gcc_aarch64_linux",
"type": "web", "type": "web",
"name": "gcc_aarch64_linux", "name": "gcc_aarch64_linux",
"source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz", "source": "http://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz",
"version": "10.3-2021.07", "version": "7.4.1",
"sha256": "1e33d53dea59c8de823bbdfe0798280bdcd138636c7060da9d77a97ded095a84", "sha256": "27f1dc2c491ed61ae8f0d4b0c11de59cd2f7dd9c94761ee7153006fcac1bf9ab",
"compression_type": "tar", "compression_type": "tar",
"internal_path": "/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/", "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/",
"flags": ["set_shell_var", ], "flags": ["set_shell_var", ],
"var_name": "GCC5_AARCH64_INSTALL" "var_name": "GCC5_AARCH64_INSTALL"
} }

View File

@@ -1,5 +1,5 @@
## @file ## @file
# Download GCC ARM compiler from Arm's release site # Download GCC ARM compiler from Linaro's release site
# Set shell variable GCC5_ARM_INSTALL to this folder # Set shell variable GCC5_ARM_INSTALL to this folder
# #
# This is only downloaded when a build activates scope gcc_arm_linux # This is only downloaded when a build activates scope gcc_arm_linux
@@ -11,11 +11,11 @@
"scope": "gcc_arm_linux", "scope": "gcc_arm_linux",
"type": "web", "type": "web",
"name": "gcc_arm_linux", "name": "gcc_arm_linux",
"source": "https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf.tar.asc", "source": "https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz",
"version": "10.3-2021.07", "version": "7.4.1",
"sha256": "aa074fa8371a4f73fecbd16bd62c8b1945f23289e26414794f130d6ccdf8e39c", "sha256": "3C951CF1941D0FA06D64CC0D5E88612B209D8123B273FA26C16D70BD7BC6B163",
"compression_type": "tar", "compression_type": "tar",
"internal_path": "/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/", "internal_path": "/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/",
"flags": ["set_shell_var", ], "flags": ["set_shell_var", ],
"var_name": "GCC5_ARM_INSTALL" "var_name": "GCC5_ARM_INSTALL"
} }

View File

@@ -57,7 +57,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
return 0 return 0
# make GCC5_ARM_PREFIX to align with tools_def.txt # make GCC5_ARM_PREFIX to align with tools_def.txt
prefix = os.path.join(install_path, "bin", "arm-none-linux-gnueabihf-") prefix = os.path.join(install_path, "bin", "arm-linux-gnueabihf-")
shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix) shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PREFIX", prefix)
# now confirm it exists # now confirm it exists
@@ -80,7 +80,7 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin):
return 0 return 0
# make GCC5_AARCH64_PREFIX to align with tools_def.txt # make GCC5_AARCH64_PREFIX to align with tools_def.txt
prefix = os.path.join(install_path, "bin", "aarch64-none-linux-gnu-") prefix = os.path.join(install_path, "bin", "aarch64-linux-gnu-")
shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix) shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64_PREFIX", prefix)
# now confirm it exists # now confirm it exists

View File

@@ -142,7 +142,7 @@ class parser_lst(object):
line.append(struct) line.append(struct)
unparse.append(line) unparse.append(line)
else: else:
if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']: if uint not in ['UINT8', 'UINT16', 'UINT32', 'UINT64']:
line = [offset, t_name, 0, uint] line = [offset, t_name, 0, uint]
line.append(struct) line.append(struct)
unparse.append(line) unparse.append(line)
@@ -569,7 +569,7 @@ class mainprocess(object):
for i in List: for i in List:
for j in i: for j in i:
tmp = j.split("|") tmp = j.split("|")
if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() == '{0x0, 0x0}'): if (('L"' in j) and ("[" in j)) or (tmp[1].strip() == '{0x0, 0x0}'):
tmp[0] = tmp[0][:tmp[0].index('[')] tmp[0] = tmp[0][:tmp[0].index('[')]
List[List.index(i)][i.index(j)] = "|".join(tmp) List[List.index(i)][i.index(j)] = "|".join(tmp)
else: else:

View File

@@ -46,10 +46,7 @@ UPSTREAMS = [
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-platforms'}, 'list': 'devel@edk2.groups.io', 'prefix': 'edk2-platforms'},
{'name': 'edk2-non-osi', {'name': 'edk2-non-osi',
'repo': 'https://github.com/tianocore/edk2-non-osi.git', 'repo': 'https://github.com/tianocore/edk2-non-osi.git',
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'}, 'list': 'devel@edk2.groups.io', 'prefix': 'edk2-non-osi'}
{'name': 'edk2-test',
'repo': 'https://github.com/tianocore/edk2-test.git',
'list': 'devel@edk2.groups.io', 'prefix': 'edk2-test'}
] ]
# The minimum version required for all of the below options to work # The minimum version required for all of the below options to work

View File

@@ -13,6 +13,14 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile include $(MAKEROOT)/Makefiles/app.makefile
GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
ifneq ("$(GCCVERSION)", "5")
ifneq ($(CXX), llvm)
# gcc 12 trips over device path handling
BUILD_CFLAGS += -Wno-error=stringop-overflow
endif
endif
LIBS = -lCommon LIBS = -lCommon
ifeq ($(CYGWIN), CYGWIN) ifeq ($(CYGWIN), CYGWIN)
LIBS += -L/lib/e2fsprogs -luuid LIBS += -L/lib/e2fsprogs -luuid

View File

@@ -542,7 +542,7 @@ GetAlignmentFromFile(char *InFile, UINT32 *Alignment)
PeFileBuffer = (UINT8 *) malloc (PeFileSize); PeFileBuffer = (UINT8 *) malloc (PeFileSize);
if (PeFileBuffer == NULL) { if (PeFileBuffer == NULL) {
fclose (InFileHandle); fclose (InFileHandle);
Error(NULL, 0, 4001, "Resource", "memory cannot be allocated of %s", InFileHandle); Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle); fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);

View File

@@ -1062,7 +1062,7 @@ GetAlignmentFromFile(char *InFile, UINT32 *Alignment)
PeFileBuffer = (UINT8 *) malloc (PeFileSize); PeFileBuffer = (UINT8 *) malloc (PeFileSize);
if (PeFileBuffer == NULL) { if (PeFileBuffer == NULL) {
fclose (InFileHandle); fclose (InFileHandle);
Error(NULL, 0, 4001, "Resource", "memory cannot be allocated of %s", InFileHandle); Error(NULL, 0, 4001, "Resource", "memory cannot be allocated for %s", InFile);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle); fread (PeFileBuffer, sizeof (UINT8), PeFileSize, InFileHandle);

View File

@@ -2825,12 +2825,13 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, BoolInt reInit,
nowPos64 = p->nowPos64; nowPos64 = p->nowPos64;
RangeEnc_Init(&p->rc); RangeEnc_Init(&p->rc);
p->rc.outStream = &outStream.vt;
if (desiredPackSize == 0) if (desiredPackSize == 0)
return SZ_ERROR_OUTPUT_EOF; return SZ_ERROR_OUTPUT_EOF;
p->rc.outStream = &outStream.vt;
res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize); res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
p->rc.outStream = NULL;
*unpackSize = (UInt32)(p->nowPos64 - nowPos64); *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
*destLen -= outStream.rem; *destLen -= outStream.rem;

View File

@@ -1135,8 +1135,6 @@ CVfrVarDataTypeDB::DataTypeAddBitField (
if (FieldName != NULL) { if (FieldName != NULL) {
strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1); strncpy (pNewField->mFieldName, FieldName, MAX_NAME_LEN - 1);
pNewField->mFieldName[MAX_NAME_LEN - 1] = 0; pNewField->mFieldName[MAX_NAME_LEN - 1] = 0;
} else {
strncpy (pNewField->mFieldName, "", MAX_NAME_LEN - 1);
} }
pNewField->mFieldType = pFieldType; pNewField->mFieldType = pFieldType;
pNewField->mIsBitField = TRUE; pNewField->mIsBitField = TRUE;
@@ -3918,3 +3916,5 @@ CVfrStringDB::GetUnicodeStringTextSize (
CVfrVarDataTypeDB gCVfrVarDataTypeDB; CVfrVarDataTypeDB gCVfrVarDataTypeDB;
CVfrDefaultStore gCVfrDefaultStore; CVfrDefaultStore gCVfrDefaultStore;
CVfrDataStorage gCVfrDataStorage; CVfrDataStorage gCVfrDataStorage;

View File

@@ -2,7 +2,7 @@
# Create makefile for MS nmake and GNU make # Create makefile for MS nmake and GNU make
# #
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<BR> # Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
# #
@@ -177,11 +177,11 @@ class BuildFile(object):
MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH') MakePath = AutoGenObject.BuildOption.get('MAKE', {}).get('PATH')
if not MakePath: if not MakePath:
MakePath = AutoGenObject.ToolDefinition.get('MAKE', {}).get('PATH') self._FileType = ""
if "nmake" in MakePath: elif "nmake" in MakePath:
self._FileType = NMAKE_FILETYPE self._FileType = NMAKE_FILETYPE
else: else:
self._FileType = GMAKE_FILETYPE self._FileType = "gmake"
if sys.platform == "win32": if sys.platform == "win32":
self._Platform = WIN32_PLATFORM self._Platform = WIN32_PLATFORM

View File

@@ -15,7 +15,6 @@ from Common.VariableAttributes import VariableAttributes
from Common.Misc import * from Common.Misc import *
import collections import collections
import Common.DataType as DataType import Common.DataType as DataType
import Common.GlobalData as GlobalData
var_info = collections.namedtuple("uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default_value, default_value, data_type,PcdDscLine,StructurePcd") var_info = collections.namedtuple("uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default_value, default_value, data_type,PcdDscLine,StructurePcd")
NvStorageHeaderSize = 28 NvStorageHeaderSize = 28
@@ -174,16 +173,11 @@ class VariableMgr(object):
offset += VariableHeaderSize + len(default_info.var_name.split(",")) offset += VariableHeaderSize + len(default_info.var_name.split(","))
var_data_offset[default_info.pcdindex] = offset var_data_offset[default_info.pcdindex] = offset
offset += data_size - len(default_info.var_name.split(",")) offset += data_size - len(default_info.var_name.split(","))
if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE":
var_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid) var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
else:
var_header_buffer = VariableMgr.PACK_VARIABLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (default_data), vendorguid)
NvStoreDataBuffer += (var_header_buffer + DataBuffer) NvStoreDataBuffer += (var_header_buffer + DataBuffer)
if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE,"FALSE").upper() == "TRUE": variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
variable_storage_header_buffer = VariableMgr.PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
else:
variable_storage_header_buffer = VariableMgr.PACK_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)
nv_default_part = VariableMgr.AlignData(VariableMgr.PACK_DEFAULT_DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8) nv_default_part = VariableMgr.AlignData(VariableMgr.PACK_DEFAULT_DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreDataBuffer)), 8)
@@ -258,20 +252,6 @@ class VariableMgr(object):
return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
def PACK_AUTHENTICATED_VARIABLE_STORE_HEADER(size):
#Signature: gEfiAuthenticatedVariableGuid
Guid = "{ 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}"
Guid = GuidStructureStringToGuidString(Guid)
GuidBuffer = PackGUID(Guid.split('-'))
SizeBuffer = pack('=L', size)
FormatBuffer = pack('=B', 0x5A)
StateBuffer = pack('=B', 0xFE)
reservedBuffer = pack('=H', 0)
reservedBuffer += pack('=L', 0)
return GuidBuffer + SizeBuffer + FormatBuffer + StateBuffer + reservedBuffer
@staticmethod @staticmethod
def PACK_NV_STORE_DEFAULT_HEADER(size, maxsize): def PACK_NV_STORE_DEFAULT_HEADER(size, maxsize):
Signature = pack('=B', ord('N')) Signature = pack('=B', ord('N'))
@@ -299,37 +279,6 @@ class VariableMgr(object):
return Buffer return Buffer
@staticmethod
def PACK_AUTHENTICATED_VARIABLE_HEADER(attribute, namesize, datasize, vendorguid):
Buffer = pack('=H', 0x55AA) # pack StartID
Buffer += pack('=B', 0x3F) # pack State
Buffer += pack('=B', 0) # pack reserved
Buffer += pack('=L', attribute)
Buffer += pack('=Q', 0) # pack MonotonicCount
Buffer += pack('=HBBBBBBLhBB', # pack TimeStamp
0, # UINT16 Year
0, # UINT8 Month
0, # UINT8 Day
0, # UINT8 Hour
0, # UINT8 Minute
0, # UINT8 Second
0, # UINT8 Pad1
0, # UINT32 Nanosecond
0, # INT16 TimeZone
0, # UINT8 Daylight
0) # UINT8 Pad2
Buffer += pack('=L', 0) # pack PubKeyIndex
Buffer += pack('=L', namesize)
Buffer += pack('=L', datasize)
Buffer += PackGUID(vendorguid)
return Buffer
@staticmethod @staticmethod
def PACK_VARIABLES_DATA(var_value,data_type, tail = None): def PACK_VARIABLES_DATA(var_value,data_type, tail = None):
Buffer = bytearray() Buffer = bytearray()

View File

@@ -254,6 +254,7 @@ class ModuleAutoGen(AutoGen):
self.AutoGenDepSet = set() self.AutoGenDepSet = set()
self.ReferenceModules = [] self.ReferenceModules = []
self.ConstPcd = {} self.ConstPcd = {}
self.Makefile = None
self.FileDependCache = {} self.FileDependCache = {}
def __init_platform_info__(self): def __init_platform_info__(self):

View File

@@ -406,7 +406,6 @@ TAB_DSC_DEFINES_SKUID_IDENTIFIER = 'SKUID_IDENTIFIER'
TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION' TAB_DSC_DEFINES_PCD_INFO_GENERATION = 'PCD_INFO_GENERATION'
TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX = 'PCD_DYNAMIC_AS_DYNAMICEX' TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX = 'PCD_DYNAMIC_AS_DYNAMICEX'
TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION' TAB_DSC_DEFINES_PCD_VAR_CHECK_GENERATION = 'PCD_VAR_CHECK_GENERATION'
TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE = 'VPD_AUTHENTICATED_VARIABLE_STORE'
TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION' TAB_DSC_DEFINES_FLASH_DEFINITION = 'FLASH_DEFINITION'
TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER' TAB_DSC_DEFINES_BUILD_NUMBER = 'BUILD_NUMBER'
TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME' TAB_DSC_DEFINES_MAKEFILE_NAME = 'MAKEFILE_NAME'

View File

@@ -105,7 +105,7 @@ class Ecc(object):
def InitDefaultConfigIni(self): def InitDefaultConfigIni(self):
paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path) paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path)
paths = (os.path.abspath('config.ini'),) + tuple(paths) paths = (os.path.realpath('config.ini'),) + tuple(paths)
for path in paths: for path in paths:
if os.path.exists(path): if os.path.exists(path):
self.ConfigFile = path self.ConfigFile = path

View File

@@ -152,11 +152,11 @@ class CompressedImage(Image):
try: try:
TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:]) TmpData = DeCompress('Efi', self[self._HEADER_SIZE_:])
DecData = array('B') DecData = array('B')
DecData.fromstring(TmpData) DecData.frombytes(TmpData)
except: except:
TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:]) TmpData = DeCompress('Framework', self[self._HEADER_SIZE_:])
DecData = array('B') DecData = array('B')
DecData.fromstring(TmpData) DecData.frombytes(TmpData)
SectionList = [] SectionList = []
Offset = 0 Offset = 0
@@ -196,7 +196,7 @@ class Ui(Image):
return len(self) return len(self)
def _GetUiString(self): def _GetUiString(self):
return codecs.utf_16_decode(self[0:-2].tostring())[0] return codecs.utf_16_decode(self[0:-2].tobytes())[0]
String = property(_GetUiString) String = property(_GetUiString)
@@ -738,7 +738,7 @@ class GuidDefinedImage(Image):
Offset = self.DataOffset - 4 Offset = self.DataOffset - 4
TmpData = DeCompress('Framework', self[self.Offset:]) TmpData = DeCompress('Framework', self[self.Offset:])
DecData = array('B') DecData = array('B')
DecData.fromstring(TmpData) DecData.frombytes(TmpData)
Offset = 0 Offset = 0
while Offset < len(DecData): while Offset < len(DecData):
Sec = Section() Sec = Section()
@@ -759,7 +759,7 @@ class GuidDefinedImage(Image):
TmpData = DeCompress('Lzma', self[self.Offset:]) TmpData = DeCompress('Lzma', self[self.Offset:])
DecData = array('B') DecData = array('B')
DecData.fromstring(TmpData) DecData.frombytes(TmpData)
Offset = 0 Offset = 0
while Offset < len(DecData): while Offset < len(DecData):
Sec = Section() Sec = Section()

View File

@@ -707,8 +707,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
FileName, FileName,
'DEBUG' 'DEBUG'
) )
OutputPath = os.path.abspath(OutputPath) OutputPath = os.path.realpath(OutputPath)
DebugPath = os.path.abspath(DebugPath) DebugPath = os.path.realpath(DebugPath)
return OutputPath, DebugPath return OutputPath, DebugPath
## __GenSimpleFileSection__() method ## __GenSimpleFileSection__() method

View File

@@ -20,7 +20,7 @@ from linecache import getlines
from io import BytesIO from io import BytesIO
import Common.LongFilePathOs as os import Common.LongFilePathOs as os
from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile from Common.TargetTxtClassObject import TargetTxtDict
from Common.DataType import * from Common.DataType import *
import Common.GlobalData as GlobalData import Common.GlobalData as GlobalData
from Common import EdkLogger from Common import EdkLogger
@@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename) FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename)
if FdfFilename[0:2] == '..': if FdfFilename[0:2] == '..':
FdfFilename = os.path.abspath(FdfFilename) FdfFilename = os.path.realpath(FdfFilename)
if not os.path.isabs(FdfFilename): if not os.path.isabs(FdfFilename):
FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename) FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)
if not os.path.exists(FdfFilename): if not os.path.exists(FdfFilename):
@@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform) ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform)
if ActivePlatform[0:2] == '..': if ActivePlatform[0:2] == '..':
ActivePlatform = os.path.abspath(ActivePlatform) ActivePlatform = os.path.realpath(ActivePlatform)
if not os.path.isabs (ActivePlatform): if not os.path.isabs (ActivePlatform):
ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform) ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)
@@ -207,7 +207,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
GenFdsGlobalVariable.ConfDir = ConfDirectoryPath GenFdsGlobalVariable.ConfDir = ConfDirectoryPath
if not GlobalData.gConfDirectory: if not GlobalData.gConfDirectory:
GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir GlobalData.gConfDirectory = GenFdsGlobalVariable.ConfDir
BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile)) BuildConfigurationFile = os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt"))
if os.path.isfile(BuildConfigurationFile) == True: if os.path.isfile(BuildConfigurationFile) == True:
# if no build target given in command line, get it from target.txt # if no build target given in command line, get it from target.txt
TargetObj = TargetTxtDict() TargetObj = TargetTxtDict()
@@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None):
for Key in GenFdsGlobalVariable.OutputDirDict: for Key in GenFdsGlobalVariable.OutputDirDict:
OutputDir = GenFdsGlobalVariable.OutputDirDict[Key] OutputDir = GenFdsGlobalVariable.OutputDirDict[Key]
if OutputDir[0:2] == '..': if OutputDir[0:2] == '..':
OutputDir = os.path.abspath(OutputDir) OutputDir = os.path.realpath(OutputDir)
if OutputDir[1] != ':': if OutputDir[1] != ':':
OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir) OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir)

View File

@@ -24,7 +24,7 @@ from Common import EdkLogger
from Common.Misc import SaveFileOnChange from Common.Misc import SaveFileOnChange
from Common.TargetTxtClassObject import TargetTxtDict from Common.TargetTxtClassObject import TargetTxtDict
from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile from Common.ToolDefClassObject import ToolDefDict
from AutoGen.BuildEngine import ToolBuildRule from AutoGen.BuildEngine import ToolBuildRule
import Common.DataType as DataType import Common.DataType as DataType
from Common.Misc import PathClass,CreateDirectory from Common.Misc import PathClass,CreateDirectory
@@ -103,7 +103,7 @@ class GenFdsGlobalVariable:
TargetObj = TargetTxtDict() TargetObj = TargetTxtDict()
ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF] ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
if ToolDefinitionFile == '': if ToolDefinitionFile == '':
ToolDefinitionFile = os.path.join('Conf', gDefaultToolsDefFile) ToolDefinitionFile = "Conf/tools_def.txt"
if os.path.isfile(ToolDefinitionFile): if os.path.isfile(ToolDefinitionFile):
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase

View File

@@ -17,7 +17,6 @@ import Common.BuildToolError as BuildToolError
from Common.DataType import * from Common.DataType import *
from Common.BuildVersion import gBUILD_VERSION from Common.BuildVersion import gBUILD_VERSION
from Common.LongFilePathSupport import OpenLongFilePath as open from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.TargetTxtClassObject import gDefaultTargetTxtFile
# To Do 1.set clean, 2. add item, if the line is disabled. # To Do 1.set clean, 2. add item, if the line is disabled.
@@ -26,7 +25,7 @@ class TargetTool():
self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE')) self.WorkSpace = os.path.normpath(os.getenv('WORKSPACE'))
self.Opt = opt self.Opt = opt
self.Arg = args[0] self.Arg = args[0]
self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', gDefaultTargetTxtFile)) self.FileName = os.path.normpath(os.path.join(self.WorkSpace, 'Conf', 'target.txt'))
if os.path.isfile(self.FileName) == False: if os.path.isfile(self.FileName) == False:
print("%s does not exist." % self.FileName) print("%s does not exist." % self.FileName)
sys.exit(1) sys.exit(1)

View File

@@ -590,6 +590,7 @@ class PackageBuildClassObject(BuildData):
# @var OutputDirectory: To store value for OutputDirectory # @var OutputDirectory: To store value for OutputDirectory
# @var FlashDefinition: To store value for FlashDefinition # @var FlashDefinition: To store value for FlashDefinition
# @var BuildNumber: To store value for BuildNumber # @var BuildNumber: To store value for BuildNumber
# @var MakefileName: To store value for MakefileName
# @var SkuIds: To store value for SkuIds, it is a set structure as # @var SkuIds: To store value for SkuIds, it is a set structure as
# { 'SkuName' : SkuId, '!include' : includefilename, ...} # { 'SkuName' : SkuId, '!include' : includefilename, ...}
# @var Modules: To store value for Modules, it is a list structure as # @var Modules: To store value for Modules, it is a list structure as
@@ -613,6 +614,7 @@ class PlatformBuildClassObject(BuildData):
self.OutputDirectory = '' self.OutputDirectory = ''
self.FlashDefinition = '' self.FlashDefinition = ''
self.BuildNumber = '' self.BuildNumber = ''
self.MakefileName = ''
self.SkuIds = {} self.SkuIds = {}
self.Modules = [] self.Modules = []

View File

@@ -19,8 +19,8 @@ from Common.Misc import *
from types import * from types import *
from Common.Expression import * from Common.Expression import *
from CommonDataClass.CommonClass import SkuInfoClass from CommonDataClass.CommonClass import SkuInfoClass
from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile from Common.TargetTxtClassObject import TargetTxtDict
from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile from Common.ToolDefClassObject import ToolDefDict
from .MetaDataTable import * from .MetaDataTable import *
from .MetaFileTable import * from .MetaFileTable import *
from .MetaFileParser import * from .MetaFileParser import *
@@ -387,10 +387,6 @@ class DscBuildData(PlatformBuildClassObject):
for i in range(0, len(LanguageCodes), 3): for i in range(0, len(LanguageCodes), 3):
LanguageList.append(LanguageCodes[i:i + 3]) LanguageList.append(LanguageCodes[i:i + 3])
self._ISOLanguages = LanguageList self._ISOLanguages = LanguageList
elif Name == TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE:
if TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE not in gCommandLineDefines:
gCommandLineDefines[TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE] = Record[2].strip()
elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID: elif Name == TAB_DSC_DEFINES_VPD_TOOL_GUID:
# #
# try to convert GUID to a real UUID value to see whether the GUID is format # try to convert GUID to a real UUID value to see whether the GUID is format
@@ -3530,11 +3526,12 @@ class DscBuildData(PlatformBuildClassObject):
self._ToolChainFamily = TAB_COMPILER_MSFT self._ToolChainFamily = TAB_COMPILER_MSFT
TargetObj = TargetTxtDict() TargetObj = TargetTxtDict()
TargetTxt = TargetObj.Target TargetTxt = TargetObj.Target
BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, gDefaultTargetTxtFile)) BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt"))
if os.path.isfile(BuildConfigurationFile) == True: if os.path.isfile(BuildConfigurationFile) == True:
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF] ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
if ToolDefinitionFile == '': if ToolDefinitionFile == '':
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', gDefaultToolsDefFile)) ToolDefinitionFile = "tools_def.txt"
ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile))
if os.path.isfile(ToolDefinitionFile) == True: if os.path.isfile(ToolDefinitionFile) == True:
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase

View File

@@ -4,7 +4,7 @@
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.<BR> # Copyright (c) 2020, ARM Limited. All rights reserved.<BR>
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
# #
@@ -67,6 +67,10 @@ from AutoGen.AutoGen import CalculatePriorityValue
## standard targets of build command ## standard targets of build command
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run'] gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
## build configuration file
gBuildConfiguration = "target.txt"
gToolsDefinition = "tools_def.txt"
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$') TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')
TmpTableDict = {} TmpTableDict = {}
@@ -1304,9 +1308,6 @@ class Build():
if Target == 'run': if Target == 'run':
return True return True
# Fetch the MakeFileName.
self.MakeFileName = AutoGenObject.MakeFileName
# build modules # build modules
if BuildModule: if BuildModule:
BuildCommand = BuildCommand + [Target] BuildCommand = BuildCommand + [Target]
@@ -2182,6 +2183,8 @@ class Build():
Pa.CreateLibModuelDirs() Pa.CreateLibModuelDirs()
# Fetch the MakeFileName. # Fetch the MakeFileName.
self.MakeFileName = Pa.MakeFileName self.MakeFileName = Pa.MakeFileName
if not self.MakeFileName:
self.MakeFileName = Pa.MakeFile
Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList} Pa.DataPipe.DataContainer = {"LibraryBuildDirectoryList":Pa.LibraryBuildDirectoryList}
Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList} Pa.DataPipe.DataContainer = {"ModuleBuildDirectoryList":Pa.ModuleBuildDirectoryList}

View File

@@ -864,11 +864,15 @@ Pkcs7Verify (
// For generic PKCS#7 handling, InData may be NULL if the content is present // For generic PKCS#7 handling, InData may be NULL if the content is present
// in PKCS#7 structure. So ignore NULL checking here. // in PKCS#7 structure. So ignore NULL checking here.
// //
DataBio = BIO_new_mem_buf (InData, (int) DataLength); DataBio = BIO_new (BIO_s_mem ());
if (DataBio == NULL) { if (DataBio == NULL) {
goto _Exit; goto _Exit;
} }
if (BIO_write (DataBio, InData, (int) DataLength) <= 0) {
goto _Exit;
}
// //
// Allow partial certificate chains, terminated by a non-self-signed but // Allow partial certificate chains, terminated by a non-self-signed but
// still trusted intermediate certificate. Also disable time checks. // still trusted intermediate certificate. Also disable time checks.

View File

@@ -1,7 +1,7 @@
## @file ## @file
# Dsc include file for Dynamic Tables Framework. # Dsc include file for Dynamic Tables Framework.
# #
# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR> # Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
# #
@@ -13,7 +13,6 @@
RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
[LibraryClasses.common] [LibraryClasses.common]
AcpiHelperLib|DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf AmlLib|DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf SsdtSerialPortFixupLib|DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
@@ -37,9 +36,6 @@
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
# AML Codegen
DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
# #
# Dynamic Table Factory Dxe # Dynamic Table Factory Dxe
# #
@@ -59,9 +55,6 @@
# AML Fixup # AML Fixup
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortLibArm.inf
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600LibArm.inf
# AML Codegen
NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyLibArm.inf
} }
# #

View File

@@ -5,28 +5,6 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
## ##
{ {
"EccCheck": {
## Exception sample looks like below:
## "ExceptionList": [
## "<ErrorID>", "<KeyWord>"
## ]
"ExceptionList": [
# "The #ifndef at the start of an include file should use
# both prefix and postfix underscore characters, '_'"
# This error is not triggered for the latest BaseTools code.
# @TODO The error should be re-enabled when the python packages
# containing the BaseTools are updated to the latest version.
"8003", "DISABLE_NEW_DEPRECATED_INTERFACES",
"9005", "@defgroup", # Use extra Doxygen commands
"9005", "@ingroup", # Use extra Doxygen commands
"9005", "@mainpage", # Use extra Doxygen commands
"9005", "@ref", # Use extra Doxygen commands
],
## Both file path and directory path are accepted.
"IgnoreFiles": [
]
},
## options defined .pytool/Plugin/CompilerPlugin ## options defined .pytool/Plugin/CompilerPlugin
"CompilerPlugin": { "CompilerPlugin": {
"DscPath": "DynamicTablesPkg.dsc" "DscPath": "DynamicTablesPkg.dsc"
@@ -45,7 +23,6 @@
## options defined .pytool/Plugin/DependencyCheck ## options defined .pytool/Plugin/DependencyCheck
"DependencyCheck": { "DependencyCheck": {
"AcceptableDependencies": [ "AcceptableDependencies": [
"ArmPkg/ArmPkg.dec",
"ArmPlatformPkg/ArmPlatformPkg.dec", "ArmPlatformPkg/ArmPlatformPkg.dec",
"EmbeddedPkg/EmbeddedPkg.dec", "EmbeddedPkg/EmbeddedPkg.dec",
"DynamicTablesPkg/DynamicTablesPkg.dec", "DynamicTablesPkg/DynamicTablesPkg.dec",
@@ -100,25 +77,19 @@
"CCIDX", "CCIDX",
"CCSIDR", "CCSIDR",
"countof", "countof",
"edynamic",
"EOBJECT", "EOBJECT",
"invoc", "invoc",
"ITARGETSR",
"GTBLOCK", "GTBLOCK",
"lgreater", "lgreater",
"lless", "lless",
"MPIDR", "MPIDR",
"PERIPHBASE", "PERIPHBASE",
"phandle",
"pytool", "pytool",
"Rdword",
"Roadmap", "Roadmap",
"ROOTNODEBASE", "ROOTNODEBASE",
"ssdtcmn", "ssdtcmn",
"ssdtserialporttemplate", "ssdtserialporttemplate",
"SMMUV", "SMMUV",
"ssdtpcieosctemplate",
"SSDTPC",
"standardised", "standardised",
"TABLEEX", "TABLEEX",
"TNSID", "TNSID",

View File

@@ -17,10 +17,6 @@
Include Include
[LibraryClasses] [LibraryClasses]
## @libraryclass Defines a set of Acpi helper methods
# independent from the Dynamic Tables Framework.
AcpiHelperLib|Include/Library/AcpiHelperLib.h
## @libraryclass Defines a set of APIs for Dynamic AML generation. ## @libraryclass Defines a set of APIs for Dynamic AML generation.
AmlLib|Include/Library/AmlLib/AmlLib.h AmlLib|Include/Library/AmlLib/AmlLib.h

View File

@@ -35,11 +35,9 @@
[LibraryClasses.ARM, LibraryClasses.AARCH64] [LibraryClasses.ARM, LibraryClasses.AARCH64]
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
[Components.common] [Components.common]
DynamicTablesPkg/Library/Common/AcpiHelperLib/AcpiHelperLib.inf
DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf DynamicTablesPkg/Library/Common/AmlLib/AmlLib.inf
DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf DynamicTablesPkg/Library/Common/SsdtSerialPortFixupLib/SsdtSerialPortFixupLib.inf
DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
@@ -52,3 +50,4 @@
# Inhibit C6305: Potential mismatch between sizeof and countof quantities. # Inhibit C6305: Potential mismatch between sizeof and countof quantities.
*_VS2017_*_CC_FLAGS = /wd6305 /analyze *_VS2017_*_CC_FLAGS = /wd6305 /analyze
!endif !endif

View File

@@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR> Copyright (c) 2017 - 2020, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -63,10 +63,6 @@ The Dynamic Tables Framework implements the following ACPI table generators:
The SSDT CMN-600 generator collates the CMN-600 information The SSDT CMN-600 generator collates the CMN-600 information
from the Configuration Manager and patches the SSDT CMN-600 from the Configuration Manager and patches the SSDT CMN-600
template to build the SSDT CMN-600 table. template to build the SSDT CMN-600 table.
- SSDT Cpu-Topology:
The SSDT Cpu-Topology generator collates the cpu and LPI
information from the Configuration Manager and generates a
SSDT table describing the CPU hierarchy.
*/ */
/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID. /** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
@@ -92,7 +88,6 @@ typedef enum StdAcpiTableId {
EStdAcpiTableIdSrat, ///< SRAT Generator EStdAcpiTableIdSrat, ///< SRAT Generator
EStdAcpiTableIdSsdtSerialPort, ///< SSDT Serial-Port Generator EStdAcpiTableIdSsdtSerialPort, ///< SSDT Serial-Port Generator
EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Generator EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Generator
EStdAcpiTableIdSsdtCpuTopology, ///< SSDT Cpu Topology
EStdAcpiTableIdMax EStdAcpiTableIdMax
} ESTD_ACPI_TABLE_ID; } ESTD_ACPI_TABLE_ID;

View File

@@ -58,7 +58,6 @@ typedef enum ArmObjectID {
EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity EArmObjGenericInitiatorAffinityInfo, ///< 34 - Generic Initiator Affinity
EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info
EArmObjCmn600Info, ///< 36 - CMN-600 Info EArmObjCmn600Info, ///< 36 - CMN-600 Info
EArmObjLpiInfo, ///< 37 - Lpi Info
EArmObjMax EArmObjMax
} EARM_OBJECT_ID; } EARM_OBJECT_ID;
@@ -396,21 +395,21 @@ typedef struct CmArmGTBlockInfo {
} CM_ARM_GTBLOCK_INFO; } CM_ARM_GTBLOCK_INFO;
/** A structure that describes the /** A structure that describes the
Arm Generic Watchdog information for the Platform. SBSA Generic Watchdog information for the Platform.
ID: EArmObjPlatformGenericWatchdogInfo ID: EArmObjPlatformGenericWatchdogInfo
*/ */
typedef struct CmArmGenericWatchdogInfo { typedef struct CmArmGenericWatchdogInfo {
/// The physical base address of the Arm Watchdog control frame /// The physical base address of the SBSA Watchdog control frame
UINT64 ControlFrameAddress; UINT64 ControlFrameAddress;
/// The physical base address of the Arm Watchdog refresh frame /// The physical base address of the SBSA Watchdog refresh frame
UINT64 RefreshFrameAddress; UINT64 RefreshFrameAddress;
/// The watchdog interrupt /// The watchdog interrupt
UINT32 TimerGSIV; UINT32 TimerGSIV;
/** The flags for the watchdog as described by the Arm watchdog /** The flags for the watchdog as described by the SBSA watchdog
structure in the ACPI specification. structure in the ACPI specification.
*/ */
UINT32 Flags; UINT32 Flags;
@@ -712,10 +711,6 @@ typedef struct CmArmProcHierarchyInfo {
/// the NoOfPrivateResources is 0, in which case it is recommended to set /// the NoOfPrivateResources is 0, in which case it is recommended to set
/// this field to CM_NULL_TOKEN. /// this field to CM_NULL_TOKEN.
CM_OBJECT_TOKEN PrivateResourcesArrayToken; CM_OBJECT_TOKEN PrivateResourcesArrayToken;
/// Optional field: Reference Token for the Lpi state of this processor.
/// Token identifying a CM_ARM_OBJ_REF structure, itself referencing
/// CM_ARM_LPI_INFO objects.
CM_OBJECT_TOKEN LpiToken;
} CM_ARM_PROC_HIERARCHY_INFO; } CM_ARM_PROC_HIERARCHY_INFO;
/** A structure that describes the Cache Type Structure (Type 1) in PPTT /** A structure that describes the Cache Type Structure (Type 1) in PPTT
@@ -883,69 +878,6 @@ typedef struct CmArmCmn600Info {
CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4]; CM_ARM_EXTENDED_INTERRUPT DtcInterrupt[4];
} CM_ARM_CMN_600_INFO; } CM_ARM_CMN_600_INFO;
/** A structure that describes the Lpi information.
The Low Power Idle states are described in DSDT/SSDT and associated
to cpus/clusters in the cpu topology.
ID: EArmObjLpiInfo
*/
typedef struct CmArmLpiInfo {
/** Minimum Residency. Time in microseconds after which a
state becomes more energy efficient than any shallower state.
*/
UINT32 MinResidency;
/** Worst case time in microseconds from a wake interrupt
being asserted to the return to a running state
*/
UINT32 WorstCaseWakeLatency;
/** Flags.
*/
UINT32 Flags;
/** Architecture specific context loss flags.
*/
UINT32 ArchFlags;
/** Residency counter frequency in cycles-per-second (Hz).
*/
UINT32 ResCntFreq;
/** Every shallower power state in the parent is also enabled.
*/
UINT32 EnableParentState;
/** The EntryMethod _LPI field can be described as an integer
or in a Register resource data descriptor.
If IsInteger is TRUE, the IntegerEntryMethod field is used.
If IsInteger is FALSE, the RegisterEntryMethod field is used.
*/
BOOLEAN IsInteger;
/** EntryMethod described as an Integer.
*/
UINT64 IntegerEntryMethod;
/** EntryMethod described as a EFI_ACPI_GENERIC_REGISTER_DESCRIPTOR.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE RegisterEntryMethod;
/** Residency counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResidencyCounterRegister;
/** Usage counter register.
*/
EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE UsageCounterRegister;
/** String representing the Lpi state
*/
CHAR8 StateName[16];
} CM_ARM_LPI_INFO;
#pragma pack() #pragma pack()
#endif // ARM_NAMESPACE_OBJECTS_H_ #endif // ARM_NAMESPACE_OBJECTS_H_

View File

@@ -1,93 +0,0 @@
/** @file
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef ACPI_HELPER_LIB_H_
#define ACPI_HELPER_LIB_H_
/** Is a character upper case
*/
#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
/** Is a character a decimal digit
*/
#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
/** Is a character an upper case hexadecimal digit
*/
#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
/** Convert a hex number to its ASCII code.
@param [in] Hex Hex number to convert.
Must be 0 <= x < 16.
@return The ASCII code corresponding to x.
-1 if error.
**/
UINT8
EFIAPI
AsciiFromHex (
IN UINT8 Hex
);
/** Convert an ASCII char representing an hexadecimal number
to its integer value.
@param [in] Char Char to convert.
Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
@return The corresponding integer (between 0-16).
-1 if error.
**/
UINT8
EFIAPI
HexFromAscii (
IN CHAR8 Char
);
/** Check if a HID is a valid PNP ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid PNP ID.
@retval FALSE The Hid is not a valid PNP ID.
**/
BOOLEAN
IsValidPnpId (
IN CONST CHAR8 * Hid
);
/** Check if a HID is a valid ACPI ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid ACPI ID.
@retval FALSE The Hid is not a valid ACPI ID.
**/
BOOLEAN
IsValidAcpiId (
IN CONST CHAR8 * Hid
);
/** Convert a EisaId string to its compressed UINT32 equivalent.
Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
@param [in] EisaIdStr Input EisaId string.
@param [out] EisaIdInt Output EisaId UINT32 (compressed).
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlGetEisaIdFromString (
IN CONST CHAR8 * EisaIdStr,
OUT UINT32 * EisaIdInt
);
#endif // ACPI_HELPER_LIB_H_

View File

@@ -1,7 +1,7 @@
/** @file /** @file
AML Lib. AML Lib.
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR> Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@@ -301,7 +301,7 @@ AmlNameOpUpdateString (
IN CONST CHAR8 * NewName IN CONST CHAR8 * NewName
); );
/** Get the first Resource Data element contained in a named object. /** Get the first Resource Data element contained in a "_CRS" object.
In the following ASL code, the function will return the Resource Data In the following ASL code, the function will return the Resource Data
node corresponding to the "QWordMemory ()" ASL macro. node corresponding to the "QWordMemory ()" ASL macro.
@@ -312,26 +312,27 @@ AmlNameOpUpdateString (
) )
Note: Note:
"_CRS" names defined as methods are not handled by this function. - The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
They must be defined as names, using the "Name ()" statement. - "_CRS" declared using ASL "Method (Declare Control Method)" is not
supported.
@ingroup UserApis @ingroup UserApis
@param [in] NameOpNode NameOp object node defining a named object. @param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
Must have an OpCode=AML_NAME_OP, SubOpCode=0. Must have an OpCode=AML_NAME_OP, SubOpCode=0.
NameOp object nodes are defined in ASL NameOp object nodes are defined in ASL
using the "Name ()" function. using the "Name ()" function.
@param [out] OutRdNode Pointer to the first Resource Data element of @param [out] OutRdNode Pointer to the first Resource Data element of
the named object. A Resource Data element the "_CRS" object. A Resource Data element
is stored in a data node. is stored in a data node.
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter. @retval EFI_INVALID_PARAMETER Invalid parameter.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AmlNameOpGetFirstRdNode ( AmlNameOpCrsGetFirstRdNode (
IN AML_OBJECT_NODE_HANDLE NameOpNode, IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
OUT AML_DATA_NODE_HANDLE * OutRdNode OUT AML_DATA_NODE_HANDLE * OutRdNode
); );
@@ -346,14 +347,13 @@ AmlNameOpGetFirstRdNode (
} }
) )
Note: The CurrRdNode Resource Data node must be defined in an object named "_CRS"
"_CRS" names defined as methods are not handled by this function. and defined by a "Name ()" ASL function.
They must be defined as names, using the "Name ()" statement.
@ingroup UserApis @ingroup UserApis
@param [in] CurrRdNode Pointer to the current Resource Data element of @param [in] CurrRdNode Pointer to the current Resource Data element of
the named object. the "_CRS" variable.
@param [out] OutRdNode Pointer to the Resource Data element following @param [out] OutRdNode Pointer to the Resource Data element following
the CurrRdNode. the CurrRdNode.
Contain a NULL pointer if CurrRdNode is the Contain a NULL pointer if CurrRdNode is the
@@ -366,7 +366,7 @@ AmlNameOpGetFirstRdNode (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AmlNameOpGetNextRdNode ( AmlNameOpCrsGetNextRdNode (
IN AML_DATA_NODE_HANDLE CurrRdNode, IN AML_DATA_NODE_HANDLE CurrRdNode,
OUT AML_DATA_NODE_HANDLE * OutRdNode OUT AML_DATA_NODE_HANDLE * OutRdNode
); );
@@ -418,21 +418,36 @@ AmlUpdateRdQWord (
IN UINT64 BaseAddressLength IN UINT64 BaseAddressLength
); );
/** Code generation for the "Interrupt ()" ASL function. /** Add an Interrupt Resource Data node.
This function creates a Resource Data element corresponding to the
"Interrupt ()" ASL function, stores it in an AML Data Node.
It then adds it after the input CurrRdNode in the list of resource data
element.
The Resource Data effectively created is an Extended Interrupt Resource The Resource Data effectively created is an Extended Interrupt Resource
Data. Cf ACPI 6.4: Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
- s6.4.3.6 "Extended Interrupt Descriptor" for more information about Extended Interrupt Resource Data.
- s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"
The created resource data node can be: The Extended Interrupt contains one single interrupt.
- appended to the list of resource data elements of the NameOpNode.
In such case NameOpNode must be defined by a the "Name ()" ASL statement
and initially contain a "ResourceTemplate ()".
- returned through the NewRdNode parameter.
@ingroup CodeGenApis This function allocates memory to create a data node. It is the caller's
responsibility to either:
- attach this node to an AML tree;
- delete this node.
Note: The _CRS node must be defined using the ASL Name () function.
e.g. Name (_CRS, ResourceTemplate () {
...
}
@ingroup UserApis
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
NameOp object nodes are defined in ASL
using the "Name ()" function.
@param [in] ResourceConsumer The device consumes the specified interrupt @param [in] ResourceConsumer The device consumes the specified interrupt
or produces it for use by a child device. or produces it for use by a child device.
@param [in] EdgeTriggered The interrupt is edge triggered or @param [in] EdgeTriggered The interrupt is edge triggered or
@@ -442,12 +457,7 @@ AmlUpdateRdQWord (
devices or not (Exclusive). devices or not (Exclusive).
@param [in] IrqList Interrupt list. Must be non-NULL. @param [in] IrqList Interrupt list. Must be non-NULL.
@param [in] IrqCount Interrupt count. Must be non-zero. @param [in] IrqCount Interrupt count. Must be non-zero.
@param [in] NameOpNode NameOp object node defining a named object.
If provided, append the new resource data node
to the list of resource data elements of this
node.
@param [out] NewRdNode If provided and success,
contain the created node.
@retval EFI_SUCCESS The function completed successfully. @retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter. @retval EFI_INVALID_PARAMETER Invalid parameter.
@@ -455,15 +465,14 @@ AmlUpdateRdQWord (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
AmlCodeGenRdInterrupt ( AmlCodeGenCrsAddRdInterrupt (
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
IN BOOLEAN ResourceConsumer, IN BOOLEAN ResourceConsumer,
IN BOOLEAN EdgeTriggered, IN BOOLEAN EdgeTriggered,
IN BOOLEAN ActiveLow, IN BOOLEAN ActiveLow,
IN BOOLEAN Shared, IN BOOLEAN Shared,
IN UINT32 *IrqList, IN UINT32 * IrqList,
IN UINT8 IrqCount, IN UINT8 IrqCount
IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL
OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL
); );
/** AML code generation for DefinitionBlock. /** AML code generation for DefinitionBlock.
@@ -619,310 +628,4 @@ AmlCodeGenScope (
OUT AML_OBJECT_NODE_HANDLE * NewObjectNode OPTIONAL OUT AML_OBJECT_NODE_HANDLE * NewObjectNode OPTIONAL
); );
/** AML code generation for a method returning a NameString.
AmlCodeGenMethodRetNameString (
"MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode
);
is equivalent of the following ASL code:
Method(MET0, 1, Serialized, 3) {
Return (_CRS)
}
The ASL parameters "ReturnType" and "ParameterTypes" are not asked
in this function. They are optional parameters in ASL.
@ingroup CodeGenApis
@param [in] MethodNameString The new Method's name.
Must be a NULL-terminated ASL NameString
e.g.: "MET0", "_SB.MET0", etc.
The input string is copied.
@param [in] ReturnedNameString The name of the object returned by the
method. Optional parameter, can be:
- NULL (ignored).
- A NULL-terminated ASL NameString.
e.g.: "MET0", "_SB.MET0", etc.
The input string is copied.
@param [in] NumArgs Number of arguments.
Must be 0 <= NumArgs <= 6.
@param [in] IsSerialized TRUE is equivalent to Serialized.
FALSE is equivalent to NotSerialized.
Default is NotSerialized in ASL spec.
@param [in] SyncLevel Synchronization level for the method.
Must be 0 <= SyncLevel <= 15.
Default is 0 in ASL.
@param [in] ParentNode If provided, set ParentNode as the parent
of the node created.
@param [out] NewObjectNode If success, contains the created node.
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
**/
EFI_STATUS
EFIAPI
AmlCodeGenMethodRetNameString (
IN CONST CHAR8 * MethodNameString,
IN CONST CHAR8 * ReturnedNameString, OPTIONAL
IN UINT8 NumArgs,
IN BOOLEAN IsSerialized,
IN UINT8 SyncLevel,
IN AML_NODE_HANDLE ParentNode, OPTIONAL
OUT AML_OBJECT_NODE_HANDLE * NewObjectNode OPTIONAL
);
/** Create a _LPI name.
AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is
equivalent of the following ASL code:
Name (_LPI, Package (
0, // Revision
1, // LevelId
0 // Count
))
This function doesn't define any LPI state. As shown above, the count
of _LPI state is set to 0.
The AmlAddLpiState () function must be used to add LPI states.
Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
@ingroup CodeGenApis
@param [in] LpiNameString The new LPI 's object name.
Must be a NULL-terminated ASL NameString
e.g.: "_LPI", "DEV0.PLPI", etc.
The input string is copied.
@param [in] Revision Revision number of the _LPI states.
@param [in] LevelId A platform defined number that identifies the
level of hierarchy of the processor node to
which the LPI states apply.
@param [in] ParentNode If provided, set ParentNode as the parent
of the node created.
@param [out] NewLpiNode If success, contains the created node.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
**/
EFI_STATUS
EFIAPI
AmlCreateLpiNode (
IN CONST CHAR8 * LpiNameString,
IN UINT16 Revision,
IN UINT64 LevelId,
IN AML_NODE_HANDLE ParentNode, OPTIONAL
OUT AML_OBJECT_NODE_HANDLE * NewLpiNode OPTIONAL
);
/** Add an _LPI state to a LPI node created using AmlCreateLpiNode ().
AmlAddLpiState () increments the Count of LPI states in the LPI node by one,
and adds the following package:
Package() {
MinResidency,
WorstCaseWakeLatency,
Flags,
ArchFlags,
ResCntFreq,
EnableParentState,
(GenericRegisterDescriptor != NULL) ? // Entry method. If a
ResourceTemplate(GenericRegisterDescriptor) : // Register is given,
Integer, // use it. Use the
// Integer otherwise.
ResourceTemplate() { // NULL Residency Counter
Register (SystemMemory, 0, 0, 0, 0)
},
ResourceTemplate() { // NULL Usage Counter
Register (SystemMemory, 0, 0, 0, 0)
},
"" // NULL State Name
},
Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".
@ingroup CodeGenApis
@param [in] MinResidency Minimum Residency.
@param [in] WorstCaseWakeLatency Worst case wake-up latency.
@param [in] Flags Flags.
@param [in] ArchFlags Architectural flags.
@param [in] ResCntFreq Residency Counter Frequency.
@param [in] EnableParentState Enabled Parent State.
@param [in] GenericRegisterDescriptor Entry Method.
If not NULL, use this Register to
describe the entry method address.
@param [in] Integer Entry Method.
If GenericRegisterDescriptor is NULL,
take this value.
@param [in] ResidencyCounterRegister If not NULL, use it to populate the
residency counter register.
@param [in] UsageCounterRegister If not NULL, use it to populate the
usage counter register.
@param [in] StateName If not NULL, use it to populate the
state name.
@param [in] LpiNode Lpi node created with the function
AmlCreateLpiNode to which the new LPI
state is appended.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
**/
EFI_STATUS
EFIAPI
AmlAddLpiState (
IN UINT32 MinResidency,
IN UINT32 WorstCaseWakeLatency,
IN UINT32 Flags,
IN UINT32 ArchFlags,
IN UINT32 ResCntFreq,
IN UINT32 EnableParentState,
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * GenericRegisterDescriptor, OPTIONAL
IN UINT64 Integer, OPTIONAL
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * ResidencyCounterRegister, OPTIONAL
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE * UsageCounterRegister, OPTIONAL
IN CHAR8 * StateName, OPTIONAL
IN AML_OBJECT_NODE_HANDLE LpiNode
);
// DEPRECATED APIS
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
/** DEPRECATED API
Get the first Resource Data element contained in a "_CRS" object.
In the following ASL code, the function will return the Resource Data
node corresponding to the "QWordMemory ()" ASL macro.
Name (_CRS, ResourceTemplate() {
QWordMemory (...) {...},
Interrupt (...) {...}
}
)
Note:
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
- "_CRS" declared using ASL "Method (Declare Control Method)" is not
supported.
@ingroup UserApis
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
NameOp object nodes are defined in ASL
using the "Name ()" function.
@param [out] OutRdNode Pointer to the first Resource Data element of
the "_CRS" object. A Resource Data element
is stored in a data node.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlNameOpCrsGetFirstRdNode (
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
OUT AML_DATA_NODE_HANDLE * OutRdNode
);
/** DEPRECATED API
Get the Resource Data element following the CurrRdNode Resource Data.
In the following ASL code, if CurrRdNode corresponds to the first
"QWordMemory ()" ASL macro, the function will return the Resource Data
node corresponding to the "Interrupt ()" ASL macro.
Name (_CRS, ResourceTemplate() {
QwordMemory (...) {...},
Interrupt (...) {...}
}
)
The CurrRdNode Resource Data node must be defined in an object named "_CRS"
and defined by a "Name ()" ASL function.
@ingroup UserApis
@param [in] CurrRdNode Pointer to the current Resource Data element of
the "_CRS" variable.
@param [out] OutRdNode Pointer to the Resource Data element following
the CurrRdNode.
Contain a NULL pointer if CurrRdNode is the
last Resource Data element in the list.
The "End Tag" is not considered as a resource
data element and is not returned.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlNameOpCrsGetNextRdNode (
IN AML_DATA_NODE_HANDLE CurrRdNode,
OUT AML_DATA_NODE_HANDLE * OutRdNode
);
/** DEPRECATED API
Add an Interrupt Resource Data node.
This function creates a Resource Data element corresponding to the
"Interrupt ()" ASL function, stores it in an AML Data Node.
It then adds it after the input CurrRdNode in the list of resource data
element.
The Resource Data effectively created is an Extended Interrupt Resource
Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor"
for more information about Extended Interrupt Resource Data.
The Extended Interrupt contains one single interrupt.
This function allocates memory to create a data node. It is the caller's
responsibility to either:
- attach this node to an AML tree;
- delete this node.
Note: The _CRS node must be defined using the ASL Name () function.
e.g. Name (_CRS, ResourceTemplate () {
...
}
@ingroup CodeGenApis
@param [in] NameOpCrsNode NameOp object node defining a "_CRS" object.
Must have an OpCode=AML_NAME_OP, SubOpCode=0.
NameOp object nodes are defined in ASL
using the "Name ()" function.
@param [in] ResourceConsumer The device consumes the specified interrupt
or produces it for use by a child device.
@param [in] EdgeTriggered The interrupt is edge triggered or
level triggered.
@param [in] ActiveLow The interrupt is active-high or active-low.
@param [in] Shared The interrupt can be shared with other
devices or not (Exclusive).
@param [in] IrqList Interrupt list. Must be non-NULL.
@param [in] IrqCount Interrupt count. Must be non-zero.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_OUT_OF_RESOURCES Could not allocate memory.
**/
EFI_STATUS
EFIAPI
AmlCodeGenCrsAddRdInterrupt (
IN AML_OBJECT_NODE_HANDLE NameOpCrsNode,
IN BOOLEAN ResourceConsumer,
IN BOOLEAN EdgeTriggered,
IN BOOLEAN ActiveLow,
IN BOOLEAN Shared,
IN UINT32 * IrqList,
IN UINT8 IrqCount
);
#endif // DISABLE_NEW_DEPRECATED_INTERFACES
#endif // AML_LIB_H_ #endif // AML_LIB_H_

View File

@@ -12,7 +12,17 @@
#ifndef TABLE_HELPER_LIB_H_ #ifndef TABLE_HELPER_LIB_H_
#define TABLE_HELPER_LIB_H_ #define TABLE_HELPER_LIB_H_
#include <Library/AmlLib/AmlLib.h> /** Is a character upper case
*/
#define IS_UPPER_CHAR(x) ((x >= 'A') && (x <= 'Z'))
/** Is a character a decimal digit
*/
#define IS_DIGIT(x) ((x >= '0') && (x <= '9'))
/** Is a character an upper case hexadecimal digit
*/
#define IS_UPPER_HEX(x) (((x >= 'A') && (x <= 'F')) || IS_DIGIT (x))
/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO /** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
object from the Configuration Manager. object from the Configuration Manager.
@@ -64,39 +74,6 @@ AddAcpiHeader (
IN CONST UINT32 Length IN CONST UINT32 Length
); );
/** Build a RootNode containing SSDT ACPI header information using the AmlLib.
The function utilizes the ACPI table Generator and the Configuration
Manager protocol to obtain any information required for constructing the
header. It then creates a RootNode. The SSDT ACPI header is part of the
RootNode.
This is essentially a wrapper around AmlCodeGenDefinitionBlock ()
from the AmlLib.
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
protocol interface.
@param [in] Generator Pointer to the ACPI table Generator.
@param [in] AcpiTableInfo Pointer to the ACPI table info structure.
@param [out] RootNode If success, contains the created RootNode.
The SSDT ACPI header is part of the RootNode.
@retval EFI_SUCCESS Success.
@retval EFI_INVALID_PARAMETER A parameter is invalid.
@retval EFI_NOT_FOUND The required object information is not found.
@retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration
Manager is less than the Object size for the
requested object.
**/
EFI_STATUS
EFIAPI
AddSsdtAcpiHeader (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
IN CONST ACPI_TABLE_GENERATOR * CONST Generator,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
OUT AML_ROOT_NODE_HANDLE * RootNode
);
/** /**
Function prototype for testing if two arbitrary objects are equal. Function prototype for testing if two arbitrary objects are equal.
@@ -142,14 +119,41 @@ FindDuplicateValue (
IN PFN_IS_EQUAL EqualTestFunction IN PFN_IS_EQUAL EqualTestFunction
); );
/** Parse and print a CmObjDesc. /** Convert a hex number to its ASCII code.
@param [in] CmObjDesc The CmObjDesc to parse and print. @param [in] x Hex number to convert.
Must be 0 <= x < 16.
@return The ASCII code corresponding to x.
**/ **/
VOID UINT8
EFIAPI EFIAPI
ParseCmObjDesc ( AsciiFromHex (
IN CONST CM_OBJ_DESCRIPTOR * CmObjDesc IN UINT8 x
);
/** Check if a HID is a valid PNP ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid PNP ID.
@retval FALSE The Hid is not a valid PNP ID.
**/
BOOLEAN
IsValidPnpId (
IN CONST CHAR8 * Hid
);
/** Check if a HID is a valid ACPI ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid ACPI ID.
@retval FALSE The Hid is not a valid ACPI ID.
**/
BOOLEAN
IsValidAcpiId (
IN CONST CHAR8 * Hid
); );
#endif // TABLE_HELPER_LIB_H_ #endif // TABLE_HELPER_LIB_H_

View File

@@ -1,11 +1,11 @@
/** @file /** @file
FADT Table Generator FADT Table Generator
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved. Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s): @par Reference(s):
- ACPI 6.4 Specification, January 2021 - ACPI 6.3 Specification, January 2019
**/ **/
@@ -32,8 +32,8 @@ Requirements:
/** This macro defines the FADT flag options for ARM Platforms. /** This macro defines the FADT flag options for ARM Platforms.
*/ */
#define FADT_FLAGS (EFI_ACPI_6_4_HW_REDUCED_ACPI | \ #define FADT_FLAGS (EFI_ACPI_6_3_HW_REDUCED_ACPI | \
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
/** This macro defines the valid mask for the FADT flag option /** This macro defines the valid mask for the FADT flag option
if HW_REDUCED_ACPI flag in the table is set. if HW_REDUCED_ACPI flag in the table is set.
@@ -42,47 +42,47 @@ Requirements:
22-31 (reserved). 22-31 (reserved).
Valid bits are: Valid bits are:
EFI_ACPI_6_4_WBINVD BIT0 EFI_ACPI_6_3_WBINVD BIT0
EFI_ACPI_6_4_PWR_BUTTON BIT4 EFI_ACPI_6_3_PWR_BUTTON BIT4
EFI_ACPI_6_4_SLP_BUTTON BIT5 EFI_ACPI_6_3_SLP_BUTTON BIT5
EFI_ACPI_6_4_FIX_RTC BIT6 EFI_ACPI_6_3_FIX_RTC BIT6
EFI_ACPI_6_4_DCK_CAP BIT9 EFI_ACPI_6_3_DCK_CAP BIT9
EFI_ACPI_6_4_RESET_REG_SUP BIT10 EFI_ACPI_6_3_RESET_REG_SUP BIT10
EFI_ACPI_6_4_SEALED_CASE BIT11 EFI_ACPI_6_3_SEALED_CASE BIT11
EFI_ACPI_6_4_HEADLESS BIT12 EFI_ACPI_6_3_HEADLESS BIT12
EFI_ACPI_6_4_USE_PLATFORM_CLOCK BIT15 EFI_ACPI_6_3_USE_PLATFORM_CLOCK BIT15
EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL BIT18 EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL BIT18
EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19 EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE BIT19
EFI_ACPI_6_4_HW_REDUCED_ACPI BIT20 EFI_ACPI_6_3_HW_REDUCED_ACPI BIT20
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE BIT21 EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE BIT21
*/ */
#define VALID_HARDWARE_REDUCED_FLAG_MASK ( \ #define VALID_HARDWARE_REDUCED_FLAG_MASK ( \
EFI_ACPI_6_4_WBINVD | \ EFI_ACPI_6_3_WBINVD | \
EFI_ACPI_6_4_PWR_BUTTON | \ EFI_ACPI_6_3_PWR_BUTTON | \
EFI_ACPI_6_4_SLP_BUTTON | \ EFI_ACPI_6_3_SLP_BUTTON | \
EFI_ACPI_6_4_FIX_RTC | \ EFI_ACPI_6_3_FIX_RTC | \
EFI_ACPI_6_4_DCK_CAP | \ EFI_ACPI_6_3_DCK_CAP | \
EFI_ACPI_6_4_RESET_REG_SUP | \ EFI_ACPI_6_3_RESET_REG_SUP | \
EFI_ACPI_6_4_SEALED_CASE | \ EFI_ACPI_6_3_SEALED_CASE | \
EFI_ACPI_6_4_HEADLESS | \ EFI_ACPI_6_3_HEADLESS | \
EFI_ACPI_6_4_USE_PLATFORM_CLOCK | \ EFI_ACPI_6_3_USE_PLATFORM_CLOCK | \
EFI_ACPI_6_4_FORCE_APIC_CLUSTER_MODEL | \ EFI_ACPI_6_3_FORCE_APIC_CLUSTER_MODEL | \
EFI_ACPI_6_4_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \ EFI_ACPI_6_3_FORCE_APIC_PHYSICAL_DESTINATION_MODE | \
EFI_ACPI_6_4_HW_REDUCED_ACPI | \ EFI_ACPI_6_3_HW_REDUCED_ACPI | \
EFI_ACPI_6_4_LOW_POWER_S0_IDLE_CAPABLE) EFI_ACPI_6_3_LOW_POWER_S0_IDLE_CAPABLE)
#pragma pack(1) #pragma pack(1)
/** The AcpiFadt is a template EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE /** The AcpiFadt is a template EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE
structure used for generating the FADT Table. structure used for generating the FADT Table.
Note: fields marked with "{Template}" will be updated dynamically. Note: fields marked with "{Template}" will be updated dynamically.
*/ */
STATIC STATIC
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = { EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
ACPI_HEADER ( ACPI_HEADER (
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE, EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE,
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION
), ),
// UINT32 FirmwareCtrl // UINT32 FirmwareCtrl
0, 0,
@@ -91,7 +91,7 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
// UINT8 Reserved0 // UINT8 Reserved0
EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE,
// UINT8 PreferredPmProfile // UINT8 PreferredPmProfile
EFI_ACPI_6_4_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile EFI_ACPI_6_3_PM_PROFILE_UNSPECIFIED, // {Template}: Power Management Profile
// UINT16 SciInt // UINT16 SciInt
0, 0,
// UINT32 SmiCmd // UINT32 SmiCmd
@@ -160,37 +160,37 @@ EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
0, 0,
// UINT32 Flags // UINT32 Flags
FADT_FLAGS, FADT_FLAGS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE ResetReg // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE ResetReg
NULL_GAS, NULL_GAS,
// UINT8 ResetValue // UINT8 ResetValue
0, 0,
// UINT16 ArmBootArch // UINT16 ArmBootArch
EFI_ACPI_6_4_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags EFI_ACPI_6_3_ARM_PSCI_COMPLIANT, // {Template}: ARM Boot Architecture Flags
// UINT8 MinorRevision // UINT8 MinorRevision
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION,
// UINT64 XFirmwareCtrl // UINT64 XFirmwareCtrl
0, 0,
// UINT64 XDsdt // UINT64 XDsdt
0, 0,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe0Blk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XGpe0Blk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE XGpe1Blk // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE XGpe1Blk
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepControlReg // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE SleepControlReg
NULL_GAS, NULL_GAS,
// EFI_ACPI_6_4_GENERIC_ADDRESS_STRUCTURE SleepStatusReg // EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE SleepStatusReg
NULL_GAS, NULL_GAS,
// UINT64 HypervisorVendorIdentity // UINT64 HypervisorVendorIdentity
EFI_ACPI_RESERVED_QWORD // {Template}: Hypervisor Vendor ID EFI_ACPI_RESERVED_QWORD // {Template}: Hypervisor Vendor ID
@@ -532,7 +532,7 @@ BuildFadtTable (
This, This,
(EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt, (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
AcpiTableInfo, AcpiTableInfo,
sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE) sizeof (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE)
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG (( DEBUG ((
@@ -614,9 +614,9 @@ ACPI_TABLE_GENERATOR FadtGenerator = {
// Generator Description // Generator Description
L"ACPI.STD.FADT.GENERATOR", L"ACPI.STD.FADT.GENERATOR",
// ACPI Table Signature // ACPI Table Signature
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
// ACPI Table Revision supported by this Generator // ACPI Table Revision supported by this Generator
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
// Minimum supported ACPI Table Revision // Minimum supported ACPI Table Revision
EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
// Creator ID // Creator ID

View File

@@ -1,11 +1,11 @@
/** @file /** @file
GTDT Table Generator GTDT Table Generator
Copyright (c) 2017 - 2021, ARM Limited. All rights reserved. Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s): @par Reference(s):
- ACPI 6.4 Specification - January 2021 - ACPI 6.3 Specification - January 2019
**/ **/
@@ -41,7 +41,7 @@ GET_OBJECT_LIST (
CM_ARM_GENERIC_TIMER_INFO CM_ARM_GENERIC_TIMER_INFO
); );
/** This macro expands to a function that retrieves the Arm Generic /** This macro expands to a function that retrieves the SBSA Generic
Watchdog Timer Information from the Configuration Manager. Watchdog Timer Information from the Configuration Manager.
*/ */
GET_OBJECT_LIST ( GET_OBJECT_LIST (
@@ -91,7 +91,7 @@ EFI_STATUS
EFIAPI EFIAPI
AddGenericTimerInfo ( AddGenericTimerInfo (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
IN CONST UINT32 PlatformTimerCount, IN CONST UINT32 PlatformTimerCount,
IN CONST UINT32 AcpiTableRevision IN CONST UINT32 AcpiTableRevision
) )
@@ -133,7 +133,7 @@ AddGenericTimerInfo (
GenericTimerInfo->CounterReadBaseAddress; GenericTimerInfo->CounterReadBaseAddress;
Gtdt->PlatformTimerCount = PlatformTimerCount; Gtdt->PlatformTimerCount = PlatformTimerCount;
Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 : Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE); sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) { if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV; Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
@@ -143,7 +143,7 @@ AddGenericTimerInfo (
return Status; return Status;
} }
/** Add the Arm Generic Watchdog Timers to the GTDT table. /** Add the SBSA Generic Watchdog Timers to the GTDT table.
@param [in] Gtdt Pointer to the GTDT Table. @param [in] Gtdt Pointer to the GTDT Table.
@param [in] WatchdogOffset Offset to the watchdog information in the @param [in] WatchdogOffset Offset to the watchdog information in the
@@ -154,26 +154,26 @@ AddGenericTimerInfo (
STATIC STATIC
VOID VOID
AddGenericWatchdogList ( AddGenericWatchdogList (
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
IN CONST UINT32 WatchdogOffset, IN CONST UINT32 WatchdogOffset,
IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList, IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList,
IN UINT32 WatchdogCount IN UINT32 WatchdogCount
) )
{ {
EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE * Watchdog; EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
ASSERT (Gtdt != NULL); ASSERT (Gtdt != NULL);
ASSERT (WatchdogInfoList != NULL); ASSERT (WatchdogInfoList != NULL);
Watchdog = (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *) Watchdog = (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE *)
((UINT8*)Gtdt + WatchdogOffset); ((UINT8*)Gtdt + WatchdogOffset);
while (WatchdogCount-- != 0) { while (WatchdogCount-- != 0) {
// Add watchdog entry // Add watchdog entry
DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog)); DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG; Watchdog->Type = EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG;
Watchdog->Length = Watchdog->Length =
sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE); sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE);
Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE; Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
Watchdog->RefreshFramePhysicalAddress = Watchdog->RefreshFramePhysicalAddress =
WatchdogInfoList->RefreshFrameAddress; WatchdogInfoList->RefreshFrameAddress;
@@ -249,7 +249,7 @@ IsGtFrameNumberEqual (
STATIC STATIC
EFI_STATUS EFI_STATUS
AddGTBlockTimerFrames ( AddGTBlockTimerFrames (
IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame, IN EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList, IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList,
IN UINT32 GTBlockFrameCount IN UINT32 GTBlockFrameCount
) )
@@ -329,15 +329,15 @@ STATIC
EFI_STATUS EFI_STATUS
AddGTBlockList ( AddGTBlockList (
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt, IN EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
IN CONST UINT32 GTBlockOffset, IN CONST UINT32 GTBlockOffset,
IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo, IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo,
IN UINT32 BlockTimerCount IN UINT32 BlockTimerCount
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE * GTBlock; EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame; EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList; CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList;
UINT32 GTBlockTimerFrameCount; UINT32 GTBlockTimerFrameCount;
UINTN Length; UINTN Length;
@@ -345,7 +345,7 @@ AddGTBlockList (
ASSERT (Gtdt != NULL); ASSERT (Gtdt != NULL);
ASSERT (GTBlockInfo != NULL); ASSERT (GTBlockInfo != NULL);
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt + GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
GTBlockOffset); GTBlockOffset);
while (BlockTimerCount-- != 0) { while (BlockTimerCount-- != 0) {
@@ -367,8 +367,8 @@ AddGTBlockList (
return Status; return Status;
} }
Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) + Length = sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) +
(sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) * (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
GTBlockInfo->GTBlockTimerFrameCount); GTBlockInfo->GTBlockTimerFrameCount);
// Check that the length of the GT block does not // Check that the length of the GT block does not
@@ -386,15 +386,15 @@ AddGTBlockList (
return Status; return Status;
} }
GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK; GTBlock->Type = EFI_ACPI_6_3_GTDT_GT_BLOCK;
GTBlock->Length = (UINT16)Length; GTBlock->Length = (UINT16)Length;
GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE; GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress; GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount; GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
GTBlock->GTBlockTimerOffset = GTBlock->GTBlockTimerOffset =
sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE); sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE);
GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE*) GtBlockFrame = (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset); ((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
// Add GT Block Timer frames // Add GT Block Timer frames
@@ -413,7 +413,7 @@ AddGTBlockList (
} }
// Next GTBlock // Next GTBlock
GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock + GTBlock = (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
GTBlock->Length); GTBlock->Length);
GTBlockInfo++; GTBlockInfo++;
}// for }// for
@@ -460,7 +460,7 @@ BuildGtdtTable (
UINT32 BlockTimerCount; UINT32 BlockTimerCount;
CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList; CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList;
CM_ARM_GTBLOCK_INFO * GTBlockInfo; CM_ARM_GTBLOCK_INFO * GTBlockInfo;
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt; EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
UINT32 Idx; UINT32 Idx;
UINT32 GTBlockOffset; UINT32 GTBlockOffset;
UINT32 WatchdogOffset; UINT32 WatchdogOffset;
@@ -527,11 +527,11 @@ BuildGtdtTable (
// Calculate the GTDT Table Size // Calculate the GTDT Table Size
PlatformTimerCount = 0; PlatformTimerCount = 0;
TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE); TableSize = sizeof (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE);
if (BlockTimerCount != 0) { if (BlockTimerCount != 0) {
GTBlockOffset = TableSize; GTBlockOffset = TableSize;
PlatformTimerCount += BlockTimerCount; PlatformTimerCount += BlockTimerCount;
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) * TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_STRUCTURE) *
BlockTimerCount); BlockTimerCount);
for (Idx = 0; Idx < BlockTimerCount; Idx++) { for (Idx = 0; Idx < BlockTimerCount; Idx++) {
@@ -546,7 +546,7 @@ BuildGtdtTable (
)); ));
goto error_handler; goto error_handler;
} }
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) * TableSize += (sizeof (EFI_ACPI_6_3_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
GTBlockInfo[Idx].GTBlockTimerFrameCount); GTBlockInfo[Idx].GTBlockTimerFrameCount);
} }
@@ -562,7 +562,7 @@ BuildGtdtTable (
if (WatchdogCount != 0) { if (WatchdogCount != 0) {
WatchdogOffset = TableSize; WatchdogOffset = TableSize;
PlatformTimerCount += WatchdogCount; PlatformTimerCount += WatchdogCount;
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) * TableSize += (sizeof (EFI_ACPI_6_3_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE) *
WatchdogCount); WatchdogCount);
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
@@ -585,7 +585,7 @@ BuildGtdtTable (
goto error_handler; goto error_handler;
} }
Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table; Gtdt = (EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"GTDT: Gtdt = 0x%p TableSize = 0x%x\n", "GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
@@ -712,9 +712,9 @@ ACPI_TABLE_GENERATOR GtdtGenerator = {
// Generator Description // Generator Description
L"ACPI.STD.GTDT.GENERATOR", L"ACPI.STD.GTDT.GENERATOR",
// ACPI Table Signature // ACPI Table Signature
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
// ACPI Table Revision supported by this Generator // ACPI Table Revision supported by this Generator
EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION, EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
// Minimum ACPI Table Revision supported by this Generator // Minimum ACPI Table Revision supported by this Generator
EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
// Creator ID // Creator ID

View File

@@ -10,19 +10,21 @@
- Generic ACPI for Arm Components 1.0 Platform Design Document - Generic ACPI for Arm Components 1.0 Platform Design Document
**/ **/
#include <IndustryStandard/DebugPort2Table.h>
#include <Library/AcpiLib.h> #include <Library/AcpiLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/AcpiTable.h> #include <Protocol/AcpiTable.h>
// Module specific include files. // Module specific include files.
#include <AcpiTableGenerator.h> #include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h> #include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h> #include <ConfigurationManagerHelper.h>
#include <Library/AcpiHelperLib.h>
#include <Library/AmlLib/AmlLib.h> #include <Library/AmlLib/AmlLib.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h> #include <Protocol/ConfigurationManagerProtocol.h>
#include "SsdtCmn600Generator.h" #include "SsdtCmn600Generator.h"
@@ -284,7 +286,7 @@ FixupCmn600Info (
// Get the first Rd node in the "_CRS" object. // Get the first Rd node in the "_CRS" object.
// This is the PERIPHBASE node. // This is the PERIPHBASE node.
Status = AmlNameOpGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode); Status = AmlNameOpCrsGetFirstRdNode (NameOpCrsNode, &CmnPeriphBaseRdNode);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto error_handler; goto error_handler;
} }
@@ -307,7 +309,7 @@ FixupCmn600Info (
// Get the QWord node corresponding to the ROOTNODEBASE. // Get the QWord node corresponding to the ROOTNODEBASE.
// It is the second Resource Data element in the BufferNode's // It is the second Resource Data element in the BufferNode's
// variable list of arguments. // variable list of arguments.
Status = AmlNameOpGetNextRdNode ( Status = AmlNameOpCrsGetNextRdNode (
CmnPeriphBaseRdNode, CmnPeriphBaseRdNode,
&CmnRootNodeBaseRdNode &CmnRootNodeBaseRdNode
); );
@@ -336,8 +338,8 @@ FixupCmn600Info (
// Resource Data nodes. // Resource Data nodes.
for (Index = 0; Index < Cmn600Info->DtcCount; Index++) { for (Index = 0; Index < Cmn600Info->DtcCount; Index++) {
DtcInt = &Cmn600Info->DtcInterrupt[Index]; DtcInt = &Cmn600Info->DtcInterrupt[Index];
Status = AmlCodeGenCrsAddRdInterrupt (
Status = AmlCodeGenRdInterrupt ( NameOpCrsNode,
((DtcInt->Flags & ((DtcInt->Flags &
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) != 0), EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) != 0),
((DtcInt->Flags & ((DtcInt->Flags &
@@ -347,9 +349,7 @@ FixupCmn600Info (
((DtcInt->Flags & ((DtcInt->Flags &
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0), EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0),
(UINT32*)&DtcInt->Interrupt, (UINT32*)&DtcInt->Interrupt,
1, 1
NameOpCrsNode,
NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto error_handler; goto error_handler;

View File

@@ -1,7 +1,7 @@
## @file ## @file
# Ssdt CMN-600 Table Generator # Ssdt CMN-600 Table Generator
# #
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR> # Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
## ##
@@ -29,7 +29,6 @@
DynamicTablesPkg/DynamicTablesPkg.dec DynamicTablesPkg/DynamicTablesPkg.dec
[LibraryClasses] [LibraryClasses]
AcpiHelperLib
AmlLib AmlLib
BaseLib BaseLib

View File

@@ -1,134 +0,0 @@
/** @file
SSDT Cpu Topology Table Generator.
Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s):
- ACPI 6.3 Specification - January 2019 - s8.4 Declaring Processors
**/
#ifndef SSDT_CPU_TOPOLOGY_GENERATOR_H_
#define SSDT_CPU_TOPOLOGY_GENERATOR_H_
#pragma pack(1)
// Mask for the flags that need to be checked.
#define PPTT_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
// Mask for the cpu flags.
#define PPTT_CPU_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
// Mask for the cluster flags.
// Even though a _UID is generated for clusters, it is simpler to use
// EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID and to not match the cluster id of
// the PPTT table (not sure the PPTT table is generated).
#define PPTT_CLUSTER_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF << 3))
/** LPI states are stored in the ASL namespace at '\_SB_.Lxxx',
with xxx being the node index of the LPI state.
*/
#define SB_SCOPE "\\_SB_"
#define SB_SCOPE_PREFIX SB_SCOPE "."
/// Size of the SB_SCOPE_PREFIX string.
#define SB_SCOPE_PREFIX_SIZE sizeof (SB_SCOPE_PREFIX)
/// HID for a processor device.
#define ACPI_HID_PROCESSOR_DEVICE "ACPI0007"
/// HID for a processor container device.
#define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010"
/** Node names of Cpus and Clusters are 'Cxxx', and 'Lxxx' for LPI states.
The 'xxx' is an index on 12 bits is given to node name,
thus the limitation in the number of nodes.
*/
#define MAX_NODE_COUNT (1 << 12)
/** A structure used to handle the Lpi structures referencing.
A CM_ARM_PROC_HIERARCHY_INFO structure references a CM_ARM_OBJ_REF.
This CM_ARM_OBJ_REF references CM_ARM_LPI_INFO structures.
Example:
(Cpu0) (Cpu1)
CM_ARM_PROC_HIERARCHY_INFO CM_ARM_PROC_HIERARCHY_INFO
| |
+----------------------------------------
|
v
(List of references to Lpi states)
CM_ARM_OBJ_REF
|
+----------------------------------------
| |
v v
(A first Lpi state) (A second Lpi state)
CM_ARM_LPI_INFO[0] CM_ARM_LPI_INFO[1]
Here, Cpu0 and Cpu1 have the same Lpi states. Both CM_ARM_PROC_HIERARCHY_INFO
structures reference the same CM_ARM_OBJ_REF. An entry is created in the
TokenTable such as:
0 <-> CM_ARM_OBJ_REF
This will lead to the creation of this pseudo-ASL code where Cpu0 and Cpu1
return the same object at \_SB.L000:
Scope (\_SB) {
Device (C000) {
[...]
Method (_LPI) {
Return (\_SB.L000)
}
} // C000
Device (C001) {
[...]
Method (_LPI) {
Return (\_SB.L000)
}
} // C001
// Lpi states
Name (L000, Package (0x05) {
[...]
}
}
*/
typedef struct TokenTable {
/// TokenTable, a table allowing to map:
/// Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures).
CM_OBJECT_TOKEN * Table;
/// Last used index of the TokenTable.
/// LastIndex is bound by ProcNodeCount.
UINT32 LastIndex;
} TOKEN_TABLE;
/** A structure holding the Cpu topology generator and additional private data.
*/
typedef struct AcpiCpuTopologyGenerator {
/// ACPI Table generator header
ACPI_TABLE_GENERATOR Header;
// Private fields are defined from here.
/// Private object used to handle token referencing.
TOKEN_TABLE TokenTable;
/// List of CM_ARM_PROC_HIERARCHY_INFO CM objects.
CM_ARM_PROC_HIERARCHY_INFO * ProcNodeList;
/// Count of CM_ARM_PROC_HIERARCHY_INFO CM objects.
UINT32 ProcNodeCount;
} ACPI_CPU_TOPOLOGY_GENERATOR;
#pragma pack()
#endif // SSDT_CPU_TOPOLOGY_GENERATOR_H_

View File

@@ -1,33 +0,0 @@
## @file
# Ssdt Cpu Topology Table Generator
#
# Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
[Defines]
INF_VERSION = 0x0001001B
BASE_NAME = SsdtCpuTopologyLibArm
FILE_GUID = F2835EB6-4B05-48D4-A475-147DA0F3755C
VERSION_STRING = 1.0
MODULE_TYPE = DXE_DRIVER
LIBRARY_CLASS = NULL|DXE_DRIVER
CONSTRUCTOR = AcpiSsdtCpuTopologyLibConstructor
DESTRUCTOR = AcpiSsdtCpuTopologyLibDestructor
[Sources]
SsdtCpuTopologyGenerator.c
SsdtCpuTopologyGenerator.h
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
DynamicTablesPkg/DynamicTablesPkg.dec
[LibraryClasses]
AcpiHelperLib
AmlLib
BaseLib

View File

@@ -6,19 +6,21 @@
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
#include <IndustryStandard/DebugPort2Table.h>
#include <Library/AcpiLib.h> #include <Library/AcpiLib.h>
#include <Library/BaseLib.h> #include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/AcpiTable.h> #include <Protocol/AcpiTable.h>
// Module specific include files. // Module specific include files.
#include <AcpiTableGenerator.h> #include <AcpiTableGenerator.h>
#include <ConfigurationManagerObject.h> #include <ConfigurationManagerObject.h>
#include <ConfigurationManagerHelper.h> #include <ConfigurationManagerHelper.h>
#include <Library/AcpiHelperLib.h>
#include <Library/SsdtSerialPortFixupLib.h> #include <Library/SsdtSerialPortFixupLib.h>
#include <Library/TableHelperLib.h>
#include <Protocol/ConfigurationManagerProtocol.h> #include <Protocol/ConfigurationManagerProtocol.h>
/** ARM standard SSDT Serial Port Table Generator /** ARM standard SSDT Serial Port Table Generator

View File

@@ -1,7 +1,7 @@
## @file ## @file
# Ssdt Serial Port Table Generator # Ssdt Serial Port Table Generator
# #
# Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR> # Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
# #
# SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-License-Identifier: BSD-2-Clause-Patent
## ##
@@ -27,7 +27,7 @@
DynamicTablesPkg/DynamicTablesPkg.dec DynamicTablesPkg/DynamicTablesPkg.dec
[LibraryClasses] [LibraryClasses]
AcpiHelperLib
AmlLib AmlLib
BaseLib BaseLib
TableHelperLib
SsdtSerialPortFixupLib SsdtSerialPortFixupLib

View File

@@ -1,210 +0,0 @@
/** @file
Acpi Helper
Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
// Module specific include files.
#include <Library/AcpiHelperLib.h>
/** Convert a hex number to its ASCII code.
@param [in] Hex Hex number to convert.
Must be 0 <= x < 16.
@return The ASCII code corresponding to x.
-1 if error.
**/
UINT8
EFIAPI
AsciiFromHex (
IN UINT8 Hex
)
{
if (Hex < 10) {
return (UINT8)(Hex + '0');
}
if (Hex < 16) {
return (UINT8)(Hex - 10 + 'A');
}
ASSERT (FALSE);
return (UINT8)-1;
}
/** Convert an ASCII char representing an hexadecimal number
to its integer value.
@param [in] Char Char to convert.
Must be between '0'-'9' or 'A'-'F' or 'a'-'f'.
@return The corresponding integer (between 0-16).
-1 if error.
**/
UINT8
EFIAPI
HexFromAscii (
IN CHAR8 Char
)
{
if ((Char >= '0') && (Char <= '9')) {
return (UINT8)(Char - '0');
}
if ((Char >= 'A') && (Char <= 'F')) {
return (UINT8)(Char - 'A' + 10);
}
if ((Char >= 'a') && (Char <= 'f')) {
return (UINT8)(Char - 'a' + 10);
}
ASSERT (FALSE);
return (UINT8)-1;
}
/** Check if a HID is a valid PNP ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid PNP ID.
@retval FALSE The Hid is not a valid PNP ID.
**/
BOOLEAN
IsValidPnpId (
IN CONST CHAR8 * Hid
)
{
UINTN Index;
if (AsciiStrLen (Hid) != 7) {
return FALSE;
}
// A valid PNP ID must be of the form "AAA####"
// where A is an uppercase letter and # is a hex digit.
for (Index = 0; Index < 3; Index++) {
if (!IS_UPPER_CHAR (Hid[Index])) {
return FALSE;
}
}
for (Index = 3; Index < 7; Index++) {
if (!IS_UPPER_HEX (Hid[Index])) {
return FALSE;
}
}
return TRUE;
}
/** Check if a HID is a valid ACPI ID.
@param [in] Hid The Hid to validate.
@retval TRUE The Hid is a valid ACPI ID.
@retval FALSE The Hid is not a valid ACPI ID.
**/
BOOLEAN
IsValidAcpiId (
IN CONST CHAR8 * Hid
)
{
UINTN Index;
if (AsciiStrLen (Hid) != 8) {
return FALSE;
}
// A valid ACPI ID must be of the form "NNNN####"
// where N is an uppercase letter or a digit ('0'-'9')
// and # is a hex digit.
for (Index = 0; Index < 4; Index++) {
if (!(IS_UPPER_CHAR (Hid[Index]) || IS_DIGIT (Hid[Index]))) {
return FALSE;
}
}
for (Index = 4; Index < 8; Index++) {
if (!IS_UPPER_HEX (Hid[Index])) {
return FALSE;
}
}
return TRUE;
}
/** Convert a EisaId string to its compressed UINT32 equivalent.
Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
@param [in] EisaIdStr Input EisaId string.
@param [out] EisaIdInt Output EisaId UINT32 (compressed).
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlGetEisaIdFromString (
IN CONST CHAR8 * EisaIdStr,
OUT UINT32 * EisaIdInt
)
{
if ((EisaIdStr == NULL) ||
(!IsValidPnpId (EisaIdStr)) ||
(EisaIdInt == NULL)) {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
/* Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid"
Converts and compresses the 7-character text argument into its corresponding
4-byte numeric EISA ID encoding (Integer). This can be used when declaring
IDs for devices that are EISA IDs.
The algorithm used to convert the TextID is as shown in the following
example:
Starting with a seven character input string "PNP0303", we want to create
a DWordConst. This string contains a three character manufacturer code
"PNP", a three character hex product identifier "030", and a one character
revision identifier "3".
The compressed manufacturer code is created as follows:
1) Find hex ASCII value for each letter
2) Subtract 40h from each ASCII value
3) Retain 5 least significant bits for each letter and discard remaining
0's:
Byte 0:
Bit 7: reserved (0)
Bit 6-2: 1st character of compressed mfg code "P"
Bit 1-0: Upper 2 bits of 2nd character of mfg code "N"
Byte 1:
Bit 7-5: Lower 3 bits of 2nd character of mfg code "N"
Bit 4-0: 3rd character of mfg code "P"
Byte 2:
Bit 7-4: 1st hex digit of product number "0"
Bit 3-0: 2nd hex digit of product number "3"
Byte 3:
Bit 7-4: 3rd hex digit of product number "0"
Bit 3-0: 4th hex digit of product number "3"
*/
*EisaIdInt = SwapBytes32 (
((EisaIdStr[0] - 0x40) << 26) |
((EisaIdStr[1] - 0x40) << 21) |
((EisaIdStr[2] - 0x40) << 16) |
(HexFromAscii (EisaIdStr[3]) << 12) |
(HexFromAscii (EisaIdStr[4]) << 8) |
(HexFromAscii (EisaIdStr[5]) << 4) |
(HexFromAscii (EisaIdStr[6]))
);
return EFI_SUCCESS;
}

View File

@@ -1,25 +0,0 @@
## @file
# Acpi Helper
#
# Copyright (c) 2021, ARM Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
[Defines]
INF_VERSION = 0x0001001B
BASE_NAME = AcpiHelperLib
FILE_GUID = 45968FB4-A724-46FC-822D-F9E557601F9B
VERSION_STRING = 1.0
MODULE_TYPE = DXE_DRIVER
LIBRARY_CLASS = AcpiHelperLib
[Sources]
AcpiHelper.c
[Packages]
MdePkg/MdePkg.dec
DynamicTablesPkg/DynamicTablesPkg.dec
[LibraryClasses]
BaseLib

View File

@@ -2,7 +2,7 @@
AML Print Function. AML Print Function.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR> Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@@ -199,7 +199,7 @@ AmlDbgPrintNodeHeader (
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"%3d | %-15a | ", "%3d | %-15s | ",
Level, Level,
NodeTypeStrTbl[Node->NodeType] NodeTypeStrTbl[Node->NodeType]
)); ));
@@ -227,7 +227,7 @@ AmlDbgPrintDataNode (
AmlDbgPrintNodeHeader ((AML_NODE_HEADER*)DataNode, Level); AmlDbgPrintNodeHeader ((AML_NODE_HEADER*)DataNode, Level);
DEBUG ((DEBUG_INFO, "%-36a | ", NodeDataTypeStrTbl[DataNode->DataType])); DEBUG ((DEBUG_INFO, "%-36s | ", NodeDataTypeStrTbl[DataNode->DataType]));
DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size)); DEBUG ((DEBUG_INFO, "0x%04x | ", DataNode->Size));
if ((DataNode->DataType == EAmlNodeDataTypeNameString) || if ((DataNode->DataType == EAmlNodeDataTypeNameString) ||
@@ -300,13 +300,13 @@ AmlDbgPrintObjectNode (
// Print a string corresponding to the field object OpCode/SubOpCode. // Print a string corresponding to the field object OpCode/SubOpCode.
if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) { if (AmlNodeHasAttribute (ObjectNode, AML_IS_FIELD_ELEMENT)) {
DEBUG ((DEBUG_INFO, "%-15a ", AmlGetFieldOpCodeStr ( DEBUG ((DEBUG_INFO, "%-15s ", AmlGetFieldOpCodeStr (
ObjectNode->AmlByteEncoding->OpCode, ObjectNode->AmlByteEncoding->OpCode,
0 0
))); )));
} else { } else {
// Print a string corresponding to the object OpCode/SubOpCode. // Print a string corresponding to the object OpCode/SubOpCode.
DEBUG ((DEBUG_INFO, "%-15a | ", AmlGetOpCodeStr ( DEBUG ((DEBUG_INFO, "%-15s | ", AmlGetOpCodeStr (
ObjectNode->AmlByteEncoding->OpCode, ObjectNode->AmlByteEncoding->OpCode,
ObjectNode->AmlByteEncoding->SubOpCode) ObjectNode->AmlByteEncoding->SubOpCode)
)); ));
@@ -378,19 +378,19 @@ AmlDbgPrintTableHeader (
DEBUG ((DEBUG_INFO, "Lvl | Node Type |\n")); DEBUG ((DEBUG_INFO, "Lvl | Node Type |\n"));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
" | %-15a | Signature| Length | Rev | CSum | OemId | " " | %-15s | Signature| Length | Rev | CSum | OemId | "
"OemTableId | OemRev | CreatorId| CreatorRev\n", "OemTableId | OemRev | CreatorId| CreatorRev\n",
NodeTypeStrTbl[EAmlNodeRoot] NodeTypeStrTbl[EAmlNodeRoot]
)); ));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
" | %-15a | Op | SubOp| OpName | MaxI| Attribute | " " | %-15s | Op | SubOp| OpName | MaxI| Attribute | "
"PkgLen | NodeName (opt)\n", "PkgLen | NodeName (opt)\n",
NodeTypeStrTbl[EAmlNodeObject] NodeTypeStrTbl[EAmlNodeObject]
)); ));
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
" | %-15a | Data Type | Size | " " | %-15s | Data Type | Size | "
"Buffer\n", "Buffer\n",
NodeTypeStrTbl[EAmlNodeData] NodeTypeStrTbl[EAmlNodeData]
)); ));

View File

@@ -2,7 +2,7 @@
AML grammar definitions. AML grammar definitions.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<BR> Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
@@ -803,88 +803,3 @@ AmlComputePkgLengthWidth (
// Length < 2^6 // Length < 2^6
return 1; return 1;
} }
/** Given a length, compute the value of a PkgLen.
In AML, some object have a PkgLen, telling the size of the AML object.
It can be encoded in 1 to 4 bytes. The bytes used to encode the PkgLen is
itself counted in the PkgLen value.
This means that if an AML object sees its size increment/decrement,
the number of bytes used to encode the PkgLen value can itself
increment/decrement.
For instance, the AML encoding of a DeviceOp is:
DefDevice := DeviceOp PkgLength NameString TermList
If:
- sizeof (NameString) = 4 (the name is "DEV0" for instance);
- sizeof (TermList) = (2^6-6)
then the PkgLen is encoded on 1 byte. Indeed, its value is:
sizeof (PkgLen) + sizeof (NameString) + sizeof (TermList) =
sizeof (PkgLen) + 4 + (2^6-6)
So:
PkgLen = sizeof (PkgLen) + (2^6-2)
The input arguments Length and PkgLen represent, for the DefDevice:
DefDevice := DeviceOp PkgLength NameString TermList
|------Length-----|
|--------*PgkLength---------|
@param [in] Length The length to encode as a PkgLen.
Length cannot exceed 2^28 - 4 (4 bytes for the
PkgLen encoding).
The size of the PkgLen encoding bytes should not be
counted in this length value.
@param [out] PkgLen If success, contains the value of the PkgLen,
ready to encode in the PkgLen format.
This value takes into account the size of PkgLen
encoding.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER Invalid parameter.
**/
EFI_STATUS
EFIAPI
AmlComputePkgLength (
IN UINT32 Length,
OUT UINT32 * PkgLen
)
{
UINT32 PkgLenWidth;
UINT32 ReComputedPkgLenWidth;
if (PkgLen == NULL) {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
// Compute the PkgLenWidth.
PkgLenWidth = AmlComputePkgLengthWidth (Length);
if (PkgLenWidth == 0) {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
// Add it to the Length.
Length += PkgLenWidth;
// Check that adding the PkgLenWidth didn't trigger a domino effect,
// increasing the encoding width of the PkgLen again.
// The PkgLen is encoded in at most 4 bytes. It is possible to increase
// the PkgLen width if its encoding is less than 3 bytes.
ReComputedPkgLenWidth = AmlComputePkgLengthWidth (Length);
if (ReComputedPkgLenWidth != PkgLenWidth) {
if ((ReComputedPkgLenWidth != 0) &&
(ReComputedPkgLenWidth < 4)) {
// No need to recompute the PkgLen since a new threshold cannot
// be reached by incrementing the value by one.
Length += 1;
} else {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
}
*PkgLen = Length;
return EFI_SUCCESS;
}

Some files were not shown because too many files have changed in this diff Show More