Modern pinctrl for Exynos5250 devices
Subsystems (5)
v2 cover Modern pinctrl for Exynos5250 devices
This patch adds the necessary files to use a modern pinctrl driver with an exynos5250 SoC. The changes are well tested and are working. GPIO isn't implemented right now, as the older s5p_gpio driver needs to be disabled for the newer driver to work.
All changes were tested with soon-to-be upstreamed DTs for the Linux kernel. The tested device is a Google Nexus 10 (samsung-manta). U-Boot was ported to that device and will be upstreamed into U-Boot soon.
I don't have much experience with the mailing list workflow, u-boot or driver development in general. I apologize for any mistakes I might do.
Lukas Timmermann (2):
gpio: s5p_gpio: Add config option for s5p_gpio driver
pinctrl: exynos: Add exynos5250 driver
MAINTAINERS | 5 ++ arch/arm/mach-exynos/pinmux.c | 18 ++++ drivers/gpio/Kconfig | 7 ++ drivers/gpio/Makefile | 2 +- drivers/pinctrl/exynos/Kconfig | 8 ++ drivers/pinctrl/exynos/Makefile | 1 + drivers/pinctrl/exynos/pinctrl-exynos5250.c | 99 +++++++++++++++++++++ 7 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.c
Signature · 4 lines
2.51.2 base-commit: 9ccda31f54881d3321263a81599454a1d6efb65e branch: lat3st/staging
PATCH v2 1/2 gpio: s5p_gpio: Add config option for s5p_gpio driver
This config option is required to make use of a newer pinctrl driver on exynos 5 platforms. It is enabled per default to ensure older devices can still use this driver.
---
Changes since v1:
- Reworded comment for Kconfig (@Hendrik)
arch/arm/mach-exynos/pinmux.c | 18 ++++++++++++++++++ drivers/gpio/Kconfig | 7 +++++++ drivers/gpio/Makefile | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-)
arch/arm/mach-exynos/pinmux.c +18 -0
@@ -934,3 +934,21 @@ int pinmux_decode_periph_id(const void *blob, int node) return PERIPH_ID_NONE; }#endif + +#if !CONFIG_IS_ENABLED (S5P_GPIO ) + +/* Add stub functions if s5p_gpio driver isn't enabled */ + +void gpio_set_pull (int pin,int pull) +{ +} + +void gpio_set_drv (int pin,int drv) +{ +} + +void gpio_cfg_pin (int pin,int cfg) +{ +} + +#endif
drivers/gpio/Kconfig +7 -0
@@ -718,5 +718,12 @@ config MPFS_GPIO depends on DM_GPIO help Enable to support the GPIO driver on Polarfire SoC +config S5P_GPIO + default y + bool "Samsung S5P GPIO driver" + depends on DM_GPIO && S5P + help + Support GPIO controllers on Samsung Exynos SoCs. + This driver does not support upstream Linux device tree bindings. endif
drivers/gpio/Makefile +1 -1
@@ -35,7 +35,7 @@ obj-$(CONFIG_PCA953X) += pca953x.o obj-$(CONFIG_ROCKCHIP_GPIO) += rk_gpio.o obj-$(CONFIG_RCAR_GPIO) += gpio-rcar.o obj-$(CONFIG_RZA1_GPIO) += gpio-rza1.o -obj-$(CONFIG_S5P) += s5p_gpio.o +obj-$(CONFIG_S5P_GPIO) += s5p_gpio.o obj-$(CONFIG_SANDBOX_GPIO) += sandbox.o sandbox_test.o obj-$(CONFIG_TEGRA_GPIO) += tegra_gpio.o obj-$(CONFIG_TEGRA186_GPIO) += tegra186_gpio.o
Signature · 1 line
2.51.2
PATCH v2 2/2 pinctrl: exynos: Add exynos5250 driver
In reply to Lukas TimmermannAdds the needed files for using the new pinctrl driver with exynos5250 SoCs.
---
Changes since v1:
- Renamed to lower case letters in constants (@Hendrik)
- Removed co-author line and declared myself as author (@Hendrik)
MAINTAINERS | 5 ++ drivers/pinctrl/exynos/Kconfig | 8 ++ drivers/pinctrl/exynos/Makefile | 1 + drivers/pinctrl/exynos/pinctrl-exynos5250.c | 99 +++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.c
MAINTAINERS +5 -0
@@ -609,6 +609,11 @@ F: drivers/clk/exynos/clk-exynos850.c F: drivers/phy/phy-exynos-usbdrd.c F: drivers/pinctrl/exynos/pinctrl-exynos850.c +ARM SAMSUNG EXYNOS5250 SOC +M: Lukas Timmermann <[email protected]> +S: Maintained +F: drivers/pinctrl/exynos/pinctrl-exynos5250.c + ARM SAMSUNG SOC DRIVERS M: Sam Protsenko <[email protected]> S: Maintained
drivers/pinctrl/exynos/Kconfig +8 -0
@@ -1,6 +1,14 @@ config PINCTRL_EXYNOS bool +config PINCTRL_EXYNOS5250 + bool "Samsung Exynos5250 pinctrl driver" + depends on ARCH_EXYNOS && PINCTRL_FULL + select PINCTRL_EXYNOS + help + Support pin multiplexing and pin configuration control on + Samsung's Exynos5250 SoC. + config PINCTRL_EXYNOS7420 bool "Samsung Exynos7420 pinctrl driver" depends on ARCH_EXYNOS && PINCTRL_FULL
drivers/pinctrl/exynos/Makefile +1 -0
@@ -4,6 +4,7 @@ # Thomas Abraham <[email protected]> obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o +obj-$(CONFIG_PINCTRL_EXYNOS5250) += pinctrl-exynos5250.o obj-$(CONFIG_PINCTRL_EXYNOS7420) += pinctrl-exynos7420.o obj-$(CONFIG_PINCTRL_EXYNOS78x0) += pinctrl-exynos78x0.o obj-$(CONFIG_PINCTRL_EXYNOS850) += pinctrl-exynos850.o
drivers/pinctrl/exynos/pinctrl-exynos5250.c new file +99 -0
99 lines not on this page · raw message
Signature · 1 line
2.51.2
Dear Timmermann,
Sorry I missed this patch..
I tested this patch but I've got compile errors.
Could you please check?; tested with smdk5250.
/opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld: drivers/gpio/s5p_gpio.o: in function `gpio_set_pull':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:240: multiple definition of `gpio_set_pull'; arch/arm/mach-exynos/pinmux.o:pinmux.c:(.text.gpio_set_pull+0x0): first defined here /opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld: drivers/gpio/s5p_gpio.o: in function `gpio_set_drv':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:246: multiple definition of `gpio_set_drv'; arch/arm/mach-exynos/pinmux.o:pinmux.c:(.text.gpio_set_drv+0x0): first defined here /opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld: drivers/gpio/s5p_gpio.o: in function `gpio_cfg_pin':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:252: multiple definition of `gpio_cfg_pin'; arch/arm/mach-exynos/pinmux.o:/home/work/git/u-boot-samsung/arch/arm/mach-exynos/pinmux.c:952: first defined here
Thanks,
Minkyu Kang.
No worries. I'm still interested in upstreaming this patch and the corresponding DT for my device into the linux kernel.
The error you've got would be expected if you didn't disable the pinctrl part of the older S5P (see Patch v2 1/2). Please be sure to disable it in order for my suggested driver to compile correctly. The older driver didn't support newer style DTs pinctrl, which my device uses and will be upstreamed soon.
I acknowledge, that this is a less than optimal solution and I'm willing to discuss alternatives. The issue appears because the older pinmux driver did much more than the newer pinctrl driver I've written does.
Also I just noticed that I left behind "Copyright Linaro Ltd." in the header of pinctrl-exynos5250.c so please don't merge this yet. A v3 is obligatory at this point.
Best regards
Lukas Timmermann
Quoted 17 lines · Minkyu Kang
Dear Timmermann,
Sorry I missed this patch..
I tested this patch but I've got compile errors.
Could you please check?; tested with smdk5250.
/opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld:drivers/gpio/s5p_gpio.o: in function `gpio_set_pull':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:240: multiple definition of `gpio_set_pull'; arch/arm/mach-exynos/pinmux.o:pinmux.c:(.text.gpio_set_pull+0x0): first defined here/opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld:drivers/gpio/s5p_gpio.o: in function `gpio_set_drv':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:246: multiple definition of `gpio_set_drv'; arch/arm/mach-exynos/pinmux.o:pinmux.c:(.text.gpio_set_drv+0x0): first defined here/opt/toolchain/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-ld:drivers/gpio/s5p_gpio.o: in function `gpio_cfg_pin':/home/work/git/u-boot-samsung/drivers/gpio/s5p_gpio.c:252: multiple definition of `gpio_cfg_pin'; arch/arm/mach-exynos/pinmux.o:/home/work/git/u-boot-samsung/arch/arm/mach-exynos/pinmux.c:952: first defined hereThanks,
Minkyu Kang.