Skip to content

Commit ec648f6

Browse files
committed
pinctrl: starfive: Add pinctrl driver for StarFive SoCs
Add a combined pinctrl and GPIO driver for the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC, which is said to feature only minor changes to these pinctrl/GPIO parts. For each "GPIO" there are two registers for configuring the output and output enable signals which may come from other peripherals. Among these are two special signals that are constant 0 and constant 1 respectively. Controlling the GPIOs from software is done by choosing one of these signals. In other words the same registers are used for both pin muxing and controlling the GPIOs, which makes it easier to combine the pinctrl and GPIO driver in one. I wrote the pinconf and pinmux parts, but the GPIO part of the code is based on the GPIO driver in the vendor tree written by Huan Feng with cleanups and fixes by Drew and me. Datasheet: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Co-developed-by: Huan Feng <huan.feng@starfivetech.com> Signed-off-by: Huan Feng <huan.feng@starfivetech.com> Co-developed-by: Drew Fustini <drew@beagleboard.org> Signed-off-by: Drew Fustini <drew@beagleboard.org> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
1 parent 7431b39 commit ec648f6

File tree

4 files changed

+1380
-0
lines changed

4 files changed

+1380
-0
lines changed

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18137,6 +18137,14 @@ F: Documentation/devicetree/bindings/clock/starfive,jh7100-clkgen.yaml
1813718137
F: drivers/clk/starfive/clk-starfive-jh7100.c
1813818138
F: include/dt-bindings/clock/starfive-jh7100.h
1813918139

18140+
STARFIVE JH7100 PINCTRL DRIVER
18141+
M: Emil Renner Berthing <kernel@esmil.dk>
18142+
L: linux-gpio@vger.kernel.org
18143+
S: Maintained
18144+
F: Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
18145+
F: drivers/pinctrl/pinctrl-starfive.c
18146+
F: include/dt-bindings/pinctrl/pinctrl-starfive.h
18147+
1814018148
STARFIVE JH7100 RESET CONTROLLER DRIVER
1814118149
M: Emil Renner Berthing <kernel@esmil.dk>
1814218150
S: Maintained

drivers/pinctrl/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,23 @@ config PINCTRL_ST
281281
select PINCONF
282282
select GPIOLIB_IRQCHIP
283283

284+
config PINCTRL_STARFIVE
285+
tristate "Pinctrl and GPIO driver for the StarFive JH7100 SoC"
286+
depends on SOC_STARFIVE || COMPILE_TEST
287+
depends on OF
288+
default SOC_STARFIVE
289+
select GENERIC_PINCTRL_GROUPS
290+
select GENERIC_PINMUX_FUNCTIONS
291+
select GENERIC_PINCONF
292+
select GPIOLIB
293+
select GPIOLIB_IRQCHIP
294+
select OF_GPIO
295+
help
296+
Say yes here to support pin control on the StarFive JH7100 SoC.
297+
This also provides an interface to the GPIO pins not used by other
298+
peripherals supporting inputs, outputs, configuring pull-up/pull-down
299+
and interrupts on input changes.
300+
284301
config PINCTRL_STMFX
285302
tristate "STMicroelectronics STMFX GPIO expander pinctrl driver"
286303
depends on I2C

drivers/pinctrl/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o
3939
obj-$(CONFIG_PINCTRL_LPC18XX) += pinctrl-lpc18xx.o
4040
obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o
4141
obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o
42+
obj-$(CONFIG_PINCTRL_STARFIVE) += pinctrl-starfive.o
4243
obj-$(CONFIG_PINCTRL_STMFX) += pinctrl-stmfx.o
4344
obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
4445
obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o

0 commit comments

Comments
 (0)