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

Platform/ADLINK: Add new ComHpcAltPkg platform #226

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

bexcran
Copy link
Contributor

@bexcran bexcran commented Oct 22, 2024

This new ComHpcAltPkg platform supports ADLINK's Ampere Altra Dev Kit,
Ampere Altra Developer Platform, and AVA Developer Platform.

They're all based on the COM-HPC-ALT module and carrier with an LGA
4926 socket supporting Ampere Altra and Ampere Altra Max CPUs up to
128 cores.


Add scripts which help users to build and flash firmware images for
platforms based on the Ampere Altra SoC.

'buildfw.sh' can be used to build images containing just UEFI, or if
the TF-A (ATF) binary is present TF-A + UEFI and complete 32MB SPI-NOR
images. If the SYS (SMPro and PMPro microprocessors) binary is also
present then a capsule update file for the SYS/SCP component of the SOC
will also be built. Usage:

Usage:
  ./Platform/Ampere/buildfw.sh [options]
    
Options:
  -b <bldtype>, --build <bldtype>  Specify the build type: DEBUG or
                                  RELEASE
  -t <tc>, --toolchain <tc>        Specify the toolchain to use: GCC or
                                   CLANG
  -m <mfg>, --manufacturer <mfg>   Specify platform manufacturer
                                   (e.g. Ampere)
  -p <plat>, --platform <plat>     Specify platform to build (e.g. Jade)
  -l <kern>, --linuxboot <kern>    Build LinuxBoot firmware instead of
           full EDK2 with UEFI Shell, specifying path to flashkernel
  -f, --flash                      Copy firmware to BMC and flash
           firmware (keeping EFI variables and NVPARAMs) after building
  -F, --full-flash                 Copy firmware to BMC and flash full
           EEPROM (resetting EFI variables and NVPARAMs) after building
    
  Note: flash options require bmc.sh file with env vars BMC_HOST, BMC_USER and BMC_PASS defined
  
  Available manufacturers:
    ADLINK
    Ampere
    ASRockRack
    
  Available platforms:
    ADLINK     -> ComHpcAlt
    Ampere     -> Jade
    ASRockRack -> Altrad8ud2

'fwver.sh' is used by buildfw.sh to keep track of the number of builds
done, so that firmware files of the format e.g.
comhpcalt_uefi_2024-10-22-5.bin are created along with displaying the
date including build number during boot.

'fwflash.sh' automates flashing the host firmware when the target
system is running a BMC with OpenBMC. 'fwflash.exp' is a helper
script used by 'fwflash.sh' to ssh into the BMC and run the
ampere_flash_bios.sh utility. Usage:

Copies firmware to the BMC (running OpenBMC) and runs
               ampere_flash_bios.sh to flash the host.
Usage:
      fwflash.sh [options] <Host firmware file>
    
    Options:
      -f, --full   Flash the entire SPI-NOR chip (default)
      -c, --code   Flash the code (TF-A + UEFI) area
      -t, --tfa    Flash the TF-A (ATF) area
      -u, --uefi   Flash the UEFI area
      -h, --help   This help message
    
    Note: TF-A (Trusted Firmware for ARMv8-A) is the same as ATF
          (ARM Trusted Firmware).

@bexcran bexcran force-pushed the bexcran-ampere branch 5 times, most recently from 7ac9199 to db8d2f2 Compare October 23, 2024 23:51
Copy link
Member

@nhivp nhivp left a comment

Choose a reason for hiding this comment

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

I have not fully reviewed this. But there are several common comments can be applied in multiple places. Please help address them, then I will continue to review in the next revision.

Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.fdf Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/Application/FwUi/FwUi.c Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/Application/FwUi/FwUi.c Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/AdlinkAmpereAltraPkg.dec Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/AdlinkAmpereAltra.fdf.inc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/Include/Library/MmcLib.h Outdated Show resolved Hide resolved
@bexcran bexcran force-pushed the bexcran-ampere branch 3 times, most recently from 0063ffd to 6a65374 Compare October 29, 2024 01:21
Platform/Ampere/buildfw.sh Show resolved Hide resolved
Platform/Ampere/fwflash.sh Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.dsc Outdated Show resolved Hide resolved
Platform/ADLINK/ComHpcAltPkg/ComHpcAlt.fdf Show resolved Hide resolved
Platform/Ampere/buildfw.sh Outdated Show resolved Hide resolved
Platform/Ampere/buildfw.sh Outdated Show resolved Hide resolved
Platform/Ampere/buildfw.sh Outdated Show resolved Hide resolved
Platform/Ampere/buildfw.sh Outdated Show resolved Hide resolved
@bexcran bexcran force-pushed the bexcran-ampere branch 4 times, most recently from a8f54bc to 94982b8 Compare October 31, 2024 03:21
Remove a bogus assert in PrePeiCoreGetMpCoreInfo that `*ArmCoreTable` isn't NULL.
It's expected to be NULL since it's an OUT parameter.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Update the debug print and debug property masks in
AmpereAltraPkg.dsc.inc to allow DEBUG_WARN and DEBUG_ERROR messages
to be displayed on the serial port in RELEASE builds. Otherwise, users
won't know about any problems.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Remove StatusCodeHandler libraries from AmpereAltraPkg.dsc.inc to allow
platforms to add their own functionality, for example using the POST
Code Debug library to print codes to a 7-segment display.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Add scripts which help users to build and flash firmware images for
platforms based on the Ampere Altra SoC.

'buildfw.sh' can be used to build images containing just UEFI, or if
the TF-A (ATF) binary is present TF-A + UEFI and complete 32MB SPI-NOR
images. If the SYS (SMPro and PMPro microprocessors) binary is also
present then a capsule update file for the SYS/SCP component of the SOC
will also be built. Usage:

Usage:
  ./Platform/Ampere/buildfw.sh [options]

Options:
  -b <bldtype>, --build <bldtype>  Specify the build type: DEBUG or
                                   RELEASE
  -t <tc>, --toolchain <tc>        Specify the toolchain to use: GCC or
                                   CLANG
  -m <mfg>, --manufacturer <mfg>   Specify platform manufacturer
                                   (e.g. Ampere)
  -p <plat>, --platform <plat>     Specify platform to build (e.g. Jade)
  -l <kern>, --linuxboot <kern>    Build LinuxBoot firmware instead of
           full EDK2 with UEFI Shell, specifying path to flashkernel
  -f, --flash                      Copy firmware to BMC and flash
           firmware (keeping EFI variables and NVPARAMs) after building
  -F, --full-flash                 Copy firmware to BMC and flash full
           EEPROM (resetting EFI variables and NVPARAMs) after building

  Note: flash options require bmc.sh file with env vars BMC_HOST, BMC_USER and BMC_PASS defined

  Available manufacturers:
    ADLINK
    Ampere
    ASRockRack

  Available platforms:
    ADLINK     -> ComHpcAlt
    Ampere     -> Jade
    ASRockRack -> Altrad8ud2

'fwver.sh' is used by buildfw.sh to keep track of the number of builds
done, so that firmware files of the format e.g.
comhpcalt_uefi_2024-10-22-5.bin are created along with displaying the
date including build number during boot.

'fwflash.sh' automates flashing the host firmware when the target
system is running a BMC with OpenBMC. 'fwflash.exp' is a helper
script used by 'fwflash.sh' to ssh into the BMC and run the
ampere_flash_bios.sh utility. Usage:

Copies firmware to the BMC (running OpenBMC) and runs
               ampere_flash_bios.sh to flash the host.
Usage:
  fwflash.sh [options] <Host firmware file>

Options:
  -f, --full   Flash the entire SPI-NOR chip (default)
  -c, --code   Flash the code (TF-A + UEFI) area
  -t, --tfa    Flash the TF-A (ATF) area
  -u, --uefi   Flash the UEFI area
  -h, --help   This help message

Note: TF-A (Trusted Firmware for ARMv8-A) is the same as ATF
      (ARM Trusted Firmware).

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
This new ComHpcAltPkg platform supports ADLINK's Ampere Altra Dev Kit,
Ampere Altra Developer Platform, and AVA Developer Platform.

They're all based on the COM-HPC-ALT module and carrier with an LGA
4926 socket supporting Ampere Altra and Ampere Altra Max CPUs up to
128 cores.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
With recent commits to add new Ampere build scripts and add the
ComHpcAlt platform, common files were changed which require the
following updates to Jade.dsc and JadeCapsule.dsc:

- Since release builds now print DEBUG messages, update the debug
  print error level in release builds to only print warnings
  and errors.
- StatusCodeHandler libraries were removed from AmpereAltraPkg.dsc.inc
  so add them to Jade.dsc.
- The ATF (TF-A) and SCP binaries were renamed. Update JadeCapsule.dsc
  to match.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
@bexcran bexcran merged commit 5b5885e into tianocore:master Oct 31, 2024
1 check passed
@bexcran bexcran deleted the bexcran-ampere branch October 31, 2024 21:30
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.

2 participants