9.7. Switch VPAC instance usage to a different core¶
9.7.1. Introduction¶
In J784S4, there are two VPAC instances. Default SDK config supports these on following cores:-
VPAC Instance | Default Core |
---|---|
Instance 0 | mcu2_0 |
Instance 1 | mcu4_0 |
This developer note is written to guide you on how to switch a VPAC instance to different core. VPAC also relies on various dedicated UDMA HWA channels for performing required DMA transfers. These UDMA HWA channels are part of central resources in the SoC and is managed by the BoardCfg RM. Hence to switch a VPAC instance to different core, corresponding UDMA HWA channel allocation to the core should also be incorporated in the BoardCfg RM.
9.7.2. VPAC Driver level updates¶
To switch VPAC instance to a different core, following changes are required in VHWA driver makefiles:-
Update vhwa_default_j784s4_CORELIST and vhwa_vpac_j784s4_CORELIST in <PDK_PATH>/packages/ti/drv/vhwa/vhwa_component.mk
- For example, to switch VPAC Instance 1 from mcu4_0 to mcu3_0, following update is required:-
--- a/vhwa_component.mk +++ b/vhwa_component.mk -vhwa_default_j784s4_CORELIST = mcu2_0 mcu2_1 mcu4_0 -vhwa_vpac_j784s4_CORELIST = mcu2_0 mcu4_0 +vhwa_default_j784s4_CORELIST = mcu2_0 mcu2_1 mcu3_0 +vhwa_vpac_j784s4_CORELIST = mcu2_0 mcu3_0
Set VHWA_M2M_VPAC_INSTANCE CFLAG value for the desired core as the required instance number in <PDK_PATH>/packages/ti/drv/vhwa/src/makefile
- For example, to switch VPAC Instance 1 from mcu4_0 to mcu3_0, following update is required:-
--- a/src/makefile +++ b/src/makefile ifeq ($(SOC),$(filter $(SOC), j784s4)) - # For J784S4 VPAC Instance 0/1 is currently supported on mcu2_0/mcu4_0 respectively + # For J784S4 VPAC Instance 0/1 is currently supported on mcu2_0/mcu3_0 respectively CFLAGS_LOCAL_mcu2_0 += -DVHWA_M2M_VPAC_INSTANCE=0 - CFLAGS_LOCAL_mcu4_0 += -DVHWA_M2M_VPAC_INSTANCE=1 + CFLAGS_LOCAL_mcu3_0 += -DVHWA_M2M_VPAC_INSTANCE=1 endif
Following changes are required in each VHWA VPAC examples makefiles:-
Note
This step can be skipped if you are not planning to run VHWA VPAC examples in PDK.
Set VPAC_TEST_INSTANCE CFLAG value for the desired core as the required instance number in <PDK_PATH>/packages/ti/drv/vhwa/examples/<VPAC_EXAMPLE>/makefile.mk
- For example, to switch VPAC Instance 1 from mcu4_0 to mcu3_0, following update in vhwa_ldc_testapp makefile is required. Similarly for ‘vhwa_viss_testapp`, ‘vhwa_msc_testapp’ and ‘vhwa_nf_testapp`
-- a/examples/vhwa_ldc_test/makefile.mk +++ b/examples/vhwa_ldc_test/makefile.mk ifeq ($(SOC),$(filter $(SOC), j784s4)) - # For J784S4 VPAC Instance 0/1 is currently supported on mcu2_0/mcu4_0 respectively + # For J784S4 VPAC Instance 0/1 is currently supported on mcu2_0/mcu3_0 respectively CFLAGS_LOCAL_mcu2_0 += -DVPAC_TEST_INSTANCE=0 - CFLAGS_LOCAL_mcu4_0 += -DVPAC_TEST_INSTANCE=1 + CFLAGS_LOCAL_mcu3_0 += -DVPAC_TEST_INSTANCE=1 endif
9.7.3. BoardCfg RM updates¶
9.7.3.1. Step 1: Generate BoardCfg RM file¶
K3 Resource Partitioning Tool is used to generate Linux and RTOS BoardCfg RM files. Refer K3 Resource Partitioning Tool User Guide for more info on setup and usage.
To switch a VPAC instance to different core, the corresponding HWA channel range should be allocated to that core in BoardCfg RM. Following steps are required to switch HWA channels allocation from one core to another.
In SysConfig tool, update Extended Tx channels HWA Start and Extended Tx channels HWA Count for the desired core(host) to the corresponding range for a particular VPAC instance. The range of dedicated HWA channels for a VPAC instance is mentioned in Main NAVSS UDMA HWA channels
Note
You should first update the above fields to 0 for the core(host) to which these channels are currently allocated. Else the tool will show Overlap WARNING and the BoardCfg won’t be generated correctly.
For example, to switch VPAC Instance 1 from mcu4_0 to mcu3_0
Update Extended Tx channels HWA Start and Extended Tx channels HWA Count for mcu4_0 as 0
Update Extended Tx channels HWA Start and Extended Tx channels HWA Count for mcu3_0 as 213 and 96 respectively
9.7.3.2. Step 2: Integrate updated BoardCfg RM¶
For RTOS, run boardcfg_update.sh script present in <PDK_PATH>/packages/ti/drv/sciclient/tools to integrate the updated BoardCfg RM file
cd <PDK_PATH>/packages/ti/drv/sciclient/tools ./boardcfg_update.sh j784s4_evm --boardcfg=path/to/generated/sciclient/defaultBoardcfg/rm/c/file
- Refer How to integrate updated RM BoardCfg in PDK? for more details.
For Linux, check-in the generated rm-cfg.c and tifs-rm-cfg.c to k3-image-gen/soc/j784s4/evm/ and rebuild k3-image-gen
- Refer k3-image-gen README for more detials.