Enable UART and I2C on J2 header (#1349)

Enable UART as well as I2C on the J2 header. Also backport the upstream
version of the I2C3/RTC patch.
This commit is contained in:
Stefan Agner 2021-04-29 23:04:34 +02:00 committed by GitHub
parent 367fc1561b
commit be2cfd7622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 267 additions and 68 deletions

View File

@ -1,50 +0,0 @@
From bcbcd8967de78638e5b861ceb9caa73da003280a Mon Sep 17 00:00:00 2001
Message-Id: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 16 Nov 2020 23:11:02 +0100
Subject: [PATCH 1/5] arm64: dts: meson: add RTC to ODROID-N2 boards
All ODROID-N2 boards come with a NXP PCF8563TS RTC connected to I2C bus
3. This is the RTC which is connected to the on-board RTC backup battery.
Use it as primary RTC.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
.../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 39a09661c5f6..445d90d25aa3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -13,6 +13,8 @@ / {
aliases {
serial0 = &uart_AO;
ethernet0 = &ethmac;
+ rtc0 = &board_rtc;
+ rtc1 = &vrtc;
};
dioo2133: audio-amplifier-0 {
@@ -471,6 +473,18 @@ hdmi_tx_tmds_out: endpoint {
};
};
+&i2c3 {
+ status = "okay";
+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+ pinctrl-names = "default";
+ clock-frequency = <400000>;
+
+ board_rtc: rtc@51 {
+ compatible = "nxp,pcf8563";
+ reg = <0x51>;
+ };
+};
+
&ir {
status = "okay";
pinctrl-0 = <&remote_input_ao_pins>;
--
2.31.1

View File

@ -0,0 +1,53 @@
From cdfb8eea4103e537898073dc3f7bf8f75cec5efb Mon Sep 17 00:00:00 2001
Message-Id: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Mon, 11 Jan 2021 13:58:31 +0000
Subject: [PATCH 1/8] arm64: dts: meson: add i2c3/rtc nodes and rtc aliases to
ODROID-N2 dtsi
Enable the onboard pcf8563 rtc hardware on ODROID N2/N2+ boards via the
common dtsi. Also add aliases to ensure vrtc does not claim /dev/rtc0.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20210111135831.2218-1-christianshewitt@gmail.com
---
.../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 39a09661c5f6..b78be3e6974d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -13,6 +13,8 @@ / {
aliases {
serial0 = &uart_AO;
ethernet0 = &ethmac;
+ rtc0 = &rtc;
+ rtc1 = &vrtc;
};
dioo2133: audio-amplifier-0 {
@@ -478,6 +480,18 @@ &ir {
linux,rc-map-name = "rc-odroid";
};
+&i2c3 {
+ status = "okay";
+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+ pinctrl-names = "default";
+
+ rtc: rtc@51 {
+ compatible = "nxp,pcf8563";
+ reg = <0x51>;
+ wakeup-source;
+ };
+};
+
&pwm_ab {
pinctrl-0 = <&pwm_a_e_pins>;
pinctrl-names = "default";
--
2.31.1

View File

@ -0,0 +1,37 @@
From 8b2ab165b2ed529f74b242159648893d53272c24 Mon Sep 17 00:00:00 2001
Message-Id: <8b2ab165b2ed529f74b242159648893d53272c24.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Wed, 7 Apr 2021 04:26:08 +0000
Subject: [PATCH 2/8] arm64: dts: meson: add saradc node to ODROID N2/N2+
Add the meson saradc node to the ODROID N2/N2+ common dtsi.
Signed-off-by: Hyeonki Hong <hhk7734@gmail.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20210407042609.9736-3-christianshewitt@gmail.com
---
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index b78be3e6974d..8a5e132c4b79 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -508,6 +508,11 @@ &pwm_AO_cd {
status = "okay";
};
+&saradc {
+ status = "okay";
+ vref-supply = <&vddao_1v8>;
+};
+
/* SD card */
&sd_emmc_b {
status = "okay";
--
2.31.1

View File

@ -0,0 +1,78 @@
From 602012d9081be7a54d2d6cee59035ae019dd3bb4 Mon Sep 17 00:00:00 2001
Message-Id: <602012d9081be7a54d2d6cee59035ae019dd3bb4.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Wed, 7 Apr 2021 04:26:09 +0000
Subject: [PATCH 3/8] arm64: dts: meson: add GPIO line names to ODROID N2/N2+
Add GPIO line-name identifiers to the ODROID N2/N2+ common dtsi.
Signed-off-by: Hyeonki Hong <hhk7734@gmail.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20210407042609.9736-4-christianshewitt@gmail.com
---
.../dts/amlogic/meson-g12b-odroid-n2.dtsi | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 8a5e132c4b79..41b2f9c96b5f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -446,6 +446,51 @@ &frddr_c {
};
&gpio {
+ gpio-line-names =
+ /* GPIOZ */
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ /* GPIOH */
+ "", "", "", "", "", "", "", "",
+ "",
+ /* BOOT */
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ /* GPIOC */
+ "", "", "", "", "", "", "", "",
+ /* GPIOA */
+ "PIN_44", /* GPIOA_0 */
+ "PIN_46", /* GPIOA_1 */
+ "PIN_45", /* GPIOA_2 */
+ "PIN_47", /* GPIOA_3 */
+ "PIN_26", /* GPIOA_4 */
+ "", "", "", "", "", "",
+ "PIN_42", /* GPIOA_11 */
+ "PIN_32", /* GPIOA_12 */
+ "PIN_7", /* GPIOA_13 */
+ "PIN_27", /* GPIOA_14 */
+ "PIN_28", /* GPIOA_15 */
+ /* GPIOX */
+ "PIN_16", /* GPIOX_0 */
+ "PIN_18", /* GPIOX_1 */
+ "PIN_22", /* GPIOX_2 */
+ "PIN_11", /* GPIOX_3 */
+ "PIN_13", /* GPIOX_4 */
+ "PIN_33", /* GPIOX_5 */
+ "PIN_35", /* GPIOX_6 */
+ "PIN_15", /* GPIOX_7 */
+ "PIN_19", /* GPIOX_8 */
+ "PIN_21", /* GPIOX_9 */
+ "PIN_24", /* GPIOX_10 */
+ "PIN_23", /* GPIOX_11 */
+ "PIN_8", /* GPIOX_12 */
+ "PIN_10", /* GPIOX_13 */
+ "PIN_29", /* GPIOX_14 */
+ "PIN_31", /* GPIOX_15 */
+ "PIN_12", /* GPIOX_16 */
+ "PIN_3", /* GPIOX_17 */
+ "PIN_5", /* GPIOX_18 */
+ "PIN_36"; /* GPIOX_19 */
/*
* WARNING: The USB Hub on the Odroid-N2 needs a reset signal
* to be turned high in order to be detected by the USB Controller
--
2.31.1

View File

@ -1,10 +1,10 @@
From 22e84d9b5b5ed45ee67e8bfde9af7518bdbbbdf3 Mon Sep 17 00:00:00 2001
Message-Id: <22e84d9b5b5ed45ee67e8bfde9af7518bdbbbdf3.1619651621.git.stefan@agner.ch>
In-Reply-To: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
References: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
From 0a70fbc9a556737d3f70a1a194ba7be280b007c5 Mon Sep 17 00:00:00 2001
Message-Id: <0a70fbc9a556737d3f70a1a194ba7be280b007c5.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 11:20:48 +0100
Subject: [PATCH 2/5] arm64: dts: meson: g12b: add power button support
Subject: [PATCH 4/8] arm64: dts: meson: g12b: add power button support
Add power button support on J2 pin 11 (GPIOX_3 on the SoC side). The
GPIO is low active, e.g. when connecting with pin 9 (GND) a power
@ -16,7 +16,7 @@ Signed-off-by: Stefan Agner <stefan@agner.ch>
1 file changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 445d90d25aa3..ddc7ad9a7d8d 100644
index 41b2f9c96b5f..4b6bb7e74e25 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -39,6 +39,17 @@ emmc_pwrseq: emmc-pwrseq {

View File

@ -1,10 +1,10 @@
From 753ddc99cabde67b7f2e5e6282432361c1c8c443 Mon Sep 17 00:00:00 2001
Message-Id: <753ddc99cabde67b7f2e5e6282432361c1c8c443.1619651621.git.stefan@agner.ch>
In-Reply-To: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
References: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
From 8a4a640d1b8dea977795de3f49b6ea3a791e401a Mon Sep 17 00:00:00 2001
Message-Id: <8a4a640d1b8dea977795de3f49b6ea3a791e401a.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 11:38:54 +0100
Subject: [PATCH 3/5] arm64: dts: meson: g12b: add GPIO fan support
Subject: [PATCH 5/8] arm64: dts: meson: g12b: add GPIO fan support
Add simple GPIO fan node to support a fan on GPIO J8. Unfortunately the
pad used to control the fan does not support real PWM, hence the RPM
@ -16,7 +16,7 @@ Signed-off-by: Stefan Agner <stefan@agner.ch>
1 file changed, 11 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index ddc7ad9a7d8d..4d96732d0613 100644
index 4b6bb7e74e25..e8a3ede698b5 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -39,6 +39,17 @@ emmc_pwrseq: emmc-pwrseq {

View File

@ -1,10 +1,10 @@
From 5df619f3887d30a74355ee62dca06d5e674e6463 Mon Sep 17 00:00:00 2001
Message-Id: <5df619f3887d30a74355ee62dca06d5e674e6463.1619651621.git.stefan@agner.ch>
In-Reply-To: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
References: <bcbcd8967de78638e5b861ceb9caa73da003280a.1619651621.git.stefan@agner.ch>
From eee30c74e72b6092b5e30c4744a4f1d7d9526403 Mon Sep 17 00:00:00 2001
Message-Id: <eee30c74e72b6092b5e30c4744a4f1d7d9526403.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 11 Jan 2021 15:53:55 +0100
Subject: [PATCH 4/5] arm64: dts: meson: g12b: odroid-n2: add fan as cooling
Subject: [PATCH 6/8] arm64: dts: meson: g12b: odroid-n2: add fan as cooling
device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -21,7 +21,7 @@ Signed-off-by: Stefan Agner <stefan@agner.ch>
1 file changed, 38 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 4d96732d0613..30d79175fa3e 100644
index e8a3ede698b5..dd345c6aa4b5 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -388,6 +388,44 @@ &clkc_audio {

View File

@ -0,0 +1,44 @@
From b10ae8fd3bef195eda4a30bc5f3995ca13b6cffd Mon Sep 17 00:00:00 2001
Message-Id: <b10ae8fd3bef195eda4a30bc5f3995ca13b6cffd.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Hyeonki Hong <hhk7734@gmail.com>
Date: Fri, 27 Mar 2020 17:05:22 +0900
Subject: [PATCH 7/8] arm64: dts: meson: add uart_A node
The UART_A is available through J3 pin 8/10 and documented to be
available as UART by default.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index dd345c6aa4b5..cec346178e3d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -12,6 +12,7 @@
/ {
aliases {
serial0 = &uart_AO;
+ serial1 = &uart_A;
ethernet0 = &ethmac;
rtc0 = &rtc;
rtc1 = &vrtc;
@@ -728,6 +729,12 @@ &toddr_c {
status = "okay";
};
+&uart_A {
+ status = "okay";
+ pinctrl-0 = <&uart_a_pins>;
+ pinctrl-names = "default";
+};
+
&uart_AO {
status = "okay";
pinctrl-0 = <&uart_ao_a_pins>;
--
2.31.1

View File

@ -0,0 +1,37 @@
From aea42d4a9a307438bf7099aee38daedac2bd5044 Mon Sep 17 00:00:00 2001
Message-Id: <aea42d4a9a307438bf7099aee38daedac2bd5044.1619725559.git.stefan@agner.ch>
In-Reply-To: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
References: <cdfb8eea4103e537898073dc3f7bf8f75cec5efb.1619725559.git.stefan@agner.ch>
From: Stefan Agner <stefan@agner.ch>
Date: Thu, 29 Apr 2021 21:32:43 +0200
Subject: [PATCH 8/8] arm64: dts: meson: add i2c2 node to ODROID N2/N2+
The J2 connectors pinout documents "I2C.SDA0/SCL0" on pin 3 and 5, which
are connected to GPIOX_17/18. This GPIO allow to mux I2C to the second
I2C instance. Enable i2c2 and use the appropriate pinmux.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index cec346178e3d..f1c3356c78a0 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -586,6 +586,12 @@ &ir {
linux,rc-map-name = "rc-odroid";
};
+&i2c2 {
+ status = "okay";
+ pinctrl-0 = <&i2c2_sda_x_pins>, <&i2c2_sck_x_pins>;
+ pinctrl-names = "default";
+};
+
&i2c3 {
status = "okay";
pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
--
2.31.1