Modern pinctrl for Exynos5250 devices
Subsystems (5)
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 | 100 ++++++++++++++++++++ 7 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.c
Signature · 4 lines
2.51.0 base-commit: ebf4cce0b009e45b1d4e778603b74fae5ea29678 branch: lat3st/samsung-manta
RFC PATCH 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.
---
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
@@ -724,5 +724,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 5 family of SoCs. + This driver doesn't 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.0
Re: [RFC PATCH 1/2] gpio: s5p_gpio: Add config option for s5p_gpio driver
Hi Lukas,
Quoted 43 lines · Lukas Timmermann
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 <[email protected]>---
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 +0
-0
drivers/gpio/Kconfig config MPFS_GPIO · line 732
Quoted 9 lines
drivers/gpio/Kconfig +6
-0@@ -724,5 +724,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 5 family of SoCs.
S5P has more members than just Exynos 5, in fact it seems like most Exynos processors also have an S5Pxxxx name. Please make the description more general, as the driver is used by not only Exynos 5.
drivers/gpio/Kconfig config MPFS_GPIO · line 733
Quoted 1 line
drivers/gpio/Kconfig +1
-0+ This driver doesn't support upstream Linux device tree bindings.
Nitpick: AFAIK, as a non native speaker, "doesn't" is conversational / informal, and the long form 'does not' should be preferred in written English.
Best regards,
Henrik Grimler
Quoted 18 lines
drivers/gpio/Kconfig +0
-0endifdrivers/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.oSignature · 1 line
2.51.0
RFC PATCH 2/2 pinctrl: exynos: add exynos5250 driver
In reply to Lukas TimmermannAdds the needed files for using the new pinctrl driver with exynos5250 SoCs.
---
MAINTAINERS | 5 + drivers/pinctrl/exynos/Kconfig | 8 ++ drivers/pinctrl/exynos/Makefile | 1 + drivers/pinctrl/exynos/pinctrl-exynos5250.c | 100 ++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.c
MAINTAINERS +5 -0
@@ -606,6 +606,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 +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [RFC PATCH 2/2] pinctrl: exynos: add exynos5250 driver
Hi Lukas,
Quoted 66 lines · Lukas Timmermann
Adds the needed files for using the new pinctrl driver with exynos5250 SoCs.
Signed-off-by Lukas Timmermann <[email protected]>---
MAINTAINERS | 5 + drivers/pinctrl/exynos/Kconfig | 8 ++ drivers/pinctrl/exynos/Makefile | 1 + drivers/pinctrl/exynos/pinctrl-exynos5250.c | 100 ++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.cMAINTAINERS +5
-0@@ -606,6 +606,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: Maintaineddrivers/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_FULLdrivers/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.odrivers/pinctrl/exynos/pinctrl-exynos5250.c new file +0
-0
drivers/pinctrl/exynos/pinctrl-exynos5250.c line 5
Quoted 5 lines
drivers/pinctrl/exynos/pinctrl-exynos5250.c new file +5
-0@@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (c) 2023 Linaro Ltd. +* Author: Sam Protsenko <[email protected]> +* Co-author: Lukas Timmermann <[email protected]>
I think "Co-author:" is generally not used, please consider settings yourself as just "Author:"
Quoted 48 lines
drivers/pinctrl/exynos/pinctrl-exynos5250.c new file +48
-0+* +* 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" ),
drivers/pinctrl/exynos/pinctrl-exynos5250.c line 63
Quoted 10 lines
drivers/pinctrl/exynos/pinctrl-exynos5250.c new file +10
-0+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"),
Lower-case letters in the constants please, in all the bank structs.
Otherwise looks good to me, thanks!
Best regards,
Henrik Grimler
Quoted 40 lines
drivers/pinctrl/exynos/pinctrl-exynos5250.c new file +37
-0+}; + +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, +};Signature · 1 line
2.51.0
Hi Lukas,
Quoted 5 lines · Lukas Timmermann
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_gpiodriver needs to be disabled for the newer driver to work.
Quoted 8 lines
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.
For future submissions, please use the ./scripts/get_maintainer.pl script to more easily send the patches to the maintainers, reviewers and others that might be interested in the patch. Alternatively, please consider using b4 to arrange and handle the patches, it has an option --auto-to-cc which can help find suitable receivers.
Best regards,
Henrik Grimler
Quoted 21 lines
Signed-off-by Lukas Timmermann <[email protected]>Lukas Timmermann (2):
gpio:s5p_gpio: Add config option fors5p_gpiodriver
pinctrl: exynos: add exynos5250 driverMAINTAINERS | 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 | 100 ++++++++++++++++++++ 7 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 drivers/pinctrl/exynos/pinctrl-exynos5250.cSignature · 4 lines
2.51.0 base-commit: ebf4cce0b009e45b1d4e778603b74fae5ea29678 branch: lat3st/samsung-manta