/FPD-LinkIII_ds90ub95x

FDP Link III driver for ds90ub954/ds90ub953

Primary LanguageC

FPD-LinkIII_ds90ub95x

This repository contains an FDP Link III driver for ds90ub954 (deserializer) and ds90ub953 (serializer) from Texas Instruments. The driver was tested on a Jetson Nano (Jetpack 4.4) and on a RaspberryPi 4.


logo

The group High Performance Multimedia from the Institute of Embedded Systems associated with ZHAW School of Engineering proudly presents an open source driver for TI devices DS90UB954 paired with DS90UB953.

Additionally we made a TI FPD-Link III hardware compatible with the Raspberry Pi camera and the Raspberry Pi FFC (FPC, ZIF) camera connector: https://github.com/InES-HPMM/FPD-LinkIII_Raspberry_HW

For recent news check out our Blog.

Table of contents

Setup RaspberryPi 4 for FDP-LinkIII_Raspberry_HW: Instructions to get the FDP-LinkIII Raspberry Hardware running on a RaspberryPi 4 by using our precompiled module.

Insert Driver into your Linux Sources: Instructions on how to get the driver into your custom linux sources.


Setup RaspberryPi 4 for FDP-LinkIII_Raspberry_HW

This section gives instructions to setup a RaspberryPi 4 to use the hardware developed in: https://github.com/InES-HPMM/FPD-LinkIII_Raspberry_HW.

The raspian operating system comes with programs such as raspistill, raspivid and so forth which enables the user to record pictures/videos with the RaspberryPi Camera v2.1 (imx219). But when adding the FPD-Link III driver to the device tree, these programs will no longer work. An alternative way to get images from the camera is by using libcamera (https://libcamera.org/). Libcamera is developed for the linux kernel 5. For this reason, these instructions will use the kernel version 5.4.51.

Setup SD card

Setup an SD card for the RaspberryPi. The easiest way is to install the Imager software from the official RaspberryPi sources: https://www.raspberrypi.org/downloads/. Run Imager and choose the Operating System Raspberry Pi OS (32-bit), choose your SD card and then press Write.

Boot your RaspberryPi with the prepared SD card.

Update to Kernel 5.4

Connect the RaspberryPi to the internet (ethernet or wifi). Open a terminal an execute the following commands:

sudo apt update
sudo apt full-upgrade

After a reboot, execute:

sudo rpi-update 8382ece2b30be0beb87cac7f3b36824f194d01e9
sudo reboot

(Do not skip this reboot!)

Add Driver Sources to RaspberryPi

Download ds90ub954.dtbo and ds90ub954.ko from this release Release 5.4.51-v7l onto the RaspberryPi. In the terminal go to the folder with the downloaded files and copy them to the correct destinations:

//sudo chmod 777 ds90ub954.dtbo
sudo cp ds90ub954.dtbo /boot/overlays/.
sudo cp ds90ub954.ko /lib/modules/`uname -r`/kernel/drivers/media/i2c/.

Get ds90ub954.ko to start at boot by opening /etc/modules:

sudo nano /etc/modules

Insert the following line at the bottom of the file:

ds90ub954

Reload module dependencies by running:

sudo depmod

Update /boot/config.txt:

sudo nano /boot/config.txt

Add the following lines at the end of the file:

dtoverlay=ds90ub954
dtoverlay=imx219
core_freq_min=250

Reboot the RaspberryPi:

sudo reboot

If the module was successfully loaded, you should find a video0 device in the /dev folder:

ls /dev/video0

If the command returns No such file or directory then the loading of the imx219 module failed. This can happen when the imx219 sensor model is loaded before the ds90ub954 module has finished setting up the i2c channel.

This problem can be solved by reloading the imx219 module:

sudo modprobe -r imx219
sudo modprobe imx219

Now /dev/video0 should exist.

Install libcamera

The follwing steps were taken from https://www.raspberrypi.org/documentation/linux/software/libcamera/README.md.

Install software dependencies:

sudo apt install libboost-dev libgnutls28-dev openssl libtiff5-dev meson qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
sudo pip3 install pyyaml

Get libcamera sources:

git clone git://linuxtv.org/libcamera.git
cd libcamera

Build libcamera:

meson build
cd build
meson configure -Dpipelines=raspberrypi -Dtest=false
cd ..
sudo ninja -C build install

Run libcamera's qcam:

./build/src/qcam/qcam

Insert Driver into your Linux Sources

The driver can be used in different linux kernels and for different hardware setups. We have tested the driver on the RaspberryPi 4 and on a Nvidia Jetson Nano. In order to adapt the driver to different hardware setups, the driver provides device tree parameters to set the number of csi lanes, lane speed, gpio control and more. A detailed description can be found in the file ti,ds90ub954.txt.

Insert Driver into Kernel Sources with Git Subtree

An option of adding the driver to the kernel is by using git subtree.

Go into the kernel source folder (drivers should be a subfolder) and then add the driver sources with git subtree:

git subtree add --prefix drivers/media/i2c/ds90ub95x https://github.com/InES-HPMM/FPD-LinkIII_ds90ub95x master --squash

This will make a new folder ds90ub95x in drivers/media/i2c which includes all the driver files.

Add the Driver to Makefile and Kconfig

Open the file drivers/media/i2c/Makefile:

nano drivers/media/i2c/Makefile

Add the following line to the beginning of the file:

obj-$(CONFIG_VIDEO_DS90UB954)	+= ds90ub95x/

Open drivers/media/i2c/Kconfig:

nano drivers/media/i2c/Kconfig

Add the following line to the beginning of the file:

source "drivers/media/i2c/ds90ub95x/Kconfig"

After this step, the driver module can be enabled in the menuconfig.