diff --git a/CMakeLists.txt b/CMakeLists.txt index 7455d24..50729a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ ## # Set the minimum required version of CMake for the project -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.21) project(bsa-acs LANGUAGES) diff --git a/pal/baremetal/README.md b/pal/baremetal/README.md index 4779fa1..83585e2 100644 --- a/pal/baremetal/README.md +++ b/pal/baremetal/README.md @@ -4,72 +4,77 @@ The directory baremetal consists of the reference code of the PAL API's specific Description of each directory are as follows: ## Directory Structure -  1. **base**: The implementation for all modules are present in this directory.\ -    1.1 **include**: Consists of the include files \ -    1.2. **src**: Source files for all modules which do not require user modification.\ +  - `base`: The implementation for all modules are present in this directory.\ +    - `include`: Consists of the include files\ +    - `src`: Source files for all modules which do not require user modification.\       Eg: Info tables parsing, PCIe enumeration code, etc. -  2. **target**: Contains Platform specific code. The details in this folder need to be modified w.r.t the platform -    2.1. ****: Info tables parsing, PCIe enumeration code, etc. -      2.1.1. **pal**: Info tables parsing, PCIe enumeration code, etc. - -Contains Platform specific code. The details in this folder need to be modified w.r.t the platform. +  - `target`: Contains Platform specific code. The details in this folder need to be modified w.r.t the platform\ +    - ``: Info tables parsing, PCIe enumeration code, etc\ +      - `include`: Consists of the include files for the platform specific information\ +      - `src`: Source files for all modules which require user modification.\ ## Build Steps ### Pre-requisite -Run the command -- cd sysarch-acs -- python tools/scripts/generate.py - Eg: python tools/scripts/generate.py RDN2 +> Note: .bin stands for either bsa.bin or sbsa.bin or pc_bsa.bin. Any platform specific changes can be done by using `TARGET_BAREMETAL` macro definition. The baremetal reference code is located in [baremetal](.). -This command will create a folder RDN2 under the pal/target folder path and the files pal_bsa.c and pal_sbsa.c files within the RDN2/src folder. +Run the command +- `cd sysarch-acs` +- `python tools/scripts/generate.py ` -1. To compile BSA, perform the following steps \ -  1.1 `cd sysarch-acs` \ -  1.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-` \ -  1.3 `cmake --preset bsa -DTARGET="Target platform"` \ +> Eg: `python tools/scripts/generate.py RDN2` +> This command will create a folder RDN2 under the `pal/target` folder path and the files `pal_bsa.c` and `pal_sbsa.c` files within the `RDN2/src` folder. + +1. To compile BSA, perform the following steps\ +  1.1 `cd sysarch-acs`\ +  1.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-`\ +  1.3 `cmake --preset bsa -DTARGET="Target platform"`\   1.4 `cmake --build --preset bsa` -2. To compile SBSA , perform the following steps \ -  1.1 `cd sysarch-acs` \ -  2.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-` \ -  1.3 `cmake --preset sbsa -DTARGET="Target platform"` \ -  1.4 `cmake --build --preset sbsa` - -3. To compile PC_BSA , perform the following steps \ -  1.1 `cd sysarch-acs` \ -  2.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-` \ -  1.3 `cmake --preset pc_bsa -DTARGET="Target platform"` \ -  1.4 `cmake --build --preset pc_bsa` -
+2. To compile SBSA, perform the following steps\ +  2.1 `cd sysarch-acs`\ +  2.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-`\ +  2.3 `cmake --preset sbsa -DTARGET="Target platform"`\ +  2.4 `cmake --build --preset sbsa` + +3. To compile PC_BSA, perform the following steps\ +  3.1 `cd sysarch-acs`\ +  3.2 `export CROSS_COMPILE=/bin/aarch64-none-elf-`\ +  3.3 `cmake --preset pc_bsa -DTARGET="Target platform"`\ +  3.4 `cmake --build --preset pc_bsa` +
+ > **Note:** > You can check available presets using `cmake --list-presets` > If you do not provide `-DTARGET`, defaults to `RDN2`. > If you like to use make command do `cmake --preset acs_all; cd build; make bsa` (for all baremetal acs `make acs_all`) +> Recommended: CMake v3.21 (min version to support --preset), GCC v12.2 + +
-*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 baremetal/target/ - -DACS = To compile SBSA ACS - -DSBSA_DIR = SBSA path for SBSA compilation + `-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 baremetal/target/ + `-DACS` = To compile ACS ``` -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/* of the bsa-acs directory. +
+ +> On a successful build, *.bin, *.elf, *.img and debug binaries are generated at `build/_build/output` directory. The output library files will be generated at `build/_build/tools/cmake` directory. ## Running ACS with Bootwrapper on RDN2 **1. In RDN2 software stack make following change:** - In /build-scripts/build-target-bins.sh - replace uefi.bin with acs_latest.bin + In `/build-scripts/build-target-bins.sh` - replace `uefi.bin` with `acs_latest.bin` -``` +```bash if [ "${!tfa_tbbr_enabled}" == "1" ]; then $TOP_DIR/$TF_A_PATH/tools/cert_create/cert_create \ ${cert_tool_param} \ @@ -86,19 +91,12 @@ On a successful build, *.bin, *.elf, *.img and debug binaries are generated at * ``` **2. Repackage the FIP image with this new binary** -- cp /build/output/.bin /output/rdn2/components/css-common/acs_latest.bin - -- cd - -- ./build-scripts/rdinfra/build-test-acs.sh -p rdn2 package - -- export MODEL= - -- cd /model-scripts/rdinfra/platforms/rdn2 - -- ./run_model.sh - -**Note:** .bin stands for either bsa.bin or sbsa.bin. Any platform specific changes can be done by using TARGET_BAREMETAL macro defintion. The baremetal reference code is located in [baremetal](.). To customize the bare-metal code for different platforms, create a directory in [target](target/) folder and copy the reference code from [include](target/RDN2/include) and [source](target/RDN2/src) folders from [RDN2](target/RDN2) to . +- `cp /build/_build/output/.bin /output/rdn2/components/css-common/acs_latest.bin` +- `cd ` +- `./build-scripts/rdinfra/build-test-acs.sh -p rdn2 package` +- `export MODEL=` +- `cd /model-scripts/rdinfra/platforms/rdn2` +- `./run_model.sh` 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_bsa_architecture_compliance_bare-metal_user_guide.pdf)