cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
11,811 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
Reply
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
17,661 Views
Registered: ‎09-10-2008

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

View solution in original post

15 Replies
Highlighted
Scholar
Scholar
11,796 Views
Registered: ‎10-26-2012

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
Reply
Highlighted
Xilinx Employee
Xilinx Employee
17,662 Views
Registered: ‎09-10-2008

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

View solution in original post

Highlighted
Explorer
Explorer
11,711 Views
Registered: ‎02-27-2014

Thanks for your reply. 

 

Regards

Suheb

0 Kudos
Reply
Highlighted
Explorer
Explorer
11,707 Views
Registered: ‎02-27-2014

@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
Reply
Highlighted
Xilinx Employee
Xilinx Employee
11,705 Views
Registered: ‎09-10-2008

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
Reply
Highlighted
Explorer
Explorer
11,639 Views
Registered: ‎02-27-2014

@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
Reply
Highlighted
Xilinx Employee
Xilinx Employee
11,635 Views
Registered: ‎09-10-2008

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
Reply
Highlighted
Explorer
Explorer
11,619 Views
Registered: ‎02-27-2014

@linnj

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

0 Kudos
Reply
Highlighted
Explorer
Explorer
11,466 Views
Registered: ‎02-27-2014

@linnj 

 Hi ...hope you are doing fine.

 Did you use petalinux tool for the method explained above?

 

Regards

 

 

0 Kudos
Reply
Highlighted
Xilinx Employee
Xilinx Employee
7,999 Views
Registered: ‎09-10-2008
I believe I did. I likely called bootgen manually to create boot.bin since I was using a specific BIF file.
0 Kudos
Reply
Highlighted
Explorer
Explorer
7,872 Views
Registered: ‎02-27-2014

@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
Reply
Highlighted
Explorer
Explorer
7,687 Views
Registered: ‎02-27-2014

@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
Reply
Highlighted
Xilinx Employee
Xilinx Employee
7,640 Views
Registered: ‎09-10-2008

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
Reply
Highlighted
Explorer
Explorer
7,369 Views
Registered: ‎02-27-2014
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
Reply
Highlighted
Visitor
Visitor
2,146 Views
Registered: ‎08-08-2017

Hello Linnj -

 

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

 

 

Regards

0 Kudos
Reply