How to create a bootable SD for the LS1043ARDB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to create a bootable SD for the LS1043ARDB

Jump to solution
2,310 Views
gfine1
Contributor III

Similar to some other requests of same.

After my frustration with the flex-installer and flex-builder. I reverted to building using the yocto instructions posted here. I only changed the 2088 with 1043

https://source.codeaurora.org/external/qoriq/qoriq-components/yocto-sdk/about/

After fixing some minor errors in the build. But in the end it looks like I successfully have a tmp/deploy/images/ls1043ardb directory with the images below..

Here is as 'tree' of the directories in /temp/deploy/images/ls1043ardb

├── atf
│   ├── bl2_nand.pbl
│   ├── bl2_nor.pbl
│   ├── bl2_sd.pbl
│   ├── fip_uboot.bin
│   ├── fip_uefi.bin
│   ├── srk.pri
│   └── srk.pub
├── boot
│   ├── fsl_qe_ucode_1021_10_A.bin
│   ├── iram_Type_A_LS1021a_r1.0.bin
│   ├── iram_Type_A_T1024_r1.0.bin
│   └── iram_Type_A_T1040_r1.0.bin
├── engine-pfe-bin
│   └── pfe_fw_sbl.itb
├── fitImage -> fitImage--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage-fsl-image-networking-ls1043ardb--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage-fsl-image-networking-ls1043ardb-ls1043ardb -> fitImage-fsl-image-networking-ls1043ardb--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage-its--4.19-r0-ls1043ardb-20210622204214.its
├── fitImage-its-fsl-image-networking-ls1043ardb--4.19-r0-ls1043ardb-20210622204214.its
├── fitImage-its-fsl-image-networking-ls1043ardb-ls1043ardb -> fitImage-its-fsl-image-networking-ls1043ardb--4.19-r0-ls1043ardb-20210622204214.its
├── fitImage-its-ls1043ardb -> fitImage-its--4.19-r0-ls1043ardb-20210622204214.its
├── fitImage-linux.bin--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage-linux.bin-ls1043ardb -> fitImage-linux.bin--4.19-r0-ls1043ardb-20210622204214.bin
├── fitImage-ls1043ardb.bin -> fitImage--4.19-r0-ls1043ardb-20210622204214.bin
├── fsl_fman_ucode_ls1043_r1.1_106_4_18.bin
├── fsl_fman_ucode_ls1043_r1.1_108_4_9.bin
├── fsl-image-networking-ls1043ardb-20210622155747.rootfs.manifest
├── fsl-image-networking-ls1043ardb-20210622155747.testdata.json
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.cpio.gz
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.ext2.gz
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.ext2.gz.u-boot
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.jffs2
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.tar.gz
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.ubi
├── fsl-image-networking-ls1043ardb-20210622175854.rootfs.ubifs
├── fsl-image-networking-ls1043ardb.cpio.gz -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.cpio.gz
├── fsl-image-networking-ls1043ardb.ext2.gz -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.ext2.gz
├── fsl-image-networking-ls1043ardb.ext2.gz.u-boot -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.ext2.gz.u-boot
├── fsl-image-networking-ls1043ardb.jffs2 -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.jffs2
├── fsl-image-networking-ls1043ardb.manifest -> fsl-image-networking-ls1043ardb-20210622155747.rootfs.manifest
├── fsl-image-networking-ls1043ardb.tar.gz -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.tar.gz
├── fsl-image-networking-ls1043ardb.testdata.json -> fsl-image-networking-ls1043ardb-20210622155747.testdata.json
├── fsl-image-networking-ls1043ardb.ubi -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.ubi
├── fsl-image-networking-ls1043ardb.ubifs -> fsl-image-networking-ls1043ardb-20210622175854.rootfs.ubifs
├── fsl-ls1043a-qds--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-qds.dtb -> fsl-ls1043a-qds--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-qds-ls1043ardb.dtb -> fsl-ls1043a-qds--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-qds-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-qds-sdk.dtb -> fsl-ls1043a-qds-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-qds-sdk-ls1043ardb.dtb -> fsl-ls1043a-qds-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-sdk.dtb -> fsl-ls1043a-rdb-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-sdk-ls1043ardb.dtb -> fsl-ls1043a-rdb-sdk--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-usdpaa--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-usdpaa.dtb -> fsl-ls1043a-rdb-usdpaa--4.19-r0-ls1043ardb-20210622204214.dtb
├── fsl-ls1043a-rdb-usdpaa-ls1043ardb.dtb -> fsl-ls1043a-rdb-usdpaa--4.19-r0-ls1043ardb-20210622204214.dtb
├── Image -> Image--4.19-r0-ls1043ardb-20210622204214.bin
├── Image--4.19-r0-ls1043ardb-20210622204214.bin
├── Image-ls1043ardb.bin -> Image--4.19-r0-ls1043ardb-20210622204214.bin
├── ls2-phy
│   ├── cs4315-cs4340-PHY-ucode.txt
│   ├── EULA.txt
│   ├── Readme
│   └── SCR.txt
├── modules--4.19-r0-ls1043ardb-20210622204214.tgz
├── modules-ls1043ardb.tgz -> modules--4.19-r0-ls1043ardb-20210622204214.tgz
├── optee
│   └── tee_ls1043ardb.bin
├── rcw
│   └── ls1043ardb
│   ├── README
│   └── RR_FQPP_1455
│   ├── rcw_1200.bin
│   ├── rcw_1200_nandboot.bin
│   ├── rcw_1200_nandboot_sben.bin
│   ├── rcw_1200_sdboot.bin
│   ├── rcw_1200_sdboot_sben.bin
│   ├── rcw_1400.bin
│   ├── rcw_1400_nandboot.bin
│   ├── rcw_1400_nandboot_sben.bin
│   ├── rcw_1400_sdboot.bin
│   ├── rcw_1400_sdboot_sben.bin
│   ├── rcw_1500.bin
│   ├── rcw_1500_nandboot.bin
│   ├── rcw_1500_nandboot_sben.bin
│   ├── rcw_1500_qetdm.bin
│   ├── rcw_1500_sben.bin
│   ├── rcw_1500_sdboot.bin
│   ├── rcw_1500_sdboot_sben.bin
│   ├── rcw_1600.bin
│   ├── rcw_1600_gic4k.bin
│   ├── rcw_1600_nandboot.bin
│   ├── rcw_1600_nandboot_sben.bin
│   ├── rcw_1600_qetdm.bin
│   ├── rcw_1600_sben.bin
│   ├── rcw_1600_sdboot.bin
│   ├── rcw_1600_sdboot_sben.bin
│   ├── rcw_uefi_1400.bin
│   ├── rcw_uefi_1500.bin
│   └── rcw_uefi_1600.bin
├── ubinize-fsl-image-networking-ls1043ardb-20210622175854.cfg
├── u-boot.bin -> u-boot-tfa-2019.04+fslgit-r0.bin
├── u-boot.bin-tfa -> u-boot-tfa-2019.04+fslgit-r0.bin
├── u-boot.bin-tfa-secure-boot -> u-boot-tfa-secure-boot-2019.04+fslgit-r0.bin
├── u-boot-ls1043ardb.bin -> u-boot-tfa-2019.04+fslgit-r0.bin
├── u-boot-ls1043ardb.bin-tfa -> u-boot-tfa-2019.04+fslgit-r0.bin
├── u-boot-ls1043ardb.bin-tfa-secure-boot -> u-boot-tfa-secure-boot-2019.04+fslgit-r0.bin
├── u-boot-tfa-2019.04+fslgit-r0.bin
├── u-boot-tfa-secure-boot-2019.04+fslgit-r0.bin
└── uefi
├── grub
│   └── BOOTAA64.EFI
└── ls1043ardb
├── LS1043ARDB_EFI_NORBOOT.fd
└── LS1043ARDBNV_EFI_NORBOOT.fd

 

Now I have combed documentation from Reference manuals to Application Notes, and didn't find anything on how to create an SD from a Yocto build.

I guess I am used to the i.MX series setup.

Now how is the SD to be formatted? for u-boot? for the kernel & dtb? and for the Root File System?

And then what contents get copied to which partition?

I read somewhere else about the rcw.bin. Where does that get placed? Is it used?

The document on the link above says the ls1043ardb is supported.

I am formerly familiar with the way i.MX series works. Is there something similar for the LS1043ardb?

Cheers, Glen

0 Kudos
1 Solution
2,287 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please pay attention to my step 1, please connect SD card your your host PC.

Please create two partitions with Linux command "fdisk", one 1G FAT16 and 2G one ext2/ext3 or with remainder of the available disk size.
# mkfs.vfat /dev/sdb1
# mkfs.ext2 /dev/sdb2

Then use mkfs.ext2 to format the second partition and put rootfs filesystem and Kernel Image in this partition. In my following bootargs, I assume rootfs is in the second partition of SD card.

=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000- 0xb0000000'

View solution in original post

0 Kudos
4 Replies
2,293 Views
gfine1
Contributor III

Hi Yipingwang,

One difference was the SD enumerates as /dev/mmcblk0 and not /dev/sdX (where X is b or c)

I had to modify any hex values to decimal as 'dd' thought 0x was a multiplier.

$ cd ~/yocto-sdk/build_ls1043ardb/tmp/deploy/images/ls1043ardb/atf/
$ sudo dd if=bl2_sd.pbl of=/dev/mmcblk0 bs=512 seek=8
95+1 records in
95+1 records out
49060 bytes (49 kB, 48 KiB) copied, 0.0124063 s, 4.0 MB/s
$ sudo dd if=fip_uboot.bin of=/dev/mmcblk0 bs=512 seek=2048
1497+1 records in
1497+1 records out
766652 bytes (767 kB, 749 KiB) copied, 0.230024 s, 3.3 MB/s
$ cd ..
$ sudo dd if=fsl_fman_ucode_ls1043_r1.1_106_4_18.bin of=/dev/mmclblk0 bs=512 seek=18432
63+1 records in
63+1 records out
32604 bytes (33 kB, 32 KiB) copied, 0.000310164 s, 105 MB/s

$ sudo mkdir ~/temp

$ sudo mount /dev/mmcblk0 ~/temp

$ sudo cp fsl-image-networking-ls1043ardb.tar.gz ~/temp/

$ cd ~/temp

$ sudo tar -xzvf fsl-image-networking-ls1043ardb.tar.gz

... [unpacked here]

$ sudo rm -xzvf fsl-image-networking-ls1043ardb.tar.gz

$ cd ~/yocto-sdk/build_ls1043ardb/tmp/deploy/images/ls1043ardb/

$ sudo cp Image ~/temp/boot

$ sudo cp fsl-ls1043a-rdb-sdk.dtb ~/temp/boot

$ sudo umount ~/temp

$ sync

My switch settings are as you mention.

ls1043ardb_switches.jpg

I was able to get to u-boot but booting to the kernel fails.

=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000- 0xb0000000'

=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> boot
Device: FSL_SDHC
Manufacturer ID: 1b
OEM: 534d
Name: EB1QT
Bus Speed: 50000000
Mode : SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
24457728 bytes read in 1049 ms (22.2 MiB/s)
32127 bytes read in 10 ms (3.1 MiB/s)
## Loading ramdisk from FIT Image at b0000000 ...
Bad FIT ramdisk image format!
Ramdisk image is corrupt or invalid

Do I need to use another Image???

 

Cheers, Glen

 

0 Kudos
2,288 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please pay attention to my step 1, please connect SD card your your host PC.

Please create two partitions with Linux command "fdisk", one 1G FAT16 and 2G one ext2/ext3 or with remainder of the available disk size.
# mkfs.vfat /dev/sdb1
# mkfs.ext2 /dev/sdb2

Then use mkfs.ext2 to format the second partition and put rootfs filesystem and Kernel Image in this partition. In my following bootargs, I assume rootfs is in the second partition of SD card.

=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000- 0xb0000000'

0 Kudos
2,281 Views
gfine1
Contributor III

Got the same error but realized it was the booti command and a small syntax error

You posted :

setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000- 0xb0000000'

The error was the missing space after the kernel address.  When I added the space (after the 0xa000000)  it booted properly.

setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000 - 0xb0000000'

Thank you for the help !!

Cheers, Glen

0 Kudos
2,300 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following procedure.

Please connect SD card to your host PC

1. Please create two partitions with Linux command "fdisk", one 1G FAT16 and 2G one ext2/ext3 or with remainder of the available disk size.
# mkfs.vfat /dev/sdb1
# mkfs.ext2 /dev/sdb2


2. Please deployed RCW + PBI + BL2(bl2_<boot_mode>.pbl)image to SD card as the following.
dd if=bl2_sd.pbl of=/dev/sdb bs=512 seek=8

note:/dev/sdb is SD device name.

Please deploy TF-A FIP image at 0x00800 in SD card.

dd if=fip_uboot.bin of=/dev/sdb bs=512 seek=0x800

Please deploy FMAN ucode at 0x04800 in SD card.

dd if=fsl_fman_ucode_ls1043_r1.1_106_4_18.bin of=/dev/sdb bs=512 seek=0x4800


3. Please deploy rootfs filesystem to SD card in the host PC as the following.
# mkdir  /temp
# mount  /dev/sdb2  /temp
# cd /temp
# cp  fsl-image-networking-ls1043ardb.tar.gz .
# tar -xzvf  fsl-image-networking-ls1043ardb.tar.gz
# rm  fsl-image-networking-ls1043ardb.tar.gz
Please deploy Kernel Image and the dtb to the /boot folder.
# cp Image boot
# cp  fsl-ls1043a-rdb-sdk.dtb boot

Configure the switch setting boot from SD card 

               SW3[1:8]     SW4[1:8]       SW5[1:8]

SD card 10110011      00100000     00100010

Plug in the SD card to the target board and power on.
Set the environment in uboot for SD boot.
=> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:2 0xa0000000 /boot/Image;ext2load mmc 0:2 0xb0000000 /boot/fsl-ls1043a-rdb-sdk.dtb;booti 0xa0000000- 0xb0000000'
=> saveenv

Boot up Linux
=> boot

0 Kudos