Board: Altera Cyclone V SoC Board
Tools Version: 15.0
State: running
Members: JohnTio


This projects provides an example on how to control FPGA power supply regulator running on Cyclone V SoC FPGA. The FPGA regulator is interface through I2C connection from FPGA HPS.

The project was developed with CV GSRD

System Components

All the software and hardware components of the A10 GSRD (which is a typical system) are presented in the picture below:


Note that in case of the GSRD all the files are stored on the SD card. However, the project could be updated to handle the case where the files are stored on QSPI and/or NAND Flash.



Release Contents

The GSRD sources and prebuilt binaries can be downloaded from

Cyclone V Binary Archieve - linux-socfpga-gsrd-15.0.1-cv-bin.tar.gz

The following documents are also part of the release:
DocumentSort DescriptionSort
GSRD v15.0 Release notes Release Notes
GSRD v15.0 - User Manual User Manual

The Cyclone V precompiled binaries archives (linux-socfpga-gsrd-15.0.1-cv-bin.tar.gz) contain the following files:
Cyclone V File NameSort DescriptionSort
console-image-cyclone5.tar.gz Generic Angstrom Root filesystem as compressed tarball
gsrd-console-image-cyclone5.tar.gz GSRD Root filesystem as compressed tarball
preloader-mkpimage.bin Preloader image
sdimage.img.gz Compressed bootable SD card image
socfpga.dtb Device Tree Blob
soc_system.rbf Compressed FPGA configuration file
u-boot.scr U-boot script for configuring the FPGA
u-boot-cyclone5.img U-boot image
vmlinux Linux kernel ELF image
zImage Compressed Linux kernel image

SD Card Image Modification

Cyclone V precompiled binary will only stored teh soc_system.rbf in FAT32 partition. soc_system.rbf will need to be copy to the LINUX partition in order to performed FPGA configuration in Linux system.

Below is the method to copy soc_system.rbf to Linux partition.
sudo cp <FAT32 Partition>/soc_system.rbf <Linux Partition>/home/root/altera

Linux Command

Command Description
/home/root/altera/scroll_client -1 Stop LED Scrolling
/home/root/altera/scroll_client <delay> Start LED Scrolling based on the delay set
echo leds.1 > /sys/class/leds/fpga_led0/device/driver/unbind Unbind FPGA LED
echo leds.1 > /sys/bus/platform/drivers/leds-gpio/bind Bind FPGA LED
rmmod gpio_altera Remove GPIO_Altera Module
modprobe gpio_altera Add GPIO_Altera Module
dd if=<fpga rbf file> of=/dev/fpga0 bs=1M Configure FPGA with new rbf file
i2cset -y 0 0x5E 0x01 0x00 Power down FPGA power supply
i2cset -y 0 0x5E 0x01 0x80 Power up FPGA power supply

Running the Project

1. Connect the A10 board to the USB UART.

2. Write the SD card image to an SD Card as shown in the BootingLinuxUsingPrebuildImage

3. Boot up the development kit and initiate the Putty for UART communication

4. After Linux booted up, you can send the Linux command to stop the LED scrolling

FPGA LED Kernel Disabling

./home/root/altera/scroll_client -1
echo leds.1 > /sys/class/leds/fpga_led0/device/driver/unbind
rmmod gpio_altera

FPGA LED Kernel Enabling

modprobe gpio_altera
echo leds.1 > /sys/bus/platform/drivers/leds-gpio/bind
/home/root/altera/scroll_client <delay> 

FPGA Configuration

Please remember that you need to disable the FPGA LED Kernel before reconfiguring the FPGA.
dd if=/home/root/altera/soc_system.rbf of=/dev/fpga0 bs=1M

FPGA Regulator power down

Please remember that you need to disable the FPGA LED Kernel before reconfiguring the FPGA.
i2cset -y 0 0x5E 0x01 0x00

FPGA Regulator power up

i2cset -y 0 0x5E 0x01 0x80


Altera Cyclone V SOC 15.0 GSRD
GSRD SD Card Partition

Give us your feedback

© 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Privacy.