Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and improvements for Ampere-based platforms. Add support for ASRock boards. #260

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

bexcran
Copy link
Contributor

@bexcran bexcran commented Dec 18, 2024

Numerous fixes and improvements to the Ampere Jade and ADLINK ComHpcAlt platforms.
Also, add support for the ASRock Rack ALTRAD8UD-1L2T and ALTRAD8UD2-1L2Q boards.

@bexcran bexcran requested a review from leiflindholm December 18, 2024 01:58
@bexcran bexcran self-assigned this Dec 18, 2024
@bexcran bexcran changed the title Bexcran asrock ComHpcAltPkg fixes and improvements Jan 2, 2025
@bexcran
Copy link
Contributor Author

bexcran commented Jan 2, 2025

@chuongtranle @nhivp Reminder after the holidays to please review this.

Rebecca Cran added 22 commits February 11, 2025 08:38
Add a new PCD, PcdFirmwareVersionNumber, which is used to hold a
decimal value for use in capsule builds.

Signed-off-by: Rebecca Cran <[email protected]>
Increase the maximum size of auth variables. This is needed to work with Secure
Boot where variables can be up to around 10KB.

Signed-off-by: Rebecca Cran <[email protected]>
Name the BMC configuration file bmc.conf instead of bmc.sh, since
that makes more sense.

Signed-off-by: Rebecca Cran <[email protected]>
Instead of checking that the flash size is greater than *twice* the
size of the NV storage, we only need to check that it's larger than it.

Signed-off-by: Rebecca Cran <[email protected]>
Add a define, SHELL_ENABLE, which allows building the firmware without
the shell, as recommended in
https://lvfs.readthedocs.io/en/latest/claims.html#uefi-shell.

To maintain existing behavior, it defaults to TRUE.

Also, move the setting of PcdShellLibAutoInitialize to FALSE into the
PCDs used when building just the shell and dynamic commands as the
instructions in ShellPkg/ShellPkg.dec say to do.

Signed-off-by: Rebecca Cran <[email protected]>
Fix the SMBIOS BIOS Size field by setting gArmTokenSpaceGuid.PcdFdSize
to 32MB.

Signed-off-by: Rebecca Cran <[email protected]>
Waiting 10 seconds for the user to press a key to interrupt boot seems
excessive. Reduce it to 5 seconds.

Signed-off-by: Rebecca Cran <[email protected]>
Add the BootGraphicsResourceTableDxe driver to allow the OS to display
a splash screen if the build includes one.

Signed-off-by: Rebecca Cran <[email protected]>
Update the SMBIOS Type17 code to use JedecJep106Lib instead of custom
code to determine the manufacturer.

Signed-off-by: Rebecca Cran <[email protected]>
Rework capsule update support so that the capsules contain correct,
up-to-date version information and can be applied from Linux using
fwupmgr.

Since there can only be a single FMP descriptor, drop support for
SCP upgrades: those can still be done via the BMC.

Signed-off-by: Rebecca Cran <[email protected]>
Use the full space allocated in the flash layout map for NVRAM.
Move the storage of the UUID to the end of that region.

Signed-off-by: Rebecca Cran <[email protected]>
- Improve comments in the file header.
- Change NV_SI_RO_BOARD_S0_DIMM_AVAIL to 0xffff since the code which
  reads DIMM information shouldn't get a different array based on the
  platform.
- Remove the notes of where changes from the default were made.
- Add missing fields at the bottom.

Signed-off-by: Rebecca Cran <[email protected]>
Update PlatformFlashAccessLib.c to avoid use of yoda conditions.

Signed-off-by: Rebecca Cran <[email protected]>
Improve the error checking code when fetching the I2C board config info.
Change the DEBUG print on success from DEBUG_ERROR to DEBUG_INFO and
on error print a message and return A2.

Signed-off-by: Rebecca Cran <[email protected]>
To provide flexibility, allow users to build with or without the
X86 emulator.

Signed-off-by: Rebecca Cran <[email protected]>
The LogoDxe allows OEMs to display their logo while waiting
for the user to press a key to interrupt the boot. Add it to
AmpereAltraPkg.dsc.inc and ComHpcAlt.fdf.

Signed-off-by: Rebecca Cran <[email protected]>
Add RemoveStaleFvFileOptions from OVMF to PlatformBootManagerDxe.
This removes stale boot options such as the UEFI Shell if the firmware
has been built without it.

Signed-off-by: Rebecca Cran <[email protected]>
Add checks around adding non-NULL PerformanceLib instances, only adding
them if PERFORMANCE_MEASUREMENT_ENABLE is TRUE.

Signed-off-by: Rebecca Cran <[email protected]>
Since we set PcdPerformanceLibraryPropertyMask to 1, extra memory is
needed to hold the FPDT boot records. Through testing, increase it from
the default of 192KB to 3MB.

Signed-off-by: Rebecca Cran <[email protected]>
Add the BGRT driver to ComHpcAlt.fdf to allow the OS to display
the OEM logo while booting.

Signed-off-by: Rebecca Cran <[email protected]>
Rebecca Cran added 6 commits February 11, 2025 08:38
Move the FirmwarePerformancePei driver earlier in the boot process.

Signed-off-by: Rebecca Cran <[email protected]>
Include the file which sets the Secure Boot keys.

Signed-off-by: Rebecca Cran <[email protected]>
Add boot manager drivers which were missing.

Signed-off-by: Rebecca Cran <[email protected]>
Override the video configuration PCDs to use the maximum available
resolution.

Copied from Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc

Signed-off-by: Rebecca Cran <[email protected]>
Add a script to generate Secure Boot keys and certificates.
Also, add a default openssl.cnf file which will be copied to
the secureboot_objects directory where users can customize it.

Signed-off-by: Rebecca Cran <[email protected]>
Use the DxeRuntimeDebugLibSerialPort driver in RELEASE builds to
avoid a crash if a driver tries to output text at Runtime.

Signed-off-by: Rebecca Cran <[email protected]>
Rebecca Cran added 7 commits February 11, 2025 09:03
buildfw.sh depends on features of the GNU getopt implementation
such as long options. Require users to install the gnu-getopt
homebrew package on macOS.

Signed-off-by: Rebecca Cran <[email protected]>
GetNumberOfSupportedSockets currently always returns 2 because
there's a fixed number of elements in the array. Instead, check
if SkuMaxLink2pSpeed is non-zero, in which case there are 2 sockets.

Signed-off-by: Rebecca Cran <[email protected]>
Instead of checking if INCLUDE_TFTP_COMMAND is _defined_, check whether
it's TRUE. This prevents it erronenously being included if it's set to
FALSE.

Signed-off-by: Rebecca Cran <[email protected]>
Since there are two types of Secure Boot in modern platforms - one
which secures from UEFI onwards, and one which secures the entire SoC
boot process from a root of trust in ROM, rename 'SECURE_BOOT_ENABLE' to
'UEFI_SECURE_BOOT_ENABLE' to differentiate it from the latter.

The SoC Secure Boot is enabled via a separate, different process.

Signed-off-by: Rebecca Cran <[email protected]>
Catch to with changes in edk2 ArmPkg: delete ArmGicArchLib instance and
add instances of ArmFfaLib and ArmSvcLib.

Signed-off-by: Rebecca Cran <[email protected]>
To help people understand the default configuration, list configuration
knobs along with their default values in the `--help` output.

Signed-off-by: Rebecca Cran <[email protected]>
@bexcran
Copy link
Contributor Author

bexcran commented Feb 11, 2025

Sorry for the delay. I was hoping to add the SoC secure boot support but ran into some problems.
This update also adds a new commit adding support for the ASRock ALTRAD8UD-1L2T and ALTRAD8UD2-1L2Q platforms - I hope it's not too much in one PR.

@bexcran bexcran changed the title ComHpcAltPkg fixes and improvements Ampere-based platforms fixes and improvements. Add support for ASRock boards. Feb 11, 2025
@bexcran bexcran changed the title Ampere-based platforms fixes and improvements. Add support for ASRock boards. Fixes and improvements for Ampere-based platforms. Add support for ASRock boards. Feb 11, 2025
# Blockmap[0]: 0x3 Blocks * 0x10000 Bytes / Block
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
# Blockmap[0]: 0x7 Blocks * 0x10000 Bytes / Block
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be size of the whole NVRAM (0x10 blocks). Let dump your fd binary to cross-check. Similar comment for other fdf files

# Size: 0x30000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) -
# 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x2FFB8
# Size: 0xB0000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) -
# 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xAFFB8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should align with actual size, 0x70000. Similar comment for other fdf files

@@ -109,16 +112,12 @@ DATA = {
# Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved
0x2c, 0xaf, 0x2c, 0x64, 0xFE, 0xFF, 0xFF, 0xFF,
# WriteQueueSize: UINT64 Size: 0x10000 - 0x20 (FTW_WORKING_HEADER) = 0xFFE0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment to align with the change 0x20000 - 0x020 (FTW_WORKING_HEADER) = 0x1FFE0. Similar comment for other fdf files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants