build/patch/kernel/archive/rockchip64-4.4/check/0038-arm64-overlays-add-console-choices-for-rockpi.patch

118 lines
3.9 KiB
Diff

From 155a65a72b20b477663218ce47fd9130579ab375 Mon Sep 17 00:00:00 2001
From: stephen <stephen@vamrs.com>
Date: Thu, 28 Feb 2019 17:08:38 +0800
Subject: [PATCH 38/97] arm64: overlays: add console choices for rockpi
Signed-off-by: stephen <stephen@vamrs.com>
---
.../arm64/boot/dts/rockchip/overlays/Makefile | 2 ++
arch/arm64/boot/dts/rockchip/overlays/README | 18 +++++++++++
.../overlays/console-disabled-overlay.dts | 16 ++++++++++
.../overlays/console-on-uart4-overlay.dts | 32 +++++++++++++++++++
4 files changed, 68 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/overlays/console-disabled-overlay.dts
create mode 100644 arch/arm64/boot/dts/rockchip/overlays/console-on-uart4-overlay.dts
diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile
index 106f4412612d..0e06b7e1748f 100644
--- a/arch/arm64/boot/dts/rockchip/overlays/Makefile
+++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile
@@ -1,6 +1,8 @@
# Overlays for the ROCK Pi platform
dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
+ console-on-uart4.dtbo \
+ console-disabled.dtbo \
two-color-led.dtbo \
at24c02.dtbo
diff --git a/arch/arm64/boot/dts/rockchip/overlays/README b/arch/arm64/boot/dts/rockchip/overlays/README
index 93c4c42029a8..5f9ee4ed12e4 100644
--- a/arch/arm64/boot/dts/rockchip/overlays/README
+++ b/arch/arm64/boot/dts/rockchip/overlays/README
@@ -119,3 +119,21 @@ Name: two-color-led
Info: Overlay for activation of two color led module.
Load: intfc:dtoverlay=two-color-led
+
+Name: console-disabled
+Info: Overlay for disabling fiq debugger console.
+ When this dtbo file is not loaded, Rock Pi enables fiq debugger console
+ by default. And UART2DBG Pins will output console information.
+ When this dtbo is loaded, Rock Pi disables fiq debugger console and
+ UART2DBG pins do not output console information. What's more,
+ UART2DBG pins can be used for serial communication if UART2 is enabled.
+Load: intfc:dtoverlay=console-disabled
+
+
+Name: console-on-uart4
+Info: Overlay for setting uart4 pins as fiq debugger console pins. With this
+ dtbo loaded, UART4 pins output console information after kernel is
+ booted. Note that at the same time, Rock Pi cannot work with other
+ serial communication devices like UART Serial Bluetooth Module through
+ UART4 (even though set "on" for BUS UART4).
+Load: intfc:dtoverlay=console-on-uart4
diff --git a/arch/arm64/boot/dts/rockchip/overlays/console-disabled-overlay.dts b/arch/arm64/boot/dts/rockchip/overlays/console-disabled-overlay.dts
new file mode 100644
index 000000000000..59001bb2ac67
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlays/console-disabled-overlay.dts
@@ -0,0 +1,16 @@
+// Definitions for disabling ttyFIQ0 console
+/dts-v1/;
+/plugin/;
+
+/ {
+ model = "ROCK PI 4B";
+ compatible = "rockchip,rockpi","rockchip,rk3399";
+
+ fragment@0 {
+ target = <&fiq_debugger>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+};
diff --git a/arch/arm64/boot/dts/rockchip/overlays/console-on-uart4-overlay.dts b/arch/arm64/boot/dts/rockchip/overlays/console-on-uart4-overlay.dts
new file mode 100644
index 000000000000..2ecafe7aa18b
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/overlays/console-on-uart4-overlay.dts
@@ -0,0 +1,32 @@
+// Definitions for setting uart4 pins as ttyFIQ0 console pins
+/dts-v1/;
+/plugin/;
+
+/ {
+ model = "ROCK PI 4B";
+ compatible = "rockchip,rockpi","rockchip,rk3399";
+
+ fragment@0 {
+ target = <&uart4>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@1 {
+ target = <&fiq_debugger>;
+
+ __overlay__ {
+ status = "okay";
+ compatible = "rockchip,fiq-debugger";
+ rockchip,serial-id = <4>;
+ rockchip,signal-irq = <182>;
+ rockchip,wake-irq = <0>;
+ rockchip,irq-mode-enable = <1>; /* If enable uart uses irq instead of fiq */
+ rockchip,baudrate = <1500000>; /* Only 115200 and 1500000 */
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart4_xfer>;
+ };
+ };
+};
--
2.25.1