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

Enable UPL support for RISC-V #6139

Merged
merged 10 commits into from
Sep 14, 2024

Conversation

dhaval-rivos
Copy link
Contributor

Description

This patchset enable RISC-V support for UPL.

  1. Fixes a bug in earlier UPL baseline patch related to NULL pointer
  2. Add support for smbios table FDT parser to baseline UPL patch
  3. Enables RISC-V specific build requirements (PCDs etc)
  4. Enable RISC-V entry point (parse FDT argument)
  5. Remove UPL ACPI code with incorrect assumption about table availability
  6. Add support for special purpose memory (HBM)
  7. Add ecam field to support multisegment root bridge
  8. Add root bridge FDT parser and fill up correct data
  9. support for reserved memory parser lib functions
  10. Use Misc fixes for EDK2 #9 functions to create required reserved memory hobs
  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

This patchset was tested on an internal Risc-V simulation platform hence:

  1. Requires proper dsc file which stiches correct modules
  2. https://github.com/rivosinc/edk2/tree/dev/dhaval/dev-add-rv-cpuhob is WIP

Integration Instructions

Build instructions:
python UefiPayloadPkg/UniversalPayloadBuild.py -t GCC5 --Fit -a RISCV64 -l "place your addr here" -c */UefiPayloadPkg.dsc

@dhaval-rivos
Copy link
Contributor Author

dhaval-rivos commented Sep 12, 2024 via email

@gdong1
Copy link
Contributor

gdong1 commented Sep 12, 2024

It looks this branch is out-of-date, need rebase it.

@ChaselChiu ChaselChiu added the push Auto push patch series in PR if all checks pass label Sep 12, 2024
@ChaselChiu ChaselChiu force-pushed the dev/dhaval/master-upl20 branch 2 times, most recently from da50d16 to 2ed2689 Compare September 13, 2024 17:28
Option node provides info that is to be consumed by during
metadata creation for other nodes like root bridge; pci-enum-done
etc. Handle that dependency by storing option values in a variable
and then apply it during post processing. Ideally such cross node
dependency should be avoided in design. Scope for futher improvements.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Not every node has compatible property; avoid parsing nodes
which return NULL.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Expose UPL required PCDs for RISC-V Arch

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
As per specification we are going to accept only one argument
at the entry point which is FDT pointer. Grab that and call
the entry point.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
We do not need to go deep into verifying all ACPI tables
at this stage. TODO: Just a simple ACPI header signature
check should be good enough. For now just commenting out
asserts that mandate one to have various tables which is
not applicable to all platforms.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
We need to let UEFI know that there are cetain memory types
which are special purpose (CXL/HBM) etc and we may want to
avoid using them for UEFI purposes. Hence UPL needs to know
about such memory types.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
In order to properly enable multisegment RB, we need
to grab ecam data from the FDT for each bridge.
Current UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES struct from
MdeModulePkg does not include definition for ecam. In
order to maintain backward compatibility and also avoid
diverging too much from core, we are going to define a
new HOB for UPL segment information and pass it to
GetPciSegmentInfo function. Ths function then grabs specifically
ecam info from the segment hob along with other rb specific
information to create final RB info required by multi segment
PCI driver.

Additionally we would like to support legacy implementations which
rely on ACPIBoard HOB to fill up segment info. So if UplSegmentInfo Hob
is not found we try and look for other hob.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Devicetree defines a short hand way of defining reserved memory
ranges. Add APIs to access such nodes

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
DT has a way to provide reserved images in a simpler tabular
manner. UPL should be able to support that.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
@mergify mergify bot merged commit 1f32b5a into tianocore:master Sep 14, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants