[meta-xilinx] mainline u-boot on zedboard
Nathan Rossi
nathan at nathanrossi.com
Mon Jan 11 00:08:39 PST 2016
On Sat, Jan 9, 2016 at 9:05 PM, <gmane at reliableembeddedsystems.com> wrote:
> Hi,
>
>>>
>>> If you use u-boot master you'll end up with a spl/boot.bin.
>>
>>
>> I've been working on U-Boot master, and getting some of the SPL stuff
>> working well (including boot.bin generation :)). If you want to use a
>> mainline U-Boot go for master till 2016.01 is released. Also note,
>> make sure to use 'u-boot-dtb.img' when using mainline U-Boot.
>>
>> On a related note I am trying to get feature parity so that
>> meta-xilinx can use mainline U-Boot for Zynq (and later MicroBlaze).
>> So I am definitely interested in knowing about issues or general
>> comments as to whether it meets peoples requirements.
>
>
> I just build the latest an greatest u-boot from master and copied those
> files to the SD card:
>
> scp spl/boot.bin root at 192.168.42.12:/run/media/mmcblk0p1
>
> scp u-boot-dtb.img root at 192.168.42.12:/run/media/mmcblk0p1
>
> ... but ...
>
> U-Boot SPL 2016.01-mainline-student-vmaster-00002-g3861d78 (Jan 09 2016 -
> 12:05:10)
> mmc boot
> Trying to boot from MMC
> reading system.dtb
> spl_load_image_fat_os: error reading image system.dtb, err - -1
> reading u-boot-dtb.img
> reading u-boot-dtb.img
>
>
> U-Boot 2016.01-mainline-student-vmaster-00002-g3861d78 (Jan 09 2016 -
> 12:05:10 +0200)
>
> Model: Zynq Zed Development Board
> Board: Xilinx Zynq
> DRAM: ECC disabled 512 MiB
> MMC: sdhci at e0100000: 0
> Using default environment
>
> In: serial at e0001000
> Out: serial at e0001000
> Err: serial at e0001000
> Model: Zynq Zed Development Board
> Board: Xilinx Zynq
> Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id
>
> Warning: ethernet at e000b000 (eth0) using random MAC address -
> 0a:42:f7:b9:44:8c
> eth0: ethernet at e000b000
> Hit any key to stop autoboot: 0
> Copying FIT from SD to RAM...
> reading fit.itb
> ** Unable to read file fit.itb **
> =>
>
> Looks like it does not read my uEnv.txt[1] anymore
>
> If I enter what I have in uEnv.txt manually it works. Is it intentionally
> that you don't check for uEnv.txt anymore?
>
> Also saveenv does not work, so I guess I would like to have something like
> uEnv.txt.
uEnv.txt is something that is only in u-boot-xlnx. I do not believe it
will make an appearance as the default environment in mainline, this
is because the FIT format is much more complete and relies less on
magic environment configuration. In the future I was intending on
having meta-xilinx generate fit images (using wic) which would include
the main image components in a single binary and u-boot would just
load the default configuration.
As for saveenv and general environment stored in flash support. The
QSPI driver was only added to mainline u-boot within the past few
months as such the surrounding setup still has to be completed.
You will need to modify zynq-common.h to enable it.
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 0ab6083..a844062 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -199,6 +199,8 @@
#ifndef CONFIG_ENV_IS_NOWHERE
# ifndef CONFIG_SYS_NO_FLASH
# define CONFIG_ENV_IS_IN_FLASH
+# elif defined(CONFIG_ZYNQ_QSPI)
+# define CONFIG_ENV_IS_IN_SPI_FLASH
# elif defined(CONFIG_SYS_NO_FLASH)
# define CONFIG_ENV_IS_NOWHERE
# endif
This will use the QSPI flash if available for storing the environment.
After this saveenv/etc. will work. I quickly tested on a Zybo (I don't
have a Zedboard) and it works quite well albeit slowing the boot a bit
(~1 second or so).
U-Boot 2016.01-rc3 (Jan 11 2016 - 17:45:34 +1000)
Model: Zynq ZYBO Development Board
Board: Xilinx Zynq
DRAM: ECC disabled 512 MiB
MMC: sdhci at e0100000: 0
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64
KiB, total 16 MiB
Regards,
Nathan
>
> => setenv hostname zedboard
> => setenv kernel_addr_r 0x3000000
> => setenv expand_bootfile 'setenv bootfile ${hostname}/uImage'
> => setenv fdt_addr_r 0x2a00000
> => setenv expand_fdtfile 'setenv fdtfile ${hostname}/zedboard-zynq7.dtb'
> => setenv bitstream_addr_r 0x100000
> => setenv expand_bitstream 'setenv bitstream ${hostname}/fpga.bin'
> => setenv ipaddr 192.168.42.12
> => setenv serverip 192.168.42.1
> => setenv gatewayip 192.168.42.1
> => setenv netmask 255.255.255.0
> => setenv kernel_netload 'tftpboot ${kernel_addr_r} ${bootfile}'
> => setenv fdt_netload 'tftpboot ${fdt_addr_r} ${fdtfile}'
> => setenv bitstream_netload_fpgaload 'if tftpboot ${bitstream_addr_r}
> ${bitstream}; then fpga load 0 ${bitstream_addr_r} ${filesize}; else echo no
> ${bitstream}; fi'
> => setenv netload 'run bitstream_netload_fpgaload kernel_netload
> fdt_netload'
> => setenv bootargs console=ttyPS0,115200n8
> => setenv nfsroot /opt/poky/zedboard-rootfs
> => setenv ips_to_bootargs 'setenv bootargs ${bootargs}
> ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off'
> => setenv nfs_to_bootargs 'setenv bootargs ${bootargs}
> nfsroot=${serverip}:${nfsroot},v3,tcp'
> => setenv default_to_bootargs 'setenv bootargs ${bootargs} noinitrd nohlt
> panic=1'
> => setenv compose_nfs_bootargs 'run ips_to_bootargs; run nfs_to_bootargs;
> run default_to_bootargs'
> => setenv nfsboot 'echo Booting from nfs...; run compose_nfs_bootargs'
> => setenv compose_nfsboot 'run nfsboot'
> => setenv compose_default 'run expand_bitstream; echo bitstream:
> ${bitstream}; run expand_bootfile; echo bootfile: ${bootfile}; run
> expand_fdtfile; echo fdtfile: ${fdtfile}; ping ${serverip}'
> => setenv uenvcmd 'run compose_default; run netload; run compose_nfsboot;
> printe bootargs; bootm ${kernel_addr_r} - ${fdt_addr_r}'
> => run uenvcmd
> bitstream: zedboard/fpga.bin
> bootfile: zedboard/uImage
> fdtfile: zedboard/zedboard-zynq7.dtb
> Using ethernet at e000b000 device
> host 192.168.42.1 is alive
> Using ethernet at e000b000 device
> TFTP from server 192.168.42.1; our IP address is 192.168.42.12
> Filename 'zedboard/fpga.bin'.
> Load address: 0x100000
> ....
>
>>
>> Regards,
>> Nathan
>
>
> [1]
> https://github.com/RobertBerger/meta-mainline/blob/jethro-training-v4.4.x/meta-xilinx-zedboard-ml/recipes-bsp/u-boot/u-boot/tftp-nfs-uEnv-zedboard.txt
>
>>
>>>
>>> Cheers,
>>>
>>> Moritz
>>> --
>>> _______________________________________________
>>> meta-xilinx mailing list
>>> meta-xilinx at yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/meta-xilinx
>
>
> Regards,
>
> Robert
More information about the meta-xilinx
mailing list