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.

AM6442: How to create ospi.rootfs(UBIFS) and boot Linux from OSPI without SD

Part Number: AM6442

Hello TI expert,

I would like to develop the device using AM6442 which can boot-up from OSPI without SD.

Currently, I am investigating the reference doc at https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/07_03_01_006/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html

and read information at  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/848408/ccs-am6548-ubifs-create-error

Could you provide me how to create the ospi.rootfs(UBIFS) from the files of processor_sdk_linux_am64x_07_03_01_006/yocto-build/build/arago-tmp-external-arm-glibc/deploy/images/am64xx-evm/

Thanks

  • Hi Thinh,
    It'd take several steps to fully boot u-boot/kernel/dtb/rootfs... completely from OSPI in general.
    As a first step, have you tried building/flashing/booting u-boot (i.e. tiboot3.bin, tispl.bin, u-boot.img) from OSPI on AM64x EVM?
    For your reference, there's additional workaround when building/booting u-boot using SDK 7.3.1 as discussed in another e2e.
    e2e.ti.com/.../3759656

    Best,
    -Hong

  • Hi Hong,

    I have already build all of image package by yocto successfully.

    and my board can boot from OSPI and enter u-boot without SD.

    I want to run ospi.rootfs(ubifs) only because I have removed eMMC and SD device on my product. I will build a tiny rootfs for my product.

    Your reference ticket does not help me yet to resolve this issue.

    Thanks,

  • Hi Thinh,
    I'm attaching the log using SDK 7.3.1 from "mtdinfo -a" running @kernel.
    I think it is feasible to mount a small footprint rootfs as UBIFS on mtd5 (ospi.rootfs)
    I'll spend some time on this, and get back to you, most likely sometime next week.
    Best,
    -Hong

    am6_7.3.1_mtdinfo.txt
    am64xx-evm login: root
    root@am64xx-evm:~# uname -a
    Linux am64xx-evm 5.4.106-g023faefa70 #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021 aarch64 GNU/Linux
    root@am64xx-evm:~# mtdinfo -a
    Count of MTD devices:           7
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6
    Sysfs interface supported:      yes
    
    mtd0
    Name:                           ospi.tiboot3
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          2 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:0
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd1
    Name:                           ospi.tispl
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          8 (2097152 bytes, 2.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:2
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd2
    Name:                           ospi.u-boot
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          16 (4194304 bytes, 4.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:4
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd3
    Name:                           ospi.env
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:6
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd4
    Name:                           ospi.env.backup
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:8
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd5
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          223 (58458112 bytes, 55.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:10
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd6
    Name:                           ospi.phypattern
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:12
    Bad blocks are allowed:         false
    Device is writable:             true
    
    root@am64xx-evm:~# 

  • Dear Hong Guan64,

    Maybe you could not understand my opinions.

    I would like to clarify some information that I'm being stuck in that is: processor_sdk_linux_am64x_07_03_01_006 does not have any script to create the ubifs for ospi.rootfs. That is why my process of Linux booting is stuck at u-boot. (My product has only OSPI flash memory, not use eMMC/SD).

    Could you give me the script to create the ubifs?

    Thanks

  • Hi Thinh,
    Yes, understood your inquiry.
    I'll spend some time looking into the full OSPI boot flow, i.e. generating rootfs UBIFS, & UBI files which depends on AM64x EVM on-board OSPI parameters etc..., will get back to you, most likely earlier next week.
    Best,
    -Hong

  • Hello Hong,

    I am doing workaround by get the script from the old AM65x SDK and can make the ubifs file with some missing image from /root/boot/ (Image, dtb, vmlinx,) as log below:

    I have built a tiny rootfs from Yocto and decompress it into tmp/arago-am64x-tiny-image/

    After copy /targetNFS/boot/* to tmp/arago-am64x-tiny-image/boot/

    And then create ubifs file as below

    brian@brian:~/processor_sdk_linux_am64x_07_03_01_006$ sudo ./create-ubifs.sh tmp/arago-am64x-tiny-image -v rootfs
    SDK path: /home/brian/processor_sdk_linux_am64x_07_03_01_006
    
    Parameters:
        image_rootfs_dir ..... "tmp/arago-am64x-tiny-image"
        image_name_prefix .... "/home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs"
        vol_name ............. "rootfs"
    
    mkfs.ubifs
    	root:         tmp/arago-am64x-tiny-image/
    	min_io_size:  8
    	leb_size:     130944
    	max_leb_cnt:  448
    	output:       /home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs.ubifs
    	jrn_size:     7201920
    	reserved:     0
    	compr:        lzo
    	keyhash:      r5
    	fanout:       8
    	orph_lebs:    1
    	space_fixup:  0
    	super lebs:   1
    	master lebs:  2
    	log_lebs:     4
    	lpt_lebs:     2
    	orph_lebs:    1
    	main_lebs:    168
    	gc lebs:      1
    	index lebs:   2
    	leb_cnt:      178
    	UUID:         CDD72F61-BD89-4147-8150-A1F4C6795A77
    Success!
    ubinize: LEB size:                  130944
    ubinize: PEB size:                  131072
    ubinize: min. I/O size:             1
    ubinize: sub-page size:             1
    ubinize: VID offset:                64
    ubinize: data offset:               128
    ubinize: UBI image sequence number: 2081104671
    ubinize: loaded the ini-file "/home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs.ubinize.cfg"
    ubinize: count of sections: 1
    
    ubinize: parsing section "ubifs"
    ubinize: mode=ubi, keep parsing
    ubinize: volume type: dynamic
    ubinize: volume ID: 0
    ubinize: volume size was not specified in section "ubifs", assume minimum to fit image "/home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs.ubifs"23308032 bytes (22.2 MiB)
    ubinize: volume name: rootfs
    ubinize: volume alignment: 1
    ubinize: autoresize flags found
    ubinize: adding volume 0
    ubinize: writing volume 0
    ubinize: image file: /home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs.ubifs
    
    ubinize: writing layout volume
    ubinize: done
    
    Success! The UBI image is available at "/home/brian/processor_sdk_linux_am64x_07_03_01_006/filesystem/custom-am64xx-evm-rootfs.ubi"
    

    And then downloading it into OSPI Flash and boot up:

    => dhcp 0x80000000 custom-am64xx-evm-rootfs.ubifs
    link up on port 1, speed 1000, full duplex
    BOOTP broadcast 1
    DHCP client bound to address 192.168.1.11 (11 ms)
    Using ethernet@8000000 device
    TFTP from server 192.168.1.9; our IP address is 192.168.1.11
    Filename 'custom-am64xx-evm-rootfs.ubifs'.
    Load address: 0x80000000
    Loading: #################
             289.1 KiB/s
    done
    Bytes transferred = 23308032 (163a700 hex)

    => sf probe
    WARN: Unable to get temperature. Assuming room temperature
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => sf erase 0x800000 2000000
    SF: 33554432 bytes @ 0x800000 Erased: OK
    => sf update 0x80000000 0x800000 0x$filesize
    device 0 offset 0x800000, size 0x163a700
    23045888 bytes written, 262144 bytes skipped in 143.294s, speed 167683 B/s
    => env set boot ubi
    => boot
    SD/MMC found on device 1
    ## Error: "init_ubi" not defined
    ## Error: "get_kern_ubi" not defined
    ## Error: "get_fdt_ubi" not defined
    Bad Linux ARM64 Image magic!
    

    I don't know why 262144 bytes skipped in write command and it can not bootup.

    I went to SD Linux and mout my ubifs and

    shown wrong fs type, bad option, bad superblock on ubi0:thinh_ubi, missing codepage or helper program, or other error.

    It seems there is an error in ubifs file.

  • Hi Thinh,
    I'm looking into your inquiry, including root_fs UBIFS/UBI files creation etc..., will get back to you early next week.
    Best,
    -Hong

  • Hello Hong,

    While waiting for your feedback I continue to workaround as below process.

    1. Bootup Linux from SD card and create the ubifs filesystem on mtd5 partition of SNOR.

    1.1 List out partions by the following command:

    root@am64xx-evm:/# cat /proc/mtd 
    dev:    size   erasesize  name
    mtd0: 00080000 00040000 "ospi.tiboot3"
    mtd1: 00200000 00040000 "ospi.tispl"
    mtd2: 00400000 00040000 "ospi.u-boot"
    mtd3: 00040000 00040000 "ospi.env"
    mtd4: 00040000 00040000 "ospi.env.backup"
    mtd5: 037c0000 00040000 "ospi.rootfs"
    mtd6: 00040000 00040000 "ospi.phypattern"

    1.2 Format the ospi.rootfs partition:

    root@am64xx-evm:/# ubiformat /dev/mtd5
    ubiformat: mtd5 (nor), size 58458112 bytes (55.7 MiB), 223 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 16 bytes
    libscan: scanning eraseblock 222 -- 100 % complete  
    ubiformat: 223 eraseblocks are supposedly empty
    ubiformat: formatting eraseblock 222 -- 100 % complete

    1.3 Attach /dev/mtd5 (ospi.rootfs) to UBI:

    root@am64xx-evm:/# ubiattach /dev/ubi_ctrl -m 5
    [ 1812.828857] ubi0: attaching mtd5
    [ 1812.845075] ubi0: scanning is finished
    [ 1812.852783] ubi0: attached mtd5 (name "ospi.rootfs", size 55 MiB)
    [ 1812.858967] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
    [ 1812.865908] ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
    [ 1812.872300] ubi0: VID header offset: 64 (aligned 64), data offset: 128
    [ 1812.878838] ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
    [ 1812.884861] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
    [ 1812.892089] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 403966760
    [ 1812.901135] ubi0: available PEBs: 219, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0
    [ 1812.910278] ubi0: background thread "ubi_bgt0d" started, PID 976
    UBI device number 0, total 223 LEBs (58429568 bytes, 55.7 MiB), available 219 LEBs (57381504 bytes, 54.7 MiB), LEB size 262016 bytes (255.8 K)

    1.4 Create UBI volumes:

    root@am64xx-evm:/# ubimkvol /dev/ubi0 -s 50MiB -N rootfs
    Volume ID 0, size 201 LEBs (52665216 bytes, 50.2 MiB), LEB size 262016 bytes (255.8 KiB), dynamic, name "rootfs", alignment 1

    1.5 Create a rootfs.ubi directory in root:

    root@am64xx-evm:/# mkdir rootfs.ubi

    1.6 Mount ubi0.rootfs(ospi.rootfs) into the created directory rootfs.ubi

    [ 2130.561582] UBIFS (ubi0:0): default file-system created
    [ 2130.566898] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [ 2130.573133] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1025
    [ 2130.589493] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [ 2130.596979] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
    [ 2130.606656] UBIFS (ubi0:0): FS size: 50045056 bytes (47 MiB, 191 LEBs), journal size 2620160 bytes (2 MiB, 10 LEBs)
    [ 2130.617093] UBIFS (ubi0:0): reserved for root: 2363750 bytes (2308 KiB)
    [ 2130.623716] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID D3EEC4F0-9471-483F-B448-1F31D53EB8F3, small LPT model

    1.7 Decompress the tisdk-tiny-image into the rootfs.ubi directory:

    root@am64xx-evm:/# tar -xvf tisdk-tiny-image-am64xx-evm-20210714070458.rootfs.tar.xz -C rootfs.ubi/
    root@am64xx-evm:/# sync

    1.8 copy all things in /boot/* to /rootfs.ubi/boot/

    root@am64xx-evm:/# cp boot/* rootfs.ubi/boot/
    root@am64xx-evm:/# sync
    root@am64xx-evm:/# ls rootfs.ubi/boot/
    Image                          k3-am642-evm.dtb               vmlinux.gz-5.4.87-gb6adce5bd1
    Image-5.4.87-gb6adce5bd1       vmlinux.gz
    root@am64xx-evm:/# ls rootfs.ubi/
    bin      dev      home     linuxrc  mnt      run      sys      usr
    boot     etc      lib      media    proc     sbin     tmp      var
    
    root@am64xx-evm:/# umount rootfs.ubi/
    [ 2058.377258] UBIFS (ubi0:0): un-mount UBI device 0
    [ 2058.382258] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" stops

    2. Verify the ubifs on the ospi.rootfs partition
    Reboot the board and still bootup again from SD card,
    login the root dir after that attaching /dev/mtd5 to UBI,
    mount ubi0.rootfs to the created dir /rootfs.ubi/ and checking kerel image and dtb file.

    root@am64xx-evm:/# ubiattach /dev/ubi_ctrl -m 5
    [  311.268337] ubi0: attaching mtd5
    [  311.283124] ubi0: scanning is finished
    [  311.291413] ubi0: attached mtd5 (name "ospi.rootfs", size 55 MiB)
    [  311.297549] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
    [  311.305921] ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
    [  311.312734] ubi0: VID header offset: 64 (aligned 64), data offset: 128
    [  311.319336] ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
    [  311.325415] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [  311.332644] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 403966760
    [  311.341689] ubi0: available PEBs: 18, total reserved PEBs: 205, PEBs reserved for bad PEB handling: 0
    [  311.351010] ubi0: background thread "ubi_bgt0d" started, PID 791
    UBI device number 0, total 223 LEBs (58429568 bytes, 55.7 MiB), available 18 LEBs (4716288 bytes, 4.4 MiB), LEB size 262016 bytes (255.8 KiB)
    root@am64xx-evm:/# mount -t ubifs ubi0:rootfs rootfs.ubi/
    [  338.021255] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [  338.027208] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 803
    [  338.038447] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [  338.045932] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
    [  338.055615] UBIFS (ubi0:0): FS size: 50045056 bytes (47 MiB, 191 LEBs), journal size 2620160 bytes (2 MiB, 10 LEBs)
    [  338.066055] UBIFS (ubi0:0): reserved for root: 2363750 bytes (2308 KiB)
    [  338.072677] UBIFS (ubi0:0): media format: w5/r0 (latest is w5/r0), UUID D3EEC4F0-9471-483F-B448-1F31D53EB8F3, small LPT model
    root@am64xx-evm:/# ls rootfs.ubi/boot/
    Image                          k3-am642-evm.dtb               vmlinux.gz-5.4.87-gb6adce5bd1
    Image-5.4.87-gb6adce5bd1       vmlinux.gz
    root@am64xx-evm:/# 

    Conclusion: UBIFS was created on ospi.rootfs by application on ARAGO Linux successfully.

    3. Poweroff the EVM board, and to switch off the power switch.

    And then switch OSPI boot mode, switch on the power switch.
     And enter the u-boot.
    3.1 Checking u-boot env

    => print
    args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_ubi=setenv bootargs ${console} ${optargs} rootfstype=ubifs root=ubi0:rootfs rw ubi.mtd=ospi.rootfs
    init_ubi=run args_all args_ubi; sf probe; ubi part ospi.rootfs; ubifsmount ubi:rootfs;

    3.2 Run some the following commands:

    => run args_all
    => run args_ubi
    => sf probe
    WARN: Unable to get temperature. Assuming room temperature
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => ubi part ospi.rootfs
    ubi0: attaching mtd6
    ubi0: scanning is finished
    ubi0 error: vtbl_check: bad CRC at record 127: 0xf116c36b, not 0x000000
    Volume table record 127 dump:
            reserved_pebs   0
            alignment       0
            data_pad        0
            vol_type        0
            upd_marker      0
            name_len        0
            name            NULL
    ubi0: volume table was restored
    ubi0: attached mtd6 (name "ospi.rootfs", size 55 MiB)
    ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
    ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1
    ubi0: VID header offset: 64 (aligned 64), data offset: 128
    ubi0: good PEBs: 223, bad PEBs: 0, corrupted PEBs: 0
    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 403966760
    ubi0: available PEBs: 18, total reserved PEBs: 205, PEBs reserved for bad PEB handling: 0
    flash operation timed out
    ubi0 error: nor_erase_prepare: cannot invalidate PEB 0, write returned -110
    ubi0: dumping 262144 bytes of data from PEB 0, offset 0
    ubi0 error: erase_worker: failed to erase PEB 0, error -5
    ubi0 error: erase_worker: bad physical eraseblock 0 detected
    ubi0 error: do_work: work failed with error code -5
    ubi0 error: ubi_do_worker: ubi_bgt0d: work failed with error code -5
    =>
    

    There is a problem in attaching ospi.rootfs to UBI.
    There is a difference in the " min/max. I/O unit sizes " of UBI function between u-boot and Linux apps.
    Please take a look the message and help me to resolve the issue. Thanks.

  • Hi Thinh,
    I'm able to have full OSPI boot on AM64x EVM using SDK 7.3.1, and summarizing the steps for your reference:
    1. Re-partition OSPI MTD partitions
    There are 7 partitions in kernel in SDK 7.3.1 as listed below:

    [    2.139178] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    2.144180] 7 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    2.150702] Creating 7 MTD partitions on "fc40000.spi.0":
    [    2.156102] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    2.162856] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    2.169423] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    2.176018] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    2.182348] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    2.189285] 0x000000800000-0x000003fc0000 : "ospi.rootfs"
    [    2.195853] 0x000003fc0000-0x000004000000 : "ospi.phypattern"

    I re-partition OSPI by modifying "mtdparts" bootargs as listed below:

    setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)
    =>
    [    2.139098] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    2.144100] 9 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    2.150622] Creating 9 MTD partitions on "fc40000.spi.0":
    [    2.156021] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    2.162771] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    2.169339] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    2.175928] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    2.182260] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    2.189192] 0x000000700000-0x000000800000 : "ospi.dtb"
    [    2.195457] 0x000000800000-0x000001c00000 : "ospi.kernel"
    [    2.202151] 0x000001c00000-0x000003fc0000 : "ospi.rootfs"
    [    2.208732] 0x000003fc0000-0x000004000000 : "ospi.phypattern"

    Where the two additional fixed partitions are added for "ospi.dtb" and "ospi.kernel". Refer to the attached log file "am6_mtdinfo_ospi.txt" for more details. By doing so, it is possible to load the kernel/dtb to DDR from OSPI using "sf..." cmd @u-boot instead of accessing them from "ospi.rootfs" under UBI.

    2. Generate UBIFS/UBI rootfs files
    I used the following cmds to generate UBIFS/UBI files for a reference SDK tiny file system "sdk-tiny-fs" (~8MiB):

    - "mkfs.ubifs -r sdk-tiny-fs -o am6-sdk-tiny-fs.ubifs -m 16 -e 262016 -c 143 -v"
    - "ubinize -o am6-sdk-tiny-fs.ubi -m 16 -s 16 -p 256KiB ubinize.cfg -v"
    ubinize.cfg:
    [ubifs]
     mode=ubi
     image=am6-sdk-tiny-fs.ubifs
     vol_id=0
     vol_type=dynamic
     vol_name=rootfs
     vol_flags=autoresize

    Note that:
    - I found very useful reference on MTD/UBI/UBIFS:
    www.linux-mtd.infradead.org/.../ubi.html
    www.linux-mtd.infradead.org/.../ubifs.html
    - The parameters used in the above "mkfs.ubifs..." and "ubinize..." cmds are based on the MTD7 partition for ospi.rootfs as listed below.

    mtd7
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:14
    Bad blocks are allowed:         false
    Device is writable:             true

    3. Flash the generated UBI rootfs file "am6-sdk-tiny-fs.ubi" to OSPI in kernel from SD card boot as an example:
    I used "ubiformat /dev/mtd7 -f am6-sdk-tiny-fs.ubi" at kernel to flash/format the UBI rootfs file to MTD7 (ospi.rootfs).
    Refer to the attached log file "am6_ubiformat_ospi.txt" for more details.
    I also attached another log file "am6_ubiattach_ospi.txt" to show attaching MDT7 (ospi.rootfs) for testing.

    4. Flash rest of files to OSPI at u-boot from SD card boot as an example:
    Refer to the attached log file "am6_flash_ospi.txt" for flashing tiboot3.bin/tispl.bin/u-boot.img/kernel/dtb to OSPI @u-boot from SD card boot

    5. Full boot from OSPI
    Note the following u-boot cmds, and refer to the attached log file "am6_7.3.1_ospi_boot.txt" for full OSPI boot log:

    - OSPI MTD re-partition
    setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)
    - env setup
    run findfdt; run envboot; run args_all; run finduuid
    setenv bootargs console=${console} ${optargs} root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1
    - load kernel/dtb from OSPI to DDR, and then boot kernel....
    sf probe; sf read ${loadaddr} 0x800000 0x1100000; sf read ${fdtaddr} 0x700000 0x10000; run run_kern

    Best,

    -Hong

    am6_mtdinfo_ospi.txt
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 16:20:13 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    SPL initial stack usage: 13396 bytes
    Trying to boot from MMC2
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.4(release):2021.00.003-dirty
    NOTICE:  BL31: Built : 14:41:43, May 28 2021
    
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Trying to boot from MMC2
    
    
    U-Boot 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    Board: AM64-GPEVM rev E2
    DRAM:  2 GiB
    not found for dev mux
    MMC:   sdhci@fa10000: 0, sdhci@fa00000: 1
    Loading Environment from FAT... In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   
    Warning: ethernet@8000000 using MAC address from ROM
    eth0: ethernet@8000000
    Hit any key to stop autoboot:  2  0 
    => setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)
    => boot
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    574 bytes read in 3 ms (186.5 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    16799752 bytes read in 665 ms (24.1 MiB/s)
    35357 bytes read in 6 ms (5.6 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 000000008fff4000, end 000000008ffffa1c ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.4.106-g023faefa70 (oe-user@oe-host) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021
    [    0.000000] Machine model: Texas Instruments AM642 EVM
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a2100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a3000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a3100000, compatible id shared-dma-pool
    [    0.000000] cma: Reserved 512 MiB at 0x00000000e0000000
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.0
    [    0.000000] percpu: Embedded 2 pages/cpu s48472 r8192 d74408 u131072
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 3296
    [    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern) root=PARTUUID=3c261301-02 rw rootfstype=ext4 rootwait
    ....
    ....
    [    2.139098] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    2.144100] 9 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    2.150622] Creating 9 MTD partitions on "fc40000.spi.0":
    [    2.156021] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    2.162771] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    2.169339] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    2.175928] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    2.182260] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    2.189192] 0x000000700000-0x000000800000 : "ospi.dtb"
    [    2.195457] 0x000000800000-0x000001c00000 : "ospi.kernel"
    [    2.202151] 0x000001c00000-0x000003fc0000 : "ospi.rootfs"
    [    2.208732] 0x000003fc0000-0x000004000000 : "ospi.phypattern"
    ....
    ....
    root@am64xx-evm:~# uname -a
    Linux am64xx-evm 5.4.106-g023faefa70 #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
    root@am64xx-evm:~# mtdinfo -a
    Count of MTD devices:           9
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8
    Sysfs interface supported:      yes
    
    mtd0
    Name:                           ospi.tiboot3
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          2 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:0
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd1
    Name:                           ospi.tispl
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          8 (2097152 bytes, 2.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:2
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd2
    Name:                           ospi.u-boot
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          16 (4194304 bytes, 4.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:4
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd3
    Name:                           ospi.env
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:6
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd4
    Name:                           ospi.env.backup
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:8
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd5
    Name:                           ospi.dtb
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          4 (1048576 bytes, 1024.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:10
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd6
    Name:                           ospi.kernel
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          80 (20971520 bytes, 20.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:12
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd7
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:14
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd8
    Name:                           ospi.phypattern
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:16
    Bad blocks are allowed:         false
    Device is writable:             true
    
    root@am64xx-evm:~# 

    am6_ubiformat_ospi.txt
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 16:20:13 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    SPL initial stack usage: 13396 bytes
    Trying to boot from MMC2
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.4(release):2021.00.003-dirty
    NOTICE:  BL31: Built : 14:41:43, May 28 2021
    
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Trying to boot from MMC2
    
    
    U-Boot 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    Board: AM64-GPEVM rev E2
    DRAM:  2 GiB
    not found for dev mux
    MMC:   sdhci@fa10000: 0, sdhci@fa00000: 1
    Loading Environment from FAT... In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   
    Warning: ethernet@8000000 using MAC address from ROM
    eth0: ethernet@8000000
    Hit any key to stop autoboot:  2  0 
    => setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)
    => boot
    switch to partitions #0, OK
    mmc1 is current device
    SD/MMC found on device 1
    574 bytes read in 3 ms (186.5 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    16799752 bytes read in 665 ms (24.1 MiB/s)
    35357 bytes read in 7 ms (4.8 MiB/s)
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 000000008fff4000, end 000000008ffffa1c ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.4.106-g023faefa70 (oe-user@oe-host) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021
    [    0.000000] Machine model: Texas Instruments AM642 EVM
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a2100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a3000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a3100000, compatible id shared-dma-pool
    [    0.000000] cma: Reserved 512 MiB at 0x00000000e0000000
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.0
    [    0.000000] percpu: Embedded 2 pages/cpu s48472 r8192 d74408 u131072
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 3296
    [    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern) root=PARTUUID=3c261301-02 rw rootfstype=ext4 rootwait
    ....
    ....
    [    2.142971] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    2.147969] 9 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    2.154492] Creating 9 MTD partitions on "fc40000.spi.0":
    [    2.159892] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    2.166645] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    2.173205] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    2.179795] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    2.186120] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    2.193047] 0x000000700000-0x000000800000 : "ospi.dtb"
    [    2.199313] 0x000000800000-0x000001c00000 : "ospi.kernel"
    [    2.206014] 0x000001c00000-0x000003fc0000 : "ospi.rootfs"
    [    2.212618] 0x000003fc0000-0x000004000000 : "ospi.phypattern"
    ....
    ....
    root@am64xx-evm:~# uname -a
    Linux am64xx-evm 5.4.106-g023faefa70 #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
    root@am64xx-evm:~# mtdinfo -a
    Count of MTD devices:           9
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8
    Sysfs interface supported:      yes
    
    mtd0
    Name:                           ospi.tiboot3
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          2 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:0
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd1
    Name:                           ospi.tispl
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          8 (2097152 bytes, 2.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:2
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd2
    Name:                           ospi.u-boot
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          16 (4194304 bytes, 4.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:4
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd3
    Name:                           ospi.env
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:6
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd4
    Name:                           ospi.env.backup
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:8
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd5
    Name:                           ospi.dtb
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          4 (1048576 bytes, 1024.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:10
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd6
    Name:                           ospi.kernel
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          80 (20971520 bytes, 20.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:12
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd7
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:14
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd8
    Name:                           ospi.phypattern
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:16
    Bad blocks are allowed:         false
    Device is writable:             true
    
    root@am64xx-evm:~# cd  ..
    root@am64xx-evm:/home# cd ..
    root@am64xx-evm:/# cd boot
    root@am64xx-evm:/boot# ls 
    Image			      k3-am642-evm.dtb
    Image-5.4.106-g023faefa70     k3-am642-sk.dtb
    am6-sdk-tiny-fs-mtd5.ubi      tisdk-tiny-image-am64xx-evm.cpio
    am6-sdk-tiny-fs.ubi	      vmlinux.gz
    arago-tiny-image-k2g-evm.ubi  vmlinux.gz-5.4.106-g023faefa70
    root@am64xx-evm:/boot# ubiformat /dev/mtd7 -f am6-sdk-tiny-fs.ubi
    ubiformat: mtd7 (nor), size 37486592 bytes (35.7 MiB), 143 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 16 bytes
    libscan: scanning eraseblock 0 --  0 % complete  libscan: scanning eraseblock 1 --  1 % complete  libscan: scanning eraseblock 2 --  2 % complete  libscan: scanning eraseblock 3 --  2 % complete  libscan: scanning eraseblock 4 --  3 % complete  libscan: scanning eraseblock 5 --  4 % complete  libscan: scanning eraseblock 6 --  4 % complete  libscan: scanning eraseblock 7 --  5 % complete  libscan: scanning eraseblock 8 --  6 % complete  libscan: scanning eraseblock 9 --  6 % complete  libscan: scanning eraseblock 10 --  7 % complete  libscan: scanning eraseblock 11 --  8 % complete  libscan: scanning eraseblock 12 --  9 % complete  libscan: scanning eraseblock 13 --  9 % complete  libscan: scanning eraseblock 14 -- 10 % complete  libscan: scanning eraseblock 15 -- 11 % complete  libscan: scanning eraseblock 16 -- 11 % complete  libscan: scanning eraseblock 17 -- 12 % complete  libscan: scanning eraseblock 18 -- 13 % complete  libscan: scanning eraseblock 19 -- 13 % complete  libscan: scanning eraseblock 20 -- 14 % complete  libscan: scanning eraseblock 21 -- 15 % complete  libscan: scanning eraseblock 22 -- 16 % complete  libscan: scanning eraseblock 23 -- 16 % complete  libscan: scanning eraseblock 24 -- 17 % complete  libscan: scanning eraseblock 25 -- 18 % complete  libscan: scanning eraseblock 26 -- 18 % complete  libscan: scanning eraseblock 27 -- 19 % complete  libscan: scanning eraseblock 28 -- 20 % complete  libscan: scanning eraseblock 29 -- 20 % complete  libscan: scanning eraseblock 30 -- 21 % complete  libscan: scanning eraseblock 31 -- 22 % complete  libscan: scanning eraseblock 32 -- 23 % complete  libscan: scanning eraseblock 33 -- 23 % complete  libscan: scanning eraseblock 34 -- 24 % complete  libscan: scanning eraseblock 35 -- 25 % complete  libscan: scanning eraseblock 36 -- 25 % complete  libscan: scanning eraseblock 37 -- 26 % complete  libscan: scanning eraseblock 38 -- 27 % complete  libscan: scanning eraseblock 39 -- 27 % complete  libscan: scanning eraseblock 40 -- 28 % complete  libscan: scanning eraseblock 41 -- 29 % complete  libscan: scanning eraseblock 42 -- 30 % complete  libscan: scanning eraseblock 43 -- 30 % complete  libscan: scanning eraseblock 44 -- 31 % complete  libscan: scanning eraseblock 45 -- 32 % complete  libscan: scanning eraseblock 46 -- 32 % complete  libscan: scanning eraseblock 47 -- 33 % complete  libscan: scanning eraseblock 48 -- 34 % complete  libscan: scanning eraseblock 49 -- 34 % complete  libscan: scanning eraseblock 50 -- 35 % complete  libscan: scanning eraseblock 51 -- 36 % complete  libscan: scanning eraseblock 52 -- 37 % complete  libscan: scanning eraseblock 53 -- 37 % complete  libscan: scanning eraseblock 54 -- 38 % complete  libscan: scanning eraseblock 55 -- 39 % complete  libscan: scanning eraseblock 56 -- 39 % complete  libscan: scanning eraseblock 57 -- 40 % complete  libscan: scanning eraseblock 58 -- 41 % complete  libscan: scanning eraseblock 59 -- 41 % complete  libscan: scanning eraseblock 60 -- 42 % complete  libscan: scanning eraseblock 61 -- 43 % complete  libscan: scanning eraseblock 62 -- 44 % complete  libscan: scanning eraseblock 63 -- 44 % complete  libscan: scanning eraseblock 64 -- 45 % complete  libscan: scanning eraseblock 65 -- 46 % complete  libscan: scanning eraseblock 66 -- 46 % complete  libscan: scanning eraseblock 67 -- 47 % complete  libscan: scanning eraseblock 68 -- 48 % complete  libscan: scanning eraseblock 69 -- 48 % complete  libscan: scanning eraseblock 70 -- 49 % complete  libscan: scanning eraseblock 71 -- 50 % complete  libscan: scanning eraseblock 72 -- 51 % complete  libscan: scanning eraseblock 73 -- 51 % complete  libscan: scanning eraseblock 74 -- 52 % complete  libscan: scanning eraseblock 75 -- 53 % complete  libscan: scanning eraseblock 76 -- 53 % complete  libscan: scanning eraseblock 77 -- 54 % complete  libscan: scanning eraseblock 78 -- 55 % complete  libscan: scanning eraseblock 79 -- 55 % complete  libscan: scanning eraseblock 80 -- 56 % complete  libscan: scanning eraseblock 81 -- 57 % complete  libscan: scanning eraseblock 82 -- 58 % complete  libscan: scanning eraseblock 83 -- 58 % complete  libscan: scanning eraseblock 84 -- 59 % complete  libscan: scanning eraseblock 85 -- 60 % complete  libscan: scanning eraseblock 86 -- 60 % complete  libscan: scanning eraseblock 87 -- 61 % complete  libscan: scanning eraseblock 88 -- 62 % complete  libscan: scanning eraseblock 89 -- 62 % complete  libscan: scanning eraseblock 90 -- 63 % complete  libscan: scanning eraseblock 91 -- 64 % complete  libscan: scanning eraseblock 92 -- 65 % complete  libscan: scanning eraseblock 93 -- 65 % complete  libscan: scanning eraseblock 94 -- 66 % complete  libscan: scanning eraseblock 95 -- 67 % complete  libscan: scanning eraseblock 96 -- 67 % complete  libscan: scanning eraseblock 97 -- 68 % complete  libscan: scanning eraseblock 98 -- 69 % complete  libscan: scanning eraseblock 99 -- 69 % complete  libscan: scanning eraseblock 100 -- 70 % complete  libscan: scanning eraseblock 101 -- 71 % complete  libscan: scanning eraseblock 102 -- 72 % complete  libscan: scanning eraseblock 103 -- 72 % complete  libscan: scanning eraseblock 104 -- 73 % complete  libscan: scanning eraseblock 105 -- 74 % complete  libscan: scanning eraseblock 106 -- 74 % complete  libscan: scanning eraseblock 107 -- 75 % complete  libscan: scanning eraseblock 108 -- 76 % complete  libscan: scanning eraseblock 109 -- 76 % complete  libscan: scanning eraseblock 110 -- 77 % complete  libscan: scanning eraseblock 111 -- 78 % complete  libscan: scanning eraseblock 112 -- 79 % complete  libscan: scanning eraseblock 113 -- 79 % complete  libscan: scanning eraseblock 114 -- 80 % complete  libscan: scanning eraseblock 115 -- 81 % complete  libscan: scanning eraseblock 116 -- 81 % complete  libscan: scanning eraseblock 117 -- 82 % complete  libscan: scanning eraseblock 118 -- 83 % complete  libscan: scanning eraseblock 119 -- 83 % complete  libscan: scanning eraseblock 120 -- 84 % complete  libscan: scanning eraseblock 121 -- 85 % complete  libscan: scanning eraseblock 122 -- 86 % complete  libscan: scanning eraseblock 123 -- 86 % complete  libscan: scanning eraseblock 124 -- 87 % complete  libscan: scanning eraseblock 125 -- 88 % complete  libscan: scanning eraseblock 126 -- 88 % complete  libscan: scanning eraseblock 127 -- 89 % complete  libscan: scanning eraseblock 128 -- 90 % complete  libscan: scanning eraseblock 129 -- 90 % complete  libscan: scanning eraseblock 130 -- 91 % complete  libscan: scanning eraseblock 131 -- 92 % complete  libscan: scanning eraseblock 132 -- 93 % complete  libscan: scanning eraseblock 133 -- 93 % complete  libscan: scanning eraseblock 134 -- 94 % complete  libscan: scanning eraseblock 135 -- 95 % complete  libscan: scanning eraseblock 136 -- 95 % complete  libscan: scanning eraseblock 137 -- 96 % complete  libscan: scanning eraseblock 138 -- 97 % complete  libscan: scanning eraseblock 139 -- 97 % complete  libscan: scanning eraseblock 140 -- 98 % complete  libscan: scanning eraseblock 141 -- 99 % complete  libscan: scanning eraseblock 142 -- 100 % complete  
    ubiformat: 143 eraseblocks have valid erase counter, mean value is 1
    ubiformat: flashing eraseblock 0 --  3 % complete  ubiformat: flashing eraseblock 1 --  6 % complete  ubiformat: flashing eraseblock 2 -- 10 % complete  ubiformat: flashing eraseblock 3 -- 13 % complete  ubiformat: flashing eraseblock 4 -- 16 % complete  ubiformat: flashing eraseblock 5 -- 20 % complete  ubiformat: flashing eraseblock 6 -- 23 % complete  ubiformat: flashing eraseblock 7 -- 26 % complete  ubiformat: flashing eraseblock 8 -- 30 % complete  ubiformat: flashing eraseblock 9 -- 33 % complete  ubiformat: flashing eraseblock 10 -- 36 % complete  ubiformat: flashing eraseblock 11 -- 40 % complete  ubiformat: flashing eraseblock 12 -- 43 % complete  ubiformat: flashing eraseblock 13 -- 46 % complete  ubiformat: flashing eraseblock 14 -- 50 % complete  ubiformat: flashing eraseblock 15 -- 53 % complete  ubiformat: flashing eraseblock 16 -- 56 % complete  ubiformat: flashing eraseblock 17 -- 60 % complete  ubiformat: flashing eraseblock 18 -- 63 % complete  ubiformat: flashing eraseblock 19 -- 66 % complete  ubiformat: flashing eraseblock 20 -- 70 % complete  ubiformat: flashing eraseblock 21 -- 73 % complete  ubiformat: flashing eraseblock 22 -- 76 % complete  ubiformat: flashing eraseblock 23 -- 80 % complete  ubiformat: flashing eraseblock 24 -- 83 % complete  ubiformat: flashing eraseblock 25 -- 86 % complete  ubiformat: flashing eraseblock 26 -- 90 % complete  ubiformat: flashing eraseblock 27 -- 93 % complete  ubiformat: flashing eraseblock 28 -- 96 % complete  ubiformat: flashing eraseblock 29 -- 100 % complete  
    ubiformat: formatting eraseblock 30 --  0 % complete  ubiformat: formatting eraseblock 31 --  1 % complete  ubiformat: formatting eraseblock 32 --  2 % complete  ubiformat: formatting eraseblock 33 --  3 % complete  ubiformat: formatting eraseblock 34 --  4 % complete  ubiformat: formatting eraseblock 35 --  5 % complete  ubiformat: formatting eraseblock 36 --  6 % complete  ubiformat: formatting eraseblock 37 --  7 % complete  ubiformat: formatting eraseblock 38 --  7 % complete  ubiformat: formatting eraseblock 39 --  8 % complete  ubiformat: formatting eraseblock 40 --  9 % complete  ubiformat: formatting eraseblock 41 -- 10 % complete  ubiformat: formatting eraseblock 42 -- 11 % complete  ubiformat: formatting eraseblock 43 -- 12 % complete  ubiformat: formatting eraseblock 44 -- 13 % complete  ubiformat: formatting eraseblock 45 -- 14 % complete  ubiformat: formatting eraseblock 46 -- 15 % complete  ubiformat: formatting eraseblock 47 -- 15 % complete  ubiformat: formatting eraseblock 48 -- 16 % complete  ubiformat: formatting eraseblock 49 -- 17 % complete  ubiformat: formatting eraseblock 50 -- 18 % complete  ubiformat: formatting eraseblock 51 -- 19 % complete  ubiformat: formatting eraseblock 52 -- 20 % complete  ubiformat: formatting eraseblock 53 -- 21 % complete  ubiformat: formatting eraseblock 54 -- 22 % complete  ubiformat: formatting eraseblock 55 -- 23 % complete  ubiformat: formatting eraseblock 56 -- 23 % complete  ubiformat: formatting eraseblock 57 -- 24 % complete  ubiformat: formatting eraseblock 58 -- 25 % complete  ubiformat: formatting eraseblock 59 -- 26 % complete  ubiformat: formatting eraseblock 60 -- 27 % complete  ubiformat: formatting eraseblock 61 -- 28 % complete  ubiformat: formatting eraseblock 62 -- 29 % complete  ubiformat: formatting eraseblock 63 -- 30 % complete  ubiformat: formatting eraseblock 64 -- 30 % complete  ubiformat: formatting eraseblock 65 -- 31 % complete  [  130.502486] Initializing XFRM netlink socket
    ubiformat: formatting eraseblock 66 -- 32 % complete  ubiformat: formatting eraseblock 67 -- 33 % complete  ubiformat: formatting eraseblock 68 -- 34 % complete  ubiformat: formatting eraseblock 69 -- 35 % complete  ubiformat: formatting eraseblock 70 -- 36 % complete  ubiformat: formatting eraseblock 71 -- 37 % complete  ubiformat: formatting eraseblock 72 -- 38 % complete  ubiformat: formatting eraseblock 73 -- 38 % complete  ubiformat: formatting eraseblock 74 -- 39 % complete  ubiformat: formatting eraseblock 75 -- 40 % complete  ubiformat: formatting eraseblock 76 -- 41 % complete  ubiformat: formatting eraseblock 77 -- 42 % complete  ubiformat: formatting eraseblock 78 -- 43 % complete  ubiformat: formatting eraseblock 79 -- 44 % complete  ubiformat: formatting eraseblock 80 -- 45 % complete  ubiformat: formatting eraseblock 81 -- 46 % complete  ubiformat: formatting eraseblock 82 -- 46 % complete  ubiformat: formatting eraseblock 83 -- 47 % complete  ubiformat: formatting eraseblock 84 -- 48 % complete  ubiformat: formatting eraseblock 85 -- 49 % complete  ubiformat: formatting eraseblock 86 -- 50 % complete  ubiformat: formatting eraseblock 87 -- 51 % complete  ubiformat: formatting eraseblock 88 -- 52 % complete  ubiformat: formatting eraseblock 89 -- 53 % complete  ubiformat: formatting eraseblock 90 -- 53 % complete  ubiformat: formatting eraseblock 91 -- 54 % complete  ubiformat: formatting eraseblock 92 -- 55 % complete  ubiformat: formatting eraseblock 93 -- 56 % complete  ubiformat: formatting eraseblock 94 -- 57 % complete  ubiformat: formatting eraseblock 95 -- 58 % complete  ubiformat: formatting eraseblock 96 -- 59 % complete  ubiformat: formatting eraseblock 97 -- 60 % complete  ubiformat: formatting eraseblock 98 -- 61 % complete  ubiformat: formatting eraseblock 99 -- 61 % complete  ubiformat: formatting eraseblock 100 -- 62 % complete  ubiformat: formatting eraseblock 101 -- 63 % complete  ubiformat: formatting eraseblock 102 -- 64 % complete  ubiformat: formatting eraseblock 103 -- 65 % complete  ubiformat: formatting eraseblock 104 -- 66 % complete  ubiformat: formatting eraseblock 105 -- 67 % complete  ubiformat: formatting eraseblock 106 -- 68 % complete  ubiformat: formatting eraseblock 107 -- 69 % complete  ubiformat: formatting eraseblock 108 -- 69 % complete  ubiformat: formatting eraseblock 109 -- 70 % complete  ubiformat: formatting eraseblock 110 -- 71 % complete  ubiformat: formatting eraseblock 111 -- 72 % complete  ubiformat: formatting eraseblock 112 -- 73 % complete  ubiformat: formatting eraseblock 113 -- 74 % complete  ubiformat: formatting eraseblock 114 -- 75 % complete  ubiformat: formatting eraseblock 115 -- 76 % complete  ubiformat: formatting eraseblock 116 -- 76 % complete  ubiformat: formatting eraseblock 117 -- 77 % complete  ubiformat: formatting eraseblock 118 -- 78 % complete  ubiformat: formatting eraseblock 119 -- 79 % complete  ubiformat: formatting eraseblock 120 -- 80 % complete  ubiformat: formatting eraseblock 121 -- 81 % complete  ubiformat: formatting eraseblock 122 -- 82 % complete  ubiformat: formatting eraseblock 123 -- 83 % complete  ubiformat: formatting eraseblock 124 -- 84 % complete  ubiformat: formatting eraseblock 125 -- 84 % complete  ubiformat: formatting eraseblock 126 -- 85 % complete  ubiformat: formatting eraseblock 127 -- 86 % complete  ubiformat: formatting eraseblock 128 -- 87 % complete  ubiformat: formatting eraseblock 129 -- 88 % complete  ubiformat: formatting eraseblock 130 -- 89 % complete  ubiformat: formatting eraseblock 131 -- 90 % complete  ubiformat: formatting eraseblock 132 -- 91 % complete  ubiformat: formatting eraseblock 133 -- 92 % complete  ubiformat: formatting eraseblock 134 -- 92 % complete  ubiformat: formatting eraseblock 135 -- 93 % complete  ubiformat: formatting eraseblock 136 -- 94 % complete  ubiformat: formatting eraseblock 137 -- 95 % complete  ubiformat: formatting eraseblock 138 -- 96 % complete  ubiformat: formatting eraseblock 139 -- 97 % complete  ubiformat: formatting eraseblock 140 -- 98 % complete  ubiformat: formatting eraseblock 141 -- 99 % complete  ubiformat: formatting eraseblock 142 -- 100 % complete  
    root@am64xx-evm:/boot# 

    am6_ubiattach_ospi.txt
    root@am64xx-evm:/boot# uname -a
    Linux am64xx-evm 5.4.106-g023faefa70 #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
    root@am64xx-evm:/boot# mtdinfo -a
    Count of MTD devices:           9
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8
    Sysfs interface supported:      yes
    
    mtd0
    Name:                           ospi.tiboot3
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          2 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:0
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd1
    Name:                           ospi.tispl
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          8 (2097152 bytes, 2.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:2
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd2
    Name:                           ospi.u-boot
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          16 (4194304 bytes, 4.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:4
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd3
    Name:                           ospi.env
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:6
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd4
    Name:                           ospi.env.backup
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:8
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd5
    Name:                           ospi.dtb
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          4 (1048576 bytes, 1024.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:10
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd6
    Name:                           ospi.kernel
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          80 (20971520 bytes, 20.0 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:12
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd7
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:14
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd8
    Name:                           ospi.phypattern
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          1 (262144 bytes, 256.0 KiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:16
    Bad blocks are allowed:         false
    Device is writable:             true
    
    root@am64xx-evm:/boot# ubiattach -m 7
    [  286.899494] ubi0: attaching mtd7
    [  286.914837] ubi0: scanning is finished
    [  287.018454] ubi0: volume 0 ("rootfs") re-sized from 28 to 139 LEBs
    [  287.031900] ubi0: attached mtd7 (name "ospi.rootfs", size 35 MiB)
    [  287.042821] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
    [  287.049790] ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
    [  287.056205] ubi0: VID header offset: 64 (aligned 64), data offset: 128
    [  287.062752] ubi0: good PEBs: 143, bad PEBs: 0, corrupted PEBs: 0
    [  287.068798] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [  287.076047] ubi0: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1945417933
    [  287.085217] ubi0: available PEBs: 0, total reserved PEBs: 143, PEBs reserved for bad PEB handling: 0
    [  287.094383] ubi0: background thread "ubi_bgt0d" started, PID 1114
    UBI device number 0, total 143 LEBs (37468288 bytes, 35.7 MiB), available 0 LEBs (0 bytes), LEB size 262016 bytes (255.8 KiB)
    root@am64xx-evm:/boot# ubinfo -a
    UBI version:                    1
    Count of UBI devices:           1
    UBI control device major/minor: 10:61
    Present UBI devices:            ubi0
    
    ubi0
    Volumes count:                           1
    Logical eraseblock size:                 262016 bytes, 255.8 KiB
    Total amount of logical eraseblocks:     143 (37468288 bytes, 35.7 MiB)
    Amount of available logical eraseblocks: 0 (0 bytes)
    Maximum count of volumes                 128
    Count of bad physical eraseblocks:       0
    Count of reserved physical eraseblocks:  0
    Current maximum erase counter value:     5
    Minimum input/output unit size:          16 bytes
    Character device major/minor:            238:0
    Present volumes:                         0
    
    Volume ID:   0 (on ubi0)
    Type:        dynamic
    Alignment:   1
    Size:        139 LEBs (36420224 bytes, 34.7 MiB)
    State:       OK
    Name:        rootfs
    Character device major/minor: 238:1
    root@am64xx-evm:/boot# mount -t ubifs ubi0 /mnt/fs_test
    [  305.393026] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [  305.398996] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1118
    [  307.373207] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [  307.380775] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
    [  307.391683] UBIFS (ubi0:0): FS size: 33800064 bytes (32 MiB, 129 LEBs), journal size 5240320 bytes (4 MiB, 20 LEBs)
    [  307.402700] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [  307.409003] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 763BE965-1F7D-4F3A-90C5-ABE0CCBF2B8D, small LPT model
    root@am64xx-evm:/boot# cd /mnt/fs_test
    root@am64xx-evm:/mnt/fs_test# ls -lrt
    total 0
    drwxrwxrwt  2 root root  160 Apr  4 04:08 tmp
    dr-xr-xr-x  2 root root  160 Apr  4 04:08 sys
    dr-xr-xr-x  2 root root  160 Apr  4 04:08 proc
    drwxr-xr-x  2 root root  160 Apr  4 04:08 mnt
    drwxr-xr-x  2 root root  160 Apr  4 04:08 media
    drwxr-xr-x  3 root root  224 Apr  4 04:08 home
    drwxr-xr-x  2 root root  160 Apr  4 04:08 dev
    drwxr-xr-x  2 root root  160 Apr  4 04:08 boot
    drwxr-xr-x  8 root root  808 Apr  6 18:36 var
    drwxr-xr-x  9 root root  608 Apr  6 18:36 usr
    drwxr-xr-x  4 root root 3168 Apr  6 18:36 lib
    drwxr-xr-x  2 root root 5128 Apr  6 18:36 bin
    drwxr-xr-x  2 root root 4520 Apr  6 18:36 sbin
    drwxr-xr-x  2 root root  160 Apr  6 18:36 run
    drwxr-xr-x 19 root root 3496 Apr  6 18:36 etc
    lrwxrwxrwx  1 root root   19 Jun 17  2021 linuxrc -> /bin/busybox.nosuid
    root@am64xx-evm:/mnt/fs_test# 

    am6_flash_ospi.txt
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 16:20:13 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    SPL initial stack usage: 13396 bytes
    Trying to boot from MMC2
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.4(release):2021.00.003-dirty
    NOTICE:  BL31: Built : 14:41:43, May 28 2021
    
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Trying to boot from MMC2
    
    
    U-Boot 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    Board: AM64-GPEVM rev E2
    DRAM:  2 GiB
    not found for dev mux
    MMC:   sdhci@fa10000: 0, sdhci@fa00000: 1
    Loading Environment from FAT... In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   
    Warning: ethernet@8000000 using MAC address from ROM
    eth0: ethernet@8000000
    Hit any key to stop autoboot:  2  0 
    => mmc rescan
    => ls mmc 1:1
       390826   tiboot3_7.3.1_pb.bin
          574   uEnv.txt
       824532   u-boot_7.3.1_env.img
                System Volume Information/
       703508   tispl_7.3.1_env.bin
     16799752   Image-am64xx-evm.bin
       704484   tispl_7.3.1_pb.bin
                .Trash-1000/
       393003   tiboot3_7.3.1_env.bin
        35357   k3-am642-evm.dtb
       824412   u-boot_7.3.1_pb.img
          128   ospi_phy_pattern
       823972   u-boot_7.3.1.img
       704380   tispl_7.3.1.bin
       390595   tiboot3_7.3.1.bin
       824412   u-boot.img
       704484   tispl.bin
       390826   tiboot3.bin
    
    16 file(s), 2 dir(s)
    
    => sf probe
    WARN: Unable to get temperature. Assuming room temperature
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    => load mmc 1:1 ${loadaddr} tiboot3.bin
    390826 bytes read in 20 ms (18.6 MiB/s)
    => sf update $loadaddr 0x0 $filesize
    device 0 offset 0x0, size 0x5f6aa
    0 bytes written, 390826 bytes skipped in 0.5s, speed 50025728 B/s
    => load mmc 1:1 ${loadaddr} tispl.bin
    704484 bytes read in 33 ms (20.4 MiB/s)
    => sf update $loadaddr 0x80000 $filesize
    device 0 offset 0x80000, size 0xabfe4
    0 bytes written, 704484 bytes skipped in 0.8s, speed 65581056 B/s
    => load mmc 1:1 ${loadaddr} u-boot.img
    824412 bytes read in 39 ms (20.2 MiB/s)
    => sf update $loadaddr 0x280000 $filesize
    device 0 offset 0x280000, size 0xc945c
    0 bytes written, 824412 bytes skipped in 0.10s, speed 64938299 B/s
    => ls mmc 1:2 boot
    <DIR>       4096 .
    <DIR>       4096 ..
    <SYM>         30 vmlinux.gz
            16799752 Image-5.4.106-g023faefa70
               35511 k3-am642-sk.dtb
               35357 k3-am642-evm.dtb
    <SYM>         25 Image
             8121233 vmlinux.gz-5.4.106-g023faefa70
             6615552 tisdk-tiny-image-am64xx-evm.cpio
            12320768 arago-tiny-image-k2g-evm.ubi
             7864320 am6-sdk-tiny-fs.ubi
             7864320 am6-sdk-tiny-fs-mtd5.ubi
    => load mmc 1:2 ${loadaddr} boot/Image              
    16799752 bytes read in 666 ms (24.1 MiB/s)
    => sf update $loadaddr 0x800000 $filesize
    device 0 offset 0x800000, size 0x1005808
       Updating, 57% 9437184 B/s0 bytes written, 16799752 bytes skipped in 0.182s, speed 16799752 B/s
    => load mmc 1:2 ${loadaddr} boot/k3-am642-evm.dtb
    35357 bytes read in 6 ms (5.6 MiB/s)
    => sf update $loadaddr 0x700000 $filesize
    device 0 offset 0x700000, size 0x8a1d
    0 bytes written, 35357 bytes skipped in 0.2s, speed 7241113 B/s
    => 

    5482.am6_7.3.1_ospi_boot.txt
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 16:20:13 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    SPL initial stack usage: 13396 bytes
    Trying to boot from SPI
    WARN: Unable to get temperature. Assuming room temperature
    Starting ATF on ARM64 core...
    
    NOTICE:  BL31: v2.4(release):2021.00.003-dirty
    NOTICE:  BL31: Built : 14:41:43, May 28 2021
    
    U-Boot SPL 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    Trying to boot from SPI
    WARN: Unable to get temperature. Assuming room temperature
    
    
    U-Boot 2020.01-ge995ed0ec1 (May 28 2021 - 14:48:57 +0000)
    
    SoC:   AM64X SR1.0
    Model: Texas Instruments AM642 EVM
    Board: AM64-GPEVM rev E2
    DRAM:  2 GiB
    not found for dev mux
    MMC:   sdhci@fa10000: 0, sdhci@fa00000: 1
    Loading Environment from FAT... In:    serial@2800000
    Out:   serial@2800000
    Err:   serial@2800000
    Net:   
    Warning: ethernet@8000000 using MAC address from ROM
    eth0: ethernet@8000000
    Hit any key to stop autoboot:  2  0 
    => setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)
    => run findfdt; run envboot; run args_all; run finduuid
    SD/MMC found on device 1
    => setenv bootargs console=${console} ${optargs} root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1
    => sf probe; sf read ${loadaddr} 0x800000 0x1100000; sf read ${fdtaddr} 0x700000 0x10000; run run_kern
    WARN: Unable to get temperature. Assuming room temperature
    SF: Detected s28hs512t with page size 256 Bytes, erase size 256 KiB, total 64 MiB
    device 0 offset 0x800000, size 0x1100000
    SF: 17825792 bytes @ 0x800000 Read: OK
    device 0 offset 0x700000, size 0x10000
    SF: 65536 bytes @ 0x700000 Read: OK
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 000000008fff4000, end 000000008ffffa1c ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 5.4.106-g023faefa70 (oe-user@oe-host) (gcc version 9.2.1 20191025 (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10))) #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021
    [    0.000000] Machine model: Texas Instruments AM642 EVM
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a0000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a0100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a1000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a1100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a2000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a2100000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-dma-memory@a3000000, compatible id shared-dma-pool
    [    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB
    [    0.000000] OF: reserved mem: initialized node r5f-memory@a3100000, compatible id shared-dma-pool
    [    0.000000] cma: Reserved 512 MiB at 0x00000000e0000000
    [    0.000000] psci: probing for conduit method from DT.
    [    0.000000] psci: PSCIv1.1 detected in firmware.
    [    0.000000] psci: Using standard PSCI v0.2 function IDs
    [    0.000000] psci: Trusted OS migration not required
    [    0.000000] psci: SMC Calling Convention v1.0
    [    0.000000] percpu: Embedded 2 pages/cpu s48472 r8192 d74408 u131072
    [    0.000000] Detected VIPT I-cache on CPU0
    [    0.000000] CPU features: detected: ARM erratum 845719
    [    0.000000] CPU features: detected: GIC system register CPU interface
    [    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 3296
    [    0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern) root=ubi0:rootfs rw ubi.mtd=ospi.rootfs rootfstype=ubifs rootwait=1
    [    0.000000] Dentry cache hash table entries: 32768 (order: 2, 262144 bytes, linear)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 1, 131072 bytes, linear)
    [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
    [    0.000000] software IO TLB: mapped [mem 0xbbff0000-0xbfff0000] (64MB)
    [    0.000000] Memory: 1388096K/212992K available (9662K kernel code, 854K rwdata, 3840K rodata, 1664K init, 681K bss, 18446744073707852224K reserved, 524288K cma-reserved)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    [    0.000000] rcu: Preemptible hierarchical RCU implementation.
    [    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=2.
    [    0.000000] 	Tasks RCU enabled.
    [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
    [    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
    [    0.000000] GICv3: GIC: Using split EOI/Deactivate mode
    [    0.000000] GICv3: 256 SPIs implemented
    [    0.000000] GICv3: 0 Extended SPIs implemented
    [    0.000000] GICv3: Distributor has no Range Selector support
    [    0.000000] GICv3: 16 PPIs implemented
    [    0.000000] GICv3: no VLPI support, no direct LPI support
    [    0.000000] GICv3: CPU0: found redistributor 0 region 0:0x0000000001840000
    [    0.000000] ITS [mem 0x01820000-0x0182ffff]
    [    0.000000] GIC: enabling workaround for ITS: Socionext Synquacer pre-ITS
    [    0.000000] ITS@0x0000000001820000: allocated 1048576 Devices @df000000 (flat, esz 8, psz 64K, shr 0)
    [    0.000000] ITS: using cache flushing for cmd queue
    [    0.000000] GICv3: using LPI property table @0x00000000df870000
    [    0.000000] GIC: using cache flushing for LPI property table
    [    0.000000] GICv3: CPU0: using allocated LPI pending table @0x00000000df880000
    [    0.000000] random: get_random_bytes called from start_kernel+0x2b8/0x42c with crng_init=0
    [    0.000000] arch_timer: cp15 timer(s) running at 200.00MHz (phys).
    [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2e2049d3e8, max_idle_ns: 440795210634 ns
    [    0.000005] sched_clock: 56 bits at 200MHz, resolution 5ns, wraps every 4398046511102ns
    [    0.008432] Console: colour dummy device 80x25
    [    0.013019] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=800000)
    [    0.023688] pid_max: default: 32768 minimum: 301
    [    0.028494] LSM: Security Framework initializing
    [    0.033295] Mount-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.040886] Mountpoint-cache hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.051118] ASID allocator initialised with 32768 entries
    [    0.056793] rcu: Hierarchical SRCU implementation.
    [    0.061946] Platform MSI: msi-controller@1820000 domain created
    [    0.068199] PCI/MSI: /bus@f4000/interrupt-controller@1800000/msi-controller@1820000 domain created
    [    0.077737] smp: Bringing up secondary CPUs ...
    [    0.083100] Detected VIPT I-cache on CPU1
    [    0.083135] GICv3: CPU1: found redistributor 1 region 0:0x0000000001860000
    [    0.083147] GICv3: CPU1: using allocated LPI pending table @0x00000000df890000
    [    0.083197] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [    0.083315] smp: Brought up 1 node, 2 CPUs
    [    0.112689] SMP: Total of 2 processors activated.
    [    0.117498] CPU features: detected: 32-bit EL0 Support
    [    0.122764] CPU features: detected: CRC32 instructions
    [    0.134027] CPU: All CPU(s) started at EL2
    [    0.138229] alternatives: patching kernel code
    [    0.144108] devtmpfs: initialized
    [    0.153098] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [    0.163084] futex hash table entries: 512 (order: -1, 32768 bytes, linear)
    [    0.172313] pinctrl core: initialized pinctrl subsystem
    [    0.178614] NET: Registered protocol family 16
    [    0.190135] DMA: preallocated 256 KiB pool for atomic allocations
    [    0.197238] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
    [    0.217797] HugeTLB registered 16.0 GiB page size, pre-allocated 0 pages
    [    0.224672] HugeTLB registered 512 MiB page size, pre-allocated 0 pages
    [    0.231440] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
    [    0.239878] cryptd: max_cpu_qlen set to 1000
    [    0.247970] vsys_5v0: supplied by evm_12v0
    [    0.252398] vsys_3v3: supplied by evm_12v0
    [    0.257385] iommu: Default domain type: Translated 
    [    0.262822] SCSI subsystem initialized
    [    0.267193] mc: Linux media interface: v0.10
    [    0.271590] videodev: Linux video capture interface: v2.00
    [    0.277217] pps_core: LinuxPPS API ver. 1 registered
    [    0.282290] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.291632] PTP clock support registered
    [    0.295660] EDAC MC: Ver: 3.0.0
    [    0.299531] omap-mailbox 29020000.mailbox: omap mailbox rev 0x66fc9100
    [    0.306560] omap-mailbox 29040000.mailbox: omap mailbox rev 0x66fc9100
    [    0.313356] omap-mailbox 29060000.mailbox: omap mailbox rev 0x66fc9100
    [    0.320671] FPGA manager framework
    [    0.324267] Advanced Linux Sound Architecture Driver Initialized.
    [    0.331510] clocksource: Switched to clocksource arch_sys_counter
    [    0.337973] VFS: Disk quotas dquot_6.6.0
    [    0.342110] VFS: Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
    [    0.354831] thermal_sys: Registered thermal governor 'step_wise'
    [    0.354837] thermal_sys: Registered thermal governor 'power_allocator'
    [    0.361390] NET: Registered protocol family 2
    [    0.373152] tcp_listen_portaddr_hash hash table entries: 4096 (order: 0, 65536 bytes, linear)
    [    0.381999] TCP established hash table entries: 8192 (order: 0, 65536 bytes, linear)
    [    0.389979] TCP bind hash table entries: 8192 (order: 1, 131072 bytes, linear)
    [    0.397470] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.404100] UDP hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.411036] UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes, linear)
    [    0.418568] NET: Registered protocol family 1
    [    0.423638] RPC: Registered named UNIX socket transport module.
    [    0.429699] RPC: Registered udp transport module.
    [    0.434503] RPC: Registered tcp transport module.
    [    0.439310] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.445900] PCI: CLS 0 bytes, default 64
    [    0.450630] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
    [    0.462707] Initialise system trusted keyrings
    [    0.467524] workingset: timestamp_bits=46 max_order=15 bucket_order=0
    [    0.479860] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    0.486524] NFS: Registering the id_resolver key type
    [    0.491732] Key type id_resolver registered
    [    0.496005] Key type id_legacy registered
    [    0.500111] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
    [    0.507173] 9p: Installing v9fs 9p2000 file system support
    [    0.527997] Key type asymmetric registered
    [    0.532198] Asymmetric key parser 'x509' registered
    [    0.537230] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
    [    0.544789] io scheduler mq-deadline registered
    [    0.549418] io scheduler kyber registered
    [    0.555550] pinctrl-single f4000.pinctrl: 185 pins, size 740
    [    0.562430] pinctrl-single a40000.timesync-router: 512 pins, size 2048
    [    0.576246] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [    0.597034] brd: module loaded
    [    0.607856] loop: module loaded
    [    0.614162] libphy: Fixed MDIO Bus: probed
    [    0.618923] tun: Universal TUN/TAP device driver, 1.6
    [    0.624687] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
    [    0.632704] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
    [    0.638815] sky2: driver version 1.30
    [    0.643624] VFIO - User Level meta-driver version: 0.3
    [    0.649729] i2c /dev entries driver
    [    0.654087] sdhci: Secure Digital Host Controller Interface driver
    [    0.660408] sdhci: Copyright(c) Pierre Ossman
    [    0.665294] sdhci-pltfm: SDHCI platform and OF driver helper
    [    0.671800] ledtrig-cpu: registered to indicate activity on CPUs
    [    0.678079] ti-sci bus@f4000:dmsc: invalid resource
    [    0.684277] optee: probing for conduit method from DT.
    [    0.689587] optee: revision 3.11 (c4def2a8)
    [    0.690361] optee: initialized driver
    [    0.700270] NET: Registered protocol family 17
    [    0.705004] 9pnet: Installing 9P2000 support
    [    0.709429] Key type dns_resolver registered
    [    0.714202] registered taskstats version 1
    [    0.718405] Loading compiled-in X.509 certificates
    [    0.731867] ti-sci bus@f4000:dmsc: invalid resource
    [    0.737039] ti-sci bus@f4000:dmsc: ABI: 3.1 (firmware rev 0x0015 '21.1.1--v2021.01a (Terrific Lla')
    [    0.761302] omap_i2c 20000000.i2c: bus 0 rev0.12 at 100 kHz
    [    0.768187] pca953x 1-0022: 1-0022 supply vcc not found, using dummy regulator
    [    0.775693] pca953x 1-0022: using AI
    [    0.800387] omap_i2c 20010000.i2c: bus 1 rev0.12 at 400 kHz
    [    0.806967] omap_i2c 20020000.i2c: bus 2 rev0.12 at 100 kHz
    [    0.813525] omap_i2c 20030000.i2c: bus 3 rev0.12 at 100 kHz
    [    0.819480] ti-sci-intr bus@f4000:interrupt-controller0: Interrupt Router 3 domain created
    [    0.828150] ti-sci-inta 48000000.interrupt-controller: Interrupt Aggregator domain -1 created
    [    1.853040] j721e-pcie f102000.pcie: host bridge /bus@f4000/pcie@f102000 ranges:
    [    1.860726] j721e-pcie f102000.pcie:    IO 0x68001000..0x68010fff -> 0x68001000
    [    1.868218] j721e-pcie f102000.pcie:   MEM 0x68011000..0x6fffffff -> 0x68011000
    [    1.875890] j721e-pcie f102000.pcie: PCI host bridge to bus 0000:00
    [    1.882304] pci_bus 0000:00: root bus resource [bus 00-0f]
    [    1.887915] pci_bus 0000:00: root bus resource [io  0x0000-0xffff] (bus address [0x68001000-0x68010fff])
    [    1.897606] pci_bus 0000:00: root bus resource [mem 0x68011000-0x6fffffff]
    [    1.904664] pci 0000:00:00.0: [104c:b010] type 01 class 0x060400
    [    1.910821] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
    [    1.920692] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x4 may corrupt adjacent RW1C bits
    [    1.930586] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0xe8 may corrupt adjacent RW1C bits
    [    1.940547] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x3e may corrupt adjacent RW1C bits
    [    1.950518] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x92 may corrupt adjacent RW1C bits
    [    1.960485] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0xb2 may corrupt adjacent RW1C bits
    [    1.970480] pci 0000:00:00.0: supports D1
    [    1.974579] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
    [    1.980456] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x84 may corrupt adjacent RW1C bits
    [    1.992165] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
    [    2.000353] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x3e may corrupt adjacent RW1C bits
    [    2.010313] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x3e may corrupt adjacent RW1C bits
    [    2.020273] pci_bus 0000:00: 2-byte config write to 0000:00:00.0 offset 0x3e may corrupt adjacent RW1C bits
    [    2.031736] pci_bus 0000:01: busn_res: [bus 01-0f] end is updated to 01
    [    2.038516] pci 0000:00:00.0: PCI bridge to [bus 01]
    [    2.044083] pcieport 0000:00:00.0: PME: Signaling with IRQ 29
    [    2.050338] pcieport 0000:00:00.0: AER: enabled with IRQ 29
    [    2.056583] ti-bcdma 485c0100.dma-controller: Number of rings: 68
    [    2.063883] ti-bcdma 485c0100.dma-controller: Channels: 24 (bchan: 12, tchan: 6, rchan: 6)
    [    2.074062] ti-pktdma 485c0000.dma-controller: Number of rings: 288
    [    2.085648] ti-pktdma 485c0000.dma-controller: Channels: 32 (tchan: 21, rchan: 11)
    [    2.096008] printk: console [ttyS2] disabled
    [    2.100432] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 8, base_baud = 3000000) is a 8250
    [    2.109094] printk: console [ttyS2] enabled
    [    2.109094] printk: console [ttyS2] enabled
    [    2.117537] printk: bootconsole [ns16550a0] disabled
    [    2.117537] printk: bootconsole [ns16550a0] disabled
    [    2.130753] random: fast init done
    [    2.138876] spi-nor spi0.0: s28hs512t (65536 Kbytes)
    [    2.143880] 9 cmdlinepart partitions found on MTD device fc40000.spi.0
    [    2.150402] Creating 9 MTD partitions on "fc40000.spi.0":
    [    2.155802] 0x000000000000-0x000000080000 : "ospi.tiboot3"
    [    2.162561] 0x000000080000-0x000000280000 : "ospi.tispl"
    [    2.169123] 0x000000280000-0x000000680000 : "ospi.u-boot"
    [    2.175726] 0x000000680000-0x0000006c0000 : "ospi.env"
    [    2.182051] 0x0000006c0000-0x000000700000 : "ospi.env.backup"
    [    2.188988] 0x000000700000-0x000000800000 : "ospi.dtb"
    [    2.195341] 0x000000800000-0x000001c00000 : "ospi.kernel"
    [    2.201973] 0x000001c00000-0x000003fc0000 : "ospi.rootfs"
    [    2.208586] 0x000003fc0000-0x000004000000 : "ospi.phypattern"
    [    2.259571] davinci_mdio 8000f00.mdio: davinci mdio revision 9.7, bus freq 1000000
    [    2.267165] libphy: 8000f00.mdio: probed
    [    2.272586] davinci_mdio 8000f00.mdio: phy[0]: device 8000f00.mdio:00, driver TI DP83867
    [    2.280727] am65-cpsw-nuss 8000000.ethernet: initializing am65 cpsw nuss version 0x6BA00903, cpsw version 0x6BA80903 Ports: 3 quirks:00000002
    [    2.293883] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 16
    [    2.300405] am65-cpsw-nuss 8000000.ethernet: initialized cpsw ale version 1.4
    [    2.307542] am65-cpsw-nuss 8000000.ethernet: ALE Table size 512
    [    2.314040] pps pps0: new PPS source ptp0
    [    2.318428] am65-cpsw-nuss 8000000.ethernet: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:1
    [    2.330420] am65-cpts 39000000.cpts: CPTS ver 0x4e8a010c, freq:500000000, add_val:1 pps:0
    [    2.339662] mmc0: CQHCI version 5.10
    [    2.384596] mmc0: SDHCI controller on fa10000.sdhci [fa10000.sdhci] using ADMA 64-bit
    [    2.394863] gpio-mux mux-controller: 2-way mux-controller registered
    [    2.405087] davinci_gpio 601000.gpio: IRQ index 2 not found
    [    2.410721] davinci_gpio 601000.gpio: IRQ not populated, err = -6
    [    2.418158] vdd_mmc1: supplied by vsys_3v3
    [    2.422945] libphy: mdio_mux: probed
    [    2.433891] mmc1: CQHCI version 5.10
    [    2.504709] mmc0: Command Queue Engine enabled
    [    2.509184] mmc0: new HS400 MMC card at address 0001
    [    2.514834] mmcblk0: mmc0:0001 S0J56X 14.8 GiB 
    [    2.519632] mmcblk0boot0: mmc0:0001 S0J56X partition 1 31.5 MiB
    [    2.525782] mmcblk0boot1: mmc0:0001 S0J56X partition 2 31.5 MiB
    [    2.531901] mmcblk0rpmb: mmc0:0001 S0J56X partition 3 4.00 MiB, chardev (240:0)
    [    2.542073]  mmcblk0: p1
    [    3.941994] sdhci-am654 fa00000.sdhci: Power on failed
    [    3.977782] mmc1: SDHCI controller on fa00000.sdhci [fa00000.sdhci] using ADMA 64-bit
    [    3.985975] debugfs: Directory 'pd:114' with parent 'pm_genpd' already present!
    [    3.994687] ubi0: attaching mtd7
    [    4.005791] ubi0: scanning is finished
    [    4.010768] ubi0: attached mtd7 (name "ospi.rootfs", size 35 MiB)
    [    4.016900] ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 262016 bytes
    [    4.023767] ubi0: min./max. I/O unit sizes: 16/256, sub-page size 16
    [    4.030113] ubi0: VID header offset: 64 (aligned 64), data offset: 128
    [    4.036633] ubi0: good PEBs: 143, bad PEBs: 0, corrupted PEBs: 0
    [    4.042632] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    [    4.049847] ubi0: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 1945417933
    [    4.058966] ubi0: available PEBs: 0, total reserved PEBs: 143, PEBs reserved for bad PEB handling: 0
    [    4.068096] ubi0: background thread "ubi_bgt0d" started, PID 129
    [    4.068368] hctosys: unable to open rtc device (rtc0)
    [    4.081592] ALSA device list:
    [    4.084566]   No soundcards found.
    [    4.088830] UBIFS (ubi0:0): Mounting in unauthenticated mode
    [    4.094718] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 130
    [    4.107193] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    [    4.114681] UBIFS (ubi0:0): LEB size: 262016 bytes (255 KiB), min./max. I/O unit sizes: 16 bytes/256 bytes
    [    4.124327] UBIFS (ubi0:0): FS size: 33800064 bytes (32 MiB, 129 LEBs), journal size 5240320 bytes (4 MiB, 20 LEBs)
    [    4.134750] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
    [    4.140580] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 763BE965-1F7D-4F3A-90C5-ABE0CCBF2B8D, small LPT model
    [    4.152448] VFS: Mounted root (ubifs filesystem) on device 0:20.
    [    4.158675] devtmpfs: mounted
    [    4.162496] Freeing unused kernel memory: 1664K
    [    4.167047] Run /sbin/init as init process
    INIT: version 2.96 booting
    [    4.557946] random: crng init done
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Tue Apr  6 18:39:51 UTC 2021
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    INIT: Entering runlevel: 5
    Configuring network interfaces... [    5.752282] TI DP83867 8000f00.mdio:00: attached PHY driver [TI DP83867] (mii_bus:phy_addr=8000f00.mdio:00, irq=POLL)
    [    5.764669] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    udhcpc: started, v1.31.1
    udhcpc: sending discover
    udhcpc: sending discover
    udhcpc: sending discover
    udhcpc: no lease, forking to background
    done.
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Starting syslogd/klogd: done
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am64xx-evm /dev/ttyS2
    
    Arago 2020.09 am64xx-evm /dev/ttyS2
    
    am64xx-evm login: root
    root@am64xx-evm:~# uname -a
    Linux am64xx-evm 5.4.106-g023faefa70 #1 SMP PREEMPT Fri May 28 14:38:23 UTC 2021 aarch64 GNU/Linux
    root@am64xx-evm:~# cd ..
    root@am64xx-evm:/home# cd ..
    root@am64xx-evm:/# ls -lrt
    dr-xr-xr-x  133 root     root             0 Jan  1  1970 proc
    dr-xr-xr-x   12 root     root             0 Jan  1  1970 sys
    drwxr-xr-x    2 root     root           160 Apr  4 04:08 mnt
    drwxr-xr-x    2 root     root           160 Apr  4 04:08 media
    drwxr-xr-x    3 root     root           224 Apr  4 04:08 home
    drwxr-xr-x    2 root     root           160 Apr  4 04:08 boot
    drwxr-xr-x    9 root     root           608 Apr  6 18:36 usr
    drwxr-xr-x    4 root     root          3168 Apr  6 18:36 lib
    drwxr-xr-x    2 root     root          5128 Apr  6 18:36 bin
    drwxr-xr-x    2 root     root          4520 Apr  6 18:36 sbin
    drwxr-xr-x    8 root     root           808 Apr  6 18:36 var
    lrwxrwxrwx    1 root     root             8 Apr  6 18:36 tmp -> /var/tmp
    drwxr-xr-x   18 root     root          3568 Apr  6 18:36 etc
    drwxr-xr-x    4 root     root           260 Apr  6 18:40 run
    drwxr-xr-x    7 root     root          4160 Apr  6 18:40 dev
    lrwxrwxrwx    1 root     root            19 Jun 17  2021 linuxrc -> /bin/busybox.nosuid
    root@am64xx-evm:/#
    

  • Hi Hong,

    Thanks for your response. It is very useful item for me. My board works well.

    Today I have also tried to load/start kernel/dtb by command

    run args_all
    run args_ubi
    setenv boot ubi
    ext4load mmc 1:2 0x82000000 /boot/Image
    ext4load mmc 1:2 0x81200000 /boot/k3-j721e-common-proc-board.dtb
    booti 0x82000000 - 0x81200000

    =>>>> Kernel driver can attach mtd6 to UBI well thereby affirming that the ubi on U-Boot have issue.
    ubi part ospi.rootfs has error at attaching mtd6 process)

    Does TI plan to fix ubi on your u-boot in the upcoming SDK?

    Thanks you again.
  • Hi Thinh,
    It is good to know you were able to have full OSPI boot at your setup.

    The ubi/ubifsmount... cmds at u-boot in SDK 7.3.1 are not fully enabled/validated.
    In fact, using the native "sf..." cmd to load kernel/dtb as in my last reply would run faster than "ubi part rootfs", "ubifsmount ubi:rootfs", "ubifsload..." in general.

    I'd think to use the "sf..." cmd at u-boot to load kernel/dtb from OSPI to DDR, launch kernel, and
    then mount UBIFS/UBI "ospi.rootfs" with kernel MTD utility as we've already verified the full OSPI boot flow.

    Best,
    -Hong

  • Hello Hong,

    I am really to thank you so much for your support.

    If you don't mind, please take a look my following descriptions and please explain some ARG parameters of mkfs.ubifs/ubinize command I didn't understand.

    I have read carefully the "Minimum flash input/output unit" at link

    http://www.linux-mtd.infradead.org/doc/ubi.html#L_min_io_unit

         which has

    • NOR flashes usually have a minimum I/O unit size of 1 byte, because NOR flashes usually allow reading and writing single bytes (in fact, it is even be possible to change individual bits).
    • Some NOR flashes may have other minimum I/O unit sizes, e.g. 16 or 32 bytes in the case of ECC'd NOR flashes.

    In AM64x-EVM board uses NOR s28hs512t has Built-in Error Correcting Code (ECC) corrects Single-bit Erro.

    1. Could you explain me why you select the mkfs.ubifs ARGS is -m -16, I now can't find the document that describes NOT s28hs512t read/write sigle as 16 bytes.

    2. parameter: -p 256KiB that means is physical erase size 256 KiB. Right?

    3. parameter: -e 262016 -c 143 that means is 262016 multiplied by 143 that is about 35MiB. the resulting image filesystem may be put on volumes up to about 35MiB. How you can calculate the parameters of -e and -c? Please let me know your recipe?

    Thank you so much.

  • Hi Thinh,

    Yes, I found very useful reference on MTD/UBIFS/UBI:
    www.linux-mtd.infradead.org/.../ubi.html
    www.linux-mtd.infradead.org/.../ubifs.html

    Let's see steps I used to get the parameters for the following two cmds to generate UBIFS/UBI files (am6-sdk-tiny-fs.ubifs/am6-sdk-tiny-fs.ubi)
    for MTD partition mtd7(ospi.rootfs) mounted on OSPI-NOR on AM64x GP EVM:

    - "mkfs.ubifs -r sdk-tiny-fs -o am6-sdk-tiny-fs.ubifs -m 16 -e 262016 -c 143 -v"
    - "ubinize -o am6-sdk-tiny-fs.ubi -m 16 -s 16 -p 256KiB ubinize.cfg -v"
    ubinize.cfg:
    [ubifs]
     mode=ubi
     image=am6-sdk-tiny-fs.ubifs
     vol_id=0
     vol_type=dynamic
     vol_name=rootfs
     vol_flags=autoresize

    #1. OSPI-NOR is MTD partitioned as defined in the "mtdparts" bootargs, where both u-boot and kernel would used it for mtdparts.

    setenv mtdparts mtdparts=fc40000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),1m(ospi.dtb),20m@8m(ospi.kernel),36608k(ospi.rootfs),256k(ospi.phypattern)

    #2. Run "mtdinfo -a" after kernel boot-up from any working boot media (i.e. SD card)

    root@am64xx-evm:~# mtdinfo -a
    Count of MTD devices:           9
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8
    Sysfs interface supported:      yes
    ...
    ...
    mtd7
    Name:                           ospi.rootfs
    Type:                           nor
    Eraseblock size:                262144 bytes, 256.0 KiB
    Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)
    Minimum input/output unit size: 16 bytes
    Sub-page size:                  16 bytes
    Character device major/minor:   90:14
    Bad blocks are allowed:         false
    Device is writable:             true
    ...
    ...

    #3. Note on how I got the parameters used in the two cmds (mkfs.ubifs/ubinize) based on mtd7 (ospi.rootfs) info from #2 above:

    a). "mkfs.ubifs -r sdk-tiny-fs -o am6-sdk-tiny-fs.ubifs -m 16 -e 262016 -c 143 -v"
    - "Minimum input/output unit size: 16 bytes" => "-m 16"
    - 262144 - 128 (see the note below on ubi headers) = 262016 => "-e 262016"
    - "Amount of eraseblocks:          143 (37486592 bytes, 35.7 MiB)" => "-c 143"
    b). "ubinize -o am6-sdk-tiny-fs.ubi -m 16 -s 16 -p 256KiB ubinize.cfg -v"
    - "Minimum input/output unit size: 16 bytes" => "-m 16"
    - "Sub-page size:                  16 bytes" => "-s 16"
    - "Eraseblock size:                262144 bytes, 256.0 KiB" => "-p 256KiB"

    Note on "ubi header"
    www.linux-mtd.infradead.org/.../ubi.html
    UBI stores 2 small 64-byte headers at the beginning of each non-bad physical eraseblock:
    - erase counter header (or EC header) which contains the erase counter of the physical eraseblock (PEB) plus other information;
    - volume identifier header (or VID header) which stores the volume ID and the logical eraseblock (LEB) number to which this PEB belongs.

    Hope these steps are helpful!

    Best,

    -Hong

  • Hello Hong,

    I am really thank you for your explanations.

    I have a special case in the fact. I design a prototype board using only the ospi, uart, Ethernet, but without eMMC/SD. In order to get some parameters of mkfs.ubifs/ubinize, I perform step 1, and step 2 using NFS booting. Do you think it's possible?

    In the event of without media device, ethernet. I don't know how to get the accurate parameters as above. Do you have suggestion for me?

    Thanks

    Thinh Nguyen

  • Hi Thinh,
    Yes, it is feasible and easier to get the parameters for cmds to generate UBIFS/UBI files from running "mtdinfo -a" after kernel up.
    In fact, these parameters are dependent on OSPI-NOR device, and can be calculated beforehand.
    "-c 143" can also be determined based on the MTD partition size selected for "ospi.rootfs".
    Best,
    -Hong