Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: sunxi-6.13: Add all patches #7705

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
sunxi-6.13: Add megous patches
  • Loading branch information
The-going committed Jan 14, 2025
commit 4045c7f3ea0ff7c973c2890868e9610669c0876a
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 1499bb7def0445b47dd72cc26807e074bd297297 Mon Sep 17 00:00:00 2001
From: Arnav Singh <me@arnavion.dev>
Date: Mon, 6 May 2024 16:36:06 -0700
Subject: arm64: dts: sun50i: Define orientation and rotation for PinePhone
front camera

This enables libcamera to detect the correct orientation from
the device tree and propagate it further to e.g. Pipewire.

Signed-off-by: Arnav Singh <me@arnavion.dev>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 1a57720c25ef..f0f1367c5868 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -593,6 +593,9 @@ gc2145: front-camera@3c {
reset-gpios = <&pio 4 16 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE16 */
enable-gpios = <&pio 4 17 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; /* PE17 */

+ orientation = <0>;
+ rotation = <90>;
+
port {
gc2145_ep: endpoint {
remote-endpoint = <&csi_gc2145_ep>;
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 793f4b1787580b995db295e6d4f30bc2512489df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Tue, 14 Nov 2017 02:47:51 +0100
Subject: ARM: dts: axp813: Add charger LED

PMIC supports charging status indication via a LED. Add support
for it.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/axp81x.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/allwinner/axp81x.dtsi b/arch/arm/boot/dts/allwinner/axp81x.dtsi
index ebaf1c3ce8db..a4b1be159b02 100644
--- a/arch/arm/boot/dts/allwinner/axp81x.dtsi
+++ b/arch/arm/boot/dts/allwinner/axp81x.dtsi
@@ -161,4 +161,9 @@ reg_drivevbus: drivevbus {
usb_power_supply: usb-power {
compatible = "x-powers,axp813-usb-power-supply";
};
+
+ charger_led: charger-led {
+ compatible = "x-powers,axp813-charger-led";
+ status = "disabled";
+ };
};
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
From b1060cbbb7c823fdd2aef80634681b5e44c8e844 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sun, 23 Feb 2020 01:23:10 +0100
Subject: ARM: dts: sun5i: Add PocketBook Touch Lux 3 display/ctp support

Add support for display and touchscreen via out-of-tree drivers.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
.../sun5i-a13-pocketbook-touch-lux-3.dts | 105 +++++++++++++++++-
1 file changed, 103 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
index d60407772e5d..db28ab621804 100644
--- a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
+++ b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
@@ -62,6 +62,11 @@ key-left {
};
};

+ regulator-eink {
+ compatible = "custom,reg-userspace-consumer";
+ controlled-supply = <&tp65185x>;
+ };
+
reg_1v8: regulator-1v8 {
compatible = "regulator-fixed";
regulator-name = "vdd-1v8-nor-ctp";
@@ -79,7 +84,6 @@ reg_1v8_nor: regulator-nor {
gpio = <&pio 2 14 GPIO_ACTIVE_HIGH>;
enable-active-high;
vin-supply = <&reg_1v8>;
- regulator-always-on;
};

reg_1v8_ctp: regulator-ctp {
@@ -112,6 +116,7 @@ &ehci0 {

&i2c0 {
status = "okay";
+ //XXX: bsp has pullup on PB0/PB1 pins enabled, but it works without it

axp209: pmic@34 {
reg = <0x34>;
@@ -128,12 +133,42 @@ pcf8563: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
};
+
+ // hacky PMIC driver for eInk display
+ tp65185x: regulator@68 {
+ compatible = "tp,tp65185x";
+ reg = <0x68>;
+
+ regulator-min-microvolt = <3120000>;
+ regulator-max-microvolt = <3120000>;
+ regulator-name = "eink-vcom";
+
+ //XXX: we don't use interrupts in the driver right now
+ //interrupt-parent = <&pio>;
+ //interrupts = <1 10 IRQ_TYPE_LEVEL_LOW>; /* PB10 */
+
+ wakeup-gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
+ powerup-gpios = <&pio 4 7 GPIO_ACTIVE_HIGH>; /* PE7 */
+ vcom-gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
+ //XXX: not a pullup on BSP (might have an external resistor)
+ powergood-gpios = <&pio 4 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PE6 */
+ };
};

&i2c2 {
status = "okay";

- /* Touchpanel is connected here. */
+ touchpanel@24 {
+ compatible = "cypress,cyttsp4_i2c_adapter";
+ reg = <0x24>;
+
+ interrupt-parent = <&pio>;
+ interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>; /* PG11 */
+
+ vdd-supply = <&reg_1v8_ctp>;
+ power-gpios = <&pio 4 5 GPIO_ACTIVE_LOW>; /* PE5 */
+ reset-gpios = <&pio 1 3 GPIO_ACTIVE_LOW>; /* PB3 */
+ };
};

&lradc {
@@ -179,6 +214,20 @@ &otg_sram {
status = "okay";
};

+&pio {
+ eink_pins_active: eink-pins-lcd {
+ pins = "PD3", "PD4", "PD5", "PD6", "PD7", "PD10", "PD11", "PD12",
+ "PD13", "PD15", "PD20", "PD21", "PD22", "PD23", "PD24";
+ function = "lcd0";
+ };
+
+ eink_pins_idle: eink-pins-gpio {
+ pins = "PD3", "PD4", "PD5", "PD6", "PD7", "PD10", "PD11", "PD12",
+ "PD13", "PD15", "PD20", "PD21", "PD22", "PD23", "PD24";
+ function = "gpio_out";
+ };
+};
+
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pin>;
@@ -219,6 +268,55 @@ &reg_ldo3 {
regulator-ramp-delay = <1600>;
};

+&soc {
+ display-controller@1c0c000 {
+ pinctrl-names = "idle", "active";
+ pinctrl-0 = <&eink_pins_idle>;
+ pinctrl-1 = <&eink_pins_active>;
+
+ all-gpios = <&pio 3 3 GPIO_ACTIVE_HIGH>,
+ <&pio 3 4 GPIO_ACTIVE_HIGH>,
+ <&pio 3 5 GPIO_ACTIVE_HIGH>,
+ <&pio 3 6 GPIO_ACTIVE_HIGH>,
+ <&pio 3 7 GPIO_ACTIVE_HIGH>,
+ <&pio 3 10 GPIO_ACTIVE_HIGH>,
+ <&pio 3 11 GPIO_ACTIVE_HIGH>,
+ <&pio 3 12 GPIO_ACTIVE_HIGH>,
+ <&pio 3 13 GPIO_ACTIVE_HIGH>,
+ <&pio 3 15 GPIO_ACTIVE_HIGH>,
+ <&pio 3 20 GPIO_ACTIVE_HIGH>,
+ <&pio 3 21 GPIO_ACTIVE_HIGH>,
+ <&pio 3 22 GPIO_ACTIVE_HIGH>,
+ <&pio 3 23 GPIO_ACTIVE_HIGH>,
+ <&pio 3 24 GPIO_ACTIVE_HIGH>;
+
+ compatible = "custom,pocketbook-touch-lux-3-tcon0-ed060xd4-display";
+ reg = <0x01c0c000 0x1000>, // TCON0 regs
+ <0x01e60000 0x10000>; // DEBE regs
+
+ interrupts = <44>; // TCON interrupt
+
+ resets = <&ccu RST_LCD>, <&ccu RST_DE_BE>;
+ reset-names = "tcon", "be";
+
+ clocks = <&ccu CLK_AHB_LCD>, <&ccu CLK_TCON_CH0>,
+ <&ccu CLK_AHB_DE_BE>, <&ccu CLK_DE_BE>,
+ <&ccu CLK_DRAM_DE_BE>;
+ clock-names = "tcon_bus", "tcon_mod",
+ "be_bus", "be_mod",
+ "be_ram";
+
+ assigned-clocks = <&ccu CLK_DE_BE>;
+ assigned-clock-rates = <300000000>;
+
+ interconnects = <&mbus 18>;
+ interconnect-names = "dma-mem";
+
+ panel-supply = <&tp65185x>;
+ control-device-name = "eink-panel";
+ };
+};
+
&spi2 {
pinctrl-names = "default";
pinctrl-0 = <&spi2_pe_pins>, <&spi2_cs0_pe_pin>;
@@ -230,6 +328,7 @@ epd_flash: flash@0 {
compatible = "macronix,mx25u4033", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <4000000>;
+ vdd-supply = <&reg_1v8_nor>;
};
};

@@ -253,6 +352,8 @@ &usb_power_supply {
};

&usbphy {
+ //XXX: might not work, need to test
+ usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
usb1_vbus-supply = <&reg_ldo3>;
status = "okay";
};
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 59b4c0d98f6382ae86441d92972d08f1eea28d51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Sat, 5 Oct 2019 15:04:43 +0200
Subject: ARM: dts: sun5i: Add soc handle

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun5i.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/allwinner/sun5i.dtsi b/arch/arm/boot/dts/allwinner/sun5i.dtsi
index e6836fd4b8dc..126b80f3ca70 100644
--- a/arch/arm/boot/dts/allwinner/sun5i.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun5i.dtsi
@@ -123,7 +123,7 @@ default-pool {
};
};

- soc {
+ soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 0e1e0788c071cc4d19af872b3798353fc65fdb41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Thu, 25 Jun 2020 01:57:27 +0200
Subject: ARM: dts: sun5i-a13-pocketbook-touch-lux-3: Add RTC clock-cells

This stop the driver from complaining in dmesg.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
index db28ab621804..ee81db68e546 100644
--- a/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
+++ b/arch/arm/boot/dts/allwinner/sun5i-a13-pocketbook-touch-lux-3.dts
@@ -132,6 +132,7 @@ &i2c1 {
pcf8563: rtc@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
+ #clock-cells = <0>;
};

// hacky PMIC driver for eInk display
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 91273df18b02bbb6f1f4edc4193de1a3177ce9aa Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 3 Apr 2021 20:53:26 -0500
Subject: ARM: dts: sun8i: a83t: Add MBUS node

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index ef62ced26684..04b33b42b414 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -1056,6 +1056,21 @@ mdio: mdio {
};
};

+ mbus: dram-controller@1c62000 {
+ compatible = "allwinner,sun8i-a83t-mbus";
+ reg = <0x01c62000 0x1000>,
+ <0x01c63000 0x1000>;
+ reg-names = "mbus", "dram";
+ clocks = <&ccu CLK_BUS_DRAM>,
+ <&ccu CLK_DRAM>,
+ <&ccu CLK_MBUS>;
+ clock-names = "apb", "dram", "mbus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ dma-ranges = <0x00000000 0x40000000 0xc0000000>;
+ #interconnect-cells = <1>;
+ };
+
gic: interrupt-controller@1c81000 {
compatible = "arm,gic-400";
reg = <0x01c81000 0x1000>,
--
2.35.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From b0ad8691cd5525985ab250244bf51d604b4fff13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Mon, 9 Sep 2019 06:02:10 +0200
Subject: ARM: dts: sun8i-a83t: Add cedrus video codec support to A83T
[untested]

Not tested at all.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
index addf0cb0f465..ed3d8e692d84 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-a83t.dtsi
@@ -441,6 +441,16 @@ syscon: syscon@1c00000 {
reg = <0x01c00000 0x1000>;
};

+ video-codec@01c0e000 {
+ compatible = "allwinner,sun8i-a83t-video-engine";
+ reg = <0x01c0e000 0x1000>;
+ clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+ <&ccu CLK_DRAM_VE>;
+ clock-names = "ahb", "mod", "ram";
+ resets = <&ccu RST_BUS_VE>;
+ interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
dma: dma-controller@1c02000 {
compatible = "allwinner,sun8i-a83t-dma";
reg = <0x01c02000 0x1000>;
--
2.35.3

Loading
Oops, something went wrong.