I want to boot into u-boot from NAND flash and then load the linux kernel and rootfs from the SD Card using u-boot.
Can this be done with the currently shipping P1010RDB ? How? What specific u-boot settings are needed to configure u-boot to do this? What SD card formatting?
My P1010RDB is apparently pretty old.
U-Boot 2010.12-00063-g8669298-dirty
805-26374 900-26374 REV E
700-26374 REV C
805-77223
CPU: P1010E, Version: 1.0, (0x80f90010)
Core: E500, Version: 5.1, (0x80212151)
Can this be done with the version of silicon/software that I have in my version of the P1010RDB? If not, can the required components be upgraded?
Am I correct in thinking that the boot_format utility is used only when booting directly to SD card (without u-boot) ?
Thanks in advance for any help,
John
Hello John,
Yes, you are right, boot_format is used in booting from SD, and you don't need to use it.
It's better to download the an e500v2 pre-built ISO from Freescale public Website, and use the following method to deploy the system.
1. Connect the card reader with SD card to the Linux Host PC.
2. Create the partitions by "fdisk /dev/sdb", one MS-DOS partition(sdb1 and this partition usually for u-boot) and one ext2 partition(sdb2) in the SD card.
#fdisk /dev/sdb
3. Use the mkfs.ext2 command to create the filesystems.
# mkfs.vfat /dev/sdb1
# mkfs.ext2 /dev/sdb2
4. Copy the file system to SD card by extracing the QorIQ_SDK_<version>_E500v2_<date>_ROOTFS_Image.tar.gz ,Remove the tarball after extracting rootfs.
# cp QorIQ_SDK_<version>_E500v2_<date>_ROOTFS_Image.tar.gz .
# tar -zxvf QorIQ_SDK_<version>_E500v2_<date>_ROOTFS_Image.tar.gz
# rm QorIQ_SDK_<version>_E500v2_<date>_ROOTFS_Image.tar.gz
5. Plug in the SD card to the target board and power on.
6. Set the environment in uboot for SD boot.
# setenv bootfile uImage
# setenv fdtfile uImage.dtb
# setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;ext2load mmc 0:2 $loadaddr /boot/$bootfile;ext2load mmc 0:2 $fdtaddr /boot/$fdtfile;bootm $loadaddr - $fdtaddr'
# boot
In addition, please choose appropriate images for your target board(P1010RDB-PA or P1010RDB-PB).
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
First, "Thank You!" to everyone that's replied.
I haven't gotten a chance to try updating u-boot, but in the meantime I got my hands on a P1010RDB-PB fresh from the factory.
With a few tweaks, I was able to get it booting, u-boot, then into linux off the SDCARD.
Those tweaks:
1) if the partition that contains uImage and the DTB file is formatted vFAT, then replace "ext2load" with "fatload", or, as Scott suggested, just format to ext2 in the first place.
2) None of this works without enabling the SD card, so, as the Freescale instructions plainly say, use "mux sdhc" to enable it temporarily, or "setenv hwconfig esdhc" followed by saveenv to set it over a reset.
3) again, for emphasis, you must 'saveenv' after typing that very long 'setenv bootargs' command if you don't want to type it twice.
4) (I didn't find this anywhere, and it took quite a bit of experimentation to figure out) if you want multiple items in the hwconfig variable, separate them with ';' AND enclose the whole thing in tick marks, so
setenv hwconfig 'fsl_p1010mux:tdm_can=can;usb1:dr_mode=host,phy_type=utmi;esdhc'
for example. Without the tick marks, the text after the semicolon is interpreted as a separate command. Spaces and commas do not work as separators, apparently, only semicolons work.
5) remove the "/boot/" preface from the example for both uImage and the DTB file (at least in my circumstances)
Summarizing:
1) partition the card with two ext2 partitions, the first one labeled 'boot' and the second 'rootfs'
2) With the card mounted in your PC, copy uImage and the .dtb file to the first partition. In my case that was (from within build/tmp/deploy/images/p1010rdb)
==> sudo cp uImage /media/boot/.
==> sudo cp uImage-p1010rdb-pb.dtb /media/boot/p1010rdb-pd.dtb
3) Copy the root file system to the second partition. In my case:
==> tar xvfz fsl-image-minimal-p1010rdb.tar.gz -C /media/rootfs
==> sync
4) in u-boot, set the following:
==> setenv bootfile uImage
==> setenv fdtfile p1010rdb-pb.dtb
==> setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;ext2load mmc 0:1 $loadaddr $bootfile;ext2load mmc 0:1 $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr'
==> setenv hwconfig 'fsl_p1010mux:tdm_can=can;usb1:dr_mode=host,phy_type=utmi;esdhc'
5) SAVE IT
==> saveenv
6) VERIFY IT
==> printenv
7) ==> reset
Hope this helps someone,
John
Why does he need to create a vfat partition if U-Boot is coming from elsewhere?
Hello Scott,
Yes, the first partition is no need, but it's better to prepare it in case the customer wants to use SD boot.
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Yiping,
Thank you for the response. Several of the commands within the bootcmd (step 6) are not recognized by my version/configuration of u-boot, "mmcinfo" returns "Unknown command" and ext2load mmc 0:2 $loadaddr /boot/$bootfile returns unrecognized device, or something like that.
Do you know if there's any method for updating u-boot that does NOT require a JTAG/COP device ? Maybe I can update it from the development kit itself, either from u-boot or by booting into linux using tftp and then running an update command?
John
Hello John,
Under u-boot, as others mentioned you could use tftp to download u-boot image, and flash u-boot to Flash.
Before you update Nand Flash u-boot, I suggest you do back up on Nor Flash with the following command.
=> setenv ipaddr <ipaddr>
=> setenv serverip <serverip>
=> setenv netmask <netmask>
=> setenv ethaddr <mac-addr>
=> save
=>tftp 1000000 u-boot-<platform>.bin
=>protect off all
=>erase <u-boot_start_addr> <u-boot_end_addr>
=>cp.b 1000000 <u-boot_start_addr> $filesize
Nor u-boot start at 0xeff80000 in u-boot.
Then update NAND u-boot
=> tftp 1000000 u-boot_P1010RDB_NAND.bin
=> nand erase 0 100000
=> nand write 1000000 0 $filesize
Have a great day,
Yiping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
As you are using NAND flash, I guess you can try
=>tftp 1000000 u-boot-nand-<platform>.bin
=>nand erase 0 100000
=>nand write 1000000 0 100000
Hi,
You can update your u-boot using TFTP like this
tftp $loadaddr $uboot; protect off $flash_addr+$filesize; erase $flash_addr +$filesize;
cp.b $loadaddr $flash_addr $filesize; protect on $flash_addr +$filesize;
flash_addr = the address where your u-boot start in flash
filesize = the size of u-boot
loadaddr = the RAM address where u-boot is placed before it is copied in flash
uboot=path to the u-boot bin file on the TFTP server
regards,
Catalin