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.

SK-AM64B: UBIFS/UBI rootfs files generation

Part Number: SK-AM64B
Other Parts Discussed in Thread: AM625, SK-AM62B, , TMDS64EVM

Hi,
Actually, i already follow this link

3.1.1.7. OSPI/QSPI — Processor SDK AM64X Documentation

I flashed the ospi.env files and rest files with tftp except rootfs file.
The main thing is that we are still depended on SD-card for that rootfs. So, currently we don't want to depend upon SD-card because in some board SD-card is working in some boards it not. 

currently use version = 08.06.00.42 version

We also found one link to build the rootfs file system.
Flash Linux to OSPI (ti.com)

Hear they mention these commands to run in host machine.

1. "mkfs.ubifs -r sdk-tiny-fs -o am6-sdk-tiny-fs.ubifs -m 16 -e 262016 -c 143 -v"
2. "ubinize -o am6-sdk-tiny-fs.ubi -m 16 -s 16 -p 256KiB ubinize.cfg -v"

But its clearly written to extract from tisdk-tiny-image-am64xx-evm.tar.xz file.

Reference: The tiny file system “sdk-tiny-fs” is first untarred from the file “tisdk-tiny-image-am64xx-evm.tar.xz” that is included in the AM64x Processor SDK Linux package.

So, my question is where we will get this tar.xz file? 

Regards 
Debashis

  • Hi Debashis,

    The file "tisdk-tiny-image-am64xx-evm.tar.xz" is in the SDK "filesystem/" folder.

  • Hi Bin,
    Thank you, we had downloaded the .bin of version 9.

    Now we can make the ubi format file system and after making that we have done these steps.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    root@am64xx-evm:/boot# ubiformat /dev/mtd7 -f am6-sdk-tiny-fs.ubi
    Test the mtd7 (ospi.rootfs) by attaching to the partition:
    root@am64xx-evm:/boot# ubiattach -m 7
    root@am64xx-evm:/boot# ubinfo -a
    root@am64xx-evm:/boot# mkdir /mnt/fs_test
    root@am64xx-evm:/boot# mount -t ubifs ubi0 /mnt/fs_test
    root@am64xx-evm:/boot# cd /mnt/fs_test
    root@am64xx-evm:/boot# ls -lrt
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    After that when we boot from spi(switch setting 00000000 00011011), it did not boot up.
    Then we reverted to sd card and by clicking ESC button entered uboot and ran these commands to boot up from OSPI. 

    Fullscreen
    1
    2
    3
    run args_all; setenv bootargs console=${console} ${optargs} root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1
    sf probe; sf read ${loadaddr} 0x800000 0x1240200; sf read ${fdtaddr} 0x700000 0xcfe7; run run_kern
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    We are able to boot up successfully with OSPI only with this set of steps.
    To confirm that the kernel in OSPI was booted up, we looked at the ethernet interfaces by running 'ifconfig'. It showed only one ethernet interface which confirmed that kernel from OSPI was booted.


    We are still dependent on SD card for accessing uboot and then run the commands to run the kernel. Is there any other way to run these commands directly to boot up with OSPI. We know that some environment variables need to be changed in order to do this, but are unsure of where these environment variables are and what we need to change. If you can give us any resources to help with this, that will be great.

    Thanks & Regards,

    Debashis 

  • Hi Debashis,


    After that when we boot from spi(switch setting 00000000 00011011), it did not boot up.

    Can you try the xSPI boot mode: 00000000 01110011?

  • Hi Bin,

    The xSPI boot mode worked for us. Thank you.

    We have flashed the SPI and everything is working. We have updated the rootfs file successfully in the ospi.rootfs partition and included the kernel image and dtb file in the /boot/ folder of the ospi.rootfs. Though now, we are stuck at trying to run the kernel from uboot. The environment is still configured to look for the SD card/MMC, and we are not able to get past the uboot stage during bootup. Can you please help us with the environment that we need to run to be able to run the kernel from the ospi.rootfs?

    Thanks & Regards,

    Desbashis

  • Hi Desbashis,

    Glad you made progress. Thanks for the update.

    I am routing your query to our U-Boot expert to comment on configuring U-Boot environment.

  • Can you please help us with the environment that we need to run to be able to run the kernel from the ospi.rootfs?

    If you are booting from OSPI to U-Boot prompt and this part is working the boot flow should continue using OSPI but there may be dependencies on SDK version, etc.

    Can you provide a print/dump of your current U-Boot environment (`env print`)?

    Regards, Andreas

  • Hi Andreas,

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    => env print
    addr_fit=0x90000000
    arch=arm
    args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${nbootpart} root=${nbootvolume} rootfstype=ubifs
    args_usb=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    autoload=no
    baudrate=115200
    board=am64x
    board_name=am64x_skevm
    board_rev=A
    board_serial=0039
    board_software_revision=01
    boot=mmc
    boot_fdt=try
    boot_fit=0
    bootcmd=run findfdt; run envboot; run init_${boot}; if test ${boot_fit} -eq 1; then run get_fit_${boot}; run get_overlaystring; run run_fit; else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Thanks for posting your environment. You are saying you are using SDK v8.6, which should define some OSPI-related ENV variables as defined through EXTRA_ENV_AM625_BOARD_SETTINGS_OSPI_NAND here https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/include/configs/am62x_evm.h?h=ti-u-boot-2021.01#n196

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #define EXTRA_ENV_AM625_BOARD_SETTINGS_OSPI_NAND \
    "nbootpart=ospi.rootfs\0" \
    "nbootvolume=ubi0:rootfs\0" \
    "bootdir=/boot\0" \
    "rd_spec=-\0" \
    "ubi_init=ubi part ${nbootpart}; ubifsmount ${nbootvolume};\0" \
    "args_ospi_nand=setenv bootargs console=${console} " \
    "${optargs} ubi.mtd=${nbootpart} " \
    "root=${nbootvolume} rootfstype=ubifs\0" \
    "init_ospi_nand=run args_all args_ospi_nand ubi_init\0" \
    "get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/${fdtfile};\0" \
    "get_overlay_ospi_nand=" \
    "fdt address ${fdtaddr};" \
    "fdt resize 0x100000;" \
    "for overlay in $name_overlays;" \
    "do;" \
    "ubifsload ${dtboaddr} ${bootdir}/${overlay} && " \
    "fdt apply ${dtboaddr};" \
    "done;\0" \
    "get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}\0" \
    "get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}\0"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    So I'm not sure why those don't show in your environment (perhaps they didn't get included during your board port, assuming you are not running on a vanilla SK-AM62B board) but you should be able to model after this, and add this to your environment. If you do run on the standard SK-AM62B board perhaps your U-Boot environment needs a "hard reset" as follows:

    Fullscreen
    1
    2
    3
    => env default -f -a
    => env save
    => reset
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    After you have the correct environment you'd need to set the boot environmental variable to ospi_nand for those settings to be used during the execution of the bootcmd env variable.

    Regards, Andreas

  • Hi Andreas,
    We are using SK-AM64B board not SK-AM62B as you mention above.

    So, currently we can able to boot the board from XSPI with out  SD-card. And regarding the rootfs file system we are using the tisdk-tiny.tar which is inside the <SDK_path>/filesystem(But this tiny system is not suitable for our application).
    we follow this link
    https://dev.ti.com/tirex/explore/node?node=A__AJ18sLHn3k.q.KnopPVnKw__linux_academy_am64x__7qm9DIS__LATEST&search=am64

    But we didn't change the first 5 address or file size(in the sense tiboot3.bin to env.backup) at that time we can able to boot up successfully . But after that we have to run this commands(the highlighted address we are changing as per the kernel and dtb address)

    run args_all; setenv bootargs console=${console} ${optargs} root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1
    
    sf probe; sf read ${loadaddr} 0x800000 0x1240200; sf read ${fdtaddr} 0x700000 0xcfe7; run run_kern


    when we change the address or file size(first 5 address or file size) by using mtdpart command we are not able to go to U-boot itself.

    After that we follow this link to build the u-boot env
    https://dev.ti.com/tirex/explore/node?node=A__AE9QJS6sYz1lbERsguPCIg__linux_academy_am64x__7qm9DIS__LATEST&search=am64

    Can you guide me regarding that config file(am64x_evm_a53_defconfig). what are thing I have to mark yes/No.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    svaya@svaya-desktop:~/Videos/safety_osv8.06/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ cat configs/am64x_evm_a53_defconfig | grep SD
    CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
    CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1800
    CONFIG_MMC_SDHCI=y
    CONFIG_MMC_SDHCI_ADMA=y
    CONFIG_SPL_MMC_SDHCI_ADMA=y
    CONFIG_MMC_SDHCI_AM654=y
    svaya@svaya-desktop:~/Videos/safety_osv8.06/board-support/u-boot-2021.01+gitAUTOINC+2ee8efd654-g2ee8efd654$ cat configs/am64x_evm_a53_defconfig | grep SPI
    CONFIG_SYS_SPI_U_BOOT_OFFS=0x300000
    CONFIG_SPL_DM_SPI=y
    CONFIG_SPL_SPI_FLASH_SUPPORT=y
    CONFIG_SPL_SPI_SUPPORT=y
    CONFIG_SPL_DM_SPI_FLASH=y
    # CONFIG_SPL_SPI_FLASH_TINY is not set
    CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
    CONFIG_SPL_SPI_LOAD=y
    # CONFIG_CMD_SPI is not set
    CONFIG_DM_SPI_FLASH=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



    And similarly can you tell me what are the changes to be done in emmc(16Gb) side because we have ordered TMDS64EVM
    and we want every thing to flash in emmc including rootfs (tisdk-default-image-am64xx-evm.tar.xz  as you already know that 
    SD-card is not reliable) .
  • when we change the address or file size(first 5 address or file size) by using mtdpart command we are not able to go to U-boot itself.

    If you move U-Boot artifacts (U-Boot A53 SPL, U-Boot A53) around in the OSPI memory, you'd need to update the respective CONFIG_SYS_SPI_U_BOOT_OFFS definition in am64x_evm_r5_defconfig to reflect the location of tispl.bin, and the CONFIG_SYS_SPI_U_BOOT_OFFS definition in am64x_evm_a53_defconfig to reflect the location of u-boot.img to make sure the boot flow works. 'mtdparts' is not used for booting U-Boot itself.

    Can you guide me regarding that config file(am64x_evm_a53_defconfig). what are thing I have to mark yes/No.

    Don't modify those config files manually; you should always use the Kconfig tool (via `make ... menuconfig`) to update the configurations to make sure all dependencies are being considered.

    And similarly can you tell me what are the changes to be done in emmc(16Gb) side because we have ordered TMDS64EVM

    Once you get the EVM, you should start out using the SDK default defconfig files. They will not need any customization to enable eMMC boot.

    As for programming U-Boot into the eMMC boot sector, and the rootfs, please see here: https://dev.ti.com/tirex/explore/node?node=A__AJ0x6npKrLsG5-CgSKYlcw__linux_academy_am64x__7qm9DIS__LATEST

    Regards, Andreas

  • Hi Andreas,
    Thank you for your help!


    We are able to set up the EVM with emmc boot option and it works without SD card. Though we have to always change the boot environment variables:

    Fullscreen
    1
    2
    3
    setenv mmcdev 0
    setenv bootpart 0
    boot
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    and then it successfully boots from emmc. How can we boot from emmc standalone?

  • We are able to set up the EVM with emmc boot option and it works without SD card.

    Great!!

    How can we boot from emmc standalone?

    One easy way to do it is by updating EXTRA_ENV_AM642_BOARD_SETTINGS_MMC according to your boot device/partition needs, see https://git.ti.com/cgit/ti-u-boot/ti-u-boot/tree/include/configs/am64x_evm.h?h=ti-u-boot-2021.01#n122

    If you don't want to edit/change any U-Boot source files you could also customize CONFIG_BOOTCOMMAND for A53 U-Boot (via Kconfig).

    Regards, Andreas