public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration
@ 2026-01-08  6:42 Troy Mitchell
  2026-01-08  6:42 ` [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property Troy Mitchell
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Troy Mitchell @ 2026-01-08  6:42 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Linus Walleij
  Cc: devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio,
	Troy Mitchell

This series adds support for configuring IO power domain voltage for
dual-voltage GPIO banks on the Spacemit K1 SoC.

On K1, IO domain power control registers determine whether a GPIO bank
operates at 1.8V or 3.3V. These registers default to 3.3V operation,
which may lead to functional failures when GPIO banks are externally
supplied with 1.8V but internally remain configured for 3.3V.

The IO power domain registers are implemented as secure registers and
require an explicit unlock sequence via the AIB Secure Access Register
(ASAR), located in the APBC register space.

This series ensures that pin voltage configuration correctly reflects
hardware requirements.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Troy Mitchell (3):
      dt-bindings: pinctrl: spacemit: add syscon property
      pinctrl: spacemit: support I/O power domain configuration
      riscv: dts: spacemit: modify pinctrl node in dtsi

 .../bindings/pinctrl/spacemit,k1-pinctrl.yaml      |   5 +
 arch/riscv/boot/dts/spacemit/k1.dtsi               |   3 +-
 drivers/pinctrl/spacemit/pinctrl-k1.c              | 129 ++++++++++++++++++++-
 3 files changed, 133 insertions(+), 4 deletions(-)
---
base-commit: 168d19e604855cfa6024e9854f8ea9b1c8efa2d9
change-id: 20251223-kx-pinctrl-aib-io-pwr-domain-b02da255f95c

Best regards,
-- 
Troy Mitchell <troy.mitchell@linux.spacemit.com>


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

* [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property
  2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
@ 2026-01-08  6:42 ` Troy Mitchell
  2026-01-15 16:02   ` Rob Herring (Arm)
  2026-01-08  6:42 ` [PATCH v2 2/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Troy Mitchell @ 2026-01-08  6:42 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Linus Walleij
  Cc: devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio,
	Troy Mitchell

In order to access the protected IO power domain registers, a valid
unlock sequence must be performed by writing the required keys to the
AIB Secure Access Register (ASAR).

The ASAR register resides within the APBC register address space.
A corresponding syscon property is added to allow the pinctrl driver
to access this register.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changelog in v2:
- add `spacemmit` prefix in the subject
- remove offset in syscon property
- remove `spacemit,apbc` property in required
- Link to v1: https://lore.kernel.org/spacemit/20260108042753-GYA2796@gentoo.org/T/#m2ab46cd63cbb1b110eb317ee5b9d540d39cbd82b
---
 Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml
index 9a76cffcbaee8eb465ebaad3f92c929c2a6815db..141dcedb81fba31bcad39b2fa267224b84ba0535 100644
--- a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml
@@ -32,6 +32,10 @@ properties:
   resets:
     maxItems: 1
 
+  spacemit,apbc:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Phandle to syscon that access the protected register
+
 patternProperties:
   '-cfg$':
     type: object
@@ -138,6 +142,7 @@ examples:
             clocks = <&syscon_apbc 42>,
                      <&syscon_apbc 94>;
             clock-names = "func", "bus";
+            spacemit,apbc = <&syscon_apbc>;
 
             uart0_2_cfg: uart0-2-cfg {
                 uart0-2-pins {

-- 
2.52.0


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

* [PATCH v2 2/3] pinctrl: spacemit: support I/O power domain configuration
  2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
  2026-01-08  6:42 ` [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property Troy Mitchell
@ 2026-01-08  6:42 ` Troy Mitchell
  2026-01-08  6:42 ` [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi Troy Mitchell
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Troy Mitchell @ 2026-01-08  6:42 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Linus Walleij
  Cc: devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio,
	Troy Mitchell

Dual-voltage GPIO banks default to 3.3V operation. Even when a bank is
externally supplied with 1.8V, the internal logic remains in the 3.3V
domain, leading to functional failures.

Add support for programming the IO domain power control registers to
allow explicit configuration for 1.8V operation.

These registers are secure due to hardware safety constraints.
Specifically, configuring the domain for 1.8V while externally supplying
3.3V causes back-powering and potential pin damage. Consequently, access
requires unlocking the AIB Secure Access Register (ASAR) in the APBC
block before any read or write operation.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
Changelog in v2:
- drop the offset argument from 'spacemit,apbc' property parsing
- make the syscon optional: disable voltage switching feature instead of failing probe if syscon is missing
- modify commit msg
- remove changes to dts
- remove io_pd_reg
- Link to v1: https://lore.kernel.org/spacemit/20260108042753-GYA2796@gentoo.org/T/#m256523b10c85dacd179b42ef42ae83c3b7b9699f
---
 drivers/pinctrl/spacemit/pinctrl-k1.c | 129 +++++++++++++++++++++++++++++++++-
 1 file changed, 126 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/spacemit/pinctrl-k1.c b/drivers/pinctrl/spacemit/pinctrl-k1.c
index 07267c5f0f4453bcdf5eb2d267eb3148a18bd038..71390402aaa63362706ace9e72c6d506c49e196d 100644
--- a/drivers/pinctrl/spacemit/pinctrl-k1.c
+++ b/drivers/pinctrl/spacemit/pinctrl-k1.c
@@ -7,8 +7,10 @@
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 
@@ -47,6 +49,27 @@
 #define PAD_PULLUP		BIT(14)
 #define PAD_PULL_EN		BIT(15)
 
+#define IO_PWR_DOMAIN_OFFSET	0x800
+
+#define IO_PWR_DOMAIN_GPIO2_Kx  0x0c
+#define IO_PWR_DOMAIN_MMC_Kx    0x1c
+
+#define IO_PWR_DOMAIN_GPIO3_K1  0x10
+#define IO_PWR_DOMAIN_QSPI_K1   0x20
+
+#define IO_PWR_DOMAIN_GPIO1_K3  0x04
+#define IO_PWR_DOMAIN_GPIO5_K3  0x10
+#define IO_PWR_DOMAIN_GPIO4_K3  0x20
+#define IO_PWR_DOMAIN_QSPI_K3   0x2c
+
+#define IO_PWR_DOMAIN_V18EN	BIT(2)
+
+#define APBC_ASFAR		0x50
+#define APBC_ASSAR		0x54
+
+#define APBC_ASFAR_AKEY		0xbaba
+#define APBC_ASSAR_AKEY		0xeb10
+
 struct spacemit_pin_drv_strength {
 	u8		val;
 	u32		mA;
@@ -78,6 +101,8 @@ struct spacemit_pinctrl {
 	raw_spinlock_t				lock;
 
 	void __iomem				*regs;
+
+	struct regmap				*regmap_apbc;
 };
 
 struct spacemit_pinctrl_data {
@@ -85,6 +110,7 @@ struct spacemit_pinctrl_data {
 	const struct spacemit_pin	*data;
 	u16				npins;
 	unsigned int			(*pin_to_offset)(unsigned int pin);
+	unsigned int			(*pin_to_io_pd_offset)(unsigned int pin);
 	const struct spacemit_pinctrl_dconf	*dconf;
 };
 
@@ -146,6 +172,56 @@ static unsigned int spacemit_k3_pin_to_offset(unsigned int pin)
 	return offset << 2;
 }
 
+static unsigned int spacemit_k1_pin_to_io_pd_offset(unsigned int pin)
+{
+	unsigned int offset = 0;
+
+	switch (pin) {
+	case 47 ... 52:
+		offset = IO_PWR_DOMAIN_GPIO3_K1;
+		break;
+	case 75 ... 80:
+		offset = IO_PWR_DOMAIN_GPIO2_Kx;
+		break;
+	case 98 ... 103:
+		offset = IO_PWR_DOMAIN_QSPI_K1;
+		break;
+	case 104 ... 109:
+		offset = IO_PWR_DOMAIN_MMC_Kx;
+		break;
+	}
+
+	return offset;
+}
+
+static unsigned int spacemit_k3_pin_to_io_pd_offset(unsigned int pin)
+{
+	unsigned int offset = 0;
+
+	switch (pin) {
+	case 0 ... 20:
+		offset = IO_PWR_DOMAIN_GPIO1_K3;
+		break;
+	case 21 ... 41:
+		offset = IO_PWR_DOMAIN_GPIO2_Kx;
+		break;
+	case 76 ... 98:
+		offset = IO_PWR_DOMAIN_GPIO4_K3;
+		break;
+	case 99 ... 127:
+		offset = IO_PWR_DOMAIN_GPIO5_K3;
+		break;
+	case 132 ... 137:
+		offset = IO_PWR_DOMAIN_MMC_Kx;
+		break;
+	case 138 ... 144:
+		offset = IO_PWR_DOMAIN_QSPI_K3;
+		break;
+	}
+
+	return offset;
+}
+
 static inline void __iomem *spacemit_pin_to_reg(struct spacemit_pinctrl *pctrl,
 						unsigned int pin)
 {
@@ -365,6 +441,42 @@ static int spacemit_pctrl_check_power(struct pinctrl_dev *pctldev,
 	return 0;
 }
 
+static void spacemit_set_io_pwr_domain(struct spacemit_pinctrl *pctrl,
+				      const struct spacemit_pin *spin,
+				      const enum spacemit_pin_io_type type)
+{
+	u32 offset, val = 0;
+
+	if (!pctrl->regmap_apbc)
+		return;
+
+	offset = pctrl->data->pin_to_io_pd_offset(spin->pin);
+
+	/* Other bits are reserved so don't need to save them */
+	if (type == IO_TYPE_1V8)
+		val = IO_PWR_DOMAIN_V18EN;
+
+	/*
+	 * IO power domain registers are protected and cannot be accessed
+	 * directly. Before performing any read or write to the IO power
+	 * domain registers, an explicit unlock sequence must be issued
+	 * via the AIB Secure Access Register (ASAR).
+	 *
+	 * The unlock sequence allows exactly one subsequent access to the
+	 * IO power domain registers. After that access completes, the ASAR
+	 * keys are automatically cleared, and the registers become locked
+	 * again.
+	 *
+	 * This mechanism ensures that IO power domain configuration is
+	 * performed intentionally, as incorrect voltage settings may
+	 * result in functional failures or hardware damage.
+	 */
+	regmap_write(pctrl->regmap_apbc, APBC_ASFAR, APBC_ASFAR_AKEY);
+	regmap_write(pctrl->regmap_apbc, APBC_ASSAR, APBC_ASSAR_AKEY);
+
+	writel_relaxed(val, pctrl->regs + IO_PWR_DOMAIN_OFFSET + offset);
+}
+
 static int spacemit_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
 					 struct device_node *np,
 					 struct pinctrl_map **maps,
@@ -572,7 +684,8 @@ static int spacemit_pinconf_get(struct pinctrl_dev *pctldev,
 
 #define ENABLE_DRV_STRENGTH	BIT(1)
 #define ENABLE_SLEW_RATE	BIT(2)
-static int spacemit_pinconf_generate_config(const struct spacemit_pin *spin,
+static int spacemit_pinconf_generate_config(struct spacemit_pinctrl *pctrl,
+					    const struct spacemit_pin *spin,
 					    const struct spacemit_pinctrl_dconf *dconf,
 					    unsigned long *configs,
 					    unsigned int num_configs,
@@ -646,6 +759,7 @@ static int spacemit_pinconf_generate_config(const struct spacemit_pin *spin,
 			default:
 				return -EINVAL;
 			}
+			spacemit_set_io_pwr_domain(pctrl, spin, type);
 		}
 
 		val = spacemit_get_driver_strength(type, dconf, drv_strength);
@@ -701,7 +815,7 @@ static int spacemit_pinconf_set(struct pinctrl_dev *pctldev,
 	const struct spacemit_pin *spin = spacemit_get_pin(pctrl, pin);
 	u32 value;
 
-	if (spacemit_pinconf_generate_config(spin, pctrl->data->dconf,
+	if (spacemit_pinconf_generate_config(pctrl, spin, pctrl->data->dconf,
 					     configs, num_configs, &value))
 		return -EINVAL;
 
@@ -724,7 +838,7 @@ static int spacemit_pinconf_group_set(struct pinctrl_dev *pctldev,
 		return -EINVAL;
 
 	spin = spacemit_get_pin(pctrl, group->grp.pins[0]);
-	if (spacemit_pinconf_generate_config(spin, pctrl->data->dconf,
+	if (spacemit_pinconf_generate_config(pctrl, spin, pctrl->data->dconf,
 					     configs, num_configs, &value))
 		return -EINVAL;
 
@@ -795,6 +909,7 @@ static const struct pinconf_ops spacemit_pinconf_ops = {
 
 static int spacemit_pinctrl_probe(struct platform_device *pdev)
 {
+	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 	struct spacemit_pinctrl *pctrl;
 	struct clk *func_clk, *bus_clk;
@@ -816,6 +931,12 @@ static int spacemit_pinctrl_probe(struct platform_device *pdev)
 	if (IS_ERR(pctrl->regs))
 		return PTR_ERR(pctrl->regs);
 
+	pctrl->regmap_apbc = syscon_regmap_lookup_by_phandle(np, "spacemit,apbc");
+	if (IS_ERR(pctrl->regmap_apbc)) {
+		dev_warn(dev, "no syscon found, disable power voltage switch functionality\n");
+		pctrl->regmap_apbc = NULL;
+	}
+
 	func_clk = devm_clk_get_enabled(dev, "func");
 	if (IS_ERR(func_clk))
 		return dev_err_probe(dev, PTR_ERR(func_clk), "failed to get func clock\n");
@@ -1118,6 +1239,7 @@ static const struct spacemit_pinctrl_data k1_pinctrl_data = {
 	.data = k1_pin_data,
 	.npins = ARRAY_SIZE(k1_pin_desc),
 	.pin_to_offset = spacemit_k1_pin_to_offset,
+	.pin_to_io_pd_offset = spacemit_k1_pin_to_io_pd_offset,
 	.dconf = &k1_drive_conf,
 };
 
@@ -1455,6 +1577,7 @@ static const struct spacemit_pinctrl_data k3_pinctrl_data = {
 	.data = k3_pin_data,
 	.npins = ARRAY_SIZE(k3_pin_desc),
 	.pin_to_offset = spacemit_k3_pin_to_offset,
+	.pin_to_io_pd_offset = spacemit_k3_pin_to_io_pd_offset,
 	.dconf = &k3_drive_conf,
 };
 

-- 
2.52.0


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

* [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi
  2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
  2026-01-08  6:42 ` [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property Troy Mitchell
  2026-01-08  6:42 ` [PATCH v2 2/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
@ 2026-01-08  6:42 ` Troy Mitchell
  2026-01-08  7:37   ` Yixun Lan
  2026-01-19 23:53   ` Linus Walleij
  2026-01-19 23:52 ` [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Linus Walleij
  2026-01-20  0:55 ` (subset) " Yixun Lan
  4 siblings, 2 replies; 11+ messages in thread
From: Troy Mitchell @ 2026-01-08  6:42 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Linus Walleij
  Cc: devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio,
	Troy Mitchell

Change the size of the reg register to 0x1000 to match the hardware.
This register range covers the IO power domain's register addresses.

The IO power domain registers are protected. In order to access the
protected IO power domain registers, a valid unlock sequence must be
performed by writing the required keys to the AIB Secure Access Register
(ASAR).

The ASAR register resides within the APBC register address space.
A corresponding syscon property `spacemit,apbc` is added to allow
the pinctrl driver to access this register.

Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
 arch/riscv/boot/dts/spacemit/k1.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index 7818ca4979b6a7755722919a5958512aa11950ab..f05429723d1bbbd718941549782461c49196ecef 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -565,10 +565,11 @@ i2c8: i2c@d401d800 {
 
 		pinctrl: pinctrl@d401e000 {
 			compatible = "spacemit,k1-pinctrl";
-			reg = <0x0 0xd401e000 0x0 0x400>;
+			reg = <0x0 0xd401e000 0x0 0x1000>;
 			clocks = <&syscon_apbc CLK_AIB>,
 				 <&syscon_apbc CLK_AIB_BUS>;
 			clock-names = "func", "bus";
+			spacemit,apbc = <&syscon_apbc>;
 		};
 
 		pwm8: pwm@d4020000 {

-- 
2.52.0


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

* Re: [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi
  2026-01-08  6:42 ` [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi Troy Mitchell
@ 2026-01-08  7:37   ` Yixun Lan
  2026-01-09  1:31     ` Troy Mitchell
  2026-01-19 23:53   ` Linus Walleij
  1 sibling, 1 reply; 11+ messages in thread
From: Yixun Lan @ 2026-01-08  7:37 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Linus Walleij,
	devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio

Hi Troy,

  if there is one more iteration, I'd suggest to adjust the patch titile, 
to make it slightly more specific

  riscv: dts: spacemit: pinctrl: update register and IO power

On 14:42 Thu 08 Jan     , Troy Mitchell wrote:
> Change the size of the reg register to 0x1000 to match the hardware.
> This register range covers the IO power domain's register addresses.
> 
> The IO power domain registers are protected. In order to access the
> protected IO power domain registers, a valid unlock sequence must be
> performed by writing the required keys to the AIB Secure Access Register
> (ASAR).
> 
> The ASAR register resides within the APBC register address space.
> A corresponding syscon property `spacemit,apbc` is added to allow
> the pinctrl driver to access this register.
> 
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> ---
>  arch/riscv/boot/dts/spacemit/k1.dtsi | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index 7818ca4979b6a7755722919a5958512aa11950ab..f05429723d1bbbd718941549782461c49196ecef 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -565,10 +565,11 @@ i2c8: i2c@d401d800 {
>  
>  		pinctrl: pinctrl@d401e000 {
>  			compatible = "spacemit,k1-pinctrl";
> -			reg = <0x0 0xd401e000 0x0 0x400>;
> +			reg = <0x0 0xd401e000 0x0 0x1000>;
>  			clocks = <&syscon_apbc CLK_AIB>,
>  				 <&syscon_apbc CLK_AIB_BUS>;
>  			clock-names = "func", "bus";
> +			spacemit,apbc = <&syscon_apbc>;
>  		};
>  
>  		pwm8: pwm@d4020000 {
> 
> -- 
> 2.52.0
> 

-- 
Yixun Lan (dlan)

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

* Re: [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi
  2026-01-08  7:37   ` Yixun Lan
@ 2026-01-09  1:31     ` Troy Mitchell
  0 siblings, 0 replies; 11+ messages in thread
From: Troy Mitchell @ 2026-01-09  1:31 UTC (permalink / raw)
  To: Yixun Lan, Troy Mitchell
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Linus Walleij,
	devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio

On Thu, Jan 08, 2026 at 03:37:22PM +0800, Yixun Lan wrote:
> Hi Troy,
> 
>   if there is one more iteration, I'd suggest to adjust the patch titile, 
> to make it slightly more specific
> 
>   riscv: dts: spacemit: pinctrl: update register and IO power
Thanks for you pointing it out.
I'll use it if there is one more interation.

But I just want to confirm, if there are no further iterations,
you will be making the title change before applying it to your tree, right?

                              - Troy

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

* Re: [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property
  2026-01-08  6:42 ` [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property Troy Mitchell
@ 2026-01-15 16:02   ` Rob Herring (Arm)
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring (Arm) @ 2026-01-15 16:02 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Krzysztof Kozlowski, Conor Dooley, linux-kernel, linux-gpio,
	linux-riscv, Linus Walleij, Yixun Lan, devicetree, Albert Ou,
	Palmer Dabbelt, Alexandre Ghiti, Paul Walmsley, spacemit


On Thu, 08 Jan 2026 14:42:38 +0800, Troy Mitchell wrote:
> In order to access the protected IO power domain registers, a valid
> unlock sequence must be performed by writing the required keys to the
> AIB Secure Access Register (ASAR).
> 
> The ASAR register resides within the APBC register address space.
> A corresponding syscon property is added to allow the pinctrl driver
> to access this register.
> 
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> ---
> Changelog in v2:
> - add `spacemmit` prefix in the subject
> - remove offset in syscon property
> - remove `spacemit,apbc` property in required
> - Link to v1: https://lore.kernel.org/spacemit/20260108042753-GYA2796@gentoo.org/T/#m2ab46cd63cbb1b110eb317ee5b9d540d39cbd82b
> ---
>  Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration
  2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
                   ` (2 preceding siblings ...)
  2026-01-08  6:42 ` [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi Troy Mitchell
@ 2026-01-19 23:52 ` Linus Walleij
  2026-01-20  0:31   ` Yixun Lan
  2026-01-20  0:55 ` (subset) " Yixun Lan
  4 siblings, 1 reply; 11+ messages in thread
From: Linus Walleij @ 2026-01-19 23:52 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio

On Thu, Jan 8, 2026 at 7:43 AM Troy Mitchell
<troy.mitchell@linux.spacemit.com> wrote:

> This series adds support for configuring IO power domain voltage for
> dual-voltage GPIO banks on the Spacemit K1 SoC.
>
> On K1, IO domain power control registers determine whether a GPIO bank
> operates at 1.8V or 3.3V. These registers default to 3.3V operation,
> which may lead to functional failures when GPIO banks are externally
> supplied with 1.8V but internally remain configured for 3.3V.
>
> The IO power domain registers are implemented as secure registers and
> require an explicit unlock sequence via the AIB Secure Access Register
> (ASAR), located in the APBC register space.
>
> This series ensures that pin voltage configuration correctly reflects
> hardware requirements.
>
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

Excellent work in this patch series Troy!

> Troy Mitchell (3):
>       dt-bindings: pinctrl: spacemit: add syscon property
>       pinctrl: spacemit: support I/O power domain configuration

These two patches applied to the pin control tree.

>       riscv: dts: spacemit: modify pinctrl node in dtsi

Please funnel this one through the SoC tree.

Yours,
Linus Walleij

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

* Re: [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi
  2026-01-08  6:42 ` [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi Troy Mitchell
  2026-01-08  7:37   ` Yixun Lan
@ 2026-01-19 23:53   ` Linus Walleij
  1 sibling, 0 replies; 11+ messages in thread
From: Linus Walleij @ 2026-01-19 23:53 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio

On Thu, Jan 8, 2026 at 7:43 AM Troy Mitchell
<troy.mitchell@linux.spacemit.com> wrote:

> Change the size of the reg register to 0x1000 to match the hardware.
> This register range covers the IO power domain's register addresses.
>
> The IO power domain registers are protected. In order to access the
> protected IO power domain registers, a valid unlock sequence must be
> performed by writing the required keys to the AIB Secure Access Register
> (ASAR).
>
> The ASAR register resides within the APBC register address space.
> A corresponding syscon property `spacemit,apbc` is added to allow
> the pinctrl driver to access this register.
>
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>

Acked-by: Linus Walleij <linusw@kernel.org>

I have applied patches 1 & 2 in the series.

Yours,
Linus Walleij

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

* Re: [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration
  2026-01-19 23:52 ` [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Linus Walleij
@ 2026-01-20  0:31   ` Yixun Lan
  0 siblings, 0 replies; 11+ messages in thread
From: Yixun Lan @ 2026-01-20  0:31 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Troy Mitchell, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	devicetree, linux-riscv, spacemit, linux-kernel, linux-gpio

Hi Linus,

On 00:52 Tue 20 Jan     , Linus Walleij wrote:
> On Thu, Jan 8, 2026 at 7:43 AM Troy Mitchell
> <troy.mitchell@linux.spacemit.com> wrote:
> 
> > This series adds support for configuring IO power domain voltage for
> > dual-voltage GPIO banks on the Spacemit K1 SoC.
> >
> > On K1, IO domain power control registers determine whether a GPIO bank
> > operates at 1.8V or 3.3V. These registers default to 3.3V operation,
> > which may lead to functional failures when GPIO banks are externally
> > supplied with 1.8V but internally remain configured for 3.3V.
> >
> > The IO power domain registers are implemented as secure registers and
> > require an explicit unlock sequence via the AIB Secure Access Register
> > (ASAR), located in the APBC register space.
> >
> > This series ensures that pin voltage configuration correctly reflects
> > hardware requirements.
> >
> > Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> 
> Excellent work in this patch series Troy!
> 
> > Troy Mitchell (3):
> >       dt-bindings: pinctrl: spacemit: add syscon property
> >       pinctrl: spacemit: support I/O power domain configuration
> 
> These two patches applied to the pin control tree.
> 
> >       riscv: dts: spacemit: modify pinctrl node in dtsi
> 
> Please funnel this one through the SoC tree.
> 
Thanks, I will take care of this

> Yours,
> Linus Walleij
> 

-- 
Yixun Lan (dlan)

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

* Re: (subset) [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration
  2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
                   ` (3 preceding siblings ...)
  2026-01-19 23:52 ` [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Linus Walleij
@ 2026-01-20  0:55 ` Yixun Lan
  4 siblings, 0 replies; 11+ messages in thread
From: Yixun Lan @ 2026-01-20  0:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Yixun Lan,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Linus Walleij, Troy Mitchell
  Cc: Yixun Lan, devicetree, linux-riscv, spacemit, linux-kernel,
	linux-gpio


On Thu, 08 Jan 2026 14:42:37 +0800, Troy Mitchell wrote:
> This series adds support for configuring IO power domain voltage for
> dual-voltage GPIO banks on the Spacemit K1 SoC.
> 
> On K1, IO domain power control registers determine whether a GPIO bank
> operates at 1.8V or 3.3V. These registers default to 3.3V operation,
> which may lead to functional failures when GPIO banks are externally
> supplied with 1.8V but internally remain configured for 3.3V.
> 
> [...]

Applied, thanks!

[3/3] riscv: dts: spacemit: modify pinctrl node in dtsi
      https://github.com/spacemit-com/linux/commit/cf54626b0ecce137379d1a8f1e6f0fa5b36d0395

Best regards,
-- 
Yixun Lan <dlan@kernel.org>

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

end of thread, other threads:[~2026-01-20  0:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08  6:42 [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
2026-01-08  6:42 ` [PATCH v2 1/3] dt-bindings: pinctrl: spacemit: add syscon property Troy Mitchell
2026-01-15 16:02   ` Rob Herring (Arm)
2026-01-08  6:42 ` [PATCH v2 2/3] pinctrl: spacemit: support I/O power domain configuration Troy Mitchell
2026-01-08  6:42 ` [PATCH v2 3/3] riscv: dts: spacemit: modify pinctrl node in dtsi Troy Mitchell
2026-01-08  7:37   ` Yixun Lan
2026-01-09  1:31     ` Troy Mitchell
2026-01-19 23:53   ` Linus Walleij
2026-01-19 23:52 ` [PATCH v2 0/3] pinctrl: spacemit: support I/O power domain configuration Linus Walleij
2026-01-20  0:31   ` Yixun Lan
2026-01-20  0:55 ` (subset) " Yixun Lan

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