cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kraiskil
Visitor
Visitor
6,577 Views
Registered: ‎02-05-2016

bootloader works from SD card, not from QSPI flash

Jump to solution

Hi,

 

I compiled u-boot from https://github.com/Xilinx/u-boot-xlnx, using the default configuration there for my Zynq board.

This gives me the first stage bootloader spl/boot.bin and the second stage bootloader u-boot.img.

Putting these two files on a SD card, and booting the board, I can see the FSBL being run, finding the SSBL and I get an u-boot prompt on the UART. So far so good.

 

Now, if I flash the exact same FSBL to QSPI flash with the SDK tool program_flash:

program_flash -f boot.bin -blank_check -verify -flash_type qspi_single

and set jumpers on the board to boot from SPI & boot it, nothing happens. No output on the UART, nothing.

The flashing gives no errors, no warnings.

 

What am I missing? Should this work? How is the bootrom handling SD card differently from QSPI? Or do I need explicitly set the location of the FSBL in the flash (and if so, how and to what address)? Did I miss some configuration in u-boot that tells it that the FSBL is run from flash, not SD card?

 

The board is a Zybo, which has a single 16MB flash, so 'qspi_single' should be correct.

 

 

any input is appreciated :)

kalle

0 Kudos
1 Solution

Accepted Solutions
kraiskil
Visitor
Visitor
11,126 Views
Registered: ‎02-05-2016

Seems u-boot hard-codes the search for the SSBL to the same medium from where the FSBL ran from... This is override-able, but not overridden for zynq.

 

With this patch, I now got the Zybo to boot the FSBL from SPI, and SSBL from SDCard

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 21e9bf6..7aef5e4 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -8,6 +8,7 @@
 #include <fdtdec.h>
 #include <fpga.h>
 #include <mmc.h>
+#include <spl.h>
 #include <zynqpl.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
@@ -137,3 +138,9 @@ int dram_init(void)
 
        return 0;
 }
+
+void board_boot_order(u32 *spl_boot_list)
+{
+       spl_boot_list[0]=BOOT_DEVICE_MMC1;
+}
+

 

I didn't find a "clean" way of configuring this in u-boot, which probably means it is of no general interest. Which in turn means there is no point in trying to upstream this. Just leaving the diff here, in case someone else is interested in this sort of setup.

View solution in original post

0 Kudos
5 Replies
balkris
Xilinx Employee
Xilinx Employee
6,570 Views
Registered: ‎08-01-2008
check this post
https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/How-can-I-build-a-mcs-file-to-boot-the-PL-on-a-Zynq-from-SPI/td-p/499496
check this ARs
http://www.xilinx.com/support/answers/55026.html
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
smarell
Community Manager
Community Manager
6,559 Views
Registered: ‎07-23-2012
Can you please create a boot image with just FSBL (enable FSBL debug log refer to http://www.xilinx.com/support/answers/59174.html for help) and see if Zynq boots successfully, This gives us a clue on whether we are able to boot from QSPI or not.

If you fail to see any prints on serial terminal then please read REBOOT_STATUS register to get BOOTROM error code.
-----------------------------------------------------------------------------------------------
Please mark the post as "Accept as solution" if the information provided answers your query/resolves your issue.

Give Kudos to a post which you think is helpful.
kraiskil
Visitor
Visitor
6,547 Views
Registered: ‎02-05-2016

Thanks for the quick replies


I don't see what I can take from the links Balkrishan posted. Seems those links deal with booting only the PL part of the Zynq without the PS part. Which is the exact opposite of what I am doing. A bit image for the PL would be loaded only by the second-stage bootloader.

 

Loading only the FSBL on the SD-card, I can see it printing to the console that it searches for some predefined files (linux kenrel, fpga-image and finally the SSBL). When none of these are available on the SD card, the FSBL then just sits there and does nothing.

U-Boot SPL 2016.01-03965-g8681fb8-dirty (Sep 11 2016 - 21:34:31)
mmc boot
Trying to boot from MMC
reading fpga.bin
spl_load_image_fat: error reading image fpga.bin, err - -1
spl: error reading image fpga.bin, err - 1
reading system.dtb                            
spl_load_image_fat_os: error reading image sys                             |
reading u-boot.img

Now if I flash the QSPI with the command line posted above and boot from it, I do not see any of these printouts from the FSBL on the console.

 

To read the REBOOT_STATUS register:

$xmd
XMD% connect arm hw
[output redacted - no errors, no warnings]
XMD% mrd 0xF8000258                                                                                                        
F8000258:   00400000

Which according to the reference manual (ug585, table 6.22) is the reset value of REBOOT_STATUS? I.e., no error code.

 

(this gave me an idea, and I leave the above unedited for posterity)

 

That was with a cold boot. Just trying options around, I noticed that with a warm boot, the status is 0x00600000.

AND there is output into the UART!

I'd guess some part of my terminal setup is not quick enough to get the three lines sent by the Zynq.

U-Boot SPL 2016.01-03965-g8681fb8-dirty (Sep 11 2016 - 21:34:31)
qspi boot
Trying to boot from SPI

 

So it would seem I have misuderstood the boot process. And one can not have the FSBL on QSPI and the SSBL on SDCard? Or why/how would u-boot's FSBL want to read the SSBL from the same medium as where the FSBL is.

After all, it is the exact same binary booting in both cases.

I need to read up on this. But again, quick answers are of course appreciated :)

0 Kudos
kraiskil
Visitor
Visitor
11,127 Views
Registered: ‎02-05-2016

Seems u-boot hard-codes the search for the SSBL to the same medium from where the FSBL ran from... This is override-able, but not overridden for zynq.

 

With this patch, I now got the Zybo to boot the FSBL from SPI, and SSBL from SDCard

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 21e9bf6..7aef5e4 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -8,6 +8,7 @@
 #include <fdtdec.h>
 #include <fpga.h>
 #include <mmc.h>
+#include <spl.h>
 #include <zynqpl.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
@@ -137,3 +138,9 @@ int dram_init(void)
 
        return 0;
 }
+
+void board_boot_order(u32 *spl_boot_list)
+{
+       spl_boot_list[0]=BOOT_DEVICE_MMC1;
+}
+

 

I didn't find a "clean" way of configuring this in u-boot, which probably means it is of no general interest. Which in turn means there is no point in trying to upstream this. Just leaving the diff here, in case someone else is interested in this sort of setup.

View solution in original post

0 Kudos
sandeep3003
Visitor
Visitor
1,335 Views
Registered: ‎07-14-2018

I'm programmed the qspi from jtag. in the console it shows flash operation are successful but after the restart the zybo board it is not booting from the qspi,  I don't why is booting can anybody help me 

0 Kudos