Versal Platform Loader and Manager
-
makula
-
Sreedhar
-
Harsha Harsha
-
This page provides information related to the Versal Platform Loader and Manager (PLM).
Table of Contents
- 1 PLM Overview
-
2
Modules in PLM
- 2.1 User Modules
-
3
Building PLM
- 3.1 Using Vitis
- 3.2 Using XSCT
- 4 Generating Boot Image
- 5 Boot Modes
-
6
Loading Boot Image on Hardware
- 6.1 In JTAG Boot Mode
- 6.2 In QSPI Boot Mode
- 6.3 In OSPI Boot Mode
- 6.4 In SD0/SD1/eMMC Boot Mode
- 6.5 Secondary Boot
-
7
PLMI
- 7.1 IPI Handling
- 7.2 Task Modeling in PLM
- 7.3 Scheduler
- 8 Image Store
-
9
Error Handling in PLM
- 9.1 Error Management HW
- 9.2 Error Management in PLM
-
9.3
Error Management CDO commands
-
9.3.1
Set Em Action
- 9.3.1.1 **Setting subsystem action :
- 9.3.2 Register Notifier for EM Events
- 9.3.3 Notify Callback
-
9.3.1
Set Em Action
- 9.4 PSM errors handling by PLM
- 9.5 SW errors
- 9.6 EAM errors and their default error actions
- 9.7 Configuration of EAM errors through a CDO
-
10
Loader
- 10.1 CDO Offset logging
- 11 PM
- 12 Secure
- 13 Sem
- 14 PLM Build Flags
- 15 PLM Foot Print
-
16
Debugging Tips
- 16.1 Debugging PLM errors
- 16.2 Error Codes
-
16.3
Source Level Debugging with Vitis
- 16.3.1 Prerequisite
- 16.3.2 Debug Procedure
- 16.3.3 Debugging via JTAG ( *2 xsdb instance)
- 16.4 Debugging MB Core Dumps
- 16.5 SSIT Debug
- 16.6 PLM Compatibility between releases
- 17 Registers reserved for PLM
- 18 FAQs
- 19 Design Guidelines
- 20 Known Issues and Workarounds
- 21 Revision History
- 22 Related Links
PLM Overview
The Platform Management Controller (PMC) in Versal has two Platform Processing Units (PPUs) to run Boot ROM and PLM respectively. PLM runs on the PPU Microblaze in PMC. PPU has 384 KB of PPU RAM and 128 KB of PMC RAM. PLM is responsible for doing the system initialization, booting and configuration of various devices as a part of Loader. It also takes care of secure boot which are authentication and/or decryption. After the initial boot is complete, PLM is responsible for Error Management, Partial Reconfiguration, Subsystem Shutdown/Restart, Health Monitoring and Soft Error Mitigation and remains active throughout the lifetime of the system.
During the initial boot, the Boot ROM decodes the Programmable Device Image (PDI) and loads the PLM into the PPU RAM. Once the PLM starts running, it will decode and process the rest of the PDI and boot up the system by loading the partitions present in the PDI. PLM also supports loading of the partial PDIs during run time.
Configuration Data Object
Configuration Data Object (CDO) contains set of commands which are required for configuring various components in the system. Any system configuration in Versal will come in the form of a CDO to PLM. These files are generated by the tools and are input to PLM. The CDO commands are registered by each module during module initialization phase. PLM decodes and passes this information to various modules for configuration. PLM copies the CDOs to PMC RAM in 64K chunks, decodes and processes them.
Please refer to UG1283 for PDI Specification
Modules in PLM
The PLM is designed with a modular subsystem-based configuration, and task-based services. Each functionally distinct feature is designed as a module. The PLM application layer contains the module initialization and start-up tasks. Depending on the modules selected in the configuration, different modules are initialized. Modules can register event handlers, IPI handlers, CDO commands, and scheduler events with the PLM interface layer.
Following are the list of modules present in the PLM:
-
XilPLMI
-
XilLoader
-
XilPM
-
XilSecure
-
XilSEM
Note: XilLoader internally uses XilPDI library for loading the PDI image. Currently, XilPLMI, XilLoader and XilPDI are intended as PLM internal only libraries. Thus, APIs from these libraries are not intended to be called directly from other software layers outside of PLM.
User Modules
Apart from the above-mentioned list of modules, PLM also allows user to define their own modules if required. A compile time option “user_modules_count” is available to enable this. (Refer
PLM Feature Configuration
section below.) By default, this count is set to zero to save on code size. Once user sets this to any non-zero value, the configured number of user module IDs will be made available from base value of 0x81 sequentially. User can define necessary APIs in the modules and register them using
XPlmi_ModuleRegister
API available in xilplmi.
Please refer
XPlmi_GenericInit
API available in xilplmi library for an example of how a module can be registered. Once registered user can use the APIs defined as CDO commands or IPI commands.
Building PLM
PLM can be built using Vitis and XSCT. PetaLinux uses XSCT flow to generate PLM elf while generating PetaLinux project. Please refer to <tbd page> for PetaLinux flow. Also, Vivado generates a pre-built PLM with plm.elf name.
Using Vitis
Following are the steps to generate PLM elf using Vitis tool. Additionally, please refer to UG1305 to build PLM application
-
Open Vitis
-
Create new application project with File → New → Application Project…
-
New Application Window will pop up as shown below.
-
Click on “Next”. Select “Create a new platform from hardware (XSA)”, provide XSA File in “Platform” window and click on “Next”.
-
In “Application Project Details”, Select psv_pmc_0 processor and enter “Application project name” as “plm”.
-
Click on Next.
-
Select “versal PLM” in Templates window and click on “Finish”.
-
-
This would create PLM application with “plm_system” name along with the BSP.
-
Right-click on “plm_system” folder and click on “Build Project” to build PLM and generate elf.
Using XSCT
Following are the steps to generate PLM elf using XSCT:
mkdir plm_ws
cd plm_ws
setws .
app create -name plm -hw design.xsa -template "versal PLM" -os standalone -proc psv_pmc_0
app build -name plm
These steps will create and build PLM. PLM elf can be found at plm/Debug/plm.elf
Generating Boot Image
Boot image can be generated using BootGen command. We need to create a BIF file to generate Boot image. Also, please refer to UG1283 for more details on this.
-
We already have PLM elf with us. Check the previous section to build PLM.
-
Create and build PSM Firmware elf for PSM Microblaze.
-
Create required applications for A72/R5, AIE, CPM etc.
-
Create BIF file (boot.bif) with the below format
all: id_code = 0x14ca8093 //Add ID_CODE as per the Hardware extended_id_code = 0x01 id = 0x2 image name = pmc_subsys, id = 0x1c000001 {type = bootloader, file = ./plm.elf} {type = pmcdata, load = 0xf2000000, file = ./pmc_data.cdo} image id = 0x4210002, name = lpd {type = cdo, file = ./lpd_data.cdo} {core = psm, file = ./psm_fw.elf } image id = 0x18700000, name = pl_cfi {type = cdo,file = ./design.rcdo} {type = cdo,file = ./design.rnpi} image id = 0x420c003, name = fpd {type = cdo, file = ./fpd_data.cdo} image id = 0x4218007, name = cpm { type = cdo, file = ./cpm_data.cdo} image id = 0x1c000000, name = def_subsystem { load = 0x1000, file = ./system.dtb} { load = 0x10000000, file = ./image.ub} { core = a72-0,exception_level=el-3, trustzone, file = ./bl31.elf} { core = a72-0,exception_level=el-2, file = ./u-boot.elf} { load = 0x4000000, file = ./rootfs.cpio.gz.u-boot} image id = 0x1c000000, name = def_subsystem { core = r5-lockstep, file = ./rpu_hello.elf}