Skip to content

Guide Software Design

Phil Zhao edited this page Oct 27, 2015 · 4 revisions

###Build FSBL
An FSBL can be generated within the template in SDK, based on the exported hardware description from Vivado system design.
We have done some patches to the template (for ONS30), and added functions to program the clock generator during the boot stage (for ONS30 and ONS45). So it is recommended to make use of the pre-built FSBLs directly instead of regenerating, unless the following PS clock settings doesn't meet your design. Below is a typical settings for PS Clocks configured during FSBL stage.
Find the pre-built FSBL images for different boards here.
Find the details of FSBL changes comparing to the official version here.

PS Clock Frequency
FCLK0 125MHz
FCLK1 75MHz
FCLK2 200MHz
FCLK3 unused

###Build SSBL (u-boot)
This step must be done in a Linux environment.
Download our official u-boot repo, and refer to the Xilinx Wiki Build U-Boot for u-boot image generation.
To build u-boot for ONetSwitch execute

git clone https://github.com/MeshSr/u-boot-meshsr
cd u-boot-meshsr

make zynq_ons20_config # OR
make zynq_ons30_config # OR
make zynq_ons45_config

make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-

Notice that the generated file 'u-boot' should be renamed with .elf extension. And pay attention to the usage of mkimage.

cp -rp ./tools/mkimage <somewhere-in-$PATH>
mv u-boot u-boot-<any suffix>.elf

The official u-boot for ONetSwitch is derived from Xilinx u-boot.
Find the details of u-boot changes comparing to the official version here.

Find the pre-built u-boot images for different boards and types of rootfs here.
Notice that we prefer u-boot-ons*-ext.elf in our reference designs.

###Build and Modify Rootfs
Please refer to Xilinx Wiki Build and Modify a Rootfs.
You can download a pre-built one directly from our repo.

For uramdisk.image.gz, you have to put it directly in the FAT partition and use it together with u-boot-ons*-ram.elf.
For rootfs_ext4.tar.gz, you need to extract and copy to the EXT partition with sudoer privilege, use with u-boot-ons*-ext.elf.

###Build Device Tree Blob
The Xilinx Wiki Build Device Tree Blob provides two ways to create an original .dts.
Changes has been done on the original tcl-generated .dts when the ONetSwitch and certain applications require more device/driver supporting. The recommended way is to take ours as the baseline, use or make changes on our modified .dts, and finally generate the .dtb using the Linux device tree complier.

<path-to-kernel-src>/script/dtc/dtc -I dts -O dtb -o devicetree.dtb devicetree.dts

The modification on the devicetree is closely related to the board hardware and the driver support. Please refer to the .dts in each ready-to-download folder for more details.

###Build Linux Kernel
This step must be done in a Linux environment.
Download our official Linux repo, and refer to the Xilinx Wiki Build Kernel for kernel image generation.
To build kernel for ONetSwitch execute

git clone https://github.com/MeshSr/linux-meshsr
cd linux-meshsr

cp -p arch/arm/configs/meshsr_ons_defconfig .config
make uImage UIMAGE_LOADADDR=0x8000 ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-

The official Linux kernel for ONetSwitch is derived from Xilinx Linux.
Find the details of kernel changes comparing to the official version here.

Find the pre-built kernel image here.

Clone this wiki locally