Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Device-tree-overlays

Revision as of 07:57, 31 December 2019 by Stephen (Talk | contribs)


Introduction of ROCK Pi Device Tree Overlays

This document describes ROCK Pi device tree overlays provided in kernel packages.

Platform and Chips

rockchip (Rockchip)

  • rk3399pro

usage

Kernel provided DT overlay files are in /boot/dtbs/$(uname -r)/rockchip/overlay/

/boot/uEnv.txt contents:

 overlays=rk3399pro-i2c2 rk3399pro-console-on-uart2 rk3399pro-pwm0 rk3399pro-w1-gpio rk3399pro-spi-spidev
 param_spidev_spi_bus=1
 param_spidev_max_freq=10000000
 param_w1_pin=GPIO2_A2

Add names of overlays you want to activate to overlays= line in /boot/uEnv.txt, separated with spaces.

Add required parameters with their values to /boot/uEnv.txt, one per line.

Add optional parameters with their values to /boot/uEnv.txt if you want to change the default value, one per line.

RK3399PRO Available Overlay

  • rk3399pro-i2c2, rk3399pro-i2c6, rk3399pro-i2c7
  • rk3399pro-spi-spidev
  • rk3399pro-pwm0, rk3399pro-pwm1
  • rk3399pro-uart2, rk3399pro-uart4
  • rk3399pro-console-on-uart2, rk3399pro-console-on-uart4
  • rk3399pro-w1-gpio
rk3399pro-i2c2

Activates I2C bus 2

I2C2 pins (SCL, SDA): GPIO2_A1, GPIO2_A0

Usage: add one line in /boot/uEnv.txt overlays=rk3399pro-i2c2

rk3399pro-i2c6

Activates I2C bus 6

I2C7 pins (SCL, SDA): GPIO2_B2, GPIO2_A1

rk3399pro-i2c7

Activates I2C bus 7

I2C7 pins (SCL, SDA): GPIO2_B0, GPIO2_A7

rk3399pro-spi-spidev

Activates SPIdev device node (/dev/spidevX.Y) for userspace SPI access, where X is the bus number and Y is the CS number

SPI 1 pins (MOSI, MISO, SCK, CS): GPIO1_B0, GPIO1_A7, GPIO1_B1, GPIO1_B2

Parameters:

  • param_spidev_spi_bus (int)
    • SPI bus to activate SPIdev support on
    • Required
    • Supported values: 0, 1
  • param_spidev_spi_cs (int)
    • SPI chip select number
    • Optional
    • Default: 0
    • Supported values: 0, 1
    • Using chip select 1 requires using "spi-add-cs1" overlay
  • param_spidev_max_freq (int)
    • Maximum SPIdev frequency
    • Optional
    • Default: 10000000
    • Range: 3000 - 100000000
rk3399pro-pwm0

Activates PWM0

rk3399pro-pwm1

Activates PWM1

rk3399pro-uart2

Activates serial port 2 (/dev/ttyS2)

UART2 pins (RXD, TXD): GPIO4_C3, GPIO4_C4

Notice: rk3399pro-uart2 and rk3399pro-console-on-uart2 cannnot be added together in /boot/uEnv.txt.

rk3399pro-uart4

Activates serial port 4 (/dev/ttyS4)

UART4 pins (RXD, TXD): GPIO1_A7, GPIO1_B0

Notice: UART4 cannot be activated together with SPI1 since they share the same pins. Also, rk3399pro-uart4 and rk3399pro-console-on-uart4 cannnot be added together in /boot/uEnv.txt.

rk3399pro-console-on-uart2

Activates debug console on UART2

console pins (RXD, TXD): GPIO4_C3, GPIO4_C4

Notice: rk3399pro-console-on-uart2 and rk3399pro-uart2 cannnot be added together in /boot/uEnv.txt.

rk3399pro-console-on-uart4

Activates debug console on UART4

console pins (RXD, TXD): GPIO1_A7, GPIO1_B0

Notice: rk3399pro-console-on-uart4 and rk3399pro-uart4 cannnot be added together in /boot/uEnv.txt.

rk3399pro-w1-gpio

Activates 1-Wire GPIO master

Requires an external pull-up resistor on the data pin

Parameters:

  • param_w1_pin (pin)
    • Data pin for 1-Wire master
    • Optional
    • Default: GPIO2_A2
rk3399pro-raspberrypi-7-inch-lcd

Activates Raspberry Pi 7-inch LCD

Notice: In term of hardware, use a 15-pin FPC cable to connect RPI LCD to ROCK Pi N10.

For power supply, both 5V pin and GND pin on 5-pin connector on RPI LCD are connected to the 40-pin connector on ROCK Pi N10.