TDA4AL-Q1: 处理器论坛

Part Number: TDA4AL-Q1

Dear TI

How to add a partiton with ext4 file system ?

Now it only has mmcblk0p1 "rootfs"
We want to add mmcblk0p2 with ext4 file system

[u-boot] ==================================================

=> mmc info
Device: mmc@4f80000
Manufacturer ID: 13
OEM: 4e
Name: AAM20E
Bus Speed: 200000000
Mode: HS400 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.6 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.6 GiB WRREL
Boot Capacity: 31.5 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=>

=> mmc part
Partition Map for MMC device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000022 0x03b47fde "rootfs"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: 81364298-a36a-6549-b8bc-3d654d68f087
=>

[kernel] ==================================================

root@j721s2-evm:~# ls -la /dev/mmc*
brw-rw---- 1 root disk 179, 0 Feb 27 17:26 /dev/mmcblk0
brw-rw---- 1 root disk 179, 32 Feb 27 17:26 /dev/mmcblk0boot0
brw-rw---- 1 root disk 179, 64 Feb 27 17:26 /dev/mmcblk0boot1
brw-rw---- 1 root disk 179, 1 Feb 27 17:26 /dev/mmcblk0p1
crw------- 1 root root 239, 0 Feb 27 17:26 /dev/mmcblk0rpmb
root@j721s2-evm:~#

root@j721s2-evm:~# cat /proc/partitions
major minor #blocks name

179 0 31080448 mmcblk0
179 1 31080414 mmcblk0p1
179 32 32256 mmcblk0boot0
179 64 32256 mmcblk0boot1
root@j721s2-evm:~#

root@j721s2-evm:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 154.7M 98.9M 43.9M 69% /
devtmpfs 3.3G 0 3.3G 0% /dev
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 1.5G 22.1M 1.5G 1% /run
tmpfs 3.8G 0 3.8G 0% /tmp
tmpfs 3.8G 4.0K 3.8G 0% /var/volatile
tmpfs 775.5M 4.0K 775.5M 0% /run/user/0
root@j721s2-evm:~#

root@j721s2-evm:~# mount
/dev/mmcblk0p1 on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=3510692k,nr_inodes=877673,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=1588292k,nr_inodes=819200,mode=755)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=3970728k,nr_inodes=1048576)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=794144k,nr_inodes=198536,mode=700)
root@j721s2-evm:~#


Thanks
Jiahao

  • at our device

    mmcblk0p1 is 31080414 KB ( about 29.6 GB )

    rootfs in mmcblk0p1 use about 155933 KB

    we want ro resize mmblk0p1 to save space for mmcblk0p2

  • Do these files affect emmc's partition?

    meta-ti\meta-ti-bsp\wic\

    sdimage-2part.wks

    part --source bootimg-partition --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M
    part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid

    sdimage-2part-efi.wks.in

    bootloader --timeout=3 --append="rootfstype=ext4"
    part --source bootimg-efi --sourceparams="loader=${EFI_PROVIDER}" --fstype=vfat --label boot --active --align 1024 --use-uuid --fixed-size 128M
    part / --source rootfs --fstype=ext4 --label root --align 1024 --use-uuid

  • Can you try running this script.It should ideally partition the emmc into 2 partitions.

    >sudo ./mksdboot.sh --device /dev/mmcblk0

    mksdboot.sh

  • I found why my partition only has mmcblk0p1 "rootfs"

    [u-boot]
    => printenv partitions
    partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    => gpt write mmc 0 ${partitions}

    Now I can add partitions like follows, thanks help

    set rootfs=256MB, add data after rootfs
    => setenv my_blk0p1 name=rootfs,start=0x4400,size=0x10000000
    => setenv my_blk0p2 name=data,start=0x10004400,size=-
    => setenv my_part ${my_blk0p1}';'${my_blk0p2}
    => gpt write mmc 0 ${my_part}
    => gpt verify mmc 0 ${my_part}
    => mmc part

    add "data part 0 2;" into dfu_alt_info for dfu download
    => setenv dfu_alt_info_emmc 'rawemmc raw 0 0x800000 mmcpart 1; rootfs part 0 1; data part 0 2; tiboot3.bin.raw raw 0x0 0x400 mmcpart 1; tispl.bin.raw raw 0x400 0x1000 mmcpart 1; u-boot.img.raw raw 0x1400 0x2000 mmcpart 1; u-env.raw raw 0x3400 0x100 mmcpart 1; sysfw.itb.raw raw 0x3600 0x800 mmcpart 1'
    => setenv dfu_alt_info ${dfu_alt_info_emmc};
    => dfu 0 mmc 0