8.8. Using Processor SDK Linux with Processor SDK RTOS¶
8.8.1. Introduction¶
Processor SDK Linux J7200 (PSDK LINUX) and Processor SDK RTOS J7200 (PSDK RTOS) work together to realize use-cases on the J7200 platform. In most cases using the pre-built linux filesystem, kernel, bootloader is sufficient to build different usecases. However sometimes it is needed to rebuild certain parts of PSDK LINUX to update things like bootloader, SYSFW configuration, kernel dtb/dtbo and so on.
This page shows quick steps to rebuild and update below,
R5F SPL, A72 SPL, A72 uboot (tiboot3.bin, tispl.bin, u-boot.img)
SYSFW configuration (sysfw.itb)
Linux kernel .dtb’s and .dtbo’s ( /boot/*.dtb, /boot/*.dtbo)
Linux kernel and kernel modules ( /boot/Image, /lib/modules/*)
More detailed instruction to build PSDK LINUX are given in PSDK LINUX user guide. Refer ${PSDK_LINUX_PATH}//docs/linux/index.html for more details.
8.8.2. Setup PSDK LINUX¶
Download and install the PSDK LINUX installer as shown below
chmod +x ti-processor-sdk-linux-j7200-evm-xx_xx_xx-Linux-x86-Install.bin ./ti-processor-sdk-linux-j7200-evm-xx_xx_xx-Linux-x86-Install.bin
Edit below in ${PSDK_LINUX_PATH}/Rules.make to point to the root filesystem in SD card
#root of the target file system for installing applications DESTDIR ?=/media/<user name>/rootfs
Now PSDK LINUX is setup to build the bootloader and kernel
8.8.3. Build R5F SPL, A72 SPL and A72 u-boot¶
R5F SPL, A72 SPL and A72 u-boot can be found below
${PSDK_LINUX_PATH}/board-support/u-boot-*
Do below to build R5F SPL, A72 SPL and A72 u-boot in ${PSDK_LINUX_PATH}/
make u-boot
After successful build, copy below files to ‘BOOT’ partition in the SD card
${PSDK_LINUX_PATH}/board-support/k3-image-gen-*/tiboot3.bin ${PSDK_LINUX_PATH}/board-support/u-boot_build/a72/tispl.bin ${PSDK_LINUX_PATH}/board-support/u-boot_build/a72/u-boot.img
Important Note: two tiboot3.bin files will be generated when building u-boot. Please select the one at the path listed above for successful boot.
8.8.4. Build SYSFW configuration¶
Not applicable to J7200 because it uses a combined boot flow which includes the SYSFW configuration.
8.8.5. Build Linux DTB and DTBO¶
The linux kernel input dts, dtso and generated dtb, dtbo are located below
${PSDK_LINUX_PATH}/board-support/linux-*/arch/arm64/boot/dts/ti/
Do below in ${PSDK_LINUX_PATH}/ to regenerate the linux kernel .dtb, dtbo files
make linux-dtbs
Do below in ${PSDK_LINUX_PATH}/ to copy the updated .dtb, dtbo files to SD card
sudo make linux-dtbs_install;sync
8.8.6. Build Linux kernel and kernel modules¶
Linux kernel can be found below
${PSDK_LINUX_PATH}/board-support/linux-*
Do below in ${PSDK_LINUX_PATH}/ to rebuild the linux kernel and kernel modules
make linux
Do below in ${PSDK_LINUX_PATH}/ to copy the updated linux kernel and kernel modules to SD card
sudo make linux_install;sync
8.8.7. Building PSDK Linux for HS Devices¶
HS Device build with PSDK Linux has not been enabled for J7200.
8.8.7.1. Prerequisite¶
Before building any binaries for HS devices, the PSDK must be set up for HS devices.
Setup PSDK LINUX
Certain steps below require the TI security development tools package, which has been included in the Linux SDK. It is recommended to set the environment variable TI_SECURE_DEV_PKG to this location as shown below.
export TI_SECURE_DEV_PKG=${PSDK_LINUX_PATH}/board-support/core-secdev-k3
8.8.7.2. Build Using Prebuilt ATF/OPTEE/MCU1_0 Images¶
Using prebuilt images of ATF (Arm Trusted Firmware), OPTEE (Open Portable Trusted Execution Environment), and MCU1_0 (Micro Controller Unit), we can quickly build binaries that can be used to boot a HS device.
Build R5F SPL, A72 SPL and A72 u-boot
U-boot can be built in the same way as shown in the section above.
Build SYSFW
Not applicable to J7200 because it uses a combined boot flow which includes the SYSFW configuration.
Build Linux DTB and DTBO
The Linux DTB and DTBO’s can be built in the same way as referenced in the section above.
Build Linux kernel and kernel modules
The Linux kernel and kernel modules can be built in the same way as referenced in the section above.
Installing the fitImage
If using an HS device, the fitImage will need to be installed. The fitImage is included in the prebuilt-images of the PSDK Linux. Install the fitImage using the command shown below
sudo install ${PSDK_LINUX_PATH}/board-support/prebuilt-images/fitImage /media/$(USER)/rootfs/boot/
8.8.7.3. Rebuild Using Custom ATF/OPTEE/MCU1_0 Image¶
If any component listed above needs to be updated, then the following procedures can be referenced to rebuild the binaries needed to boot using the updated component.
Updating ATF/OPTEE/MCU1_0 images for u-boot
The u-boot build for HS devices references the prebuilt images for ATF/OPTEE/MCU1_0. These images have already been signed and included at the below paths
${PSDK_LINUX_PATH}/board-support/prebuilt-images/bl31.bin.signed ${PSDK_LINUX_PATH}/board-support/prebuilt-images/bl32.bin.signed ${PSDK_LINUX_PATH}/board-support/prebuilt-images/ipc_echo_testb_mcu1_0_release_strip.xer5f.signedIf these images need to be rebuilt, the rebuilt images can be signed by using the TI_SECURE_DEV_PKG referenced above. For instance, the bl31.bin can be signed by running the below command
$TI_SECURE_DEV_PKG/scripts/secure-binary-image.sh bl31.bin bl31.bin.signedThese rebuilt files must then be copied into the directory ${PSDK_LINUX_PATH}/board-support/prebuilt-images/ and u-boot can be rebuilt using the new binaries by following the steps above.
SYSFW binary location
Updating Linux DTB and DTBO
The signed binaries should then be copied into the ${PSDK_LINUX_PATH}/board-support/prebuilt-images/ folder so that it can be integrated into the fitImage as described in the last section.
Updating Linux kernel and kernel modules
If the Linux Image must be modified and rebuilt, the Image needs to be signed using the TI_SECURE_DEV_PKG referenced above. This can be done by running the below command
$TI_SECURE_DEV_PKG/scripts/secure-binary-image.sh Image Image.secThe signed Image.sec should then be copied into the ${PSDK_LINUX_PATH}/board-support/prebuilt-images/ folder so that it can be integrated into the fitImage as described in the last section, and they can be rebuilt by following the steps above.
Updating fitImage for HS Devices
The fitImage.its, which was used to generate the prebuilt fitImage, is included at the location ${PSDK_LINUX_PATH}/board-support/prebuilt-images/.
If the fitImage.its needs to be modified, this will require the u-boot-tools package. This can be downloaded by using the command shown below
sudo apt install u-boot-toolsAfter installing the u-boot-tools and modifying the fitImage.its as required, the fitImage can be generated by running the below command
mkimage -f fitImage.its -r fitImageThe fitImage can then be installed by using the command shown below
sudo install ${PSDK_LINUX_PATH}/board-support/prebuilt-images/fitImage /media/$(USER)/rootfs/boot/