Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Pinephone Pro Connectivity: Adding Modem, Bluetooth, and Wi-Fi
@ 2026-08-25  5:18 Rudraksha Gupta via B4 Relay
  2026-08-25  5:18 ` [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro Rudraksha Gupta via B4 Relay
  2026-08-25  5:18 ` [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818 Rudraksha Gupta via B4 Relay
  0 siblings, 2 replies; 5+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2026-08-25  5:18 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	Lee Jones, Michael Turquette, Stephen Boyd, Brian Masney
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Rudraksha Gupta, linux-clk, mfd, Martijn Braam

Continuing the work on upstreaming Pinephone Pro functionality,
this patch series gets the connectivity side of the Pinephone Pro
mainlined. Here are the following sources:

- https://codeberg.org/megi/linux
- https://gitlab.com/pine64-org/linux/-/commit/f9f847c6fd1

All credits to the following folks:
- Martijn Braam: original author for the Pinephone Pro bringup
- Kamil Trzcinski: original author for the Pinephone Pro bringup. No
  longer credited as I can't seem to contact this person
- Ondrej Jirman: maintains https://codeberg.org/megi/linux
- Dang Huynh: for the modem patch above

As far as I can tell, I've credited everyone that I know about, but
may be missing some because of how long its been since the original
implementation till now has been.

I've also included a short guide on how to test these patches. This
generally follows this page:
https://wiki.postmarketos.org/wiki/PINE64_PinePhone_Pro_(pine64-pinephonepro)

To test, please follow the following steps:
    https://wiki.postmarketos.org/wiki/PINE64_PinePhone_Pro_(pine64-pinephonepro)#External_storage_(microSD_card)

To build your own image, you will need to do something like this:
pmbootstrap init    # I typically choose Phosh. Defaults should work
wget https://gitlab.postmarketos.org/postmarketOS/pmaports/-/raw/main/device/community/linux-pine64-pinephonepro/config-pine64-pinephonepro.aarch64 -O arch/arm64/configs/orangepi_defconfig
make LLVM=1 CC="ccache clang" O=.output ARCH=arm64 -j $(nproc) W=1 orangepi_defconfig all
pmbootstrap build --envkernel linux-pine64-pinephonepro
pmbootstrap build --force device-pine64-pinephonepro
pmbootstrap install --sdcard=/dev/sdX    # Change /dev/sdX appropriately
pmbootstrap -y zap -a    # Cleanup everything

Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
Changes in v2:
- dropped removing the interrupt GPIO for Wifi as that is now merged into mainline
- reworked clkout2
- dropped all the signed-off-by's. credited in cover letter
- Link to v1: https://lore.kernel.org/r/20260112-ppp_connectivity-v1-0-284d6e83b212@gmail.com

To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Heiko Stuebner <heiko@sntech.de>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Brian Masney <bmasney@redhat.com>
To: Lee Jones <lee@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: mfd@lists.linux.dev

---
Martijn Braam (2):
      arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro
      clk: rk808: Select the clock function of CLK32KOUT2 on the RK818

 .../boot/dts/rockchip/rk3399-pinephone-pro.dts     | 69 ++++++++++++++++++++++
 drivers/clk/clk-rk808.c                            | 46 ++++++++++++++-
 include/linux/mfd/rk808.h                          |  1 +
 3 files changed, 115 insertions(+), 1 deletion(-)
---
base-commit: 237a1c39e8dfd3e1c6f1f023eea37a48ec04cc63
change-id: 20260112-ppp_connectivity-5edddd7b4904

Best regards,
--  
Rudraksha Gupta <guptarud@gmail.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro
  2026-08-25  5:18 [PATCH v2 0/2] Pinephone Pro Connectivity: Adding Modem, Bluetooth, and Wi-Fi Rudraksha Gupta via B4 Relay
@ 2026-08-25  5:18 ` Rudraksha Gupta via B4 Relay
  2026-08-25  5:24   ` sashiko-bot
  2026-08-25  5:18 ` [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818 Rudraksha Gupta via B4 Relay
  1 sibling, 1 reply; 5+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2026-08-25  5:18 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	Lee Jones, Michael Turquette, Stephen Boyd, Brian Masney
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Rudraksha Gupta, linux-clk, mfd, Martijn Braam

From: Martijn Braam <martijn@brixit.nl>

The Quectel EG25-G modem is soldered to the board. It sits on the USB 2.0
host controller behind u2phy1, with uart3 as its AT command port, and
draws from two switched rails: vcc_4g_5v off the RK818 boost, and vcc_4g
off vcc_sys.

Neither rail supplies anything but the modem, which has to stay powered
for the board to work as a phone, so both are always-on.

The modem itself has no binding and no in-kernel driver, so it is not
described here; its control lines are driven from userspace.

Based on work by Martijn Braam, Kamil Trzciński, Ondrej Jirman and Dang
Huynh.

Signed-off-by: Martijn Braam <martijn@brixit.nl>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
 .../boot/dts/rockchip/rk3399-pinephone-pro.dts     | 69 ++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index 8d26bd9b7500..8d2b6a46b39d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -134,6 +134,32 @@ vcca1v8_s3: regulator-vcc1v8-s3 {
 		regulator-boot-on;
 	};
 
+	vcc_4g: regulator-vcc-4g {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio4 RK_PC7 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc_4g_en>;
+		regulator-name = "vcc_4g";
+		regulator-min-microvolt = <3800000>;
+		regulator-max-microvolt = <3800000>;
+		vin-supply = <&vcc_sys>;
+		regulator-always-on;
+	};
+
+	vcc_4g_5v: regulator-vcc-4g-5v {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc_4g_5v_en>;
+		regulator-name = "vcc_4g_5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vcc5v0_sys>;
+		regulator-always-on;
+	};
+
 	vcc1v8_codec: regulator-vcc1v8-codec {
 		compatible = "regulator-fixed";
 		enable-active-high;
@@ -264,6 +290,7 @@ rk818: pmic@1c {
 		system-power-controller;
 		wakeup-source;
 
+		boost-supply = <&vcc_sys>;
 		vcc1-supply = <&vcc_sys>;
 		vcc2-supply = <&vcc_sys>;
 		vcc3-supply = <&vcc_sys>;
@@ -318,6 +345,17 @@ regulator-state-mem {
 				};
 			};
 
+			vcc5v0_sys: DCDC_BOOST {
+				regulator-name = "vcc5v0_sys";
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <5000000>;
+				regulator-max-microvolt = <5000000>;
+				regulator-state-mem {
+					regulator-on-in-suspend;
+				};
+			};
+
 			vcca3v0_codec: LDO_REG1 {
 				regulator-name = "vcca3v0_codec";
 				regulator-min-microvolt = <3000000>;
@@ -702,6 +740,16 @@ blue_led_pin: blue-led-pin {
 		};
 	};
 
+	modem {
+		vcc_4g_5v_en: vcc-4g-5v-en-pin {
+			rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		vcc_4g_en: vcc-4g-en-pin {
+			rockchip,pins = <4 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -827,6 +875,15 @@ &tsadc {
 	status = "okay";
 };
 
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_host {
+	phy-supply = <&vcc5v0_sys>;
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
@@ -852,6 +909,18 @@ &uart2 {
 	status = "okay";
 };
 
+&uart3 {
+	status = "okay";
+};
+
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
+
 &vopb {
 	status = "okay";
 	assigned-clocks = <&cru DCLK_VOP0_DIV>, <&cru DCLK_VOP0>,

-- 
2.55.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818
  2026-08-25  5:18 [PATCH v2 0/2] Pinephone Pro Connectivity: Adding Modem, Bluetooth, and Wi-Fi Rudraksha Gupta via B4 Relay
  2026-08-25  5:18 ` [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro Rudraksha Gupta via B4 Relay
@ 2026-08-25  5:18 ` Rudraksha Gupta via B4 Relay
  2026-08-25  5:22   ` sashiko-bot
  1 sibling, 1 reply; 5+ messages in thread
From: Rudraksha Gupta via B4 Relay @ 2026-08-25  5:18 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	Lee Jones, Michael Turquette, Stephen Boyd, Brian Masney
  Cc: devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
	Rudraksha Gupta, linux-clk, mfd, Martijn Braam

From: Martijn Braam <martijn@brixit.nl>

On the RK818 the CLK32KOUT2 pin is shared between the 32.768 kHz clock
output and a recovery function, selected by bit 1 of RK808_CLK32OUT_REG.
CLK32KOUT2_EN only takes effect on the clock function, so the output can
be enabled and still be silent. The datasheet resets the register to
zero, but that cannot be relied on: on the Pine64 PinePhone Pro it reads
0x03 once Linux is up, leaving the wifi and bluetooth without their
32.768 kHz reference.

Select the clock function when the output is prepared, so that it can
also be given back, and report the output as prepared only when it is
enabled and on the clock function. The bit is not defined on the other
variants, so give the RK818 its own clk_ops. Boards that never take the
clock are unaffected.

Based on an out-of-tree patch by Martijn Braam & Kamil Trzciński,
carried by Ondrej Jirman.

Signed-off-by: Martijn Braam <martijn@brixit.nl>
Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
---
 drivers/clk/clk-rk808.c   | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/mfd/rk808.h |  1 +
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c
index 5a75b5c91555..4aabe0234769 100644
--- a/drivers/clk/clk-rk808.c
+++ b/drivers/clk/clk-rk808.c
@@ -71,6 +71,49 @@ static const struct clk_ops rk808_clkout2_ops = {
 	.recalc_rate = rk808_clkout_recalc_rate,
 };
 
+static int rk818_clkout2_enable(struct clk_hw *hw, bool enable)
+{
+	struct rk808_clkout *rk808_clkout = container_of(hw,
+							 struct rk808_clkout,
+							 clkout2_hw);
+
+	return regmap_update_bits(rk808_clkout->regmap, RK808_CLK32OUT_REG,
+				  RK818_CLK32KOUT2_FUNC_MASK | CLK32KOUT2_EN,
+				  enable ? CLK32KOUT2_EN : 0);
+}
+
+static int rk818_clkout2_prepare(struct clk_hw *hw)
+{
+	return rk818_clkout2_enable(hw, true);
+}
+
+static void rk818_clkout2_unprepare(struct clk_hw *hw)
+{
+	rk818_clkout2_enable(hw, false);
+}
+
+static int rk818_clkout2_is_prepared(struct clk_hw *hw)
+{
+	struct rk808_clkout *rk808_clkout = container_of(hw,
+							 struct rk808_clkout,
+							 clkout2_hw);
+	u32 val;
+
+	int ret = regmap_read(rk808_clkout->regmap, RK808_CLK32OUT_REG, &val);
+
+	if (ret < 0)
+		return 0;
+
+	return (val & (RK818_CLK32KOUT2_FUNC_MASK | CLK32KOUT2_EN)) == CLK32KOUT2_EN;
+}
+
+static const struct clk_ops rk818_clkout2_ops = {
+	.prepare = rk818_clkout2_prepare,
+	.unprepare = rk818_clkout2_unprepare,
+	.is_prepared = rk818_clkout2_is_prepared,
+	.recalc_rate = rk808_clkout_recalc_rate,
+};
+
 static struct clk_hw *
 of_clk_rk808_get(struct of_phandle_args *clkspec, void *data)
 {
@@ -134,11 +177,12 @@ static const struct clk_ops *rkpmic_get_ops(long variant)
 	case RK809_ID:
 	case RK817_ID:
 		return &rk817_clkout2_ops;
+	case RK818_ID:
+		return &rk818_clkout2_ops;
 	/*
 	 * For the default case, it match the following PMIC type.
 	 * RK805_ID
 	 * RK808_ID
-	 * RK818_ID
 	 */
 	default:
 		return &rk808_clkout2_ops;
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index 7ffc904c864c..e3cb586d34a0 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -1051,6 +1051,7 @@ enum rk806_dvs_mode {
 
 #define VOUT_LO_INT	BIT(0)
 #define CLK32KOUT2_EN	BIT(0)
+#define RK818_CLK32KOUT2_FUNC_MASK	BIT(1)
 
 #define TEMP105C			0x08
 #define TEMP115C			0x0c

-- 
2.55.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818
  2026-08-25  5:18 ` [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818 Rudraksha Gupta via B4 Relay
@ 2026-08-25  5:22   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-08-25  5:22 UTC (permalink / raw)
  To: Rudraksha Gupta; +Cc: linux-clk, mfd, lee, devicetree, robh, conor+dt

> From: Martijn Braam <martijn@brixit.nl>
> 
> On the RK818 the CLK32KOUT2 pin is shared between the 32.768 kHz clock
> output and a recovery function, selected by bit 1 of RK808_CLK32OUT_REG.
> CLK32KOUT2_EN only takes effect on the clock function, so the output can
> be enabled and still be silent. The datasheet resets the register to
> zero, but that cannot be relied on: on the Pine64 PinePhone Pro it reads
> 0x03 once Linux is up, leaving the wifi and bluetooth without their
> 32.768 kHz reference.
> 
> Select the clock function when the output is prepared, so that it can
> also be given back, and report the output as prepared only when it is
> enabled and on the clock function. The bit is not defined on the other
> variants, so give the RK818 its own clk_ops. Boards that never take the
> clock are unaffected.
> 
> Based on an out-of-tree patch by Martijn Braam & Kamil Trzciński,
> carried by Ondrej Jirman.
> 
> Signed-off-by: Martijn Braam <martijn@brixit.nl>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-ppp_connectivity-v2-0-a4b0e11cd62c@gmail.com?part=2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro
  2026-08-25  5:18 ` [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro Rudraksha Gupta via B4 Relay
@ 2026-08-25  5:24   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-08-25  5:24 UTC (permalink / raw)
  To: Rudraksha Gupta; +Cc: linux-clk, lee, devicetree, conor+dt, mfd, robh

> From: Martijn Braam <martijn@brixit.nl>
> 
> The Quectel EG25-G modem is soldered to the board. It sits on the USB 2.0
> host controller behind u2phy1, with uart3 as its AT command port, and
> draws from two switched rails: vcc_4g_5v off the RK818 boost, and vcc_4g
> off vcc_sys.
> 
> Neither rail supplies anything but the modem, which has to stay powered
> for the board to work as a phone, so both are always-on.
> 
> The modem itself has no binding and no in-kernel driver, so it is not
> described here; its control lines are driven from userspace.
> 
> Based on work by Martijn Braam, Kamil Trzciński, Ondrej Jirman and Dang
> Huynh.
> 
> Signed-off-by: Martijn Braam <martijn@brixit.nl>
> Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824-ppp_connectivity-v2-0-a4b0e11cd62c@gmail.com?part=1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-25  5:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  5:18 [PATCH v2 0/2] Pinephone Pro Connectivity: Adding Modem, Bluetooth, and Wi-Fi Rudraksha Gupta via B4 Relay
2026-08-25  5:18 ` [PATCH v2 1/2] arm64: dts: rockchip: Enable the EG25-G modem on the Pinephone Pro Rudraksha Gupta via B4 Relay
2026-08-25  5:24   ` sashiko-bot
2026-08-25  5:18 ` [PATCH v2 2/2] clk: rk808: Select the clock function of CLK32KOUT2 on the RK818 Rudraksha Gupta via B4 Relay
2026-08-25  5:22   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox