* [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl
@ 2025-05-21 3:19 Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7 Xianwei Zhao via B4 Relay
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
In some Amlogic SoCs, to save register space or due to some
abnormal arrangements, two sets of pins share one mux register.
A group starting from pin0 is the main pin group, which acquires
the register address through DTS and has management permissions,
but the register bit offset is undetermined.
Another GPIO group as a subordinate group. Some pins mux use share
register and bit offset from bit0 . But this group do not have
register management permissions.
In SoC S7 and S7D, GPIOX(16~19) mux share with GPIOCC mux register.
In SoC S6, GPIOX(16~19) mux share with GPIOCC mux register, and GPIOD(6)
mux share with GPIOF mux register.
Add S7/S7D/S6 pinctrl compatible string and device node.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
Changes in v2:
- Add a unit address for pinctrl node.
- Use pointer instead of flexible array to solve the problem tested by kernel test robot.
- Link to v1: https://lore.kernel.org/r/20250514-s6-s7-pinctrl-v1-0-39d368cad250@amlogic.com
---
Xianwei Zhao (8):
dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7
dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D
dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6
pinctrl: meson: a4: remove special data processing
pinctrl: meson: support amlogic S6/S7/S7D SoC
dts: arm64: amlogic: add S7 pinctrl node
dts: arm64: amlogic: add S7D pinctrl node
dts: arm64: amlogic: add S6 pinctrl node
.../bindings/pinctrl/amlogic,pinctrl-a4.yaml | 9 +-
arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi | 97 +++++++++++++++++
arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi | 81 ++++++++++++++
arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi | 90 ++++++++++++++++
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 118 ++++++++++++++++-----
5 files changed, 370 insertions(+), 25 deletions(-)
---
base-commit: aa94665adc28f3fdc3de2979ac1e98bae961d6ca
change-id: 20250514-s6-s7-pinctrl-af1ebda88a4e
Best regards,
--
Xianwei Zhao <xianwei.zhao@amlogic.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
@ 2025-05-21 3:19 ` Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D Xianwei Zhao via B4 Relay
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Update dt-binding document for pinctrl of Amlogic S7.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
index c36b6fe377ad..8a6981e9f873 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
@@ -15,7 +15,9 @@ allOf:
properties:
compatible:
oneOf:
- - const: amlogic,pinctrl-a4
+ - enum:
+ - amlogic,pinctrl-a4
+ - amlogic,pinctrl-s7
- items:
- enum:
- amlogic,pinctrl-a5
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7 Xianwei Zhao via B4 Relay
@ 2025-05-21 3:19 ` Xianwei Zhao via B4 Relay
2025-05-21 9:15 ` Krzysztof Kozlowski
2025-05-21 3:19 ` [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6 Xianwei Zhao via B4 Relay
` (5 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Update dt-binding document for pinctrl of Amlogic S7D SoC.
Amlogic S7D SoCs uses the same pintrl controller as S7 SoCs. There is
no need for an extra compatible line in the driver, but add S7D
compatible line for documentation.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
index 8a6981e9f873..96a7c5646c13 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
@@ -22,6 +22,10 @@ properties:
- enum:
- amlogic,pinctrl-a5
- const: amlogic,pinctrl-a4
+ - items:
+ - enum:
+ - amlogic,pinctrl-s7d
+ - const: amlogic,pinctrl-s7
"#address-cells":
const: 2
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7 Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D Xianwei Zhao via B4 Relay
@ 2025-05-21 3:19 ` Xianwei Zhao via B4 Relay
2025-05-21 9:16 ` Krzysztof Kozlowski
2025-05-21 3:19 ` [PATCH v2 4/8] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
` (4 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Update dt-binding document for pinctrl of Amlogic S6 SoC.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
index 96a7c5646c13..61a4685f9748 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
@@ -17,6 +17,7 @@ properties:
oneOf:
- enum:
- amlogic,pinctrl-a4
+ - amlogic,pinctrl-s6
- amlogic,pinctrl-s7
- items:
- enum:
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/8] pinctrl: meson: a4: remove special data processing
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (2 preceding siblings ...)
2025-05-21 3:19 ` [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6 Xianwei Zhao via B4 Relay
@ 2025-05-21 3:19 ` Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 5/8] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
According to the data specifications of Amlogic's existing SoCs,
the function register offset and the bit offset are the same
value among various chips. Therefore, general processing can
be carried out without the need for private data modification.
Drop special data processing.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 33 +++---------------------------
1 file changed, 3 insertions(+), 30 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index a76f266b4b94..90d4d10ca10b 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -50,15 +50,8 @@ struct aml_pio_control {
u32 bit_offset[AML_NUM_REG];
};
-struct aml_reg_bit {
- u32 bank_id;
- u32 reg_offs[AML_NUM_REG];
- u32 bit_offs[AML_NUM_REG];
-};
-
struct aml_pctl_data {
unsigned int number;
- struct aml_reg_bit rb_offs[];
};
struct aml_pmx_func {
@@ -843,31 +836,11 @@ static const struct gpio_chip aml_gpio_template = {
static void init_bank_register_bit(struct aml_pinctrl *info,
struct aml_gpio_bank *bank)
{
- const struct aml_pctl_data *data = info->data;
- const struct aml_reg_bit *aml_rb;
- bool def_offs = true;
int i;
- if (data) {
- for (i = 0; i < data->number; i++) {
- aml_rb = &data->rb_offs[i];
- if (bank->bank_id == aml_rb->bank_id) {
- def_offs = false;
- break;
- }
- }
- }
-
- if (def_offs) {
- for (i = 0; i < AML_NUM_REG; i++) {
- bank->pc.reg_offset[i] = aml_def_regoffs[i];
- bank->pc.bit_offset[i] = 0;
- }
- } else {
- for (i = 0; i < AML_NUM_REG; i++) {
- bank->pc.reg_offset[i] = aml_rb->reg_offs[i];
- bank->pc.bit_offset[i] = aml_rb->bit_offs[i];
- }
+ for (i = 0; i < AML_NUM_REG; i++) {
+ bank->pc.reg_offset[i] = aml_def_regoffs[i];
+ bank->pc.bit_offset[i] = 0;
}
}
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 5/8] pinctrl: meson: support amlogic S6/S7/S7D SoC
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (3 preceding siblings ...)
2025-05-21 3:19 ` [PATCH v2 4/8] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
@ 2025-05-21 3:19 ` Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 6/8] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:19 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
In some Amlogic SoCs, to save register space or due to some
abnormal arrangements, two sets of pins share one mux register.
A group starting from pin0 is the main pin group, which acquires
the register address through DTS and has management permissions,
but the register bit offset is undetermined.
Another GPIO group as a subordinate group. Some pins mux use share
register and bit offset from bit0 . But this group do not have
register management permissions.
This submission implements this situation.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 101 ++++++++++++++++++++++++++++-
1 file changed, 99 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index 90d4d10ca10b..598c126ff62e 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -50,8 +50,23 @@ struct aml_pio_control {
u32 bit_offset[AML_NUM_REG];
};
+/*
+ * partial bank(subordinate) pins mux config use other bank(main) mux registgers
+ * m_bank_id: the main bank which pin_id from 0, but register bit not from bit 0
+ * m_bit_offs: bit offset the main bank mux register
+ * sid: start pin_id of subordinate bank
+ * eid: end pin_id of subordinate bank
+ */
+struct multi_mux {
+ unsigned int m_bank_id;
+ unsigned int m_bit_offs;
+ unsigned int sid;
+ unsigned int eid;
+};
+
struct aml_pctl_data {
unsigned int number;
+ const struct multi_mux *p_mux;
};
struct aml_pmx_func {
@@ -71,10 +86,12 @@ struct aml_gpio_bank {
struct gpio_chip gpio_chip;
struct aml_pio_control pc;
u32 bank_id;
+ u32 mux_bit_offs;
unsigned int pin_base;
struct regmap *reg_mux;
struct regmap *reg_gpio;
struct regmap *reg_ds;
+ const struct multi_mux *p_mux;
};
struct aml_pinctrl {
@@ -106,13 +123,46 @@ static const char *aml_bank_name[31] = {
"GPIOCC", "TEST_N", "ANALOG"
};
+const struct multi_mux multi_mux_s7[] = {
+ {
+ .m_bank_id = AMLOGIC_GPIO_CC,
+ .m_bit_offs = 24,
+ .sid = (AMLOGIC_GPIO_X << 8) + 16,
+ .eid = (AMLOGIC_GPIO_X << 8) + 19,
+ },
+};
+
+const struct aml_pctl_data s7_priv_data = {
+ .number = ARRAY_SIZE(multi_mux_s7),
+ .p_mux = multi_mux_s7,
+};
+
+const struct multi_mux multi_mux_s6[] = {
+ {
+ .m_bank_id = AMLOGIC_GPIO_CC,
+ .m_bit_offs = 24,
+ .sid = (AMLOGIC_GPIO_X << 8) + 16,
+ .eid = (AMLOGIC_GPIO_X << 8) + 19,
+ }, {
+ .m_bank_id = AMLOGIC_GPIO_F,
+ .m_bit_offs = 4,
+ .sid = (AMLOGIC_GPIO_D << 8) + 6,
+ .eid = (AMLOGIC_GPIO_D << 8) + 6,
+ },
+};
+
+const struct aml_pctl_data s6_priv_data = {
+ .number = ARRAY_SIZE(multi_mux_s6),
+ .p_mux = multi_mux_s6,
+};
+
static int aml_pmx_calc_reg_and_offset(struct pinctrl_gpio_range *range,
unsigned int pin, unsigned int *reg,
unsigned int *offset)
{
unsigned int shift;
- shift = (pin - range->pin_base) << 2;
+ shift = ((pin - range->pin_base) << 2) + *offset;
*reg = (shift / 32) * 4;
*offset = shift % 32;
@@ -124,9 +174,36 @@ static int aml_pctl_set_function(struct aml_pinctrl *info,
int pin_id, int func)
{
struct aml_gpio_bank *bank = gpio_chip_to_bank(range->gc);
+ unsigned int shift;
int reg;
- int offset;
+ int i;
+ unsigned int offset = bank->mux_bit_offs;
+ const struct multi_mux *p_mux;
+
+ /* peculiar mux reg set */
+ if (bank->p_mux) {
+ p_mux = bank->p_mux;
+ if (pin_id >= p_mux->sid && pin_id <= p_mux->eid) {
+ bank = NULL;
+ for (i = 0; i < info->nbanks; i++) {
+ if (info->banks[i].bank_id == p_mux->m_bank_id) {
+ bank = &info->banks[i];
+ break;
+ }
+ }
+
+ if (!bank || !bank->reg_mux)
+ return -EINVAL;
+
+ shift = (pin_id - p_mux->sid) << 2;
+ reg = (shift / 32) * 4;
+ offset = shift % 32;
+ return regmap_update_bits(bank->reg_mux, reg,
+ 0xf << offset, (func & 0xf) << offset);
+ }
+ }
+ /* normal mux reg set */
if (!bank->reg_mux)
return 0;
@@ -836,12 +913,30 @@ static const struct gpio_chip aml_gpio_template = {
static void init_bank_register_bit(struct aml_pinctrl *info,
struct aml_gpio_bank *bank)
{
+ const struct aml_pctl_data *data = info->data;
+ const struct multi_mux *p_mux;
int i;
for (i = 0; i < AML_NUM_REG; i++) {
bank->pc.reg_offset[i] = aml_def_regoffs[i];
bank->pc.bit_offset[i] = 0;
}
+
+ bank->mux_bit_offs = 0;
+
+ if (data) {
+ for (i = 0; i < data->number; i++) {
+ p_mux = &data->p_mux[i];
+ if (bank->bank_id == p_mux->m_bank_id) {
+ bank->mux_bit_offs = p_mux->m_bit_offs;
+ break;
+ }
+ if (p_mux->sid >> 8 == bank->bank_id) {
+ bank->p_mux = p_mux;
+ break;
+ }
+ }
+ }
}
static int aml_gpiolib_register_bank(struct aml_pinctrl *info,
@@ -1008,6 +1103,8 @@ static int aml_pctl_probe(struct platform_device *pdev)
static const struct of_device_id aml_pctl_of_match[] = {
{ .compatible = "amlogic,pinctrl-a4", },
+ { .compatible = "amlogic,pinctrl-s7", .data = &s7_priv_data, },
+ { .compatible = "amlogic,pinctrl-s6", .data = &s6_priv_data, },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, aml_pctl_dt_match);
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 6/8] dts: arm64: amlogic: add S7 pinctrl node
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (4 preceding siblings ...)
2025-05-21 3:19 ` [PATCH v2 5/8] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
@ 2025-05-21 3:20 ` Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 7/8] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 8/8] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:20 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Add pinctrl device to support Amlogic S7.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi | 81 +++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi
index f0c172681bd1..260918b37b9a 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-s7.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/amlogic,pinctrl.h>
/ {
cpus {
@@ -94,6 +95,86 @@ uart_b: serial@7a000 {
clock-names = "xtal", "pclk", "baud";
status = "disabled";
};
+
+ periphs_pinctrl: pinctrl@4000 {
+ compatible = "amlogic,pinctrl-s7";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges = <0x0 0x0 0x0 0x4000 0x0 0x340>;
+
+ gpioz: gpio@c0 {
+ reg = <0 0xc0 0 0x20>, <0 0x18 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_Z<<8) 13>;
+ };
+
+ gpiox: gpio@100 {
+ reg = <0 0x100 0 0x30>, <0 0xc 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_X<<8) 20>;
+ };
+
+ gpioh: gpio@140 {
+ reg = <0 0x140 0 0x20>, <0 0x2c 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_H<<8) 12>;
+ };
+
+ gpiod: gpio@180 {
+ reg = <0 0x180 0 0x20>, <0 0x40 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_D<<8) 12>;
+ };
+
+ gpioe: gpio@1c0 {
+ reg = <0 0x1c0 0 0x20>, <0 0x48 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_E<<8) 2>;
+ };
+
+ gpioc: gpio@200 {
+ reg = <0 0x200 0 0x20>, <0 0x24 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_C<<8) 8>;
+ };
+
+ gpiob: gpio@240 {
+ reg = <0 0x240 0 0x20>, <0 0x0 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_B<<8) 14>;
+ };
+
+ test_n: gpio@2c0 {
+ reg = <0 0x2c0 0 0x20>;
+ reg-names = "gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges =
+ <&periphs_pinctrl 0 (AMLOGIC_GPIO_TEST_N<<8) 1>;
+ };
+
+ gpiocc: gpio@300 {
+ reg = <0 0x300 0 0x20>, <0 0x14 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_CC<<8) 2>;
+ };
+ };
};
};
};
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 7/8] dts: arm64: amlogic: add S7D pinctrl node
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (5 preceding siblings ...)
2025-05-21 3:20 ` [PATCH v2 6/8] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
@ 2025-05-21 3:20 ` Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 8/8] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:20 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Add pinctrl device to support Amlogic S7D.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi | 90 ++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi
index e1099bc1535d..c4d260d5bb58 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-s7d.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/amlogic,pinctrl.h>
/ {
cpus {
@@ -94,6 +95,95 @@ uart_b: serial@7a000 {
clock-names = "xtal", "pclk", "baud";
status = "disabled";
};
+
+ periphs_pinctrl: pinctrl@4000 {
+ compatible = "amlogic,pinctrl-s7d",
+ "amlogic,pinctrl-s7";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges = <0x0 0x0 0x0 0x4000 0x0 0x340>;
+
+ gpioz: gpio@c0 {
+ reg = <0 0xc0 0 0x20>, <0 0x18 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_Z<<8) 13>;
+ };
+
+ gpiox: gpio@100 {
+ reg = <0 0x100 0 0x30>, <0 0xc 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_X<<8) 20>;
+ };
+
+ gpioh: gpio@140 {
+ reg = <0 0x140 0 0x20>, <0 0x2c 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_H<<8) 12>;
+ };
+
+ gpiod: gpio@180 {
+ reg = <0 0x180 0 0x20>, <0 0x40 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_D<<8) 5>;
+ };
+
+ gpioe: gpio@1c0 {
+ reg = <0 0x1c0 0 0x20>, <0 0x48 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_E<<8) 2>;
+ };
+
+ gpioc: gpio@200 {
+ reg = <0 0x200 0 0x20>, <0 0x24 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_C<<8) 8>;
+ };
+
+ gpiob: gpio@240 {
+ reg = <0 0x240 0 0x20>, <0 0x0 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_B<<8) 14>;
+ };
+
+ gpiodv: gpio@280 {
+ reg = <0 0x280 0 0x20>, <0 0x8 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_DV<<8) 7>;
+ };
+
+ test_n: gpio@2c0 {
+ reg = <0 0x2c0 0 0x20>;
+ reg-names = "gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges =
+ <&periphs_pinctrl 0 (AMLOGIC_GPIO_TEST_N<<8) 1>;
+ };
+
+ gpiocc: gpio@300 {
+ reg = <0 0x300 0 0x20>, <0 0x14 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_CC<<8) 2>;
+ };
+ };
};
};
};
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 8/8] dts: arm64: amlogic: add S6 pinctrl node
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (6 preceding siblings ...)
2025-05-21 3:20 ` [PATCH v2 7/8] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
@ 2025-05-21 3:20 ` Xianwei Zhao via B4 Relay
7 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-21 3:20 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel, Xianwei Zhao
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
Add pinctrl device to support Amlogic S6.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi | 97 +++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi
index a8c90245c42a..5f602f1170c0 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-s6.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/amlogic,pinctrl.h>
/ {
cpus {
#address-cells = <2>;
@@ -92,6 +93,102 @@ uart_b: serial@7a000 {
clock-names = "xtal", "pclk", "baud";
status = "disabled";
};
+
+ periphs_pinctrl: pinctrl@4000 {
+ compatible = "amlogic,pinctrl-s6";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges = <0x0 0x0 0x0 0x4000 0x0 0x340>;
+
+ gpioz: gpio@c0 {
+ reg = <0 0xc0 0 0x20>, <0 0x18 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_Z<<8) 16>;
+ };
+
+ gpiox: gpio@100 {
+ reg = <0 0x100 0 0x30>, <0 0xc 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_X<<8) 20>;
+ };
+
+ gpioh: gpio@140 {
+ reg = <0 0x140 0 0x20>, <0 0x2c 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_H<<8) 9>;
+ };
+
+ gpiod: gpio@180 {
+ reg = <0 0x180 0 0x20>, <0 0x8 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_D<<8) 7>;
+ };
+
+ gpiof: gpio@1a0 {
+ reg = <0 0x1a0 0 0x20>, <0 0x20 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_F<<8) 5>;
+ };
+
+ gpioe: gpio@1c0 {
+ reg = <0 0x1c0 0 0x20>, <0 0x48 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_E<<8) 3>;
+ };
+
+ gpioc: gpio@200 {
+ reg = <0 0x200 0 0x20>, <0 0x24 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_C<<8) 8>;
+ };
+
+ gpiob: gpio@240 {
+ reg = <0 0x240 0 0x20>, <0 0x0 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_B<<8) 14>;
+ };
+
+ gpioa: gpio@280 {
+ reg = <0 0x280 0 0x20>, <0 0x40 0 0x8>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_A<<8) 16>;
+ };
+
+ test_n: gpio@2c0 {
+ reg = <0 0x2c0 0 0x20>;
+ reg-names = "gpio";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges =
+ <&periphs_pinctrl 0 (AMLOGIC_GPIO_TEST_N<<8) 1>;
+ };
+
+ gpiocc: gpio@300 {
+ reg = <0 0x300 0 0x20>, <0 0x14 0 0x4>;
+ reg-names = "gpio", "mux";
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&periphs_pinctrl 0 (AMLOGIC_GPIO_CC<<8) 2>;
+ };
+ };
};
};
};
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D
2025-05-21 3:19 ` [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D Xianwei Zhao via B4 Relay
@ 2025-05-21 9:15 ` Krzysztof Kozlowski
0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-21 9:15 UTC (permalink / raw)
To: Xianwei Zhao
Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel
On Wed, May 21, 2025 at 11:19:56AM GMT, Xianwei Zhao wrote:
> Update dt-binding document for pinctrl of Amlogic S7D SoC.
>
> Amlogic S7D SoCs uses the same pintrl controller as S7 SoCs. There is
> no need for an extra compatible line in the driver, but add S7D
> compatible line for documentation.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
> ---
> Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
Squash it with the previous patch, so it will be obvious that s7 is
documented.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6
2025-05-21 3:19 ` [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6 Xianwei Zhao via B4 Relay
@ 2025-05-21 9:16 ` Krzysztof Kozlowski
2025-05-22 1:59 ` Xianwei Zhao
0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-21 9:16 UTC (permalink / raw)
To: Xianwei Zhao
Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel
On Wed, May 21, 2025 at 11:19:57AM GMT, Xianwei Zhao wrote:
> Update dt-binding document for pinctrl of Amlogic S6 SoC.
Just squash it. Three one-liners is pretty close to a churn.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6
2025-05-21 9:16 ` Krzysztof Kozlowski
@ 2025-05-22 1:59 ` Xianwei Zhao
0 siblings, 0 replies; 12+ messages in thread
From: Xianwei Zhao @ 2025-05-22 1:59 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel
Hi Krzysztof,
Thanks for your reply.
On 2025/5/21 17:16, Krzysztof Kozlowski wrote:
> [ EXTERNAL EMAIL ]
>
> On Wed, May 21, 2025 at 11:19:57AM GMT, Xianwei Zhao wrote:
>> Update dt-binding document for pinctrl of Amlogic S6 SoC.
>
>
> Just squash it. Three one-liners is pretty close to a churn.
>
Will compress the previous three submissions into one.
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-05-22 2:00 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 3:19 [PATCH v2 0/8] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 1/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7 Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 2/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7D Xianwei Zhao via B4 Relay
2025-05-21 9:15 ` Krzysztof Kozlowski
2025-05-21 3:19 ` [PATCH v2 3/8] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S6 Xianwei Zhao via B4 Relay
2025-05-21 9:16 ` Krzysztof Kozlowski
2025-05-22 1:59 ` Xianwei Zhao
2025-05-21 3:19 ` [PATCH v2 4/8] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
2025-05-21 3:19 ` [PATCH v2 5/8] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 6/8] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 7/8] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
2025-05-21 3:20 ` [PATCH v2 8/8] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).