Skip to content

Notes and helpers for Sinara Humpback microcontroller carrier board

Notifications You must be signed in to change notification settings

airwoodix/sinara-humpback-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Sinara Humpback

Documentation

OrangePi Zero

Armbian

Custom kernel

Stock Armbian kernel is not compiled with CONFIG_SPI_GPIO enabled, so the spi-gpio module is not available.

The Armbian build system is fairly easy to use, e.g. with Vagrant. There may be issues with the dependency solver when installing vagrant-disksize. If so, setting the environment variable VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 can help.

Enable GPIO-bitbang in SPI drivers and build with:

./compile.sh BRANCH=current BOARD=orangepizero KERNEL_ONLY=yes RELEASE=buster

Install the new kernel through the deb packages in output/. linux-image-* and linux-headers-* should be sufficient.

Device-tree overlay

Install the device-tree overlay humpback-spi-cfg.dts:

armbian-add-overlay humpback-spi-cfg.dts

This configures a SPI master for the FPGA’s external flash memory and a corresponding spidev userspace driver.

Flash detection

Use Flashrom. AT25SF081 is only supported since v1.1-rc1. The package in buster is 1.0. Since there’re no dependencies, the easiest is to download the package from the bullseye archive directly (arch: armhf).

Test if the flash is detected:

flashrom -p linux_spi:dev=/dev/spidev0.0

should print something like:

Found Atmel flash chip "AT25SF081" (1024 kB, SPI) on linux_spi.

FPGA flashing

Install dependencies:

apt install gpiod

Use flash.sh.

FPGA Manager

as alternative to writing the flash directly? Can load bitstream at boot.

ArchLinux ARM (old)

  • ArchLinux ARM image, upgrade to kernel 5.1.0-rc5-1 works

Patched devicetree

Working on linux-5.1-rc5 tree. The toplevel devicetree is arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts. Compilation:

zcat /proc/config.gz > .config
make sun8i-h2-plus-orangepi-zero.dtb

Configure FPGA

The configuration flash on the board is a AT25SF081-SHD-T (datasheet). The configuration flow is described in the corresponding application note. In SPI master configuration mode, this basically looks like:

  • hold SS (chipselect) high
  • pull CRESET low
  • write bitstream to flash
  • pull CRESET high to load the bitstream into FPGA
  • check CDONE

One can write the bitstream to the flash memory using the flashrom utility (need v1.1-rc1+). flashrom’s linux_spi driver requires access to the SPI bus via spidev. One can add a bit-banged SPI driver to the devicetree (linux tree patch). The flash.sh script runs the configuration flow (requires libgpiod).

Note: there is support for iCE40 in SPI slave configuration mode for the kernel’s fpga_manager (source, devicetree bindings documentation).

About

Notes and helpers for Sinara Humpback microcontroller carrier board

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages