Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems
477 Discussions

How do I get u-boot-with-spl.sfp to read u-boot.scr instead of extlinux.conf?

JMurr12
Novice
2,871 Views

Using SoCEDS 19.1

0 Kudos
3 Replies
Fawaz_Al-Jubori
Employee
2,676 Views

Hello,

This is the default setup for uboot.

once you have the uboot source code, you can navigate to inculde/configs/socfpga_common.h file

inside this file, you can see the default uboot environments. for example:

 

#define CONFIG_EXTRA_ENV_SETTINGS \

"verify=n\0" \

"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \

"fdtaddr=0x00000100\0" \

"bootimage=zImage\0" \

"bootimagesize=0x600000\0" \

"fdtimage=socfpga.dtb\0" \

"fdtimagesize=0x7000\0" \

"mmcloadcmd=fatload\0" \

"mmcloadpart=1\0" \

"mmcroot=/dev/mmcblk0p2\0" \

"qspiloadcs=0\0" \

"qspibootimageaddr=0xa0000\0" \

"qspifdtaddr=0x50000\0" \

"qspiroot=/dev/mtdblock1\0" \

"qspirootfstype=jffs2\0" \

"nandbootimageaddr=0x120000\0" \

"nandfdtaddr=0xA0000\0" \

"nandroot=/dev/mtdblock1\0" \

"nandrootfstype=jffs2\0" \

"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \

"bootz ${loadaddr} - ${fdtaddr}\0" \

"mmcload=mmc rescan;" \

"${mmcloadcmd} mmc 0:${mmcloadpart} ${loadaddr} ${bootimage};" \

"${mmcloadcmd} mmc 0:${mmcloadpart} ${fdtaddr} ${fdtimage}\0" \

"mmcboot=setenv bootargs " CONFIG_BOOTARGS \

" root=${mmcroot} rw rootwait;" \

"bootz ${loadaddr} - ${fdtaddr}\0" \

"netboot=dhcp ${bootimage} ; " \

"tftp ${fdtaddr} ${fdtimage} ; run ramboot\0" \

"qspiload=sf probe ${qspiloadcs};" \

"sf read ${loadaddr} ${qspibootimageaddr} ${bootimagesize};" \

"sf read ${fdtaddr} ${qspifdtaddr} ${fdtimagesize};\0" \

"qspiboot=setenv bootargs " CONFIG_BOOTARGS \

" root=${qspiroot} rw rootfstype=${qspirootfstype};"\

"bootz ${loadaddr} - ${fdtaddr}\0" \

"nandload=nand read ${loadaddr} ${nandbootimageaddr} ${bootimagesize};"\

"nand read ${fdtaddr} ${nandfdtaddr} ${fdtimagesize}\0" \

"nandboot=setenv bootargs " CONFIG_BOOTARGS \

" root=${nandroot} rw rootfstype=${nandrootfstype};"\

"bootz ${loadaddr} - ${fdtaddr}\0" \

"fpga=0\0" \

"fpgadata=0x2000000\0" \

"fpgadatasize=0x700000\0" \

CONFIG_KSZ9021_CLK_SKEW_ENV "=" \

__stringify(CONFIG_KSZ9021_CLK_SKEW_VAL) "\0" \

CONFIG_KSZ9021_DATA_SKEW_ENV "=" \

__stringify(CONFIG_KSZ9021_DATA_SKEW_VAL) "\0" \

"scriptfile=u-boot.scr\0" \

"callscript=if fatload mmc 0:1 $fpgadata $scriptfile;" \

"then source $fpgadata; " \

 

the above snapshot of code was taken from the socfpga_common.h, and this line show the default script name:

"scriptfile=u-boot.scr

 

if you need to change any environment setup from the default one, you need to modify this file, then compile uboot.

 

in case you need to read from .conf file, you can remove the .scr file and the uboot will read the .conf file automatically.

 

Hope this might help.

 

thanks.

 

JMurr12
Novice
2,676 Views

Hi,

 

Thanks.

 

My version of socfpga_common.h was Copyright 2012 and CONFIG_EXTRA_ENV_SETTINGS was

 

#ifndef CONFIG_EXTRA_ENV_SETTINGS

#define CONFIG_EXTRA_ENV_SETTINGS \

    "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \

    "bootm_size=0xa000000\0" \

    "kernel_addr_r="__stringify(CONFIG_SYS_LOAD_ADDR)"\0" \

    "fdt_addr_r=0x02000000\0" \

    "scriptaddr=0x02100000\0" \

    "pxefile_addr_r=0x02200000\0" \

    "ramdisk_addr_r=0x02300000\0" \

    "socfpga_legacy_reset_compat=1\0" \

    BOOTENV

 

#endif

 

I obtained this following the instructions at https://rocketboards.org/foswiki/Documentation/BuildingBootloader

 

git clone https://github.com/altera-opensource/u-boot-socfpga

 

when I issue this command, I get a version of socfpga_common.h copyright 2013-2015 where CONFIG_EXTRA_ENV_SETTINGS matches yours pretty closely.

 

When I issue the following commands,

 

cd u-boot-socfpga

git checkout -t -b test origin/socfpga_v2019.04

 

I get the Copyright 2012 version and CONFIG_EXTRA_ENV_SETTINGS as above.

 

Are these the wrong instructions? Can you point me to something more accurate?

 

Thanks again.

Fawaz_Al-Jubori
Employee
2,676 Views

Hello sir,

you are doing it perfectly.

This is the file you are referring to:

https://github.com/altera-opensource/u-boot-socfpga/blob/0c9a3bdf3ca1326e3bc539676452f2d4f8895aeb/include/configs/socfpga_common.h

 

the copyright years wont be changed unless there is an update.

I will send you an email.

 

Thank you

0 Kudos
Reply