AM62Px MCU+ SDK  11.01.00
Modifying resource allocation

Introduction

Various resources of the SOC like the number of DMA channels, number of interrupt router outputs, number of interrupt aggregator virtual interrupt numbers etc. are usually managed by a resource management system or a resource manager.

In the case of AM62PX devices, this is managed by the DM Firmware (Device Manager Firmware) running on the WKUP R5 / DM R5 core. Once the DM firmware is loaded on DM R5 and is initialized, it will read a certain configuration data regarding the resources we would be using. ROM bootloader (RBL) should have loaded this as part of bootflow. This is largely an array of resource assignment entries, with each entry specifying the start number of the resource, count or number of resource needed, type of resource, host id of the core which will request for this resource, etc. Later when the request for a specific resource is made, the DM firmware will cross check the request parameters with this already sent configuration data, and the requested resources will only be allocated if that falls within the range in this configuration data. We call this the Resource Management Board Configuration or RM boardcfg.

Refer TISCI documentation for more details on the RM board configuration.

Changing a particular resource

RM Boardcfg is stored in a C file {SDK_ROOT_DIRECTORY}\source\drivers\sciclient\sciclient_default_boardcfg\am62px\sciclient_defaultBoardcfg_rm.c. Ultimately this file needs to be changed and rebuilt for the boardcfg change to take effect. This file is autogenerated using a SysConfig based GUI tool (K3 Resource Partitioning Tool). This tool can used online or can be invoked from the commandline.

Accessing the tool online

The K3 Resource Partitioning Tool, now also known as K3 Resource Configuration, is now available as a software product on the TI website, providing a unified user experience similar to other SysConfig-based tools, such as AM6X ClockTree and DDR Configuration Tools.

Note
The online version of the K3 Resource Partitioning Tool is now the preferred access method and will serve as the standard way to use the tool from this point forward.

To access the tool online, follow these steps:

  1. Launch the Tool: Navigate to https://dev.ti.com/sysconfig/?product=K3-RESOURCE-CONFIGURATION to access the K3 Resource Partitioning tool. If prompted, log in to your TI account to access the tool.
    Resource Partitioning Tool Start Page
  2. Select Your Device: Choose the am62px device you are working with from the available options.
    Selecting device inside the tool
  3. Start Configuring Resources: Click on the Latest Baseline Design to launch the tool's interface and configure resources on top of the latest baseline design for am62px devices. Alternatively, select a Processor SDK version-specific Baseline Design to start with a design compatible with that SDK release.

Accessing the tool locally

To access the tool locally, run the following from the SDK root directory

make -s -C tools/sysfw/boardcfg configure SOC=am62px

Resource Partitioning Tool

Using the tool

  • Any changes required for any of the resources can be changed using the GUI and doing a File->Save (Ctrl+S when using locally) saves it to a *.syscfg file.
  • Once you have identified for which host you need to assign resources to, and the resource type which you want to modify, click on that particular host to see the currently assigned resources
  • A host is defined as a logically distinct high level software entity along with a particular security status. This is mostly a particular piece of software running on a physical core.
  • In the RTOS world this does not have a lot of significance, where mostly it is going to be one piece of software which is going to run in a core - be it a bare-metal application or an RTOS based one. In linux/HLOS, it is possible that a core has multiple SW entities running, mostly as VMs.
  • In a case where a security firmware and the Linux OS is running in the same core, both these SW entities would be considered as different hosts, because of the difference in security status.
  • Each of these 'hosts' are given an ID by the SYSFW.
  • Here is the host id to core mapping:
HOST ID Core
TISCI_HOST_ID_TIFS (0U) TIFS ARM Cortex M4
TISCI_HOST_ID_A53_0 (10U) Cortex A53SS0_0 (Secure Context)
TISCI_HOST_ID_A53_1 (11U) Cortex A53SS0_0 (Secure Context)
TISCI_HOST_ID_A53_2 (12U) Cortex A53SS0_1 (Non-Secure Context)
TISCI_HOST_ID_A53_3 (13U) Cortex A53SS0_1 (Non-Secure Context)
TISCI_HOST_ID_A53_4 (14U) Cortex A53SS0_0 (Non-Secure Context)
TISCI_HOST_ID_MCU_0_R5_0 (30U) Cortex MCU R5 (Non-Secure Context)
TISCI_HOST_ID_GPU_0 (31U) GPU_0 (Non-Secure Context)
TISCI_HOST_ID_GPU_1 (32U) GPU_1 (Non-Secure Context)
TISCI_HOST_ID_WKUP_0_R5_0 (35U) Cortex R5FSS0_0 (Secure Context)
TISCI_HOST_ID_WKUP_0_R5_1 (36U) Cortex R5FSS0_0 (Non-Secure Context)
TISCI_HOST_ID_DM2TIFS (250U) DM2TIFS(Secure): DM to TIFS communication
TISCI_HOST_ID_TIFS2DM (251U) TIFS2DM(Non Secure): TIFS to DM communication
TISCI_HOST_ID_HSM (253U) HSM (Secure)
TISCI_HOST_ID_DM (254U) DM(Non Secure): Device Management

Refer TISCI Host descriptions

  • For all general purpose use-cases in RTOS, you would want to allocate resources to the non-secure host. Secure hosts in RTOS are reserved special softwares like the secondary bootloader which would need elevated security privileges to perform actions like opening firewalls, booting other cores etc.

Resource Allocation
  • You can decrease/increase the number of resources.There are hard restrictions to certain resources. As long as your assignments are within the restrictions, you can change the configuration in the way which suits your application. The tool will throw an error if any of resources exceed their allowed number.

Resource Exceeding Allowed Limits
  • Resources can be shared between hosts, but at most 2 hosts can have the same resource. To share a resource, a resource sharing entry needs to be added in the GUI tool.

Resource Allocation Entry
  • After the resource is shared, it will show up as an info under the resource.

Resource Allocation Info

Generating the output files

Once you have configured your resources using the K3 Resource Configuration tool, you can generate the output files required for your project.

Online Tool

To generate output files using the online tool, follow these steps:

  1. Access the Generated Files Section: Locate the "Generated Files" section in the right panel of the tool.
  2. Save the Required File: Click the save icon (Floppy Disk icon) next to the "sciclient_defaultBoardcfg_rm_mcusdk.c" file to download it to your system.
  3. Copy and Rename the File: Copy the downloaded sciclient_defaultBoardcfg_rm_mcusdk.c file to the {SDK_ROOT_DIRECTORY}\source\drivers\sciclient\sciclient_default_boardcfg\am62px\ directory. Remove the "_mcusdk" suffix from the file name and overwrite any existing file with the same name.

You can also save other files as needed by following the same steps.

Local Tool

To generate output files using the local tool, follow these steps:

  1. Save the Config File: Save your configuration file using the GUI.
  2. Run the Generation Command: From the SDK root directory, run the following command to generate the output files:
make -s -C tools/sysfw/boardcfg configure-gen SOC=am62px
  • That should update the {SDK_ROOT_DIRECTORY}\source\drivers\sciclient\sciclient_default_boardcfg\am62px\sciclient_defaultBoardcfg_rm.c file.
Note
For more information about the K3 Resource Configuration tool and the generated files, please refer to the K3 Resource Configuration User's Guide.

Rebuilding the board configuration

After making changes to the config file and generating the sciclient_defaultBoardcfg_rm.c file, you need to rebuild the board configuration binary blob. To do this, run the following command from the SDK root directory:

make -s -C tools/sysfw/boardcfg sciclient_boardcfg SOC=am62px

Running the above command will update the boardcfg binary blob at {SDK_ROOT_DIRECTORY}\source\drivers\sciclient\sciclient_default_boardcfg\am62px\.