cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
inve7
Visitor
Visitor
2,239 Views
Registered: ‎02-21-2020

U-boot boot.scr script with QSPI

Can someone please explain the correct process for setting up booting from QSPI using the u-boot boot.scr script? (I'm using Petalinux 2020.1) I'm assuming this is the distro boot feature that is now the preferred way of booting now that u-boot autoconfig is going away?

  • Digging through the u-boot commits I found there is a config called CONFIG_BOOT_SCRIPT_OFFSET to tell u-boot where to look for boot.scr in the QSPI flash. Is the proper way to set this using 'petalinux-config -c u-boot'?
  • The images/linux/boot.scr that is generated for my project is using 0xF00000 for the image.ub offset and 0x1D00000 for the length. These are NOT right for the partitions I set up in 'petalinux config' Subsystem AUTO Hardware Settings -> Flash Settings. Why not?
  • Am I expected to modify the files in 'project-spec/meta-user/recipes-bsp/u-boot/u-boot-zynq-scr'?
  • Where is this documented?

Thanks

4 Replies
patocarr
Teacher
Teacher
2,097 Views
Registered: ‎01-28-2008

Hi @inve7 et al,

  Got any progress on the u-boot boot.scr on QSPI?

  I found the Using+Distro+Boot+With+Xilinx+U-Boot link that has some interesting comments on this very subject.

  However, it doesn't matter what it's set in the project, the boot.scr that is generated in ./images/linux doesn't get these flash addresses as set in the petalinux-config/Subsystem AUTO hardware settings/Flash settings. The u-boot configuration is set to "Petalinux u-boot config" though the "other" option doesn't make any visible difference.

That said, I still manually modified the meta-user/recipes-bsp/u-boot/u-boot-zynq-scr/boot.cmd.default to match the QSPI partitions, but u-boot doesn't respect these settings.

fdt_addr=0x1000
imageub_addr=0x10000000
kernel_addr=0x80000
kernel_offset=0x2680000
kernel_size=0x5980000
kernel_type=image.ub

Screenshot 2020-08-20-17_52_39-Selection_01.png

 In this screenshot, u-boot attempts to load from QSPI at the wrong offset (0x3e80000), ignoring the settings in the petalinux-config menu options.


Any idea what's going on?

Thanks in advance for any insight,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

inve7
Visitor
Visitor
2,084 Views
Registered: ‎02-21-2020

Hi @patocarr , I haven't had the chance yet to get any further myself, but here's what I'm thinking so far.

  • First of all, it doesn't look to me like "boot.cmd.default" is being used at all. I think "boot.cmd.default.initrd" is the file being used as the template for the generated "images/linux/boot.scr" file. I think your best bet is to try editing the "u-boot-zynq-scr.bbappend" file. In particular the QSPI_KERNEL_OFFSET and QSPI_FIT_IMAGE_SIZE values.
  • According to the wiki page: "The PetaLinux tools will automatically adjust the flash and load addresses as appropriate to fit the relative sizes of each payload partition." But I don't see this happening.
  • When u-boot is reading from address 0x3e80000, that's it looking for the boot.scr script (not the kernel image). You need to store the boot.scr in flash at that address. Or, you can change the address by changing the CONFIG_BOOT_SCRIPT_OFFSET with "petalinux-config -c u-boot"

 

Can someone from Xilinx please tell us the expected way to be setting this all up, and why the flash addresses in these files aren't being generated automatically?

 

patocarr
Teacher
Teacher
2,042 Views
Registered: ‎01-28-2008

Hi @inve7 

  Thanks for the corrections and feedback. Like you, I'm not seeing any changes from what's set in petalinux-config flash settings being applied to the boot.scr script generation.

  The CONFIG_BOOT_SCRIPT_OFFSET set in u-boot config is not respected and always shows as 0x3E80000 regardless of what's set.

  Based on the wiki, the boot.scr.uimg would be automatically generated by Petalinux, however that's not the case afaics. There's no boot.scr or boot.src.uimg being generated in images/linux/.

  Basically, the wiki is a timely addition and appreciated, but it's not reflected in what Petalinux actually does in our experience.

 

  Perhaps Xilinx can chip in and help provide guidance?

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
jrhtech
Voyager
Voyager
1,941 Views
Registered: ‎10-04-2017

I'm only using QSPI to boot and then my boot.scr and image.ub is in eMMC and see some issue there but not with addresses.  However, just looking the recipes the bbappend has this in it's pre-compile rule

"${WORKDIR}/boot.cmd.${BOOTMODE}${BOOTFILE_EXT}" > "${WORKDIR}/boot.cmd.${BOOTMODE}.${SOC_FAMILY}"

where BOOTMODE is default and BOOTFILE_EXT is initrd set the the bbappend

and then the actually yocto recipe does this:

"${WORKDIR}/boot.cmd.${BOOTMODE}.${SOC_FAMILY}" > "${WORKDIR}/boot.cmd"

Note, if you are trying to use QSPI and eMMC u-boot find's the boot.scr on the eMMC; however, when it calls the script it calls it with the device it was loaded from.   So the script is called with 'qspi0' and it can't find the image.ub so the script fails and thus the boot fails.

 

jeff

 

 

0 Kudos