Skip to content

Commit

Permalink
Merge pull request #412 from SrikarJosyula/master
Browse files Browse the repository at this point in the history
README and Document Updates
  • Loading branch information
gowthamsiddarthd authored Nov 9, 2023
2 parents 9a92881 + 50ddea1 commit 74d3111
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 14 deletions.
Binary file modified docs/arm_sbsa_architecture_compliance_bare-metal_user_guide.pdf
Binary file not shown.
81 changes: 67 additions & 14 deletions platform/pal_baremetal/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,79 @@

Please Note: The code in the "pal_baremetal" directory is only a reference code for implementation of PAL API's and it has not been verified on any model or SoC's.
# Baremetal README
**Please Note**: The code in the "pal_baremetal" directory is only a reference code for implementation of PAL API's and it has not been verified on any model or SoC's.
The directory pal_baremetal consists of the reference code of the PAL API's specific to a platform.
Description of each directory are as follows:

1. src: The implementation common to all the baremetal platforms (like FVP and juno) for all modules are in the source directory.
2. include:
- pcie_enum.h: Implementation needed for enumeration.
- pal_common_support.h: Implementation that is common to both platforms (FVP and juno).
3. FVP: Contains Platform specific code. The details in this folder need to be modified w.r.t the platform.
4. Juno: Contains Platform specific code.
## Directory Structure
1. **common**: The implementation common to all the baremetal platforms for all modules are in this directory.\
  1.1 **include**:\
    - pal_common_support.h: Implementation that is common to all platforms.\
    - pal_pcie_enum.h: Implementation needed for enumeration.\
    - pal_pl011_uart.h: Implementation needed for PL011 UART driver. \
    - pal_pmu.h: Implementation needed for PMU specific data structures.\
  1.2. **src**:\
    Source files common to all baremetal platforms which do not require user modification.\
    Eg: Info tables parsing, PCIe enumeration code, etc.
 
2. **RDN2**: Contains Platform specific code. The details in this folder need to be modified w.r.t the platform.

## Build Steps

Reference Makefile is present at [Makefile](../../Makefile). To compile SBSA, perform following steps.
Reference Cmake file is present at [CMakeLists.txt](../../CMakeLists.txt). To compile SBSA, perform following steps.

1. cd sbsa-acs
2. export SBSA_PATH=pointing to SBSA directory
3. export GCC49_AARCH64_PREFIX=GCC toolchain path pointing to /bin/aarch64-linux-gnu-
4. make
2. export CROSS_COMPILE=<path_to_the_toolchain>/bin/aarch64-none-linux-gnu-
3. mkdir build
4. cd build
5. cmake ../ -G"Unix Makefiles" -DCROSS_COMPILE=$CROSS_COMPILE -DTARGET="Target platform"
6. make

*Recommended*: CMake v3.17, GCC v12.2
```
CMake Command Line Options:
-DARM_ARCH_MAJOR = Arch major version. Default value is 9.
-DARM_ARCH_MINOR = Arch minor version. Default value is 0.
-DCROSS_COMPILE = Cross compiler path
-DTARGET = Target platform. Should be same as folder under pal_baremetal
```

On a successful build, *.bin, *.elf, *.img and debug binaries are generated at *build/output* directory. The output library files will be generated at *build/tools/cmake/acs_host* of the sbsa-acs directory.

## Running SBSA ACS with Bootwrapper on RDN2

**1. In RDN2 software stack make following change:**

In <rdn2_path>/build-scripts/build-target-bins.sh - replace uefi.bin with acs_latest.bin

```
if [ "${!tfa_tbbr_enabled}" == "1" ]; then
$TOP_DIR/$TF_A_PATH/tools/cert_create/cert_create \
${cert_tool_param} \
- ${bl33_param_id} ${OUTDIR}/${!uefi_out}/uefi.bin
+ ${bl33_param_id} ${OUTDIR}/${!uefi_out}/acs_latest.bin
fi
${fip_tool} update \
${fip_param} \
- ${bl33_param_id} ${OUTDIR}/${!uefi_out}/uefi.bin \
+ ${bl33_param_id} ${OUTDIR}/${!uefi_out}/acs_latest.bin \
${PLATDIR}/${!target_name}/fip-uefi.bin
```

**2. Repackage the FIP image with this new binary**
- cp <sbsa_acs>/build/output/acs_host.bin <rdn2_path>/output/rdn2/components/css-common/acs_latest.bin

- cd <rdn2_path>

- ./build-scripts/rdinfra/build-test-acs.sh -p rdn2 package

- export MODEL=<path_to_FVP_RDN2_model>

- cd <rdn2>/model-scripts/rdinfra/platforms/rdn2

The output library files will be generated at <sbsa_path>/build/lib/
- ./run_model.sh

Note: Any platform specific changes can be done by using TARGET_EMULATION macro defintion. The pal_baremetal reference code is located in [pal_baremetal](.). To customize the bare-metal code for different platforms, create a directory <platform_name> in [pal_baremetal](.) folder and copy the reference code from [source](src) folder and [RDN2](FVP/RDN2) folder to <platform_name>.
**Note:** Any platform specific changes can be done by using TARGET_BM_BOOT macro defintion. The pal_baremetal reference code is located in [pal_baremetal](.). To customize the bare-metal code for different platforms, create a directory <platform_name> in [pal_baremetal](.) folder and copy the reference code from [include](RDN2/include) and [source](RDN2/src) folders from [RDN2](RDN2) to <platform_name>.


For more details on how to port the reference code to a specific platform and for further customisation please refer to the [User Guide](../../docs/arm_sbsa_architecture_compliance_bare-metal_user_guide.pdf)
Expand Down

0 comments on commit 74d3111

Please sign in to comment.