I'm having issues building a Linux kernel for the MicroZed. I think my issues are related to the kernel because I can use the kernel and DTB from QSPI with a NFS root filesystem (Ubuntu core arm hf) and it seems stable. But with my own kernel and the DTB from QSPI it's very unstable.
My development machine is ubuntu 12.04.3 x86_64
To get the kernel I do the following:
git clone git://github.com/Xilinx/linux-xlnx.git
One of the AvNet tutorials suggest that I do the following, but Xilinx doesn't have it in their build instructions. I've tried it both ways, currently not in my latest kernel though:
git checkout -b xilinx-14.2-build1-trd
Here is my kernel build script:
# Clean environment
make distclean
# Setup environment variables for the kernel build
export INSTALL_MOD_PATH=../rootfs
export ARCH=arm
# Ubuntu provided ARM hard float toolchain
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
# Xilinx Vivado Toolchain
# export CROSS_COMPILE=~/Xilinx/SDK/2013.2/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-
# Updates the .config file
make xilinx_zynq_defconfig
# We would make menuconfig here if we needed to customize build options, but I'm not customizing yet
### **** Steps to make kernel and convert to u-boot format manually ****
### This step will compile both the kernel and modules
### make -j8
##
### Convert the Image to a uImage (U-Boot format image)
### cd arch/arm/boot
### mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n ZynqKernel -d Image uImage
### cd ../../..
### **** End steps to make kernel and convert to u-boot format manually ****
# Make the kernel and automatically convert it into a u-boot image
# mkimage will need to be in the path for this to work
make -j8 UIMAGE_LOADADDR=0x8000 uImage
make -j8 modules
# Install modules
make modules_install
sudo cp -R ../rootfs/lib/modules/* /media/media2/nfs_export/zynqroot/lib/modules/
# Copy kernel to tftp server storage folder
sudo cp arch/arm/boot/uImage /srv/tftp/uImage-hf
U-boot configuration:
baudrate=115200
bootargs=console=ttyPS0,115200 root=/dev/nfs nfsroot=192.168.1.26:/media/media2/nfs_export/zynqroot, tcp ip=192.168.1.20:192.168.1.26:192.168.1.1:255.255.255.0::eth0:off rw
devicetree_size=0x20000
ethact=Gem.e000b000
ethaddr=##:##:##:##:##:##
kernel_image=uImage-hf
kernel_size=0x500000
loadbit_addr=0x100000
modeboot=qspiboot
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${loadbit_addr} 0xC00000 ${bitstream_size} && mw 0xF8007080 0x30800100 0x4 && fpga load 0 ${loadbit_addr} ${bitstream_size} && sf read 0x3000000 0x100000 ${kernel_size} && sf read 0x2A00000 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read 0x2000000 0x620000 ${ramdisk_size} && bootm 0x3000000 0x2000000 0x2A00000
ramdisk_image=uramdisk.image.gz
ramdisk_size=0x5E0000
serverip=192.168.1.26
stderr=serial
stdin=serial
stdout=serial
testboot=sf probe 0 0 0; sf read 0x2A00000 0x600000 0x20000; tftpboot 0x3000000 ${serverip}:${kernel_image}
To boot it, I do the following in u-boot
run testboot
bootm 0x3000000 - 0x2A00000
It boots up, I can SSH into the system, maybe run a few commands, but the console will become unresponsive within a minute or two.
If I use the AvNet provided kernel, it runs fine (following u-boot commands):
zynq-uboot> sf probe 0 0 0
SF: Detected S25FL129P_64K with page size 64 KiB, total 16 MiB
zynq-uboot> sf read 0x3000000 0x100000 ${kernel_size}
zynq-uboot> sf read 0x2A00000 0x600000 ${devicetree_size}
zynq-uboot> bootm 0x3000000 - 0x2a00000
I can run openssl speed aes-256-cbc, ping, apt-get, etc. runs great.
This is one of my first embedded linux projects, so I've tried to verbose as to what I'm doing. I've really been struggling to figure this out... Can anyone point to something I'm doing wrong here?