From 69ef1f4ed7823dc1a6493cbbf0795860449e63c1 Mon Sep 17 00:00:00 2001 From: Deokgyu Yang Date: Thu, 28 May 2020 18:50:32 +0900 Subject: [PATCH 35/75] ODROID-XU4: arm/dts: Refactoring device tree overlay structure Signed-off-by: Deokgyu Yang Change-Id: Ied2c7fa25d464a7aa24f92bcaa5baa4a67d636f0 --- .../boot/dts/exynos5422-odroidxu3-common.dtsi | 16 ++- arch/arm/boot/dts/exynos5422-odroidxu4.dts | 130 +++--------------- arch/arm/boot/dts/overlays/Makefile | 17 ++- arch/arm/boot/dts/overlays/ads7846.dts | 58 ++++++++ .../dts/overlays/hktft-cs-ogst-overlay.dts | 36 ----- arch/arm/boot/dts/overlays/hktft-cs-ogst.dts | 48 +++++++ .../arm/boot/dts/overlays/hktft32-overlay.dts | 36 ----- arch/arm/boot/dts/overlays/hktft32.dts | 46 +++++++ .../arm/boot/dts/overlays/hktft35-overlay.dts | 36 ----- arch/arm/boot/dts/overlays/hktft35.dts | 55 ++++++++ .../overlays/{i2c1-overlay.dts => i2c0.dts} | 1 + .../overlays/{i2c5-overlay.dts => i2c1.dts} | 1 + arch/arm/boot/dts/overlays/spi0.dts | 30 ++++ .../arm/boot/dts/overlays/spidev1-overlay.dts | 20 --- arch/arm/boot/dts/overlays/sx865x-i2c1.dts | 34 +++++ arch/arm/boot/dts/overlays/uart0.dts | 12 ++ 16 files changed, 327 insertions(+), 249 deletions(-) create mode 100644 arch/arm/boot/dts/overlays/ads7846.dts delete mode 100644 arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/hktft-cs-ogst.dts delete mode 100644 arch/arm/boot/dts/overlays/hktft32-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/hktft32.dts delete mode 100644 arch/arm/boot/dts/overlays/hktft35-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/hktft35.dts rename arch/arm/boot/dts/overlays/{i2c1-overlay.dts => i2c0.dts} (78%) rename arch/arm/boot/dts/overlays/{i2c5-overlay.dts => i2c1.dts} (78%) create mode 100644 arch/arm/boot/dts/overlays/spi0.dts delete mode 100644 arch/arm/boot/dts/overlays/spidev1-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/sx865x-i2c1.dts create mode 100644 arch/arm/boot/dts/overlays/uart0.dts diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi index f218eb44da34..c3a38d1813f9 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi @@ -13,7 +13,21 @@ #include "exynos5422-odroid-core.dtsi" / { - gpio-keys { + aliases { + /* Hardkernel alignment + * I2C_0 : Pin 3, 5 + * I2C_1 : Pin 27, 28 + * SPI_0 : Pin 11, 13, 15 + * SERIAL_0 : Pin 8, 10 + */ + i2c0 = &i2c_1; + i2c1 = &hsi2c_5; + i2c5 = &i2c_0; + spi0 = &spi_1; + spi1 = &spi_0; + }; + + gpio_keys { compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&power_key>; diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts index e3f290f14d5e..e84d55e35295 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts @@ -44,49 +44,6 @@ codec { sound-dai = <&hdmi>; }; }; - - hktft35: hktft35 { - status = "disabled"; - compatible = "odroid,hktft35"; - pinctrl-names = "default"; - pinctrl-0 = <&hktft35_pins>; - - rotate = <270>; - bgr; - fps = <20>; - bpp = <16>; - reset-gpios = <&gpa0 3 GPIO_ACTIVE_HIGH>; - dc-gpios = <&gpx2 4 GPIO_ACTIVE_HIGH>; - wr-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpa0 2 GPIO_ACTIVE_HIGH>; - led-gpios = <&gpx2 7 GPIO_ACTIVE_HIGH>; - db-gpios = <&gpx1 7 GPIO_ACTIVE_HIGH>, - <&gpx2 0 GPIO_ACTIVE_HIGH>, - <&gpx1 3 GPIO_ACTIVE_HIGH>, - <&gpa2 4 GPIO_ACTIVE_HIGH>, - <&gpa2 6 GPIO_ACTIVE_HIGH>, - <&gpa2 7 GPIO_ACTIVE_HIGH>, - <&gpx1 6 GPIO_ACTIVE_HIGH>, - <&gpx1 5 GPIO_ACTIVE_HIGH>; - debug = <0>; - - hktft35_pins: hktft35_pins { - samsung,pins = "gpa0-3", /* reset */ - "gpx2-4", /* dc */ - "gpa2-5", /* wr */ - "gpa0-2", /* cs */ - "gpx2-7", /* led */ - "gpx1-7", /* db00 */ - "gpx2-0", /* db01 */ - "gpx1-3", /* db02 */ - "gpa2-4", /* db03 */ - "gpa2-6", /* db04 */ - "gpa2-7", /* db05 */ - "gpx1-6", /* db06 */ - "gpx1-5"; /* db07 */ - samsung,pin-function = <1>; - }; - }; }; &i2s0 { @@ -135,6 +92,23 @@ &usbdrd_dwc3_1 { dr_mode = "host"; }; +&serial_0 { + status = "disabled"; +}; + +&serial_1 { + status = "disabled"; +}; + +&serial_2 { + // Debugging UART port + status = "okay"; +}; + +&serial_3 { + status = "disabled"; +}; + /* i2c@12C70000 */ &i2c_1 { status = "disabled"; @@ -153,74 +127,4 @@ &spi_1 { samsung,spi-src-clk = <0>; num-cs = <2>; cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>, <&gpx2 1 GPIO_ACTIVE_HIGH>; - - spidev: spidev@0 { - status = "disabled"; - reg = <0>; - compatible = "odroid,spidev"; - spi-max-frequency = <1000000>; - - controller-data { - cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; - samsung,spi-feedback-delay = <0>; - }; - }; - - hktft_cs_ogst: hktft_cs_ogst@0 { - status = "disabled"; - compatible = "odroid,hktft32"; - reg = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&hktft_cs_ogst_pins>; - - spi-max-frequency = <40000000>; - rotate = <270>; - bgr; - backlight; - fps = <20>; - bpp = <16>; - reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>; - dc-gpios = <&gpx1 6 GPIO_ACTIVE_HIGH>; - led-gpios = <&gpx1 2 GPIO_ACTIVE_HIGH>; - debug = <0>; - - hktft_cs_ogst_pins: hktft_cs_ogst_pins { - samsung,pins = "gpx1-5", /* reset */ - "gpx1-6", /* dc */ - "gpx1-2"; /* led */ - }; - - controller-data { - cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; - samsung,spi-feedback-delay = <0>; - }; - }; - - hktft32: hktft32@0 { - status = "disabled"; - compatible = "odroid,hktft32"; - reg = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&hktft32_pins>; - - spi-max-frequency = <40000000>; - rotate = <90>; - bgr; - backlight; - fps = <20>; - bpp = <16>; - reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>; - dc-gpios = <&gpx1 6 GPIO_ACTIVE_HIGH>; - debug = <0>; - - hktft32_pins: hktft32_pins { - samsung,pins = "gpx1-5", /* reset */ - "gpx1-6"; /* dc */ - }; - - controller-data { - cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; - samsung,spi-feedback-delay = <0>; - }; - }; }; diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile index 9502f67ce928..a391e52447f1 100644 --- a/arch/arm/boot/dts/overlays/Makefile +++ b/arch/arm/boot/dts/overlays/Makefile @@ -1,12 +1,15 @@ # Overlays for the Odroid platform dtbo-y += \ - spidev1-overlay.dtbo \ - i2c1-overlay.dtbo \ - i2c5-overlay.dtbo \ - hktft32-overlay.dtbo \ - hktft35-overlay.dtbo \ - hktft-cs-ogst-overlay.dtbo + spi0.dtbo \ + i2c0.dtbo \ + i2c1.dtbo \ + uart0.dtbo \ + hktft32.dtbo \ + hktft35.dtbo \ + ads7846.dtbo \ + sx865x-i2c1.dtbo \ + hktft-cs-ogst.dtbo targets += $(dtbo-y) -always := $(dtbo-y) +always-y := $(dtbo-y) diff --git a/arch/arm/boot/dts/overlays/ads7846.dts b/arch/arm/boot/dts/overlays/ads7846.dts new file mode 100644 index 000000000000..62391a33ee18 --- /dev/null +++ b/arch/arm/boot/dts/overlays/ads7846.dts @@ -0,0 +1,58 @@ +/dts-v1/; +/plugin/; + +#include +#include + +/ { + fragment@0 { + // spi_1 aliased with spi0 + target = <&spi_1>; + + __overlay__ { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + ads7846: ads7846@1 { + status = "okay"; + + reg = <1>; + compatible = "ti,ads7846"; + interrupt-parent = <&gpa0>; + interrupts = <3 0>; + spi-max-frequency = <1000000>; + + /* GPA0.3 Pull-up enable */ + pinctrl-0 = <&ts_pendown_gpio>; + pinctrl-names = "default"; + + pendown-gpio = <&gpa0 3 GPIO_ACTIVE_HIGH>; + vcc-supply = <&ldo30_reg>; + + ti,swap-xy = <1>; + ti,x-min = /bits/ 16 <0>; + ti,x-max = /bits/ 16 <8000>; + ti,y-min = /bits/ 16 <0>; + ti,y-max = /bits/ 16 <4800>; + ti,x-plate-ohms = /bits/ 16 <40>; + ti,pressure-max = /bits/ 16 <255>; + + linux,wakeup; + + ts_pendown_gpio: ts-pendown-gpio { + samsung,pins = "gpa0-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + controller-data { + cs-gpio = <&gpx2 1 GPIO_ACTIVE_HIGH>; + samsung,spi-feedback-delay = <0>; + }; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts b/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts deleted file mode 100644 index a727fb311574..000000000000 --- a/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts +++ /dev/null @@ -1,36 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - fragment@0 { - target = <&i2c_1>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@1 { - target = <&hsi2c_5>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@2 { - target = <&spi_1>; - - __overlay__ { - status = "okay"; - }; - }; - - fragment@3 { - target = <&hktft_cs_ogst>; - - __overlay__ { - status = "okay"; - }; - }; -}; diff --git a/arch/arm/boot/dts/overlays/hktft-cs-ogst.dts b/arch/arm/boot/dts/overlays/hktft-cs-ogst.dts new file mode 100644 index 000000000000..3c2bfb9598b1 --- /dev/null +++ b/arch/arm/boot/dts/overlays/hktft-cs-ogst.dts @@ -0,0 +1,48 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + fragment@0 { + // spi_1 aliased with spi0 + target = <&spi_1>; + + __overlay__ { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hktft_cs_ogst: hktft_cs_ogst@0 { + status = "okay"; + compatible = "odroid,hktft32"; + reg = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&hktft_cs_ogst_pins>; + + spi-max-frequency = <40000000>; + rotate = <270>; + bgr; + backlight; + fps = <20>; + bpp = <16>; + reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>; + dc-gpios = <&gpx1 6 GPIO_ACTIVE_HIGH>; + led-gpios = <&gpx1 2 GPIO_ACTIVE_HIGH>; + debug = <0>; + + hktft_cs_ogst_pins: hktft_cs_ogst_pins { + samsung,pins = "gpx1-5", /* reset */ + "gpx1-6", /* dc */ + "gpx1-2"; /* led */ + }; + + controller-data { + cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; + samsung,spi-feedback-delay = <0>; + }; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/hktft32-overlay.dts b/arch/arm/boot/dts/overlays/hktft32-overlay.dts deleted file mode 100644 index 7bda6cd8e6d8..000000000000 --- a/arch/arm/boot/dts/overlays/hktft32-overlay.dts +++ /dev/null @@ -1,36 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - fragment@0 { - target = <&i2c_1>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@1 { - target = <&hsi2c_5>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@2 { - target = <&spi_1>; - - __overlay__ { - status = "okay"; - }; - }; - - fragment@3 { - target = <&hktft32>; - - __overlay__ { - status = "okay"; - }; - }; -}; diff --git a/arch/arm/boot/dts/overlays/hktft32.dts b/arch/arm/boot/dts/overlays/hktft32.dts new file mode 100644 index 000000000000..81d037216d4f --- /dev/null +++ b/arch/arm/boot/dts/overlays/hktft32.dts @@ -0,0 +1,46 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + fragment@0 { + // spi_1 aliased with spi0 + target = <&spi_1>; + + __overlay__ { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hktft32: hktft32@0 { + status = "okay"; + compatible = "odroid,hktft32"; + reg = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&hktft32_pins>; + + spi-max-frequency = <40000000>; + rotate = <90>; + bgr; + backlight; + fps = <20>; + bpp = <16>; + reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>; + dc-gpios = <&gpx1 6 GPIO_ACTIVE_HIGH>; + debug = <0>; + + hktft32_pins: hktft32_pins { + samsung,pins = "gpx1-5", /* reset */ + "gpx1-6"; /* dc */ + }; + + controller-data { + cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; + samsung,spi-feedback-delay = <0>; + }; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/hktft35-overlay.dts b/arch/arm/boot/dts/overlays/hktft35-overlay.dts deleted file mode 100644 index a656dd272165..000000000000 --- a/arch/arm/boot/dts/overlays/hktft35-overlay.dts +++ /dev/null @@ -1,36 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - fragment@0 { - target = <&i2c_1>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@1 { - target = <&hsi2c_5>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@2 { - target = <&spi_1>; - - __overlay__ { - status = "disabled"; - }; - }; - - fragment@3 { - target = <&hktft35>; - - __overlay__ { - status = "okay"; - }; - }; -}; diff --git a/arch/arm/boot/dts/overlays/hktft35.dts b/arch/arm/boot/dts/overlays/hktft35.dts new file mode 100644 index 000000000000..4f199a3be4c4 --- /dev/null +++ b/arch/arm/boot/dts/overlays/hktft35.dts @@ -0,0 +1,55 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + fragment@0 { + target-path = "/"; + + __overlay__ { + hktft35: hktft35 { + status = "okay"; + compatible = "odroid,hktft35"; + pinctrl-names = "default"; + pinctrl-0 = <&hktft35_pins>; + + rotate = <270>; + bgr; + fps = <20>; + bpp = <16>; + reset-gpios = <&gpa0 3 GPIO_ACTIVE_HIGH>; + dc-gpios = <&gpx2 4 GPIO_ACTIVE_HIGH>; + wr-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpa0 2 GPIO_ACTIVE_HIGH>; + led-gpios = <&gpx2 7 GPIO_ACTIVE_HIGH>; + db-gpios = <&gpx1 7 GPIO_ACTIVE_HIGH>, + <&gpx2 0 GPIO_ACTIVE_HIGH>, + <&gpx1 3 GPIO_ACTIVE_HIGH>, + <&gpa2 4 GPIO_ACTIVE_HIGH>, + <&gpa2 6 GPIO_ACTIVE_HIGH>, + <&gpa2 7 GPIO_ACTIVE_HIGH>, + <&gpx1 6 GPIO_ACTIVE_HIGH>, + <&gpx1 5 GPIO_ACTIVE_HIGH>; + debug = <0>; + + hktft35_pins: hktft35_pins { + samsung,pins = "gpa0-3", /* reset */ + "gpx2-4", /* dc */ + "gpa2-5", /* wr */ + "gpa0-2", /* cs */ + "gpx2-7", /* led */ + "gpx1-7", /* db00 */ + "gpx2-0", /* db01 */ + "gpx1-3", /* db02 */ + "gpa2-4", /* db03 */ + "gpa2-6", /* db04 */ + "gpa2-7", /* db05 */ + "gpx1-6", /* db06 */ + "gpx1-5"; /* db07 */ + samsung,pin-function = <1>; + }; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/i2c1-overlay.dts b/arch/arm/boot/dts/overlays/i2c0.dts similarity index 78% rename from arch/arm/boot/dts/overlays/i2c1-overlay.dts rename to arch/arm/boot/dts/overlays/i2c0.dts index 2fd27754e7c8..dbf16972867f 100644 --- a/arch/arm/boot/dts/overlays/i2c1-overlay.dts +++ b/arch/arm/boot/dts/overlays/i2c0.dts @@ -3,6 +3,7 @@ / { fragment@0 { + // i2c_1 aliased with i2c0 target = <&i2c_1>; __overlay__ { diff --git a/arch/arm/boot/dts/overlays/i2c5-overlay.dts b/arch/arm/boot/dts/overlays/i2c1.dts similarity index 78% rename from arch/arm/boot/dts/overlays/i2c5-overlay.dts rename to arch/arm/boot/dts/overlays/i2c1.dts index 9ef9e66699e0..8542709a37df 100644 --- a/arch/arm/boot/dts/overlays/i2c5-overlay.dts +++ b/arch/arm/boot/dts/overlays/i2c1.dts @@ -3,6 +3,7 @@ / { fragment@0 { + // hsi2c_5 alised with i2c1 target = <&hsi2c_5>; __overlay__ { diff --git a/arch/arm/boot/dts/overlays/spi0.dts b/arch/arm/boot/dts/overlays/spi0.dts new file mode 100644 index 000000000000..2eab40560ac2 --- /dev/null +++ b/arch/arm/boot/dts/overlays/spi0.dts @@ -0,0 +1,30 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + fragment@0 { + // spi_1 aliased with spi0 + target = <&spi_1>; + + __overlay__ { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + spidev: spidev@0 { + status = "okay"; + reg = <0>; + compatible = "odroid,spidev"; + spi-max-frequency = <1000000>; + + controller-data { + cs-gpio = <&gpa2 5 GPIO_ACTIVE_HIGH>; + samsung,spi-feedback-delay = <0>; + }; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/spidev1-overlay.dts b/arch/arm/boot/dts/overlays/spidev1-overlay.dts deleted file mode 100644 index c5cb6bcb6011..000000000000 --- a/arch/arm/boot/dts/overlays/spidev1-overlay.dts +++ /dev/null @@ -1,20 +0,0 @@ -/dts-v1/; -/plugin/; - -/ { - fragment@0 { - target = <&spi_1>; - - __overlay__ { - status = "okay"; - }; - }; - - fragment@1 { - target = <&spidev>; - - __overlay__ { - status = "okay"; - }; - }; -}; diff --git a/arch/arm/boot/dts/overlays/sx865x-i2c1.dts b/arch/arm/boot/dts/overlays/sx865x-i2c1.dts new file mode 100644 index 000000000000..c0a54ea45c78 --- /dev/null +++ b/arch/arm/boot/dts/overlays/sx865x-i2c1.dts @@ -0,0 +1,34 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + fragment@0 { + // hsi2c_5 alised with i2c1 + target = <&hsi2c_5>; + + __overlay__ { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + sx865x: sx865x@49 { + status = "okay"; + compatible = "semtech,sx8650"; + reg = <0x49>; + #clock-cells = <0>; + + /* H/W Pin control setup */ + gpio-pendown = <&gpx3 1 GPIO_ACTIVE_HIGH>; + gpio-reset = <&gpx2 5 GPIO_ACTIVE_LOW>; + + /* platform data setup */ + invert-x = <0>; + invert-y = <1>; + swap-xy = <1>; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/overlays/uart0.dts b/arch/arm/boot/dts/overlays/uart0.dts new file mode 100644 index 000000000000..34c79f291cac --- /dev/null +++ b/arch/arm/boot/dts/overlays/uart0.dts @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +/ { + fragment@0 { + target = <&serial_0>; + + __overlay__ { + status = "okay"; + }; + }; +}; -- 2.25.1