* [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices @ 2025-11-03 19:10 ` Lukas Timmermann 2025-11-03 19:10 ` [PATCH v2 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver Lukas Timmermann ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Lukas Timmermann @ 2025-11-03 19:10 UTC (permalink / raw) To: u-boot Cc: Lukas Timmermann, Alif Zakuan Yuslaimi, Arturs Artamonovs, Eoin Dickson, Greg Malysa, Heiko Schocher, Henrik Grimler, Ian Roberts, J. Neuschäfer, Jerome Forissier, Kory Maincent (TI.com), Marek Vasut, Mattijs Korpershoek, Minkyu Kang, Nathan Barrett-Morrison, Neil Armstrong, Oliver Gaskell, Patrice Chotard, Peng Fan, Philip Molloy, Simon Glass, Stefan Roese, Tom Rini, Utsav Agarwal, Vasileios Bimpikas, Yao Zi 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 -- 2.51.2 base-commit: 9ccda31f54881d3321263a81599454a1d6efb65e branch: lat3st/staging ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver 2025-11-03 19:10 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann @ 2025-11-03 19:10 ` Lukas Timmermann 2025-11-03 19:10 ` [PATCH v2 2/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann 2026-02-02 8:33 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Minkyu Kang 2 siblings, 0 replies; 5+ messages in thread From: Lukas Timmermann @ 2025-11-03 19:10 UTC (permalink / raw) To: u-boot Cc: Lukas Timmermann, Arturs Artamonovs, Eoin Dickson, Greg Malysa, Henrik Grimler, Ian Roberts, J. Neuschäfer, Marek Vasut, Minkyu Kang, Nathan Barrett-Morrison, Neil Armstrong, Oliver Gaskell, Philip Molloy, Tom Rini, Utsav Agarwal, Vasileios Bimpikas 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. Signed-off-by: Lukas Timmermann <uboot@timmermann.space> --- 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(-) diff --git a/arch/arm/mach-exynos/pinmux.c b/arch/arm/mach-exynos/pinmux.c index ed46ea03355..2665aeee6d2 100644 --- a/arch/arm/mach-exynos/pinmux.c +++ b/arch/arm/mach-exynos/pinmux.c @@ -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 diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index db077e472a8..8c93a850611 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -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 diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 73c94329e36..a26ef5a0371 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -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 -- 2.51.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] pinctrl: exynos: Add exynos5250 driver 2025-11-03 19:10 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann 2025-11-03 19:10 ` [PATCH v2 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver Lukas Timmermann @ 2025-11-03 19:10 ` Lukas Timmermann 2026-02-02 8:33 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Minkyu Kang 2 siblings, 0 replies; 5+ messages in thread From: Lukas Timmermann @ 2025-11-03 19:10 UTC (permalink / raw) To: u-boot Cc: Lukas Timmermann, Alif Zakuan Yuslaimi, Arturs Artamonovs, Greg Malysa, Heiko Schocher, Ian Roberts, Jerome Forissier, Kory Maincent (TI.com), Mattijs Korpershoek, Nathan Barrett-Morrison, Patrice Chotard, Peng Fan, Simon Glass, Stefan Roese, Tom Rini, Utsav Agarwal, Vasileios Bimpikas, Yao Zi Adds the needed files for using the new pinctrl driver with exynos5250 SoCs. Signed-off-by: Lukas Timmermann <uboot@timmermann.space> --- 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 diff --git a/MAINTAINERS b/MAINTAINERS index 8c7d0e0ab2f..b82911d0d58 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -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 <uboot@timmermann.space> +S: Maintained +F: drivers/pinctrl/exynos/pinctrl-exynos5250.c + ARM SAMSUNG SOC DRIVERS M: Sam Protsenko <semen.protsenko@linaro.org> S: Maintained diff --git a/drivers/pinctrl/exynos/Kconfig b/drivers/pinctrl/exynos/Kconfig index 1b7fb62bc4b..18503ce112e 100644 --- a/drivers/pinctrl/exynos/Kconfig +++ b/drivers/pinctrl/exynos/Kconfig @@ -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 diff --git a/drivers/pinctrl/exynos/Makefile b/drivers/pinctrl/exynos/Makefile index 3abe1226eb7..7ef8d90cb59 100644 --- a/drivers/pinctrl/exynos/Makefile +++ b/drivers/pinctrl/exynos/Makefile @@ -4,6 +4,7 @@ # Thomas Abraham <thomas.ab@samsung.com> 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 diff --git a/drivers/pinctrl/exynos/pinctrl-exynos5250.c b/drivers/pinctrl/exynos/pinctrl-exynos5250.c new file mode 100644 index 00000000000..4c0d8fad36e --- /dev/null +++ b/drivers/pinctrl/exynos/pinctrl-exynos5250.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2023 Linaro Ltd. + * Author: Lukas Timmermann <linux@timmermann.space> + * + * Exynos5250 pinctrl driver. + */ + +#include <dm.h> +#include <dm/pinctrl.h> +#include "pinctrl-exynos.h" + +static const struct pinctrl_ops exynos5250_pinctrl_ops = { + .set_state = exynos_pinctrl_set_state +}; + +static const struct samsung_pin_bank_data exynos5250_pin_banks0[] = { + EXYNOS_PIN_BANK(8, 0x000, "gpa0"), + EXYNOS_PIN_BANK(6, 0x020, "gpa1"), + EXYNOS_PIN_BANK(8, 0x040, "gpa2"), + EXYNOS_PIN_BANK(5, 0x060, "gpb0"), + EXYNOS_PIN_BANK(5, 0x080, "gpb1"), + EXYNOS_PIN_BANK(4, 0x0a0, "gpb2"), + EXYNOS_PIN_BANK(4, 0x0c0, "gpb3"), + EXYNOS_PIN_BANK(7, 0x0e0, "gpc0"), + EXYNOS_PIN_BANK(4, 0x100, "gpc1"), + EXYNOS_PIN_BANK(7, 0x120, "gpc2"), + EXYNOS_PIN_BANK(7, 0x140, "gpc3"), + EXYNOS_PIN_BANK(4, 0x160, "gpd0"), + EXYNOS_PIN_BANK(8, 0x180, "gpd1"), + EXYNOS_PIN_BANK(7, 0x2e0, "gpc4"), + EXYNOS_PIN_BANK(6, 0x1a0, "gpy0"), + EXYNOS_PIN_BANK(4, 0x1c0, "gpy1"), + EXYNOS_PIN_BANK(6, 0x1e0, "gpy2"), + EXYNOS_PIN_BANK(8, 0x200, "gpy3"), + EXYNOS_PIN_BANK(8, 0x220, "gpy4"), + EXYNOS_PIN_BANK(8, 0x240, "gpy5"), + EXYNOS_PIN_BANK(8, 0x260, "gpy6"), + EXYNOS_PIN_BANK(8, 0xc00, "gpx0"), + EXYNOS_PIN_BANK(8, 0xc20, "gpx1"), + EXYNOS_PIN_BANK(8, 0xc40, "gpx2"), + EXYNOS_PIN_BANK(8, 0xc60, "gpx3"), +}; + +static const struct samsung_pin_bank_data exynos5250_pin_banks1[] = { + EXYNOS_PIN_BANK(8, 0x000, "gpe0"), + EXYNOS_PIN_BANK(2, 0x020, "gpe1"), + EXYNOS_PIN_BANK(4, 0x040, "gpf0"), + EXYNOS_PIN_BANK(4, 0x060, "gpf1"), + EXYNOS_PIN_BANK(8, 0x080, "gpg0"), + EXYNOS_PIN_BANK(8, 0x0a0, "gpg1"), + EXYNOS_PIN_BANK(2, 0x0c0, "gpg2"), + EXYNOS_PIN_BANK(4, 0x0e0, "gph0"), + EXYNOS_PIN_BANK(8, 0x100, "gph1"), +}; + +static const struct samsung_pin_bank_data exynos5250_pin_banks2[] = { + EXYNOS_PIN_BANK(8, 0x000, "gpv0"), + EXYNOS_PIN_BANK(8, 0x020, "gpv1"), + EXYNOS_PIN_BANK(8, 0x060, "gpv2"), + EXYNOS_PIN_BANK(8, 0x080, "gpv3"), + EXYNOS_PIN_BANK(2, 0x0c0, "gpv4"), +}; + +static const struct samsung_pin_bank_data exynos5250_pin_banks3[] = { + EXYNOS_PIN_BANK(7, 0x000, "gpz"), +}; + +static const struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { + { + .pin_banks = exynos5250_pin_banks0, + .nr_banks = ARRAY_SIZE(exynos5250_pin_banks0), + }, { + .pin_banks = exynos5250_pin_banks1, + .nr_banks = ARRAY_SIZE(exynos5250_pin_banks1), + }, { + .pin_banks = exynos5250_pin_banks2, + .nr_banks = ARRAY_SIZE(exynos5250_pin_banks2), + }, { + .pin_banks = exynos5250_pin_banks3, + .nr_banks = ARRAY_SIZE(exynos5250_pin_banks3), + }, + {/* list terminator */} +}; + +static const struct udevice_id exynos5250_pinctrl_ids[] = { + { .compatible = "samsung,exynos5250-pinctrl", + .data = (ulong)exynos5250_pin_ctrl }, + { } +}; + +U_BOOT_DRIVER(pinctrl_exynos5250) = { + .name = "pinctrl_exynos5250", + .id = UCLASS_PINCTRL, + .of_match = exynos5250_pinctrl_ids, + .priv_auto = sizeof(struct exynos_pinctrl_priv), + .ops = &exynos5250_pinctrl_ops, + .probe = exynos_pinctrl_probe, +}; -- 2.51.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices 2025-11-03 19:10 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann 2025-11-03 19:10 ` [PATCH v2 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver Lukas Timmermann 2025-11-03 19:10 ` [PATCH v2 2/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann @ 2026-02-02 8:33 ` Minkyu Kang 2026-02-09 18:02 ` Lukas Timmermann 2 siblings, 1 reply; 5+ messages in thread From: Minkyu Kang @ 2026-02-02 8:33 UTC (permalink / raw) To: 'Lukas Timmermann', u-boot Cc: 'Alif Zakuan Yuslaimi', 'Arturs Artamonovs', 'Eoin Dickson', 'Greg Malysa', 'Heiko Schocher', 'Henrik Grimler', 'Ian Roberts', 'J. Neuschäfer', 'Jerome Forissier', 'Kory Maincent (TI.com)', 'Marek Vasut', 'Mattijs Korpershoek', 'Nathan Barrett-Morrison', 'Neil Armstrong', 'Oliver Gaskell', 'Patrice Chotard', 'Peng Fan', 'Philip Molloy', 'Simon Glass', 'Stefan Roese', 'Tom Rini', 'Utsav Agarwal', 'Vasileios Bimpikas', 'Yao Zi' 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices 2026-02-02 8:33 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Minkyu Kang @ 2026-02-09 18:02 ` Lukas Timmermann 0 siblings, 0 replies; 5+ messages in thread From: Lukas Timmermann @ 2026-02-09 18:02 UTC (permalink / raw) To: Minkyu Kang, 'Lukas Timmermann', u-boot Cc: 'Alif Zakuan Yuslaimi', 'Arturs Artamonovs', 'Eoin Dickson', 'Greg Malysa', 'Heiko Schocher', 'Henrik Grimler', 'Ian Roberts', 'J. Neuschäfer', 'Jerome Forissier', 'Kory Maincent (TI.com)', 'Marek Vasut', 'Mattijs Korpershoek', 'Nathan Barrett-Morrison', 'Neil Armstrong', 'Oliver Gaskell', 'Patrice Chotard', 'Peng Fan', 'Philip Molloy', 'Simon Glass', 'Stefan Roese', 'Tom Rini', 'Utsav Agarwal', 'Vasileios Bimpikas', 'Yao Zi' 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 On Mon, Feb 02, 2026 at 05:33:50PM +0900, Minkyu Kang wrote: > 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. > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-09 18:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20251103191515epcas1p209371cc60bfa83914a77194d3899619b@epcas1p2.samsung.com>
2025-11-03 19:10 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann
2025-11-03 19:10 ` [PATCH v2 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver Lukas Timmermann
2025-11-03 19:10 ` [PATCH v2 2/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann
2026-02-02 8:33 ` [PATCH v2 0/2] Modern pinctrl for Exynos5250 devices Minkyu Kang
2026-02-09 18:02 ` Lukas Timmermann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox