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.

[FAQ] TDA4VL: How to load kernel , dtb , filesystem from the USB device?

Part Number: TDA4VL

At uboot how we can load the kernel, dtb , filesystem from the USB device on TDA4X EVM ?

The detailed procedure is shown below.

  1. Boot from eMMC/SD
  2. At u-boot Choose one of two possible locations for the root filesystem and kernel to be loaded from:
    1. eMMC/SD
    2. USB drive
  • If you want to load the rootfs from the USB , these are the steps:

    1. In the UBOOT dtsi, dr_mode need to be changed from OTG to host  (eg: arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi)

      &usb0 {
      + dr_mode = "host";
         u-boot,dm-spl;
      };
       
    2. Add the usb mass storage driver support in uboot ,make below changes in UBOOT defconfig (eg: configs/j721s2_evm_a72_defconfig)

      +CONFIG_SPL_USB_STORAGE=y
      +CONFIG_USB_HOST=y
      +CONFIG_USB_STORAGE=y

    3. Make the USB drivers built in  instead of loadable , make below changes in the Linux defconfig (eg : arch/arm64/configs/tisdk_j721s2-evm_defconfig)

      CONFIG_USB_SUPPORT=y
      CONFIG_USB_COMMON=y
      CONFIG_USB=y
      CONFIG_USB_OTG=y
      CONFIG_USB_XHCI_HCD=y
      CONFIG_USB_XHCI_PCI=y
      CONFIG_USB_XHCI_PLATFORM=y
      CONFIG_USB_STORAGE=y
      CONFIG_USB_CDNS3=y
      CONFIG_USB_CDNS3_GADGET=y
      CONFIG_USB_CDNS3_HOST=y
      CONFIG_USB_CDNS3_TI=y
      CONFIG_USB_ROLE_SWITCH=y

    4. Build the uboot and Linux kernel image . Copy uboot images to emmc/sd and linux image to USB device rootfs partition (which can be created using mksdboot.sh script present in the linux sdk eg: sudo ./mksdboot.sh --device /dev/sdb --sdk  ../ )

    5. Halt at UBOOT 
      Change the bootcmd to load the kernel dtb and rootfs from the usb 

      =>setenv name_kern Image
      =>setenv get_kern_usb 'load usb ${bootpart} ${loadaddr} ${bootdir}/${name_kern}'
      =>setenv args_usb 'run finduuid; setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}'
      =>setenv get_fdt_usb 'load usb ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}'
      =>setenv init_usb 'run args_all args_usb'
      =>setenv bootcmd 'setenv boot usb;setenv bootpart 0:2; usb start; run findfdt; run init_usb; run get_kern_usb;run get_fdt_usb; run run_kern'

    6. Then run boot command 

    Demo:This is the demo on the TDA4VL EVM  though the above mentioned steps will apply on all TDA4X EVM.