UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
10,520 Views
Registered: ‎02-27-2014

How to boot linux by bypassing uboot ?

Jump to solution

I am working on the microzed board (zynq chip) of Xilinx. I am porting a linux kernel on this board and i also trying to optimize it so that it can boot in a minimum possible time. I have tried Petalinux tool provided by xilinx but could not reduced the boot time below 1.5 seconds. Now, I am trying the alternate method i.e. by replacing fsbl(first stage boot loader) by spl(secondary program loader) so that spl directly boot kernel by bypassing uboot. But, i am unable to find the right direction. Please help me regarding this.

 

I am following the given documents:

 

http://www.wiki.xilinx.com/U-Boot+Secondary+Program+Loader

 

www.denx.de/wiki/pub/U-Boot/.../2013-ELCE-U-Boot-Falcon-Boot.pdf

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
16,370 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution

I didn't have good luck with u-boot SPL in my testing either, should be simple, but not documented well yet from what I could tell.

 

Just another data point here.

 

I was able to boot Linux from FSBL without any FSBL changes if the kernel is configured in a specific manner.

I did not do a lot of testing with this configuration so bear that in mind.

 

  1.       Alter the Linux kernel configuration to use an appended DTB.
  2.       Build the kernel (zImage) and the device tree.
  3.       this assumes using a initramfs ramdisk as Petalinux does to get a single monolithic binary image
  4.       Concatenate the kernel and dtb files into one file (cat zImage system.dtb > zImage.withdtb.bin)
  5.       Create a BIF file to only load FSBL and zImage.withdtb.bin.
  6.       image : {
  7.               [bootloader]zynq_fsbl.elf
  8.               [load=0x8800000,startup=0x8800000]zImage.withdtb.bin
  9.       }
  10.       Build a new boot.bin

 

Note Linux must be loaded at or above 0x8800000 to prevent the Linux kernel wrapper from decompressing the kernel into the lower 1 MB of DDR which is not mapped into low memory at this point as it’s typically done in u-boot.  It appears that Linux does map the lower 1 MB DDR into low memory as devmem works for address 0 but this probably needs some verifying.

 

Thanks

John

15 Replies
Scholar milosoftware
Scholar
10,505 Views
Registered: ‎10-26-2012

Re: How to boot linux by bypassing uboot ?

Jump to solution

Falcon boot won't work with NAND on the Zynq, there is no NAND support for Zynq in u-boot SPL (yet?).

 

The master-next branch has SPL support and can boot from QSPI flash without loading "full" u-boot.

 

If the board has QSPI flash, the fastest would be to get the flash into memory mapped mode, point the bootloader at the kernel and devicetree in flash (must be in the first 16MB!), and then tell it to go.

 

An alternative approach is to reduce u-boot's features so it fits into OCM (192kB max program size, leaving 64k stack/heap). Then you don't need a second stage loader, and u-boot can completely replace the first-stage loader. I think there's a zynq-ocm.h in the u-boot configs that tries to accomplish that. If I'm not mistaken, the ephel camera's also boot that way.

0 Kudos
Xilinx Employee
Xilinx Employee
16,371 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution

I didn't have good luck with u-boot SPL in my testing either, should be simple, but not documented well yet from what I could tell.

 

Just another data point here.

 

I was able to boot Linux from FSBL without any FSBL changes if the kernel is configured in a specific manner.

I did not do a lot of testing with this configuration so bear that in mind.

 

  1.       Alter the Linux kernel configuration to use an appended DTB.
  2.       Build the kernel (zImage) and the device tree.
  3.       this assumes using a initramfs ramdisk as Petalinux does to get a single monolithic binary image
  4.       Concatenate the kernel and dtb files into one file (cat zImage system.dtb > zImage.withdtb.bin)
  5.       Create a BIF file to only load FSBL and zImage.withdtb.bin.
  6.       image : {
  7.               [bootloader]zynq_fsbl.elf
  8.               [load=0x8800000,startup=0x8800000]zImage.withdtb.bin
  9.       }
  10.       Build a new boot.bin

 

Note Linux must be loaded at or above 0x8800000 to prevent the Linux kernel wrapper from decompressing the kernel into the lower 1 MB of DDR which is not mapped into low memory at this point as it’s typically done in u-boot.  It appears that Linux does map the lower 1 MB DDR into low memory as devmem works for address 0 but this probably needs some verifying.

 

Thanks

John

Explorer
Explorer
10,420 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

Thanks for your reply. 

 

Regards

Suheb

0 Kudos
Explorer
Explorer
10,416 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linnj I just want to understand that in your procedure, are you able to bypass u-boot and directly boot kernel from FSBL?

Right now bypassing u-boot is my primary requirement.

0 Kudos
Xilinx Employee
Xilinx Employee
10,414 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution

Yes that was what I did, booted Linux without u-boot.  The process of how to do it might not meet your specific requirements (how the kernel must be built), but it does work.

 

Thanks

John

0 Kudos
Explorer
Explorer
10,348 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linnj 

I am thankful for your reply. Can you explain me the procedure of booting linux by bypassing kernel. I tried it alot but could'nt find the right path.

Please help

0 Kudos
Xilinx Employee
Xilinx Employee
10,344 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution

Hi,

 

The process I gave above was specific, is there some part of it that didn't work?  You need to be more specific with some details about what you have done and what it is doing if it's not working.

 

Thanks

John

0 Kudos
Explorer
Explorer
10,328 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linnj

Thanks a lot ..I am trying it again and will let you know if i get stuck.

0 Kudos
Explorer
Explorer
10,175 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linnj 

 Hi ...hope you are doing fine.

 Did you use petalinux tool for the method explained above?

 

Regards

 

 

0 Kudos
Xilinx Employee
Xilinx Employee
6,708 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution
I believe I did. I likely called bootgen manually to create boot.bin since I was using a specific BIF file.
0 Kudos
Explorer
Explorer
6,581 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linjin 

 

Hi

 

I have tried to bypass uboot but i could not make it through.

I am following the method given in the given link:

 

http://code.metager.de/source/xref/denx/u-boot/doc/README.falcon?r=cfd6de9cf98ad1418edf96da970eac50f4fe6f0d

 

Please Help.

 

 

0 Kudos
Explorer
Explorer
6,396 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution

@linnj 

Hi Linnj

 

I followed the procedure for bypassing uboot given by you. I formed BOOT.BIN file using bootgen command but when i am booting from microzed board, nothing is coming on the teraterm.

 

Please help

0 Kudos
Xilinx Employee
Xilinx Employee
6,349 Views
Registered: ‎09-10-2008

Re: How to boot linux by bypassing uboot ?

Jump to solution

I would rebuild FSBL to have verbose printfs so that you have output from FSBL.  You need to know if FSBL is starting Linux correctly and if it's Linux not getting something like the device tree right.  There were kernel configuration changes if I remember right so everything has to be setup correctly. 

 

Thanks

John

0 Kudos
Highlighted
Explorer
Explorer
6,078 Views
Registered: ‎02-27-2014

Re: How to boot linux by bypassing uboot ?

Jump to solution
Hi linnj..
Hope you are doing fine. I am thankful for the solution given by you and i am able to bypass uboot successfully.
sorry for a late reply.

Regards
Suheb
0 Kudos
Visitor sraxlz
Visitor
855 Views
Registered: ‎08-08-2017

Re: How to boot linux by bypassing uboot ?

Jump to solution

Hello Linnj -

 

Would your solution work for "Zynq UltraScale+ MPSoC" system? Thank you.

 

 

Regards

0 Kudos