How to create bootable SD card for ls1043a

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

How to create bootable SD card for ls1043a

2,834 Views
stacym
Contributor I

Hello all,

I have been struggling through the QorIQ 2.0 SDK documentation and forum threads in hope of learning how to create a bootable SD card for a product based on the ls1043ARDB.  Our product has a few differences from the reference design:

1.  RGMII phys (2 of them) are at different addresses

2. We used different phy devices

I have a working system, originally built with Yocto, then ported by copying the kernel, u-boot and rootfs to a Linux command line environment where we modified files needed and build with makefiles.  Our current design boots from NOR flash.  My goal is a fully bootable SD card

I'm having difficulties sorting out the different information in SDK and forum regarding how many partitions to create on SD card, how to format them, what is required on each partition

If 2 partitions are needed, I believe partition 1 (bootable) must contain the following:

u-boot.bin file (SD card bootable ie: CONFIG_SD_BOOT=Y  ???)

u-boot environment - if needed, how is this prepared for deployment onto SD card?

rcw.bin file (for SD card) - if needed, how/where is this written to SD card?

I have each of the individual files above, do I need to build them together into the u-boot.bin file?  If that is the case, can anyone point me to information on how to do that?

Partition 2 would contain:

root file system

kernel.itb (which has rootfs, kernel and dtb)

Am I correct that I need to extract the rootfs.tar.gz directory structure onto the SD card and copy kernel.itb to the /boot directory?

Can anyone clarify whether or not 2 partitions are required and how each should be formatted?

Our CPLD is programmed to push a different RCW Source (with SD card enabled) if an SD card is detected

Thanks for the help,

Stacy

0 Kudos
4 Replies

1,978 Views
necatikaragoz
Contributor I

Hi, I have same problem.

I'm new in yocto and I tried all the solutions that written in the community but I can't find the real solution. 

The problem is occurred from the document. when you follow the "QorIQ SDK v2.0-1703 Documentation"  there is no exact result. 

I can't find what I missed. 

Thanks.

 

Here is the my steps. 

--get repo from dunfell--

 
cp sources/meta-qoriq/tools/setup-env . 
. ./setup-env -m ls1043ardb
bitbake fsl-image-networking
##images succesfully generated.
--
I configured /meta-frescale/conf/machine/ls1043.conf file and edit uboot configurations with the following instructions. After the modification, I run "bitbake fsl-image-networking" command again. As a result, new u-boot files are generated.
 
UBOOT_CONFIG ??= "tfa-secure-boot tfa nand sdcard nor"
UBOOT_CONFIG[tfa] = "ls1043ardb_tfa_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[tfa-secure-boot] = "ls1043ardb_tfa_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[nor] = "ls1043ardb_config,,u-boot-dtb.bin"
UBOOT_CONFIG[nand] = "ls1043ardb_nand_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard] = "ls1043ardb_sdcard_config,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[secure-boot] = "ls1043ardb_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[nand-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[nand-spl-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,spl/u-boot-spl.bin"
UBOOT_CONFIG[nand-dtb-secure-boot] = "ls1043ardb_nand_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
UBOOT_CONFIG[sdcard-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-with-spl-pbl.bin"
UBOOT_CONFIG[sdcard-spl-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,spl/u-boot-spl.bin"
UBOOT_CONFIG[sdcard-dtb-secure-boot] = "ls1043ardb_sdcard_SECURE_BOOT_defconfig,,u-boot-dtb.bin"
 
Preparing the SD card:
 
sudo umount /dev/sdb1
 
sudo fdisk /dev/sdb

#create a partition and
#-d
#-p
#-n
# -1
# -4096
# -enter
#-w
 
sudo mkfs.ext2 /dev/sdb1
sync
 
sudo mount  /dev/sdb1 /mnt/sd/
sudo cp fitImage /mnt/sd/
 
sudo cp fsl-image-networking-ls1043ardb-20210913112425.rootfs.tar.gz /mnt/sd
sudo tar xvfz fsl-image-networking-ls1043ardb-20210913112425.rootfs.tar.gz
sudo rm fsl-image-networking-ls1043ardb-20210913112425.rootfs.tar.gz /mnt/sd/.
 
sudo dd if=u-boot-sdcard-2019.10+fslgit-r0.bin of=/dev/sdc seek=8 bs=512
 
Then I changed the board pins for SD card boot, inserted Sd card the board and power-up the board.
In the minicom terminal, uboot succesfully run from Sd card. After the update boot arguments, Kernel booting process halted.
 
=> setenv sdboot "setenv bootargs root=/dev/sda rw rootdelay=5 console=ttyS0,115200 earlycon=uart8250,0x21c0500,115200;mmcinfo;ext2load mmc 0:1 a0000000 fitImage ;bootm a0000000"
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> run sdboot
Device: FSL_SDHC
Manufacturer ID: 27
OEM: 5048
Name: SD16G
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
13992424 bytes read in 637 ms (20.9 MiB/s)
## Loading kernel from FIT Image at a0000000 ...
Using 'conf@freescale_fsl-ls1043a-rdb.dtb' configuration
Trying 'kernel@1' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: gzip compressed
Data Start: 0xa000010c
Data Size: 13824461 Bytes = 13.2 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x80080000
Entry Point: 0x80080000
Hash algo: sha256
Hash value: 8f237dbeb1d7fc8ac3ec30be979c7ab53e02bc85269ab6718765f0cfa8316cd1
Verifying Hash Integrity ... sha256 error!
Bad hash value for 'hash@1' hash node in 'kernel@1' image node
Bad Data Hash
ERROR: can't get kernel image!
 
 
my deploy folder is:
necati@necati:~/workspace/ls1043ardb/yocto-sdk/build_ls1043ardb/tmp/deploy/images/ls1043ardb$ ls
atf
boot
fitImage
fitImage--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.bin
fitImage-fsl-image-networking-ls1043ardb--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.bin
fitImage-fsl-image-networking-ls1043ardb-ls1043ardb
fitImage-its--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.its
fitImage-its-fsl-image-networking-ls1043ardb--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.its
fitImage-its-fsl-image-networking-ls1043ardb-ls1043ardb
fitImage-its-ls1043ardb
fitImage-linux.bin--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.bin
fitImage-linux.bin-ls1043ardb
fitImage-ls1043ardb.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-20210913112425.rootfs.cpio.gz.u-boot
fsl-image-networking-ls1043ardb-20210913112425.rootfs.ext2.gz
fsl-image-networking-ls1043ardb-20210913112425.rootfs.ext2.gz.u-boot
fsl-image-networking-ls1043ardb-20210913112425.rootfs.jffs2
fsl-image-networking-ls1043ardb-20210913112425.rootfs.manifest
fsl-image-networking-ls1043ardb-20210913112425.rootfs.tar.gz
fsl-image-networking-ls1043ardb-20210913112425.rootfs.ubi
fsl-image-networking-ls1043ardb-20210913112425.rootfs.ubifs
fsl-image-networking-ls1043ardb-20210913112425.testdata.json
fsl-image-networking-ls1043ardb.cpio.gz.u-boot
fsl-image-networking-ls1043ardb.ext2.gz
fsl-image-networking-ls1043ardb.ext2.gz.u-boot
fsl-image-networking-ls1043ardb.jffs2
fsl-image-networking-ls1043ardb.manifest
fsl-image-networking-ls1043ardb.tar.gz
fsl-image-networking-ls1043ardb.testdata.json
fsl-image-networking-ls1043ardb.ubi
fsl-image-networking-ls1043ardb.ubifs
fsl-ls1043a-qds--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.dtb
fsl-ls1043a-qds.dtb
fsl-ls1043a-qds-ls1043ardb.dtb
fsl-ls1043a-qds-sdk--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.dtb
fsl-ls1043a-qds-sdk.dtb
fsl-ls1043a-qds-sdk-ls1043ardb.dtb
fsl-ls1043a-rdb--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.dtb
fsl-ls1043a-rdb.dtb
fsl-ls1043a-rdb-ls1043ardb.dtb
fsl-ls1043a-rdb-sdk--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.dtb
fsl-ls1043a-rdb-sdk.dtb
fsl-ls1043a-rdb-sdk-ls1043ardb.dtb
fsl-ls1043a-rdb-usdpaa--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.dtb
fsl-ls1043a-rdb-usdpaa.dtb
fsl-ls1043a-rdb-usdpaa-ls1043ardb.dtb
Image
Image--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.bin
Image-ls1043ardb.bin
ls2-phy
modules--5.4.3+git0+134788b164-r0-ls1043ardb-20210913112425.tgz
modules-ls1043ardb.tgz
rcw
ubinize-fsl-image-networking-ls1043ardb-20210913112425.cfg
u-boot.bin
u-boot.bin-nand
u-boot.bin-nor
u-boot.bin-sdcard
u-boot.bin-tfa
u-boot.bin-tfa-secure-boot
u-boot-ls1043ardb.bin
u-boot-ls1043ardb.bin-nand
u-boot-ls1043ardb.bin-nor
u-boot-ls1043ardb.bin-sdcard
u-boot-ls1043ardb.bin-tfa
u-boot-ls1043ardb.bin-tfa-secure-boot
u-boot-nand-2019.10+fslgit-r0.bin
u-boot-nor-2019.10+fslgit-r0.bin
u-boot-qoriq-initial-env-ls1043ardb-nand
u-boot-qoriq-initial-env-ls1043ardb-nand-2019.10+fslgit-r0
u-boot-qoriq-initial-env-ls1043ardb-nor
u-boot-qoriq-initial-env-ls1043ardb-nor-2019.10+fslgit-r0
u-boot-qoriq-initial-env-ls1043ardb-sdcard
u-boot-qoriq-initial-env-ls1043ardb-sdcard-2019.10+fslgit-r0
u-boot-qoriq-initial-env-ls1043ardb-tfa
u-boot-qoriq-initial-env-ls1043ardb-tfa-2019.10+fslgit-r0
u-boot-qoriq-initial-env-ls1043ardb-tfa-secure-boot
u-boot-qoriq-initial-env-ls1043ardb-tfa-secure-boot-2019.10+fslgit-r0
u-boot-qoriq-initial-env-nand
u-boot-qoriq-initial-env-nor
u-boot-qoriq-initial-env-sdcard
u-boot-qoriq-initial-env-tfa
u-boot-qoriq-initial-env-tfa-secure-boot
u-boot-sdcard-2019.10+fslgit-r0.bin
u-boot-tfa-2019.10+fslgit-r0.bin
u-boot-tfa-secure-boot-2019.10+fslgit-r0.bin
uefi
 
 

 

 
 
 
 
0 Kudos

2,453 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello stacym,

For SD boot deployment, please refer to the following procedure.

Please create two partitions with Linux command "fdisk", one 512-Mbyte FAT16 and 2G one ext2/ext3 or with remainder of the available disk size.

# mkfs.vfat /dev/sdb1

# mkfs.ext2 /dev/sdb2

 

  1. Please deploy u-boot to SD card under Linux PC.

# dd if=u-boot-sdcard.bin of=/dev/sdb seek=0x8 bs=512

Under u-boot

=> tftpboot 82000000 u-boot-sdcard.bin

=> mmc write 82000000 8 800

 

2.Deploy rootfs to the the second partition of SD card.

# mkdir  /temp

# mount /dev/sdb2  /temp

# cd /temp

# cp  *.rootfs.tar.gz  .

# tar  -xzvf    *.rootfs.tar.gz

# rm   *.rootfs.tar.gz

 

Please also copy kernel.itb to SD card.

 

  1. Please configure u-boot parameter as the following.

=> ext2load mmc 0:2 a0000000 kernel.itb

=> setenv bootargs  "root=/dev/mmcblk0p2 rw earlycon=uart8250,0x21c0500 console=ttyS0,115200"

=> bootm a0000000:kernel@1 - a0000000:fdt@1

Thanks,

Yiping

0 Kudos

2,453 Views
stacym
Contributor I

Hi Yiping,

I received an email with the u-boot-sdcard.bin file but unfortunately, I don’t believe that will work for us because our Phys are not at the same addresses. We also made other changes that affect various u-boot files (IE: added memory tests, use different NOR flash/parameters etc)

Would it be possible to get some information on how to build the u-boot binary using makefiles so that it includes the RCW? I am unclear on how to do that, we use RCW_1600.bin from the u-boot SDK 2.0 for our NOR flash boot solution and we program that to the NOR flash at offset 0 (0x0_6000_0000)

I believe that once I have a u-boot binary that includes the RCW, I understand how to write it to the SD card.

Thanks,

Stacy

0 Kudos

2,453 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Stacy,

In u-boot source code, please refer board/freescale/ls1043ardb/ls1043ardb_rcw_sd.cfg, you could modify this file according to your requirement.

Thanks,

Yiping

0 Kudos