* [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl
@ 2025-05-27 5:23 Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6 Xianwei Zhao via B4 Relay
` (7 more replies)
0 siblings, 8 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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 v3:
- Squash three submissons of bindings into one.
- Link to v2: https://lore.kernel.org/r/20250521-s6-s7-pinctrl-v2-0-0ce5e3728404@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 (6):
dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/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: 176e917e010cb7dcc605f11d2bc33f304292482b
change-id: 20250514-s6-s7-pinctrl-af1ebda88a4e
Best regards,
--
Xianwei Zhao <xianwei.zhao@amlogic.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-05-27 8:23 ` Krzysztof Kozlowski
2025-05-27 5:23 ` [PATCH v3 2/6] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
` (6 subsequent siblings)
7 siblings, 1 reply; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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/S7D/S6.
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
---
.../devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml | 9 ++++++++-
1 file changed, 8 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..61a4685f9748 100644
--- a/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/amlogic,pinctrl-a4.yaml
@@ -15,11 +15,18 @@ allOf:
properties:
compatible:
oneOf:
- - const: amlogic,pinctrl-a4
+ - enum:
+ - amlogic,pinctrl-a4
+ - amlogic,pinctrl-s6
+ - amlogic,pinctrl-s7
- items:
- 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] 10+ messages in thread
* [PATCH v3 2/6] pinctrl: meson: a4: remove special data processing
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6 Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 3/6] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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 385cc619df13..11f68224342e 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 {
@@ -829,31 +822,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] 10+ messages in thread
* [PATCH v3 3/6] pinctrl: meson: support amlogic S6/S7/S7D SoC
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6 Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 2/6] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 4/6] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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 11f68224342e..2541c864086d 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;
@@ -822,12 +899,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,
@@ -994,6 +1089,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] 10+ messages in thread
* [PATCH v3 4/6] dts: arm64: amlogic: add S7 pinctrl node
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (2 preceding siblings ...)
2025-05-27 5:23 ` [PATCH v3 3/6] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 5/6] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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] 10+ messages in thread
* [PATCH v3 5/6] dts: arm64: amlogic: add S7D pinctrl node
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (3 preceding siblings ...)
2025-05-27 5:23 ` [PATCH v3 4/6] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 6/6] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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] 10+ messages in thread
* [PATCH v3 6/6] dts: arm64: amlogic: add S6 pinctrl node
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (4 preceding siblings ...)
2025-05-27 5:23 ` [PATCH v3 5/6] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
@ 2025-05-27 5:23 ` Xianwei Zhao via B4 Relay
2025-06-10 12:10 ` [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Linus Walleij
2025-07-04 15:11 ` (subset) " Neil Armstrong
7 siblings, 0 replies; 10+ messages in thread
From: Xianwei Zhao via B4 Relay @ 2025-05-27 5:23 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] 10+ messages in thread
* Re: [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6
2025-05-27 5:23 ` [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6 Xianwei Zhao via B4 Relay
@ 2025-05-27 8:23 ` Krzysztof Kozlowski
0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-27 8:23 UTC (permalink / raw)
To: xianwei.zhao, 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
On 27/05/2025 07:23, Xianwei Zhao via B4 Relay wrote:
> From: Xianwei Zhao <xianwei.zhao@amlogic.com>
>
> Update dt-binding document for pinctrl of Amlogic S7/S7D/S6.
>
> Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (5 preceding siblings ...)
2025-05-27 5:23 ` [PATCH v3 6/6] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
@ 2025-06-10 12:10 ` Linus Walleij
2025-07-04 15:11 ` (subset) " Neil Armstrong
7 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2025-06-10 12:10 UTC (permalink / raw)
To: xianwei.zhao
Cc: 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 Tue, May 27, 2025 at 7:23 AM Xianwei Zhao via B4 Relay
<devnull+xianwei.zhao.amlogic.com@kernel.org> wrote:
> Xianwei Zhao (6):
> dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6
> pinctrl: meson: a4: remove special data processing
> pinctrl: meson: support amlogic S6/S7/S7D SoC
I have applied these three to the pin control tree for v6.17.
> dts: arm64: amlogic: add S7 pinctrl node
> dts: arm64: amlogic: add S7D pinctrl node
> dts: arm64: amlogic: add S6 pinctrl node
Please funnel these through the SoC tree!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: (subset) [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
` (6 preceding siblings ...)
2025-06-10 12:10 ` [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Linus Walleij
@ 2025-07-04 15:11 ` Neil Armstrong
7 siblings, 0 replies; 10+ messages in thread
From: Neil Armstrong @ 2025-07-04 15:11 UTC (permalink / raw)
To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Xianwei Zhao
Cc: linux-amlogic, linux-gpio, devicetree, linux-kernel,
linux-arm-kernel
Hi,
On Tue, 27 May 2025 13:23:27 +0800, Xianwei Zhao wrote:
> 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.
>
> [...]
Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.17/arm64-dt)
[4/6] dts: arm64: amlogic: add S7 pinctrl node
https://git.kernel.org/amlogic/c/9291207753c733dcd9f1c08749950323f7f071e8
[5/6] dts: arm64: amlogic: add S7D pinctrl node
https://git.kernel.org/amlogic/c/bd42a25d696e0d5ccc9e27de388d4ca9ff52f710
[6/6] dts: arm64: amlogic: add S6 pinctrl node
https://git.kernel.org/amlogic/c/fb183c8d7a5a90cdee953701d8a5b92642a2e917
These changes has been applied on the intermediate git tree [1].
The v6.17/arm64-dt branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.
In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].
The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.
If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
--
Neil
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-07-04 15:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 5:23 [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 1/6] dt-bindings: pinctl: amlogic,pinctrl-a4: Add compatible string for S7/S7D/S6 Xianwei Zhao via B4 Relay
2025-05-27 8:23 ` Krzysztof Kozlowski
2025-05-27 5:23 ` [PATCH v3 2/6] pinctrl: meson: a4: remove special data processing Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 3/6] pinctrl: meson: support amlogic S6/S7/S7D SoC Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 4/6] dts: arm64: amlogic: add S7 pinctrl node Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 5/6] dts: arm64: amlogic: add S7D " Xianwei Zhao via B4 Relay
2025-05-27 5:23 ` [PATCH v3 6/6] dts: arm64: amlogic: add S6 " Xianwei Zhao via B4 Relay
2025-06-10 12:10 ` [PATCH v3 0/6] Add support for Amlogic S7/S7D/S6 pinctrl Linus Walleij
2025-07-04 15:11 ` (subset) " Neil Armstrong
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).