Zc702 Linux

Zc702 Linux

The purpose of this page is to describe how to use the ZC702 board with u-boot and Linux. The items on this page are intended to be specific details about the ZC702 rather than general u-boot / Linux information.

Board Support Package (BSP) Files

please refer to the Releases page for detailed information.

GPIOs and LEDs (>=14.1)

The DS23 LED on the ZC702 is working with Linux. The Linux kernel is setup so that the GPIO can be used through sysfs to control the LED.
Create a GPIO corresponding to MIO 10 and then configure GPIO 10 so that it is an output.
zynq> echo 10 > /sys/class/gpio/export
zynq> echo out > /sys/class/gpio/gpio10/direction
Turn on LED DS23.
zynq> echo 1 > /sys/class/gpio/gpio10/value
Turn off LED DS23.
zynq> echo 0 > /sys/class/gpio/gpio10/value

The following commands can be used to conifgure MIO 8 as GPIO, such that it can be used control the DS12 LED.
zynq> devmem 0xF8000008 32 0xDF0D
zynq> devmem 0xF8000720 32 0x1200

I2C Devices (>=14.2)

All of the following devices are connected to the I2C bus through a 1:8 mux/switch. I2C Bus 0 is the mux

I2C EEPROM

The I2C EEPROM can be read and written from sysfs such that is can be used programmatically or from a bash script. The device is on the 3rd virtual I2C bus off of the mux.

View the contents of the 1KB EEPROM.
zynq> hexdump /sys/bus/i2c/devices/3-0054/eeprom

A 1KB data file of random data can be generated and then written to the I2C EEPROM.
zynq> dd if=/dev/urandom of=/data.bin bs=1K count=1
zynq> cat /data.bin > /sys/bus/i2c/devices/3-0054/eeprom

The contents of the I2C EEPROM can be read back and compared to the data written in the previous command to verify it was successful.
zynq> cat /sys/bus/i2c/devices/3-0054/eeprom > /readback.bin
zynq> diff /readback.bin /data.bin

Real Time Clock (RTC)

A real time clock device is located on the I2C bus. The device is on the 5th virtual I2C bus off of the mux.

Read the date and time from the RTC.
zynq> cat /sys/bus/i2c/devices/5-0051/rtc/rtc0/date
zynq> cat /sys/bus/i2c/devices/5-0051/rtc/rtc0/time

Networking

The network is setup by default with a static IP address as described on Zynq Release.
The network supports 10/100/1000 rates.

QSPI Flash Memory

The QSPI flash memory on the board can be read and written thru the MTD file system of Linux.

The following command displays the partitions for the QSPI flash memory.
zynq> cat /proc/mtd

MTD devices are setup for each of the partitions with block (/dev/mtdblockX) and character devices (/dev/mtdX).

The prebuilt images for a release can be written from the SD card to the QSPI easily. The following command mounts the SD card into the /mnt directory so that files on it are accessible.
zynq> mount /dev/mmcblk0 /mnt

Note: Before proceeding, please note that the partitions used in the following sections could be different based on the release such that the correct partition (mtdX) should be specified.

Copy the images (FSBL/u-boot, Linux kernel, the device tree, and the ramdisk) from the SD card to the QSPI flash memory partitions. The flashcp command erases the flash, writes it, and verifies it. After the following command are completed, the board can be booted from QSPI flash memory after setting the boot mode jumpers.
zynq> flashcp -v BOOT.BIN /dev/mtd0
zynq> flashcp -v zImage /dev/mtd2
zynq> flashcp -v devicetree.dtb /dev/mtd3
zynq> flashcp -v ramdisk8M.image.gz /dev/mtd6

The following command will umount the SD card.
zyqn> umount /mnt

SD Card

The SD card is accessible thru the MMC subsystem of Linux.

The following command will format the SD card with a FAT file system and then mount it. Note that any files contained on the SD card will be lost. The SD card can not be mounted already as done in previous commands.
zynq> mkdosfs /dev/mmcblk0
zynq> mount /dev/mmcblk0 /mnt

The following commands copy each MTD partition from QSPI flash memory onto the SD card assuming that the QSPI flash memory was previously written with the files as done in the QSPI flash memory section above.
zynq> cp /dev/mtdblock0 /mnt/BOOT.BIN
zynq> cp /dev/mtdblock2 /mnt/zImage
zynq> cp /dev/mtdblock3 /mntdevicetree.dtb
zynq> cp /dev/mtdblock6 /mnt/ramdisk8M.image.gz
zynq> sync

The board can now be rebooted in SD boot mode and it should boot into Linux. Note that the files that were created are the size of the MTD partition from which they were read.

Unmount the SD card using the following command.
zynq> umount /mnt

USB Host

The default setup for the USB port is host mode based on the jumpers. A USB memory stick is the easiest way to exercise the functionality. A USB memory stick emulates a SCSI device in Linux using device nodes /dev/sdX where the 1st device is /dev/sda.

The following commands will format a USB memory stick which is plugged into the USB port with a FAT file system. Note that any files contained on the USB memory stick will be lost.
zynq> mkdosfs /dev/sda
zynq> mount /dev/sda /mnt

Files can be copied from the SD card to the USB memory stick using the following commands.
zynq> mkdir /sdmnt
zynq> mount /dev/mmcblk0 /sdmnt
zynq> cp /sdmnt/<file name>  /mnt/<file name>

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy