Versal Platform Loader and Manager

Versal Platform Loader and Manager

This page provides information about the Versal Platform Loader and Manager (PLM

Table of Contents

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. The amount of PPU RAM and PMC RAM available to PLM depends on the device family; see the family-wise table below. 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.

Device family

PPU RAM

PMC RAM

Device family

PPU RAM

PMC RAM

Versal (Gen 1)

384 KB

128 KB

Versal AI Edge Series Gen 2

640 KB

128 KB

Versal Prime Series Gen 2

640 KB

128 KB

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.

The PLM contains the following modules:

  1. XilPLMI

  2. XilLoader

  3. XilPM

  4. XilSecure

  5. XilSEM

  6. XilSTL (mono)

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

In addition to the modules listed above, PLM allows users to define their own modules if required. A compile-time option, user_modules_count, is available to enable this. See the PLM Feature Configuration section below. By default, this count is set to zero to save code size. When you set this to any non-zero value, the configured number of user module IDs are made available sequentially, starting from the base value 0x80. Users can define the necessary APIs in the modules and register them using the XPlmi_ModuleRegister API available in xilplmi.

See the XPlmi_GenericInit API available in the xilplmi library for an example of how to register a module. After the module is registered, users can use the defined APIs as CDO commands or IPI commands.

Steps

  • To register and utilize user modules, you need to call the 'user_module_init' function from 'XPlm_ModuleInit' in the following code: https://github.com/Xilinx/embeddedsw/blob/be4f96f3f73b0e47036eeb77949c1cc638b7648c/lib/sw_apps/versal_plm/src/common/xplm_module.c#L130

  • Additionally, you need to set the user modules count using the XILPMLI BSP options as mentioned in the PLM Feature Configuration

    Please note the following requirements for user modules:

    • The user modules index and API IDs should start from 0.

    • Use the predefined macro 'XPLMI_SET_USER_MODULE_ID' to create the user module ID, as the PLM reserved modules starts from 0x0, and the user modules starts from 0x80.

    • The maximum number of supported user modules is 0xF.

    • The major error code format for user modules is 0x3XYZ, where 'X' is the user module ID and 'YZ' represents the API ID.

  • Example User module code

/* User Module ID */ #define USER_MODULE_ID 0 /* User API IDs */ #define RESERVED_API_ID 0 #define USER_R5_API_ID 1 #define USER_A72_API_ID 2 static void user_module_init(void) { static XPlmi_Module UserModule; static XPlmi_ModuleCmd cmds[] = { XPLMI_MODULE_COMMAND(NULL), XPLMI_MODULE_COMMAND(user_r5_handler), XPLMI_MODULE_COMMAND(user_a72_handler), }; static XPlmi_AccessPerm_t perms[XPLMI_ARRAY_SIZE(cmds)] = { XPLMI_ALL_IPI_NO_ACCESS(RESERVED_API_ID), XPLMI_ALL_IPI_FULL_ACCESS(USER_R5_API_ID), XPLMI_ALL_IPI_SECURE_ACCESS(USER_A72_API_ID), }; UserModule.Id = XPLMI_SET_USER_MODULE_ID(USER_MODULE_ID); UserModule.CmdAry = cmds; UserModule.CmdCnt = XPLMI_ARRAY_SIZE(cmds); UserModule.AccessPermBufferPtr = perms; XPlmi_ModuleRegister(&UserModule); XPlmi_Printf(DEBUG_PRINT_ALWAYS, "Initialized User module\r\n"); } static int user_r5_handler(XPlmi_Cmd *Cmd) { XPlmi_Printf(DEBUG_PRINT_ALWAYS, "User API; CMD ID: 0x%08x\r\n", Cmd->CmdId); return XST_SUCCESS; } static int user_a72_handler(XPlmi_Cmd *Cmd) { XPlmi_Printf(DEBUG_PRINT_ALWAYS, "User API; CMD ID: 0x%08x\r\n", Cmd->CmdId); return XST_SUCCESS; }