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.

Linux/TMDSEVM572X: Boot from SD with single partition

Part Number: TMDSEVM572X
Other Parts Discussed in Thread: AM5726

Tool/software: Linux

Hello,

is it possible ot boot the AM572x EVM, or later a own board with Sitara AM5726, from a SD-Card with a single partition only? Meaning all images + the rootfs are getting thrown into the root directory of the sd-card.
I caught this thought when i read section 33.3.7.6 of the Sitara_AM572x_TRM User Guide.

I hope it doesnt look like a dumb question (new to forum).

Thanks in advance!

Michael

  • The software team have been notified. They will respond here.
  • Hello,

    Yes this should be possible using memory based filesystem. basically you dump your MLO/uImage/filesystem in SD card (fat partition). and then ask the boot loader to load the images onto ram and then run from there.
    You can have a look at following link
    [1] www.kernel.org/.../ramfs-rootfs-initramfs.txt

    Or another alternative would to extract the fs in fat16 partition and load the images from there (never tried it but ideally should work) for this you need to enable FAT file system support in linux.

    Cheers,
    --Prabhakar Lad
  • Hi Michael,

    I haven't seen such implementation in my experience. The boot & rootfs partitions have different types.
    U-boot looks for ext3/ext4 partition to load the kernel & filesystem, while boot partition is vfat.... See the create-sdcard.sh script.

    Best Regards,
    Yordan
  • Hi Michael,

    There is a RAW mode in some AM series, where the MLO can be selected from a RAW SDCard sector. In that case, you can just have EXT4 partition. But need to check if RAW mode booting from SDCard is available in AM572x
  • Hi Yordan,

    You can configure the uboot to use a ramdisk [1], this ramdisk image will be loaded to the RAM and you need to point the booatargs saying the root file system is on RAM refer [2]. In link 2 instead of reading from nand you can read from SD card.

    Basically ramdisk is the root filesystem which will be running onto RAM,  Infact this is used in systems which prefer quickboot.

    [1] processors.wiki.ti.com/.../Creating_a_RAMDISK
    [2] processors.wiki.ti.com/.../Booting_Linux_kernel_using_U-Boot
    [3] www.denx.de/.../RootFileSystemOnARamdisk

    Cheers,
    --Prabhakar Lad

  • Hi Michael,

    I could get access to AM572x TRM and there is RAW UDA mode for getting the MLO from RAW SDCard sector.

    "In Raw(UDA) mode, an image can be at one of the four consecutive locations in the main area: offset
    0x0 (0 KiB)/0x20000 (128 KiB)/0x40000 (256 KiB)/0x60000 (384 KiB). For this reason, the size of a
    booting image must not exceed 128 KiB. However, a device with an image greater than 128 KiB can
    be flash starting at one of the aforementioned locations. Therefore, the ROM code does not check the
    image size. The only drawback is that the image crosses the subsequent image boundary. Raw mode
    is detected by reading sectors 0, 256, 512, and 768. The content of these sectors is verified for the
    presence of a TOC structure. GP header must be located at the beginning of the booting image, as
    described in Section 33.3.8.2, Configuration Header. Image data is read directly from continuous
    sectors of a card. If raw mode is not detected, file system mode is assumed."

    Be careful in creating TOC/GP headers, which you can write into SDCard using dd command. One more pointer, you need to enable EXT filesystems in MLO, for MLO to parse and load the uboot from the single partition available. Or can also load uboot into raw partition and load it from MLO, which you might need to add.
  • Thank you for all the responses! I am going to test and try out your suggestions. It will probably take a while since I'm new to the topic.
    I will let you know what worked for me in the end!

    Cheers,

    Michael

  • Hello,

    now since a few weeks have passed I managed to build the SD-Card and wanted to share my solution with you. The goal was to boot the Linux Kernel with a custom rootfs from a single vFAT partition of the sd card.
    First of all I compiled the Kernel(4.4.32) & U-Boot(2016.05) from the provided TI-SDK. The most important configs for the Kernel regarding the boot mechanism was (ARCH=arm):
    General setup ---> Initial RAM filesystem and RAM disk support
    Device Drivers ---> Block devices ---> RAM block device support
    The rootfs was build using busybox-1.26.2. The finished rootfs was then compressed into a ramdisk image with:
    cpio -o -H newc | gzip > ramdisk.cpio.gz
    mkimage -A arm -O Linux -T ramdisk -C none -n 'some name' -d ramdisk.cpio.gz ramdisk.img

    After throwing all files (MLO, u-boot.img, zImage, *.dtb, ramdisk.img) onto my sd card I modified the environment of U-Boot to load the zImage, *.dtb and ramdisk.img into RAM and boot the Kernel via bootz ${addrImage} ${addrRamdisk} ${addrDTB} and bootargs=console=ttyS2,115200n8 root=/dev/ram0 rw

    If you want to, you can also combine your Kernel image with an initial small ramdisk. From the initial ramfs you then can initiate the proper rootfs.

    I hope this might help someone in future.

    Cheers! Michael