Linux Boot with u-boot 2014.04 on Zynq board
Hi Michal,
I am a user of Zynq ZC-706 board.
On u-boot 2014.01 release, I put Kernel Image, Device Tree, Ramdisk into "fit.itb" and I could successfully boot Linux Kernel.
But I don't know how to boot Kernel on u-boot 2014.04 release. Please help!
The default boot sequence of Zynq on the u-boot-2014.04 release is Falcon boot, right?
I am trying to boot Linux with
- U-boot 2014.04
- Linux Kernel 3.14
- SD boot mode
- ZC706 board
What I did is roughly like this:
## U-Boot ##
[1] Build u-boot
[2] Convert spl/u-boot-spl.bin into boot.bin
with BootGen tool
[3] Copy "boot.bin" to FAT-fomatted SD card.
##Kernel ##
[1] Build kernel with multi_v7_defconfig setting
[2] Copy uImage to the SD card
[3] Rename zynq-zc706.dtb into system.dtb and copy to SD card
Kernel boot failed to mount the root device.
My question is, how to pass an init ramdisk?
In which file-name should I copy init ramdisk
into SD card?
How should I load the init ramdisk from the SD card?
Best Regards
Masahiro Yamada
Hi Masahiro,
Quoted 4 lines · Masahiro Yamada
Hi Michal,
I am a user of Zynq ZC-706 board.
Quoted 8 lines
On u-boot 2014.01 release, I put Kernel Image, Device Tree, Ramdisk into "fit.itb" and I could successfully boot Linux Kernel.
But I don't know how to boot Kernel on u-boot 2014.04 release. Please help!
The default boot sequence of Zynq on the u-boot-2014.04 release is Falcon boot, right?
I personally use SPL->full u-boot -> linux
but IRC I have also tested SPL->linux.
Quoted 9 lines
I am trying to boot Linux with
- U-boot 2014.04
- Linux Kernel 3.14
- SD boot mode
- ZC706 boardWhat I did is roughly like this:
## U-Boot ##
Before you build u-boot you have to copy ps7_init.c/h from your hw design to the u-boot if you want to use SPL.
Quoted 3 lines
[1] Build u-boot
[2] Convert spl/u-boot-spl.bin into boot.bin
with BootGen tool
yes - or if you look at xilinx git u-boot repo we have one simple python script which does this automatically without bootgen.
Quoted 1 line
[3] Copy "boot.bin" to FAT-fomatted SD card.
yes.
I personally use SD boot mode it means boot.bin has just u-boot SPL and u-boot.img on SD stores full u-boot.
Keep in your mind that using U-BOOT SPL is not fully supported flow. Supported flow is fsbl->u-boot->linux.
Quoted 5 lines
##Kernel ##
[1] Build kernel withmulti_v7_defconfigsetting
[2] Copy uImage to the SD card
[3] Rename zynq-zc706.dtb into system.dtb and copy to SD card
this step just depend on your configuration.
Quoted 6 lines
Kernel boot failed to mount the root device.
My question is, how to pass an init ramdisk?
I am using cpio compiled in directly in the kernel.
Quoted 2 lines
In which file-name should I copy init ramdisk
into SD card?
Xilinx OSL versions are using initramdisk
which you can download here.
http://www.wiki.xilinx.com/Zynq+2014.1+Release
Quoted 1 line
How should I load the init ramdisk from the SD card?
And this is the command which OSL version are using.
"sdboot=if mmcinfo; then " \
"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 0 0x3000000 ${kernel_image} && " \
"fatload mmc 0 0x2A00000 ${devicetree_image} && " \
"fatload mmc 0 0x2000000 ${ramdisk_image} && " \
"bootm 0x3000000 0x2000000 0x2A00000; " \
"fi\0" \
You can probably add ramdisk_image to ITS format too.
Thanks,
Michal
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140430/572293cc/attachment.pgp>
Hi Michal.
Thanks for your reply.
Quoted 3 lines
Before you build u-boot you have to copy ps7_init.c/h from your hw design to the u-boot if you want to use SPL.
Oops, I forgot to mention this.
I did that.
Quoted 6 lines
Quoted 3 lines
[1] Build u-boot
[2] Convert spl/u-boot-spl.bin into boot.bin
with BootGen toolyes - or if you look at xilinx git u-boot repo we have one simple python script which does this automatically without bootgen.
I found tools/zynq-boot-bin.py
Is this the one you mentioned?
Quoted 6 lines
Quoted 1 line
[3] Copy "boot.bin" to FAT-fomatted SD card.
yes.
I personally use SD boot mode it means boot.bin has just u-boot SPL and u-boot.img on SD stores full u-boot.
On u-boot 2014.04 release, I don't know how to use full u-boot either.
Full u-boot image of zynq enables CONFIG_OF_SEPARATE, right? I think u-boot.img does not include device tree.
Should I combine u-boot.img and device tree by myself? Like this?
cat u-boot.img u-boot.dtb > u-boot.img.tmp
mv u-boot.img.tmp u-boot.img
Or should I disable CONFIG_OF_SEPARATE?
Quoted 2 lines
Keep in your mind that using U-BOOT SPL is not fully supported flow. Supported flow is fsbl->u-boot->linux.
OK.
Maybe I should stick to the old flow.
Quoted 11 lines
Quoted 2 lines
My question is, how to pass an init ramdisk?
I am using cpio compiled in directly in the kernel.
Quoted 2 lines
In which file-name should I copy init ramdisk
into SD card?Xilinx OSL versions are using initramdisk
which you can download here.
http://www.wiki.xilinx.com/Zynq+2014.1+Release
Yes. I am using this.
Quoted 4 lines
Quoted 1 line
How should I load the init ramdisk from the SD card?
And this is the command which OSL version are using.
Quoted 9 lines
"sdboot=if mmcinfo; then " \"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 00x3000000${kernel_image} && " \
"fatload mmc 00x2A00000${devicetree_image} && " \
"fatload mmc 00x2000000${ramdisk_image} && " \
"bootm0x30000000x20000000x2A00000; " \
"fi\0" \
Yes. I know this works.
But in my understanding, SPL cannot use this command.
My question is how SPL can load the init ramdisk.
It looks like spl_load_image_fat_os() function loads "system.dtb" and "uImage".
But I could not find which code loads ramdisk. Not supported yet?
Best Regards
Masahiro Yamada
Hi,
Quoted 10 lines · Masahiro Yamada
Hi Michal.
Thanks for your reply.
Quoted 3 lines
Before you build u-boot you have to copy ps7_init.c/h from your hw design to the u-boot if you want to use SPL.
Oops, I forgot to mention this.
I did that.
ok. Then I expect you are able to see at least u-boot SPL messages.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
[1] Build u-boot
[2] Convert spl/u-boot-spl.bin into boot.bin
with BootGen toolyes - or if you look at xilinx git u-boot repo we have one simple python script which does this automatically without bootgen.
I found
tools/zynq-boot-bin.py
Is this the one you mentioned?
yes that's the script - if you directly use that repo it is also wired in Makefile that boot.bin is automatically created.
I have this on 2014.04 but I didn't validate this yet.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
[3] Copy "boot.bin" to FAT-fomatted SD card.
yes.
I personally use SD boot mode it means boot.bin has just u-boot SPL and u-boot.img on SD stores full u-boot.
On u-boot 2014.04 release, I don't know how to use full u-boot either.
This is what I am getting - u-boot.img has full u-boot.
U-Boot SPL 2014.01-00816-ge0c1813-dirty (Jan 22 2014 - 17:56:37) mmc boot
reading download.bit
design filename = "system.ncd;HW_TIMEOUT=FALSE;UserID=0xFFFFFFFF" part number = "7z020clg484"
date = "2013/07/22"
time = "17:18:11"
bytes in bitstream = 4045564zynq_load: Align buffer at 100006c to 1000000(swap 1) reading system.dtb
spl: error reading image system.dtb, err - -1
reading u-boot.img
reading u-boot.img
U-Boot 2014.01 (Mar 19 2014 - 08:12:51)
Memory: ECC disabled DRAM: 1 GiB MMC: zynq_sdhci: 0 SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: Gem.e000b000
U-BOOT for zynq-zc702
Gem.e000b000 Waiting for PHY auto negotiation to complete.... done BOOTP broadcast 1
BOOTP broadcast 2
Abort
Hit any key to stop autoboot: 0
U-Boot-PetaLinux>
Quoted 2 lines
Full u-boot image of zynq enables
CONFIG_OF_SEPARATE, right? I think u-boot.img does not include device tree.
In mainline yes but I am not using it. It is nice for playing but it is fine just to disable it and you don't need to use dts at all. Just disable it in zynq config file.
Quoted 4 lines
Should I combine u-boot.img and device tree by myself? Like this?
cat u-boot.img u-boot.dtb > u-boot.img.tmp
mv u-boot.img.tmp u-boot.img
I am not sure if this will work because img is legacy u-boot format with entry point and load address. That's why this will not work. But OF also support to add DTB to hardcoded address but SPL has to be fixed for that.
Quoted 1 line
Or should I disable
CONFIG_OF_SEPARATE?
That's what I am doing and that's what you can see in our xilinx git repo.
Quoted 6 lines
Quoted 3 lines
Keep in your mind that using U-BOOT SPL is not fully supported flow. Supported flow is fsbl->u-boot->linux.
OK.
Maybe I should stick to the old flow.
It depends what you want to do. If you want to get just linux run then just use images from wiki and change the kernel.
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
My question is, how to pass an init ramdisk?
I am using cpio compiled in directly in the kernel.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
In which file-name should I copy init ramdisk
into SD card?Xilinx OSL versions are using initramdisk
which you can download here.
http://www.wiki.xilinx.com/Zynq+2014.1+ReleaseYes. I am using this.
ok. Then what are you trying to do? Just use latest u-boot?
Quoted 17 lines
Quoted 4 lines
Quoted 1 line
How should I load the init ramdisk from the SD card?
And this is the command which OSL version are using.
Quoted 9 lines
"sdboot=if mmcinfo; then " \"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 00x3000000${kernel_image} && " \
"fatload mmc 00x2A00000${devicetree_image} && " \
"fatload mmc 00x2000000${ramdisk_image} && " \
"bootm0x30000000x20000000x2A00000; " \
"fi\0" \Yes. I know this works.
But in my understanding, SPL cannot use this command.
Quoted 6 lines
My question is how SPL can load the init ramdisk.
It looks like
spl_load_image_fat_os()function loads "system.dtb" and "uImage".
But I could not find which code loads ramdisk. Not supported yet?
yes, I think it is not supported.
I haven't had a time but Simon mentioned that they have enabled ITS format in SPL and it should be straight forward to do so. Then you can just use full ITS instead of DTB, kernel, ramdisk in separate images.
Thanks,
Michal
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140430/21fe83f6/attachment.pgp>
Hi Michal,
Sorry for late reply. (I'm back from my vacations.)
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Before you build u-boot you have to copy ps7_init.c/h from your hw design to the u-boot if you want to use SPL.
Oops, I forgot to mention this.
I did that.ok. Then I expect you are able to see at least u-boot SPL messages.
Yes. I can see them.
Quoted 32 lines
This is what I am getting - u-boot.img has full u-boot.
U-Boot SPL 2014.01-00816-ge0c1813-dirty (Jan 22 2014 - 17:56:37) mmc boot
reading download.bit
design filename = "system.ncd;HW_TIMEOUT=FALSE;UserID=0xFFFFFFFF" part number = "7z020clg484"
date = "2013/07/22"
time = "17:18:11"
bytes in bitstream = 4045564zynq_load: Align buffer at 100006c to 1000000(swap 1) reading system.dtb
spl: error reading image system.dtb, err - -1
reading u-boot.img
reading u-boot.imgU-Boot 2014.01 (Mar 19 2014 - 08:12:51)
Memory: ECC disabled DRAM: 1 GiB MMC: zynq_sdhci: 0 SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: Gem.e000b000U-BOOT for zynq-zc702
Quoted 7 lines
Gem.e000b000 Waiting for PHY auto negotiation to complete.... done BOOTP broadcast 1
BOOTP broadcast 2Abort
Hit any key to stop autoboot: 0
U-Boot-PetaLinux>
Thanks!
Now I understand how to boot u-boot and Linux.
Quoted 6 lines
Quoted 2 lines
Full u-boot image of zynq enables
CONFIG_OF_SEPARATE, right? I think u-boot.img does not include device tree.In mainline yes but I am not using it. It is nice for playing but it is fine just to disable it and you don't need to use dts at all. Just disable it in zynq config file.
I am not convinced why unsupported CONFIG_OF_SEPARATE is enabled.
U-boot mainline and u-boot-xlnx diverged with this point. Which way are you going in your future development? U-Boot control with device tree? or without device tree?
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
My question is, how to pass an init ramdisk?
I am using cpio compiled in directly in the kernel.
Quoted 2 lines
In which file-name should I copy init ramdisk
into SD card?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Xilinx OSL versions are using initramdisk
which you can download here.
http://www.wiki.xilinx.com/Zynq+2014.1+ReleaseYes. I am using this.
ok. Then what are you trying to do? Just use latest u-boot?
Yes.
I want to run U-boot and Linux on a Zynq board.
I also want to use new features in the U-Boot mainline such as Kbuild.
That is my motivation to try to run u-boot-2014.04 on a zynq board.
Quoted 25 lines
Quoted 18 lines
Quoted 5 lines
Quoted 2 lines
How should I load the init ramdisk from the SD card?
And this is the command which OSL version are using.
Quoted 9 lines
"sdboot=if mmcinfo; then " \"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 00x3000000${kernel_image} && " \
"fatload mmc 00x2A00000${devicetree_image} && " \
"fatload mmc 00x2000000${ramdisk_image} && " \
"bootm0x30000000x20000000x2A00000; " \
"fi\0" \Yes. I know this works.
But in my understanding, SPL cannot use this command.Quoted 6 lines
My question is how SPL can load the init ramdisk.
It looks like
spl_load_image_fat_os()function loads "system.dtb" and "uImage".
But I could not find which code loads ramdisk. Not supported yet?
Quoted 5 lines
yes, I think it is not supported.
I haven't had a time but Simon mentioned that they have enabled ITS format in SPL and it should be straight forward to do so. Then you can just use full ITS instead of DTB, kernel, ramdisk in separate images.
This sounds reasonable!
I am looking forward to it.
Best Regards
Masahiro Yamada
Hi Masahiro,
Quoted 2 lines · Masahiro Yamada
Hi Michal,
Sorry for late reply. (I'm back from my vacations.)
No problem at all.
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Before you build u-boot you have to copy ps7_init.c/h from your hw design to the u-boot if you want to use SPL.
Oops, I forgot to mention this.
I did that.ok. Then I expect you are able to see at least u-boot SPL messages.
Yes. I can see them.
That's a great start.
Quoted 36 lines
Quoted 36 lines
This is what I am getting - u-boot.img has full u-boot.
U-Boot SPL 2014.01-00816-ge0c1813-dirty (Jan 22 2014 - 17:56:37) mmc boot
reading download.bit
design filename = "system.ncd;HW_TIMEOUT=FALSE;UserID=0xFFFFFFFF" part number = "7z020clg484"
date = "2013/07/22"
time = "17:18:11"
bytes in bitstream = 4045564zynq_load: Align buffer at 100006c to 1000000(swap 1) reading system.dtb
spl: error reading image system.dtb, err - -1
reading u-boot.img
reading u-boot.imgU-Boot 2014.01 (Mar 19 2014 - 08:12:51)
Memory: ECC disabled DRAM: 1 GiB MMC: zynq_sdhci: 0 SF: Detected N25Q128A with page size 256 Bytes, erase size 64 KiB, total 16 MiB*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: Gem.e000b000U-BOOT for zynq-zc702
Gem.e000b000 Waiting for PHY auto negotiation to complete.... done BOOTP broadcast 1
BOOTP broadcast 2
Quoted 7 lines
Quoted 3 lines
Abort
Hit any key to stop autoboot: 0
U-Boot-PetaLinux>Thanks!
Now I understand how to boot u-boot and Linux.
You can run Linux directly from SPL. I have tried that but without FIT it is not so nice.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Full u-boot image of zynq enables
CONFIG_OF_SEPARATE, right? I think u-boot.img does not include device tree.In mainline yes but I am not using it. It is nice for playing but it is fine just to disable it and you don't need to use dts at all. Just disable it in zynq config file.
I am not convinced why unsupported
CONFIG_OF_SEPARATEis enabled.
Jagan has enabled it - don't know why but it is enabled by default.
Quoted 3 lines
U-boot mainline and u-boot-xlnx diverged with this point. Which way are you going in your future development? U-Boot control with device tree? or without device tree?
yes. I have tried OF_SEPARATE and if you copy DTS from the kernel (our repo) you can use it and should work. At least worked when I have tried it.
u-boot should be configured from device-tree.
We are pushing a lot of drivers to mainline and we are reviewing the whole binding to ensure that it is correct that's why I haven't pushed any DTS file to u-boot source code for reference boards.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
Quoted 11 lines
Quoted 2 lines
My question is, how to pass an init ramdisk?
I am using cpio compiled in directly in the kernel.
Quoted 2 lines
In which file-name should I copy init ramdisk
into SD card?Xilinx OSL versions are using initramdisk
which you can download here.
http://www.wiki.xilinx.com/Zynq+2014.1+ReleaseYes. I am using this.
Quoted 7 lines
Quoted 1 line
ok. Then what are you trying to do? Just use latest u-boot?
Yes.
I want to run U-boot and Linux on a Zynq board.
I also want to use new features in the U-Boot mainline such asKbuild.That is my motivation to try to run u-boot-2014.04 on a zynq board.
ok. Just disable OF_CONTROL for now and I haven't pushed that SPL fpga feature because it needs to be cleanup.
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 5 lines
Quoted 2 lines
How should I load the init ramdisk from the SD card?
And this is the command which OSL version are using.
Quoted 9 lines
"sdboot=if mmcinfo; then " \"run uenvboot; " \
"echo Copying Linux from SD to RAM... && " \
"fatload mmc 00x3000000${kernel_image} && " \
"fatload mmc 00x2A00000${devicetree_image} && " \
"fatload mmc 00x2000000${ramdisk_image} && " \
"bootm0x30000000x20000000x2A00000; " \
"fi\0" \Yes. I know this works.
But in my understanding, SPL cannot use this command.My question is how SPL can load the init ramdisk.
It looks like
spl_load_image_fat_os()function loads "system.dtb" and "uImage".
But I could not find which code loads ramdisk. Not supported yet?
Quoted 8 lines
Quoted 5 lines
yes, I think it is not supported.
I haven't had a time but Simon mentioned that they have enabled ITS format in SPL and it should be straight forward to do so. Then you can just use full ITS instead of DTB, kernel, ramdisk in separate images.This sounds reasonable!
I am looking forward to it.
my too. :-)
thanks,
Michal
Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140507/b8df0d21/attachment-0001.pgp>
Hi Masahiro,
Although this is not directed to me, but perhaps I can help you out. I am working on zc702 board.
Can you copy paste the content of your bif file that you use with bootgen
to generate BOOT.BIN file?
Thanks and regards,
Heshsham
Quoted 53 lines · Masahiro Yamada
Hi Michal,
I am a user of Zynq ZC-706 board.
On u-boot 2014.01 release, I put Kernel Image, Device Tree, Ramdisk into "fit.itb" and I could successfully boot Linux Kernel.
But I don't know how to boot Kernel on u-boot 2014.04 release. Please help!
The default boot sequence of Zynq on the u-boot-2014.04 release is Falcon boot, right?
I am trying to boot Linux with
- U-boot 2014.04
- Linux Kernel 3.14
- SD boot mode
- ZC706 boardWhat I did is roughly like this:
## U-Boot ##
[1] Build u-boot
[2] Convert spl/u-boot-spl.bin into boot.bin
with BootGen tool
[3] Copy "boot.bin" to FAT-fomatted SD card.##Kernel ##
[1] Build kernel withmulti_v7_defconfigsetting
[2] Copy uImage to the SD card
[3] Rename zynq-zc706.dtb into system.dtb and copy to SD cardKernel boot failed to mount the root device.
My question is, how to pass an init ramdisk?
In which file-name should I copy init ramdisk
into SD card?How should I load the init ramdisk from the SD card?
Best Regards
Masahiro Yamada_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Hi Heshsham,
Thanks for your offering help!
Quoted 7 lines · On Wed, 30 Apr 2014 15:52:02 +0530 Heshsham Abdul Basit <[email protected]>…
Hi Masahiro,
Although this is not directed to me, but perhaps I can help you out. I am working on zc702 board.
Can you copy paste the content of your bif file that you use with bootgen
to generate BOOT.BIN file?
My BIF file is super simple. Like this.
image:
{
[bootloader,load=0x00000000]u-boot/spl/u-boot-spl.bin
}
Best Regards
Masahiro Yamada