This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EVMK2H: Problems with the supplied arago-base-tisdk-image-k2hk-evm.ubi in ti-processor-sdk-linux-k2hk-evm-06.00.00.07

Part Number: EVMK2H

When trying to program the arago-base-tisdk-image-k2hk-evm.ubi image from ti-processor-sdk-linux-k2hk-evm-06.00.00.07 into the NAND flash on an EVMK2H Rev 4.0 I found the following issues:

1. The absence of the filesystem/tisdk-server-rootfs-image-k2hk-evm.ubi in the installation causes the setup.sh script to abort - see https://e2e.ti.com/support/processors/f/791/p/830795/3073458#3073458 for details.

The filesystem/tisdk-server-rootfs-image-k2hk-evm.ubi is not provided in the installation because it is too large to fit in the 512 MiB NAND flash on the EVMK2H. However, the lack of the tisdk-server-rootfs-image-k2hk-evm.ubi image causes the setup.sh script to crash before you can select other UBI (smaller) images to flash. As per the referenced thread a work-around is to create an empty tisdk-server-rootfs-image-k2hk-evm.ubi file to stop the setup.sh script from crashing.

2. When programmed the pre-built arago-base-tisdk-image-k2hk-evm.ubi image into NAND flash, Linux failed to boot because it was unable to mount the root file system in NAND flash. 

The first UBIFS related error during Linux boot is:

[2.752004] UBI error: cannot open mtd ubifs, error -2

Followed by:

[    2.789205] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0) error -19
[    2.797255] Please append a correct "root=" boot option; here are the availale partitions:

On investigation the problem was that the tisdk_k2hk-evm_defconfig didn't have the CONFIG_MTD_NAND_DAVINCI driver for the Keystone-II devices built into the Kernel.

To correct this used menuconfig to:

a. Add CONFIG_MEMORY and  CONFIG_TI_AEMIF which are dependencies for CONFIG_MTD_NAND_DAVINCI.

b. Add CONFIG_MTD_NAND_DAVINCI

The following is the difference between the supplied tisdk_k2hk-evm_defconfig and the change made the .config used for a re-build of the Kernel:

mr_halfword@Haswell-Ubuntu:~/ti/ti-processor-sdk-linux-k2hk-evm-06.00.00.07$ git diff ./board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/arch/arm/configs/tisdk_k2hk-evm_defconfig board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/.config
diff --git a/./board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/arch/arm/configs/tisdk_k2hk-evm_defconfig b/board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/.config
index e5c6dd3..fa0c649 100644
--- a/./board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/arch/arm/configs/tisdk_k2hk-evm_defconfig
+++ b/board-support/linux-4.19.38+gitAUTOINC+4dae378bbe-g4dae378bbe/.config
@@ -1564,6 +1564,7 @@ CONFIG_MTD_NAND_OMAP_BCH_BUILD=y
 # CONFIG_MTD_NAND_NANDSIM is not set
 CONFIG_MTD_NAND_BRCMNAND=y
 # CONFIG_MTD_NAND_PLATFORM is not set
+CONFIG_MTD_NAND_DAVINCI=y
 # CONFIG_MTD_SPI_NAND is not set
 
 #
@@ -4967,7 +4968,8 @@ CONFIG_EXTCON_PALMAS=m
 # CONFIG_EXTCON_RT8973A is not set
 # CONFIG_EXTCON_SM5502 is not set
 CONFIG_EXTCON_USB_GPIO=m
-# CONFIG_MEMORY is not set
+CONFIG_MEMORY=y
+CONFIG_TI_AEMIF=y
 CONFIG_IIO=y
 CONFIG_IIO_BUFFER=y
 # CONFIG_IIO_BUFFER_CB is not set

With the zImage rebuilt from the above and the arago-base-tisdk-image-k2hk-evm.ubi image rebuilt Linux on the EVMK2H was then able to successfully mount the rootfs from NAND flash.

3. The /boot/k2-fw-initrd.cpio.gz firmware file is not part of the filesystem for arago-base-tisdk-image-k2hk-evm, which was causing Linux to report errors about failure to load firmware.

To correct this I copied the /boot/k2-fw-initrd.cpio.gz from the tisdk-server-rootfs-image-k2hk-evm.tar.xz into the arago-base-tisdk-image-k2hk-evm filesystem and re-created the UBI image.

Can ti-processor-sdk-linux-k2hk-evm be corrected to resolve these issues for a future release?

For now have got a working Linux which is booting from NAND flash on the EVMK2H.