Skip to content

Commit

Permalink
add rockpis board
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen <[email protected]>
  • Loading branch information
StephenInVamrs committed May 31, 2019
1 parent bfb30d6 commit 00882a5
Show file tree
Hide file tree
Showing 9 changed files with 777 additions and 20 deletions.
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.dtb
*.dtbo
14 changes: 13 additions & 1 deletion arch/arm64/boot/dts/rockchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,19 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-tve1030g.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-tve1205g.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-videostrong-linux.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-vr-android.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rockpi-s-linux.dtb

targets += dtbs dtbs_instal
targets += $(dtb-y)
dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))

always := $(dtb-y)
subdir-y := $(dts-dirs)
subdir-y := $(dts-dirs) overlays-rockpis
clean-files := *.dtb

# Enable fixups to support overlays on ROCK Pi platforms
ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
DTC_FLAGS ?= -@ -H epapr
dts-dirs += overlays-rockpis
endif
10 changes: 10 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlays-rockpis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Overlays for the ROCK PI S platform

dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
console-on-ttyS2.dtbo

targets += dtbs dtbs_install
targets += $(dtbo-y)

always := $(dtbo-y)
clean-files := *.dtbo
141 changes: 141 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlays-rockpis/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
Introduction
=============

This directory contains Device Tree overlays. Device Tree makes it possible
to support many hardware configurations with a single kernel and without the
need to explicitly load or blacklisr kernel modules.

On Rock Pi S, you will find a .dtb for each base platform in /boot. This
describes the hardware that is part of the Rock Pi S board. The loader selects
the .dtb file appropriate for the platform by name and pass it to the kernel.

Device Tree Overlays usage is controlled from /boot/hw_intfc.conf. You can do
the settings for Rock Pi S in your hw_intfc.conf, which should cause your
Rock Pi S to do your wanted things after a reboot.

In /boot/overlays you will find many .dtbo files. The loader will merge the
selected .dtbo files by reading file /boot/hw_intfc.conf.


Using Overlays
===============

Overlays are loaded using "intfc:" directive. Take disable-console as an example.
Add one line in hw_intfc.conf:

intfc:dtoverlay=console-on-ttyS2

This causes the file /boot/overlays/disable-console.dtbo to be loaded.


The Overlay and Parameter Reference
=====================================

N.B. When editing this file, please preserve the indentation levels to make it
simple to parse programmatically. NO HARD TABS.

Name: i2c1
Info: Overlay for BUS I2C1
Load: intfc:i2c1=<value>
Value:
on Set to "on" to enable the i2c1 interface (default "off")
off Set to "off" to disable the i2c1 interface


Name: i2c2
Info: Overlay for BUS I2C2
Load: intfc:i2c2=<value>
Value:
on Set to "on" to enable the i2c2 interface (default "off")
off Set to "off" to disable the i2c2 interface


Name: i2c3
Info: Overlay for BUS I2C3
Load: intfc:i2c3=<value>
Value:
on Set to "on" to enable the i2c3 interface (default "off")
off Set to "off" to disable the i2c3 interface


Name: i2c4
Info: Overlay for BUS I2C4
Load: intfc:i2c4=<value>
Value:
on Set to "on" to enable the i2c4 interface (default "off")
off Set to "off" to disable the i2c4 interface


Name: pwm1
Info: Overlay for BUS PWM1
Load: intfc:pwm1=<value>
Value:
on Set to "on" to enable the pwm1 interface (default "off")
off Set to "off" to disable the pwm1 interface


Name: pwm2
Info: Overlay for BUS PWM2
Load: intfc:pwm2=<value>
Value:
on Set to "on" to enable the pwm2 interface (default "off")
off Set to "off" to disable the pwm2 interface


Name: pwm3
Info: Overlay for BUS PWM3
Load: intfc:pwm3=<value>
Value:
on Set to "on" to enable the pwm3 interface (default "off")
off Set to "off" to disable the pwm3 interface


Name: spi0
Info: Overlay for BUS SPI0
Load: intfc:spi0=<value>
Value:
on Set to "on" to enable the spi0 interface (default "off")
off Set to "off" to disable the spi0 interface


Name: spi2
Info: Overlay for BUS SPI2
Load: intfc:spi2=<value>
Value:
on Set to "on" to enable the spi2 interface (default "off")
off Set to "off" to disable the spi2 interface


Name: uart0
Info: Overlay for BUS UART0
Load: intfc:uart0=<value>
Value:
on Set to "on" to enable the uart0 interface (default "off")
off Set to "off" to disable the uart0 interface


Name: uart1
Info: Overlay for BUS UART1
Load: intfc:uart1=<value>
Value:
on Set to "on" to enable the uart1 interface (default "off")
off Set to "off" to disable the uart1 interface


Name: uart2
Info: Overlay for BUS UART2
Load: intfc:uart2=<value>
Value:
on Set to "on" to enable the uart2 interface (default "off")
off Set to "off" to disable the uart2 interface


N.B. It is recommended to only ebable those bus interfaces that are needed.
Leaving all interfaces enabled can lead to unwanted behaviour.


Name: console-on-ttyS2.dtbo
Info: By default, fiq debugger console is disabled.
When this dtbo file is loaded, Rock Pi S enables fiq debugger console.
ttyS2 Pins will output console information.
Load: intfc:dtoverlay=console-on-ttyS2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Definitions for setting uart4 pins as ttyFIQ0 console pins
/dts-v1/;
/plugin/;

/ {
model = "ROCK PI S";
compatible = "rockchip,rockpis-rk3308", "rockchip,rk3308";

fragment@0 {
target = <&fiq_debugger>;

__overlay__ {
status = "okay";
};
};
};
25 changes: 25 additions & 0 deletions arch/arm64/boot/dts/rockchip/overlays-rockpis/hw_intfc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Hardware Interface Config

# Set "on" to enable the optional hardware interfaces while set "off" to disable.

intfc:i2c1=off
intfc:i2c2=off
intfc:i2c3=off
intfc:i2c4=off

intfc:pwm1=off
intfc:pwm2=off
intfc:pwm3=off

intfc:spi0=off
intfc:spi2=off

intfc:uart0=off
intfc:uart1=off
intfc:uart2=off

# Devicetree Overlay Enable, uncomment to enable .dtbo under /boot/overlays/.

# Disable ttyFIQ0 console
intfc:dtoverlay=console-on-ttyS2
Loading

0 comments on commit 00882a5

Please sign in to comment.