Skip to main content

4. Overlay

4.1 brief introduction

The device tree Overlays make it possible to support multiple hardware configurations with a single kernel without explicitly loading or masking kernel modules.

4.2 Supporting overlay images

The currently supported overlay images are: Ubuntu 22.04, Armbian,ArmSoM-SDK.

4.3 How to enable an overlay

4.3.1 Ubuntu 22.04 Image Enable Overlay

  • The overlay file of Ubuntu 22.04 image is stored in the path on the board:/boot/firmware/dtbs/rockchip/overlay/*. dtbo
  • Find the keyword overlays= in the/boot/firmware/ubuntEnv. txt file. The following is an example of using two overlay layers for ArmSoM Sige7.
overlays=armsom-sige7-camera-imx415-4k armsom-sige7-display-10hd

After editing, restart the device to change the overlay settings.

4.3.2 Enable overlay for Armbian images

  • The overlay file of the Armbian image is stored in the path on the board:/boot/dtb/dockchip/overlay/*. dtbo
  • Find or add the keyword 'overlays=' in the/boot/armbianEnv. txt file. The following is an example of using two overlay layers for ArmSoM Sige7.
overlays=armsom-sige7-camera-imx415-4k armsom-sige7-display-10hd

After editing, restart the device to change the overlay settings.

  • Armbian images can have overlay files added to them: Taking the addition of Sige5 UART10 functionality as an example:
linux-rockchip/arch/arm64/boot/dts/rockchip/overlay$ git remote -v
origin git@github.com:xxx/linux-rockchip.git (fetch)
origin git@github.com:xxx/linux-rockchip.git (push)
upstream git@github.com:armbian/linux-rockchip.git (fetch)
upstream git@github.com:armbian/linux-rockchip.git (push)

Download the linux-rockchip to your local system, refer to other dts files related to serial ports in the arch/arm64/boot/dts/rockchip/overlay directory, and modify the KERNELSOURCE in config/sources/families/rk35xx.conf to point to the local code

4.3.3 Enable overlay for ArmSoM-SDK image

  • The overlay files for the ArmSoM-SDK image are stored in the following path on the board: /boot/dtb/overlay/*.dtbo
  • Open the /boot/uEnv/uEnv.txt file and remove the # symbol before the dtoverlay for the reuse function Below is an example of ArmSoM-Sige7 uEnv.txt:
armsom@armsom:/boot$ sudo vi /boot/uEnv/uEnvarmsom-sige7.txt
cmdline="earlyprintk console=ttyFIQ0 console=tty1 consoleblank=0 loglevel=7 roott
wait rw rootfstype=ext4"

enable_uboot_overlays=1
#overlay_start

#40pin
#dtoverlay=/dtb/overlay/rk3588-armsom-can1-m0.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-can1-m1.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-i2c0-m1.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-i2c1-m0.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-i2c3-m1.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-i2c7-m3.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-i2c8-m4.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm2-m1.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm3-m1.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm5-m2.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm6-m2.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm7-m3.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm8-m0.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm12-m0.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm13-m0.dtbo
#dtoverlay=/dtb/overlay/rk3588-armsom-pwm13-m2.dtbo

After editing, restart the device to change the overlays settings.

4.4 40-PIN functional test

Some of the pins on the 40PIN can be reused for multiple functions, which can be configured as needed. For specific pin functions, please refer to the 40 pin header on the board.

Taking the 11 and 15 pins in the 40PIN on Sige7 to open the serial port function as an example:

  • View the serial ports opened by the system
root@armsom-sige7 :/boot# ls /dev/ttyS*
/dev/ttyS6
  • Open overlay

The serial ports corresponding to pins 11 and 15 on the 40PIN are UART 7_m1, and the corresponding overlay file is/boot/dtb/rockchip/overlay/rk3588-uart7-m1.dtbo.

Edit/boot/armbianEnv. txt file:

root@armsom-sige7 :/boot# cat armbianEnv.txt
verbosity=1
bootlogo=false
console=both
overlay_prefix=rockchip-rk3588
overlays=rk3588-uart7-m1
fdtfile=rockchip/rk3588-bananapi-m7.dtb
rootdev=UUID=a61c17cd-2e49-4302-879c-6cb86ebf07d1
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

Only the line overlays= has been added here.

Configuration takes effect after restart:

root@armsom-sige7 :/boot# ls /dev/ttyS*
/dev/ttyS6 /dev/ttyS7
tip

The functions in the 40PIN are turned off by default and need to be manually turned on to use

Add configuration in/boot/armbianEnv. txt and restart the Linux system to take effect

If only one function needs to be opened, just fill in one. If there are multiple functions, separate them with spaces after overlays= overlays=uart2-m0 uart3-m1 uart4-m2 uart7-m1

Similar to UART 7-m1 and UART 7-m2, they cannot be used simultaneously