arm64: berlin: add pinctrl support
Subsystems (5)
v6 cover arm64: berlin: add pinctrl support
This series adds support for Marvell berlin4ct pin-controller, allowing to configure the pin muxing from the device tree.
Since v5:
- add Sebastian and Antoine ack tag
- Reorder the statements under the PINCTRL_BERLIN_BG4CT config option
Since v4:
- drop ARCH_BERLIN dependency for it has been met
- drop COMPILE_TEST dependency but make berlin pinctrl driver visible if COMPILE_TEST=y, and let this change be a seperate commit.
Since v3:
- fix stupid build error: I missed local changes to berlin-bg4ct.c
Since v2:
- introduce new berlin_pinctrl_probe_regmap() to avoid duplicated code
- renaming such as s/urt/uart etc. but keep the group name as URT* to keep consistent with HW/ASIC
Since v1:
- use generic name for pin functions
- a new commit to add pinmux for uart0
- correct pinctrl usage in dts
Jisheng Zhang (7):
pinctrl: berlin: introduce berlin_pinctrl_probe_regmap()
pinctrl: berlin: Make berlin pinctrl driver visible if COMPILE_TEST=y
pinctrl: berlin: add the berlin4ct pinctrl driver
arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs
pinctrl: dt-binding: document berlin4ct SoC pinctrl
arm64: dts: berlin4ct: add the pinctrl node
arm64: dts: berlin4ct: add default pinmux for uart0
.../devicetree/bindings/pinctrl/berlin,pinctrl.txt | 5 +- arch/arm64/Kconfig.platforms | 1 + arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 22 + drivers/pinctrl/berlin/Kconfig | 7 +- drivers/pinctrl/berlin/Makefile | 1 + drivers/pinctrl/berlin/berlin-bg4ct.c | 503 +++++++++++++++++++++ drivers/pinctrl/berlin/berlin.c | 26 +- drivers/pinctrl/berlin/berlin.h | 4 + 8 files changed, 558 insertions(+), 11 deletions(-) create mode 100644 drivers/pinctrl/berlin/berlin-bg4ct.c
Signature · 1 line
2.6.1
PATCH v6 1/7 pinctrl: berlin: introduce berlin_pinctrl_probe_regmap()
This is to prepare for the next berlin4ct support, where we won't use simple-mfd any more.
--- drivers/pinctrl/berlin/berlin.c | 26 +++++++++++++++++--------- drivers/pinctrl/berlin/berlin.h | 4 ++++ 2 files changed, 21 insertions(+), 9 deletions(-)
drivers/pinctrl/berlin/berlin.c +17 -9
@@ -292,20 +292,14 @@ static struct pinctrl_desc berlin_pctrl_desc = { .owner = THIS_MODULE, }; -int berlin_pinctrl_probe (struct platform_device *pdev, -const struct berlin_pinctrl_desc *desc) +int berlin_pinctrl_probe_regmap (struct platform_device *pdev, +const struct berlin_pinctrl_desc *desc, +struct regmap *regmap) {struct device *dev = &pdev->dev; -struct device_node *parent_np =of_get_parent (dev->of_node);struct berlin_pinctrl *pctrl; -struct regmap *regmap;int ret; - regmap =syscon_node_to_regmap (parent_np); -of_node_put (parent_np); -if (IS_ERR (regmap)) -return PTR_ERR (regmap); - pctrl =devm_kzalloc (dev,sizeof (*pctrl),GFP_KERNEL );if (!pctrl)return -ENOMEM ;
@@ -330,3 +324,17 @@ int berlin_pinctrl_probe(struct platform_device *pdev,return 0 ; } + +int berlin_pinctrl_probe (struct platform_device *pdev, +const struct berlin_pinctrl_desc *desc) +{ +struct device *dev = &pdev->dev; +struct device_node *parent_np =of_get_parent (dev->of_node); +struct regmap *regmap =syscon_node_to_regmap (parent_np); + +of_node_put (parent_np); +if (IS_ERR (regmap)) +return PTR_ERR (regmap); + +return berlin_pinctrl_probe_regmap (pdev, desc, regmap); +}
drivers/pinctrl/berlin/berlin.h +4 -0
@@ -58,4 +58,8 @@ struct berlin_pinctrl_function {int berlin_pinctrl_probe (struct platform_device *pdev,const struct berlin_pinctrl_desc *desc); +int berlin_pinctrl_probe_regmap (struct platform_device *pdev, +const struct berlin_pinctrl_desc *desc, +struct regmap *regmap); +#endif /* __PINCTRL_BERLIN_H */
Signature · 1 line
2.6.1
PATCH v6 2/7 pinctrl: berlin: Make berlin pinctrl driver visible if COMPILE_TEST=y
In reply to Jisheng ZhangIt is good to allow berlin pinctrl driver to build with COMPILE_TEST, so make the it menu visible when compile-testing.
--- drivers/pinctrl/berlin/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/berlin/Kconfig +1 -1
@@ -1,4 +1,4 @@ -if ARCH_BERLIN +if (ARCH_BERLIN || COMPILE_TEST) config PINCTRL_BERLIN bool
Signature · 1 line
2.6.1
PATCH v6 3/7 pinctrl: berlin: add the berlin4ct pinctrl driver
In reply to Jisheng ZhangAdd the pin-controller driver for Marvell Berlin BG4CT SoC, with definition of its groups and functions. This uses the core Berlin pinctrl driver.
--- drivers/pinctrl/berlin/Kconfig | 5 + drivers/pinctrl/berlin/Makefile | 1 + drivers/pinctrl/berlin/berlin-bg4ct.c | 503 ++++++++++++++++++++++++++++++++++ 3 files changed, 509 insertions(+) create mode 100644 drivers/pinctrl/berlin/berlin-bg4ct.c
drivers/pinctrl/berlin/Kconfig +5 -0
@@ -17,4 +17,9 @@ config PINCTRL_BERLIN_BG2Q bool select PINCTRL_BERLIN +config PINCTRL_BERLIN_BG4CT + bool "Marvell berlin4ct pin controller driver" + depends on OF + select PINCTRL_BERLIN + endif
drivers/pinctrl/berlin/Makefile +1 -0
@@ -2,3 +2,4 @@ obj-$(CONFIG_PINCTRL_BERLIN) += berlin.o obj-$(CONFIG_PINCTRL_BERLIN_BG2) += berlin-bg2.o obj-$(CONFIG_PINCTRL_BERLIN_BG2CD) += berlin-bg2cd.o obj-$(CONFIG_PINCTRL_BERLIN_BG2Q) += berlin-bg2q.o +obj-$(CONFIG_PINCTRL_BERLIN_BG4CT) += berlin-bg4ct.o
drivers/pinctrl/berlin/berlin-bg4ct.c new file +503 -0
503 lines not on this page · raw message
Signature · 1 line
2.6.1
PATCH v6 4/7 arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs
In reply to Jisheng ZhangThis is to add the pinctrl dependency for Marvell Berlin SoCs.
--- arch/arm64/Kconfig.platforms | 1 + 1 file changed, 1 insertion(+)
arch/arm64/Kconfig.platforms +1 -0
@@ -9,6 +9,7 @@ config ARCH_BERLIN bool "Marvell Berlin SoC Family" select ARCH_REQUIRE_GPIOLIB select DW_APB_ICTL + select PINCTRL help This enables support for Marvell Berlin SoC Family
Signature · 1 line
2.6.1
PATCH v6 5/7 pinctrl: dt-binding: document berlin4ct SoC pinctrl
In reply to Jisheng ZhangAdd berlin4ct to existing berlin pinctrl device tree binding.
--- Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt +4 -1
@@ -20,7 +20,10 @@ Required properties: "marvell,berlin2cd-soc-pinctrl", "marvell,berlin2cd-system-pinctrl", "marvell,berlin2q-soc-pinctrl", - "marvell,berlin2q-system-pinctrl" + "marvell,berlin2q-system-pinctrl", + "marvell,berlin4ct-avio-pinctrl", + "marvell,berlin4ct-soc-pinctrl", + "marvell,berlin4ct-system-pinctrl" Required subnode-properties: - groups: a list of strings describing the group names.
Signature · 1 line
2.6.1
PATCH v6 6/7 arm64: dts: berlin4ct: add the pinctrl node
In reply to Jisheng ZhangAdd the avio, soc, sm pinctrl nodes for Marvell berlin4ct SoC.
--- arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/marvell/berlin4ct.dtsi +15 -0
@@ -225,6 +225,16 @@ }; }; + soc_pinctrl: pin-controller at ea8000 { + compatible = "marvell,berlin4ct-soc-pinctrl"; + reg = <0xea8000 0x14>; + }; + + avio_pinctrl: pin-controller at ea8400 { + compatible = "marvell,berlin4ct-avio-pinctrl"; + reg = <0xea8400 0x8>; + }; + apb at fc0000 { compatible = "simple-bus"; #address-cells = <1>;
@@ -280,5 +290,10 @@ status = "disabled"; }; }; + + system_pinctrl: pin-controller at fe2200 { + compatible = "marvell,berlin4ct-system-pinctrl"; + reg = <0xfe2200 0xc>; + }; }; };
Signature · 1 line
2.6.1
PATCH v6 7/7 arm64: dts: berlin4ct: add default pinmux for uart0
In reply to Jisheng ZhangAdd urt0 txd and rxd muxing setup in the dtsi because uart0 always uses them to work, no other possibilities.
--- arch/arm64/boot/dts/marvell/berlin4ct.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/marvell/berlin4ct.dtsi +7 -0
@@ -288,12 +288,19 @@ clocks = <&osc>; reg-shift = <2>; status = "disabled"; + pinctrl-0 = <&uart0_pmux>; + pinctrl-names = "default"; }; }; system_pinctrl: pin-controller at fe2200 { compatible = "marvell,berlin4ct-system-pinctrl"; reg = <0xfe2200 0xc>; + + uart0_pmux: uart0-pmux { + groups = "SM_URT0_TXD", "SM_URT0_RXD"; + function = "uart0"; + }; }; }; };
Signature · 1 line
2.6.1
Re: [PATCH v6 1/7] pinctrl: berlin: introduce berlin_pinctrl_probe_regmap()
In reply to Jisheng ZhangQuoted 6 lines · Jisheng Zhang
This is to prepare for the next berlin4ct support, where we won't use simple-mfd any more.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH v6 2/7] pinctrl: berlin: Make berlin pinctrl driver visible if COMPILE_TEST=y
In reply to Jisheng ZhangQuoted 6 lines · Jisheng Zhang
It is good to allow berlin pinctrl driver to build with
COMPILE_TEST, so make the it menu visible when compile-testing.Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH v6 3/7] pinctrl: berlin: add the berlin4ct pinctrl driver
In reply to Jisheng ZhangQuoted 6 lines · Jisheng Zhang
Add the pin-controller driver for Marvell Berlin BG4CT SoC, with definition of its groups and functions. This uses the core Berlin pinctrl driver.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH v6 4/7] arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs
In reply to Jisheng ZhangQuoted 5 lines · Jisheng Zhang
This is to add the pinctrl dependency for Marvell Berlin SoCs.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Please push this through the ARM SoC tree or wherever patches to this file goes. It doesn't seem to be a hard dependency to the pin control patches.
Yours,
Linus Walleij
Re: [PATCH v6 5/7] pinctrl: dt-binding: document berlin4ct SoC pinctrl
In reply to Jisheng ZhangQuoted 5 lines · Jisheng Zhang
Add berlin4ct to existing berlin pinctrl device tree binding.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH v6 6/7] arm64: dts: berlin4ct: add the pinctrl node
In reply to Jisheng ZhangQuoted 5 lines · Jisheng Zhang
Add the avio, soc, sm pinctrl nodes for Marvell berlin4ct SoC.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Funnel this through ARM SoC.
Yours,
Linus Walleij
Re: [PATCH v6 7/7] arm64: dts: berlin4ct: add default pinmux for uart0
In reply to Jisheng ZhangQuoted 6 lines · Jisheng Zhang
Add urt0 txd and rxd muxing setup in the dtsi because uart0 always uses them to work, no other possibilities.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Funnel this through ARM SoC.
Yours,
Linus Walleij
Re: [PATCH v6 6/7] arm64: dts: berlin4ct: add the pinctrl node
In reply to Linus WalleijQuoted 10 lines · Linus Walleij
Quoted 5 lines · Jisheng Zhang
Add the avio, soc, sm pinctrl nodes for Marvell berlin4ct SoC.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>Acked-by Linus Walleij <[email protected]>Funnel this through ARM SoC.
Applied to berlin64/dt with Linus' Ack.
Thanks,
Sebastian
Re: [PATCH v6 7/7] arm64: dts: berlin4ct: add default pinmux for uart0
In reply to Linus WalleijQuoted 11 lines · Linus Walleij
Quoted 6 lines · Jisheng Zhang
Add urt0 txd and rxd muxing setup in the dtsi because uart0 always uses them to work, no other possibilities.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>Acked-by Linus Walleij <[email protected]>Funnel this through ARM SoC.
Applied to berlin64/dt with Linus' Ack.
Thanks,
Sebastian
Sebastian Hesselbarth
maintainerRe: [PATCH v6 4/7] arm64: berlin: add the pinctrl dependency for Marvell Berlin SoCs
In reply to Linus WalleijQuoted 8 lines · Linus Walleij
Quoted 5 lines · Jisheng Zhang
This is to add the pinctrl dependency for Marvell Berlin SoCs.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Antoine Tenart <[email protected]>
Quoted 5 lines
Acked-by Linus Walleij <[email protected]>Please push this through the ARM SoC tree or wherever patches to this file goes. It doesn't seem to be a hard dependency to the pin control patches.
[Added arm-soc Maintainers]
This patch is touching arch/arm64/Kconfig.platforms. The hunk is very small so that it may be ok that I apply and send it with the next PR.
If the arm-soc Maintainers want to pick it up, I can resend the original patch with all Acked-by to arm-soc maintainer e-mail directly.
Sebastian