Update U-boot and Linux Kernel for PetaLinux 13.10.

PetaLinux 13.10 coming with U-boot vesrion 2013.07 and Linux Kernel 3.8.1. If for some reason you need to change U-boot and/or Linux kernel with newer one - u can do it manually(configure, compile and include to BOOT.BIN image) or using PetaLinux tools to automate it. This post will be about later.
I will do it on virtual machine (VMWare Workstation 10) running Ubuntu 13.10 64 bit version with PetaLinux 13.10 already installed. I will also use fresh installation of prebuilt Avnet-Digilent BSP for ZedBoard, but this recipe works for my custom "hardware design" for ZedBoard too.

So, since I'm using 64 bit Ubuntu, I'm missing quite a few packages, especially 32bit versions. Below the list, but some package uninstalled my 64 version of GCC, so I re-install it as a last step.

Also, gmake package for Ubuntu not exist, but some Xilinx tools relay on it, so lets gmake symlink to make:

sudo ln -s /usr/bin/make /usr/bin/gmake

We also have to source PetaLinux settings, but because I'm always forget to do it - I will change my .bashrc so it will be done automatically, each time I log in. SO, in home directory, add next instructions to the end of the ~/.bashrc file.

Now, let's create 'Projects' forlder for our PetaLinux projects and install Avnet-Digilent BSP project into it. It will create 2 projects for us: Vivado 13.3 and ISE-14.7. I will use Vivado one and we can delete 14.7.

As you can see very first in a log is U-boot version and build timestamp: U-Boot 2013.07 (Nov 21 2013 - 18:27:09).
Loging as 'root'/'root' and check what version of kernel we got. It's 3.8.11 and it built on Thu Nov 21 18:30:11 EST 2013.

Now, let's verify that we can reconfigure and rebuild existing kernel, uboot and rootfs. Run petalinux-config for each one, but don't change any settings yet. Just go thru menus if you like and exit. If you got any errors - most likely your installation missing some packages.

Now, we need to generate BOOT.BIN which includes our hardware implementation bitstream, FSBL and U-boot. Bitstream and FSBL executable are the same, so we will point them to petalinux tool and it will use just built u-boot exec. By default tool will put BOOT.BIN in current directory, but we need it to be in images directory. I will also force to replace file if it exists.

Now we are ready to boot our rebuilt images using JTAG. So, reset ZedBoard (with JP13 shorted) or repower and run. Verify that we have same version of U-boot (2013.07) and Kernel 3.8.11, but build date is new.

INFO: The image provided is a zImage and no addition options were provided
INFO: Append dtb - /home/d9/Projects/Avnet-Digilent-ZedBoard-2013.3/pre-built/linux/images/system.dtb and other options to boot zImage
INFO: Configuring the FPGA...
INFO: FPGA configuration completed.
INFO: Downloading FSBL
INFO: FSBL download completed.
INFO: Launching XMD for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.

So, for what its worth, for Kernel we got Git tag version 2013.4 and Makefile saying its 3.12.0. And for U-boot Git tag is 2013.4 and Makefile 2013.10.
Now we can copy Linux Kernel and U-Boot sources into our PetaLinux projects, but first we have to create some directories

Configure PetaLinux project to include new kernel and u-boot sources. Run petalinux-config.

d9@ubuntu:~/Projects/Avnet-Digilent-ZedBoard-2013.3$ petalinux-config

In a main menu select 'kernel' submenu and then switch from kernel 'xlnx-3.8' kernel to our new 'linux-xlnx-git'.

In a main menu select 'u-boot' submenu and then switch to 'u-boot-xlnx-git'.

In a main menu select 'u-boot config' and then switch to 'other'.

In a main menu select 'u-boot config target (NEW)' and type 'zynq_zed'.

Save configuration and exit from menus. You can read more about options for Xilinx version of U-boot at , unfortunately not much more.

I went thru Xilinx Wiki pages and all PetaLinux documentation for 13.10 version and found very little information about u-boot customization options. I also went thru U-boot configuration scripts for PetaLinux and U-boot sources and found no specific different between Zynq_Zed and Zynq_Zc70x targets. Where is no 'MicroZed' target and I'm not sure if Zed or Zc70x will work for it.
If somebody knows more about Xilinx patches and/or configuration for U-boot - please share information. I'm in particular interesting if I will need to change U-boot configuration to support my custom board, what and how.

INFO: The image provided is a zImage and no addition options were provided
INFO: Append dtb - /home/d9/Projects/Avnet-Digilent-ZedBoard-2013.3/pre-built/linux/images/system.dtb and other options to boot zImage
INFO: Configuring the FPGA...
INFO: FPGA configuration completed.
INFO: Downloading FSBL
INFO: FSBL download completed.
INFO: Launching XMD for file download and boot.
INFO: This may take a few minutes, depending on the size of your image.

P.S. I tried to download and build vanilla Linux Kernel versions 3.12.11 and 3.13.3 from kernel.org - it builds and boots, but some hardware not working. So, we may need to apply some Xilinx Zynq related patches to vanilla kernel, but this is another topic.

2 comments on “Update U-boot and Linux Kernel for PetaLinux 13.10.”

Great and clean material, thank you!
I'm also working with a ZeadBoard and I've used this recipe in order to use a recent Xilinx Linux version.
My motivation is to used flash above 16MB.
Did you realize that after you bring up the new version, you no longer access to flash? Do you have an explanation for that?

Right now Xilinx replacing 'Zynq' kernel modules. Reason is - most of the Zynq IP is aindustry standard blocks. So, for example, in Kernel 3.13.0 for I2C and SPI we have to use 'Cadence' drivers and for MMC it's a 'Arasan'.