SPRADD1A August 2023 – September 2024 AM620-Q1 , AM623 , AM625 , AM625-Q1 , AM625SIP , AM62A1-Q1 , AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM62P , AM62P-Q1
This section covers loading the Linux kernel image, devicetree, and filesystem once a peripheral capable of loading these components into RAM has been configured. To test the kernel configuration, load U-Boot binaries over UART and exit autoboot when prompted as in previous sections.
This method uses the kernel image and initramfs filesystem that is provided by the AM62x Processor SDK. The table below specifies where these images are found within the SDK.
Component | Path |
---|---|
Kernel Image | TI_SDK/board-support/prebuilt-images/am62xx-evm/Image |
Ramdisk | TI_SDK/filesystem/am62xx-evm/tisdk-tiny-initramfs-am62xx-evm.rootfs.cpio |
The kernel devicetree needs to be compiled. While this devicetree will be identical to the devicetree used for U-Boot to this point, it must be compiled in the Linux kernel repository.
Follow the commands below to copy the edited board devicetree file from U-Boot to the Linux kernel repository and generate the kernel DTB.
// copy board DTS from U-Boot to kernel
$ cp TI_U_BOOT/arch/arm/dts/k3-am625-<boardname>.dts TI_LINUX/arch/arm64/boot/dts/ti/
// from the root of TI_LINUX
$ make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILE_64" distclean
$ make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILE_64" defconfig ti_arm64_prune.config
$ make DTC_FLAGS=-@ ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILE_64" ti/k3-am625-<boardname>.dtb
The resulting DTB is found at TI_LINUX/arch/arm64/boot/dts/ti/k3-am625-<boardname>.dtb.
The kernel image, devicetree, and filesystem are loaded separately into RAM through a peripheral or copied from non-volatile storage. This process depends on the peripharal or interface that was enabled on the custom board in the above sections. The Linux images need to be copied to the external media or host directory that is used to transfer the kernel components to the device through the available interface. In the above section, Ethernet was discussed and can be used if it is functional. In the below steps, SD Card is used as it is readily available on TI boards and is easy to use at this stage of board bring up.
To use SD card to load kernel components, a partitioned SD card is required. One way to create this is to flash the SD card with a default image provided by the SDK. This is done using an application like balenaEtcher. The default image is found at the AM62x Processor SDK Download Page. Select "Downloads" and then select "Download options" for PROCESSOR-SDK-LINUX-AM62X. Download the AM62x Yocto SD card image and flash it to the SD card. This will partition the card correctly and place a working version of the SDK filesystem on the card. This filesystem will not be used at this point.
To avoid confusion, remove all files from the boot partition and copy the kernel components to this location. A guide to flashing the SD card can be found in the AM62x Processor SDK Guide.
Use UART boot to get to a U-Boot prompt and halt autoboot. Use the U-Boot load command for the peripheral used to load kernel components into RAM. Refer to the U-Boot Documentation to determine what commands to use for each different peripheral. The following example is for using SD card to load the required kernel components.
/* using MMC device 0 (SD), partition 1 */
=> load mmc 0:1 $loadaddr Image
=> load mmc 0:1 $fdtaddr k3-am625-<boardname>.dtb
=> load mmc 0:1 $rdaddr tisdk-tiny-initramfs-am62xx-evm.rootfs.cpio
If the image fails to load, there is likely an issue with the device configuration. Return to Section 5.1 to attempt to reconfigure the device.
Now that the required kernel components have been loaded into device RAM, the next step is to specify the kernel initialization process. For board bring-up, this is to enter a kernel command shell and use initramfs as the filesystem. To do this, set the bootargs environment variable, which is passed from U-Boot to the Linux kernel when it begins to boot. The following U-Boot command sets this initialization process.
=> setenv bootargs rdinit=/bin/sh
The device is now prepared to attempt to boot the kernel using the images copied to RAM. The command below boots the kernel components stored in RAM.
=> booti $loadaddr $rdaddr:0x$filesize $fdtaddr
The Linux kernel will attempt to boot. If successful, the kernel bootlog will populate with initialization messages and eventually enter a kernel command shell. In order to have access to the system and hardware information, mount the following psuedo-filesystems using the commands below.
# mount -t proc none /proc
# mount -t sysfs none /sys
# mount -t devtmpfs none /dev
If you did not reach the kernel command shell, there are multiple methods to debug this issue. For methods on how to attempt to reconfigure a peripheral correctly to successfully boot the kernel, see Section 5.1. For help debugging, see Section 7.
Reaching the kernel command line provides access to tools that are useful in building the devicetree and debugging boot failures. It is important to continue the same iterative approach of enabling each peripheral one by one, and committing code to the U-Boot repository once a working configuration has been established. The devicetree configuration methods provided in Section 5.1 as well as tools in the next section are useful in building a devicetree to initialize all peripherals on the board.
Common next steps to complete the board bring-up process include configuring the custom board to use an external filesystem, enabling high speed data features, and customizing the kernel image. For more details, see the AM62x Processor SDK Guide.