* [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices
@ 2026-05-05 23:13 Lukas Timmermann
2026-05-05 23:13 ` [PATCH RFC v3 1/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Lukas Timmermann @ 2026-05-05 23:13 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent,
Peng Fan, Kuan-Wei Chiu, Raymond Mao, Quentin Schulz,
Stefan Roese, Philip Molloy, Jerome Forissier,
Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang,
Lukas Timmermann
This patch series adds the necessary files to use a modern pinctrl driver
with an exynos5250 SoC. The changes are well tested and are working.
In contrast to v1, this reenables GPIO functionality. But as I'm still
lacking experience, I'm not quite sure on how to prevent s5p_gpio to
load when using upstream DTS in a clean way. Because of that, this
patch series is marked as an RFC.
checkpatch complains about using #ifdef.
All changes were tested with an DT already in linux-next.
The tested device is a Google Nexus 10 (google-manta).
U-Boot was ported to that device and will be upstreamed into U-Boot
soon.
Changes in v3:
- Reenable s5p_gpio
- Fix new driver not binding s5p_gpio
Signed-off-by: Lukas Timmermann <uboot@timmermann.space>
---
Lukas Timmermann (2):
pinctrl: exynos: Add exynos5250 driver
gpio: s5p: Disable when using upstream DTS
MAINTAINERS | 5 ++
drivers/gpio/s5p_gpio.c | 2 +
drivers/pinctrl/exynos/Kconfig | 8 +++
drivers/pinctrl/exynos/Makefile | 1 +
drivers/pinctrl/exynos/pinctrl-exynos5250.c | 99 +++++++++++++++++++++++++++++
5 files changed, 115 insertions(+)
---
base-commit: 7d6cd981df6662ec042e570495b04dc922f0e9d7
change-id: 20260506-pinctrl-exyno5250-c5ae6f447b28
Best regards,
--
Lukas Timmermann <uboot@timmermann.space>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RFC v3 1/2] pinctrl: exynos: Add exynos5250 driver 2026-05-05 23:13 [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann @ 2026-05-05 23:13 ` Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS Lukas Timmermann 2026-05-06 13:14 ` [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Quentin Schulz 2 siblings, 0 replies; 6+ messages in thread From: Lukas Timmermann @ 2026-05-05 23:13 UTC (permalink / raw) To: u-boot Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent, Peng Fan, Kuan-Wei Chiu, Raymond Mao, Quentin Schulz, Stefan Roese, Philip Molloy, Jerome Forissier, Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang, Lukas Timmermann Adds the needed files for using the new pinctrl driver with exynos5250 SoCs. Signed-off-by: Lukas Timmermann <uboot@timmermann.space> --- MAINTAINERS | 5 ++ drivers/pinctrl/exynos/Kconfig | 8 +++ drivers/pinctrl/exynos/Makefile | 1 + drivers/pinctrl/exynos/pinctrl-exynos5250.c | 99 +++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0dcc7243124..475000e56da 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -625,6 +625,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..8e34f46921a --- /dev/null +++ b/drivers/pinctrl/exynos/pinctrl-exynos5250.c @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Exynos5250 pinctrl driver. + * + * Copyright (c) 2026 Lukas Timmermann <uboot@timmermann.space> + */ + +#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, + .bind = exynos_pinctrl_bind, +}; -- 2.54.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS 2026-05-05 23:13 [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 1/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann @ 2026-05-05 23:13 ` Lukas Timmermann 2026-05-05 23:28 ` Lukas Timmermann 2026-05-06 13:14 ` [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Quentin Schulz 2 siblings, 1 reply; 6+ messages in thread From: Lukas Timmermann @ 2026-05-05 23:13 UTC (permalink / raw) To: u-boot Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent, Peng Fan, Kuan-Wei Chiu, Raymond Mao, Quentin Schulz, Stefan Roese, Philip Molloy, Jerome Forissier, Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang, Lukas Timmermann Prevent the older s5p_gpio driver from probing when using upstream DTs because of incompatibilities. pinctrl_exynos5250 driver should be used instead which binds the s5p_gpio for gpio features but replaces pinctrl. Signed-off-by: Lukas Timmermann <uboot@timmermann.space> --- drivers/gpio/s5p_gpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index c072f146514..f32c5f7ae1a 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -353,7 +353,9 @@ static const struct udevice_id exynos_gpio_ids[] = { { .compatible = "samsung,s5pc110-pinctrl" }, { .compatible = "samsung,exynos4210-pinctrl" }, { .compatible = "samsung,exynos4x12-pinctrl" }, +#if IS_ENABLED(CONFIG_OF_UPSTREAM) { .compatible = "samsung,exynos5250-pinctrl" }, +#endif { .compatible = "samsung,exynos5420-pinctrl" }, { .compatible = "samsung,exynos78x0-gpio" }, { } -- 2.54.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS 2026-05-05 23:13 ` [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS Lukas Timmermann @ 2026-05-05 23:28 ` Lukas Timmermann 0 siblings, 0 replies; 6+ messages in thread From: Lukas Timmermann @ 2026-05-05 23:28 UTC (permalink / raw) To: Lukas Timmermann, u-boot Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent, Peng Fan, Kuan-Wei Chiu, Raymond Mao, Quentin Schulz, Stefan Roese, Philip Molloy, Jerome Forissier, Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang On Wed, May 06, 2026 at 01:13:30AM +0200, Lukas Timmermann wrote: > Prevent the older s5p_gpio driver from probing when using upstream DTs > because of incompatibilities. pinctrl_exynos5250 driver should be used > instead which binds the s5p_gpio for gpio features but replaces pinctrl. > > Signed-off-by: Lukas Timmermann <uboot@timmermann.space> > --- > drivers/gpio/s5p_gpio.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c > index c072f146514..f32c5f7ae1a 100644 > --- a/drivers/gpio/s5p_gpio.c > +++ b/drivers/gpio/s5p_gpio.c > @@ -353,7 +353,9 @@ static const struct udevice_id exynos_gpio_ids[] = { > { .compatible = "samsung,s5pc110-pinctrl" }, > { .compatible = "samsung,exynos4210-pinctrl" }, > { .compatible = "samsung,exynos4x12-pinctrl" }, > +#if IS_ENABLED(CONFIG_OF_UPSTREAM) I just noticed, that this if should be inverted. Will be fixed in the next patch. Sorry for the noise. > { .compatible = "samsung,exynos5250-pinctrl" }, > +#endif > { .compatible = "samsung,exynos5420-pinctrl" }, > { .compatible = "samsung,exynos78x0-gpio" }, > { } > > -- > 2.54.0 > Best regards Lukas Timmermann ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices 2026-05-05 23:13 [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 1/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS Lukas Timmermann @ 2026-05-06 13:14 ` Quentin Schulz 2026-05-19 16:32 ` Lukas Timmermann 2 siblings, 1 reply; 6+ messages in thread From: Quentin Schulz @ 2026-05-06 13:14 UTC (permalink / raw) To: Lukas Timmermann, u-boot Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent, Peng Fan, Kuan-Wei Chiu, Raymond Mao, Stefan Roese, Philip Molloy, Jerome Forissier, Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang Hi Lukas, On 5/6/26 1:13 AM, Lukas Timmermann wrote: > This patch series adds the necessary files to use a modern pinctrl driver > with an exynos5250 SoC. The changes are well tested and are working. > > In contrast to v1, this reenables GPIO functionality. But as I'm still > lacking experience, I'm not quite sure on how to prevent s5p_gpio to > load when using upstream DTS in a clean way. Because of that, this > patch series is marked as an RFC. > checkpatch complains about using #ifdef. > We already have an issue with samsung,exynos78x0-gpio so we'd need a similar work-around for that one. An easy way to sort this out would be to know if we know of devices which are still using the old binding? Qualcomm is rather special, is Samsung Exynos also special with regard to how it handles Device Trees? Do we get it from an earlier boot stage or is everything coming from U-Boot itself? If the latter, we can always migrate the existing devices to the new binding and remove support for the old binding and with it the same compatible in two drivers. Another question would be, does it make sense for both drivers to be compiled? If not (e.g. it's only pinctrl IPs inside an SoC and there's only one pinctrl device per SoC, so if your device supports the new binding, you only need the new driver). Then we can add a depends on !PINCTRL_EXYNOS5250 for CONFIG_S5P (we probably should have a different symbol for the GPIO driver though, maybe CONFIG_GPIO_S5P?). Cheers, Quentin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices 2026-05-06 13:14 ` [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Quentin Schulz @ 2026-05-19 16:32 ` Lukas Timmermann 0 siblings, 0 replies; 6+ messages in thread From: Lukas Timmermann @ 2026-05-19 16:32 UTC (permalink / raw) To: Quentin Schulz, Lukas Timmermann, u-boot Cc: Tom Rini, Simon Glass, Neil Armstrong, Yao Zi, Kory Maincent, Peng Fan, Kuan-Wei Chiu, Raymond Mao, Stefan Roese, Philip Molloy, Jerome Forissier, Kaustabh Chakraborty, Henrik Grimler, Minkyu Kang On Wed, May 06, 2026 at 03:14:11PM +0200, Quentin Schulz wrote: > Hi Lukas, > > On 5/6/26 1:13 AM, Lukas Timmermann wrote: > > This patch series adds the necessary files to use a modern pinctrl driver > > with an exynos5250 SoC. The changes are well tested and are working. > > > > In contrast to v1, this reenables GPIO functionality. But as I'm still > > lacking experience, I'm not quite sure on how to prevent s5p_gpio to > > load when using upstream DTS in a clean way. Because of that, this > > patch series is marked as an RFC. > > checkpatch complains about using #ifdef. > > > > We already have an issue with samsung,exynos78x0-gpio so we'd need a similar > work-around for that one. > > An easy way to sort this out would be to know if we know of devices which > are still using the old binding? Qualcomm is rather special, is Samsung > Exynos also special with regard to how it handles Device Trees? Do we get it > from an earlier boot stage or is everything coming from U-Boot itself? If > the latter, we can always migrate the existing devices to the new binding > and remove support for the old binding and with it the same compatible in > two drivers. Another question would be, does it make sense for both drivers > to be compiled? If not (e.g. it's only pinctrl IPs inside an SoC and there's > only one pinctrl device per SoC, so if your device supports the new binding, > you only need the new driver). Then we can add a > depends on !PINCTRL_EXYNOS5250 > for CONFIG_S5P (we probably should have a different symbol for the GPIO > driver though, maybe CONFIG_GPIO_S5P?). > > Cheers, > Quentin I'm sorry. Some of these Infos should've been in my original message: This driver replaces the pinctrl functionality in the old s5p_gpio driver. It doesn't replace GPIO functionality itself. So both drivers have to be compiled in order to work with modern upstream DTs. This driver binds the older s5p_gpio driver during its own binding. The pinctrl dt-bindings are incompatible to each other. This driver fixes pinctrl with upstream DTs and the older one must be used on it's own when relying on U-Boots deprecated DTs. DTs are provided by U-Boot itself, at least that's the case on my device (exynos5250-manta). If I understood you correctly, we could modify the deprecated exynos5250.dtsi to fix this situation. But I don't know about possible side effects and I'm not that experienced in kernel/bootloader development. Is this an option? I had split the gpio symbol into it's own thing before and could add that back into v4 but it's functionally the same. (Both drivers needed for upstream DT) Best regards, Lukas ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-05-19 20:05 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-05 23:13 [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 1/2] pinctrl: exynos: Add exynos5250 driver Lukas Timmermann 2026-05-05 23:13 ` [PATCH RFC v3 2/2] gpio: s5p: Disable when using upstream DTS Lukas Timmermann 2026-05-05 23:28 ` Lukas Timmermann 2026-05-06 13:14 ` [PATCH RFC v3 0/2] Modern pinctrl for Exynos5250 devices Quentin Schulz 2026-05-19 16:32 ` Lukas Timmermann
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.