Exynos5: Pinmux: Add fdt for pinmux
PATCH v5 1/1 Exynos5: Pinmux: Add fdt for pinmux
Hi Simon,
Quoted 24 lines
Hi Akshay,
Quoted 21 lines · Akshay Saraswat
This patch adds fdt nodes for peripherals which require pin muxing and configuration. Device tree bindings for pinctrl are kept same as required for Linux. Existing pinmux code modified to retrieve gpio range and function related info from fdt.
Depends-on: [U-Boot] [PATCH 0/4 V3] EXYNOS5: Add GPIO numbering feature
URL: http://lists.denx.de/pipermail/u-boot/2013-February/146151.htmlSigned-off-by Akshay Saraswat <[email protected]>---
Changes since v1:
- Device tree bindings changed to linux style.
- Added documentation for samsung pinctrl.Changes since v2:
- Rebased as per new version of GPIO numbering patch-set.Changes since v3:
- Added comments to reduce ambiguity and increase readability.
- Fixed few other nits.
Quoted 9 lines
Quoted 3 lines
Changes since v4:
- Added support for reading peripheral pinctrl subnode names from preipheral's node instead of hard coding.Well I have to say this is looking really nice. From what I can tell you are using the Linux binding for samsung,pinctrl-names - please can you add in that binding information to your binding file - I can't see it there?
"samsung,pinctrl-names" is already mentioned in example 3 of doc/device-tree-bindings/samsung-pinctrl.txt. samsung-pinctrl.txt in u-boot and kernel are same except the name exynos5 replaced exynos4210. Please tell me, if I misunderstood the requirement.
Quoted 6 lines
The interesting thing is that you should at some point (further patch) be able to remove the alias stuff and have the driver's pass their node offset into this function. Then we can drop the peripheral IDs altogether perhaps?
I think for now we should keep PERIPH_ID's because same pinmux.c and functions are being used by exynos4 and exynos4x12. Since, I thought we should not break support for these SoC's, I kept node retrieval in Pinmux itself instead of drivers or smdk5250.c. Please suggest.
Quoted 27 lines
Quoted 12 lines
arch/arm/cpu/armv7/exynos/pinmux.c | 357 +++++++------- arch/arm/dts/exynos5250-pinctrl.dtsi | 675 +++++++++++++++++++++++++++ arch/arm/dts/exynos5250.dtsi | 92 ++++ board/samsung/dts/exynos5250-smdk5250.dts | 11 + doc/device-tree-bindings/samsung-pinctrl.txt | 253 ++++++++++ include/fdtdec.h | 4 + lib/fdtdec.c | 4 + 7 files changed, 1231 insertions(+), 165 deletions(-) create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi create mode 100644 doc/device-tree-bindings/samsung-pinctrl.txt[..]
Quoted 13 lines
include/fdtdec.h +4
-0@@ -81,6 +81,10 @@ enum fdt_compat_id {COMPAT_SAMSUNG_EXYNOS_EHCI ,/* Exynos EHCI controller */ COMPAT_SAMSUNG_EXYNOS_USB_PHY ,/* Exynos phy controller for usb2.0 */ COMPAT_MAXIM_MAX77686_PMIC ,/* MAX77686 PMIC */ +COMPAT_SAMSUNG_EXYNOS_UART ,/* Exynos serial */ +COMPAT_SAMSUNG_EXYNOS_MSHC ,/* Exynos MMC controller */ +COMPAT_SAMSUNG_EXYNOS_I2S ,/* Exynos MMC controller */ + COMPAT_SAMSUNG_PINCTRL, /* PINCTRL */
Quoted 17 lines
Quoted 7 lines
include/fdtdec.h +0
-0COMPAT_COUNT, };lib/fdtdec.c +0
-0lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 62
Quoted 7 lines
lib/fdtdec.c +4
-0@@ -56,6 +56,10 @@ static const char * const compat_names[COMPAT_COUNT] = {COMPAT (SAMSUNG_EXYNOS_EHCI ,"samsung,exynos-ehci" ),COMPAT (SAMSUNG_EXYNOS_USB_PHY ,"samsung,exynos-usb-phy" ),COMPAT (MAXIM_MAX77686_PMIC ,"maxim,max77686_pmic" ), +COMPAT (SAMSUNG_EXYNOS_UART ,"samsung,exynos-uart" ), +COMPAT (SAMSUNG_EXYNOS_MSHC ,"samsung,exynos-mshc" ), +COMPAT (SAMSUNG_EXYNOS_I2S ,"samsung,exynos-i2s" ), + COMPAT(SAMSUNG_PINCTRL, "samsung,pinctrl"),Do these match the kernel names?
In kernel these are mentioned as ""samsung,exynos5250-dw-mshc"" & "samsung,exynos4210-uart". I wanted to keep it consistent with others like "samsung,exynos-ehci", "samsung,exynos-spi" etc., hence, made "samsung,exynos-mshc" & "samsung,exynos-uart". Shall I change it ?
Quoted 4 lines
lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] = { · line 64
Quoted 3 lines
lib/fdtdec.c +0
-0};
Regards,
Akshay Saraswat
PATCH v5 1/1 Exynos5: Pinmux: Add fdt for pinmux
Hi Akshay,
Quoted 38 lines · Akshay Saraswat
Hi Simon,
Quoted 3 lines
Hi Akshay,
On Thu, Mar 7, 2013 at 6:09 AM, Akshay Saraswat <[email protected]>
Quoted 17 lines · wrote:
Quoted 17 lines
This patch adds fdt nodes for peripherals which require pin muxing and configuration. Device tree bindings for pinctrl are kept same as required for Linux. Existing pinmux code modified to retrieve gpio range and function related info from fdt.
Depends-on: [U-Boot] [PATCH 0/4 V3] EXYNOS5: Add GPIO numbering feature
URL: http://lists.denx.de/pipermail/u-boot/2013-February/146151.htmlSigned-off-by Akshay Saraswat <[email protected]>---
Changes since v1:
- Device tree bindings changed to linux style.
- Added documentation for samsung pinctrl.Changes since v2:
- Rebased as per new version of GPIO numbering patch-set.Quoted 6 lines
Quoted 6 lines
Changes since v3:
- Added comments to reduce ambiguity and increase readability.
- Fixed few other nits.Changes since v4:
- Added support for reading peripheral pinctrl subnode namesfrom preipheral's node instead of hard coding.
Quoted 7 lines
Quoted 1 line
Well I have to say this is looking really nice. From what I can tell you are using the Linux binding for samsung,pinctrl-names - please can you add in that binding information to your binding file - I can't see it there?
Quoted 6 lines
"samsung,pinctrl-names" is already mentioned in example 3 of
doc/device-tree-bindings/samsung-pinctrl.txt. samsung-pinctrl.txt in u-boot and kernel are same except the name exynos5 replaced exynos4210.
Please tell me, if I misunderstood the requirement.
I don't see 'samsung,pinctrl-names' in example 3, but also, is it possible to mention this in the binding somehow?
The names should match the kernel if possible.
Quoted 8 lines
Quoted 7 lines
The interesting thing is that you should at some point (further patch) be able to remove the alias stuff and have the driver's pass their node offset into this function. Then we can drop the peripheral IDs altogether perhaps?
Quoted 7 lines
I think for now we should keep PERIPH_ID's because same
pinmux.cand functions are being used by
exynos4 and exynos4x12. Since, I thought we should not break support for these SoC's, I kept node
retrieval in Pinmux itself instead of drivers orsmdk5250.c. Please suggest.
That's fine. I suspect perhaps driver could pass their node offset, but let's worry about that another time.
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
arch/arm/cpu/armv7/exynos/pinmux.c | 357 +++++++------- arch/arm/dts/exynos5250-pinctrl.dtsi | 675+++++++++++++++++++++++++++
Quoted 11 lines
Quoted 9 lines
arch/arm/dts/exynos5250.dtsi | 92 ++++ board/samsung/dts/exynos5250-smdk5250.dts | 11 + doc/device-tree-bindings/samsung-pinctrl.txt | 253 ++++++++++ include/fdtdec.h | 4 + lib/fdtdec.c | 4 + 7 files changed, 1231 insertions(+), 165 deletions(-) create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi create mode 100644 doc/device-tree-bindings/samsung-pinctrl.txt[..]
Quoted 13 lines
Quoted 7 lines
include/fdtdec.h enum fdt_compat_id { · line 82
Quoted 7 lines
include/fdtdec.h +0
-0@@ -81,6 +81,10 @@ enum fdt_compat_id {COMPAT_SAMSUNG_EXYNOS_EHCI ,/* Exynos EHCI controller */ COMPAT_SAMSUNG_EXYNOS_USB_PHY, /* Exynos phy controller forusb2.0 */
Quoted 4 lines
Quoted 4 lines
include/fdtdec.h +3
-0COMPAT_MAXIM_MAX77686_PMIC ,/* MAX77686 PMIC */ +COMPAT_SAMSUNG_EXYNOS_UART ,/* Exynos serial */ +COMPAT_SAMSUNG_EXYNOS_MSHC ,/* Exynos MMC controller */ + COMPAT_SAMSUNG_EXYNOS_I2S, /* Exynos MMC controller */
This comment should be I2C.
Quoted 21 lines
Quoted 9 lines
lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT]
Quoted 9 lines
include/fdtdec.h +1
-0+COMPAT_SAMSUNG_PINCTRL ,/* PINCTRL */ COMPAT_COUNT, };lib/fdtdec.c +0
-0@@ -56,6 +56,10 @@ static const char * const compat_names[COMPAT_COUNT]= {
Quoted 10 lines
lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] · line 62
Quoted 7 lines
lib/fdtdec.c +4
-0COMPAT (SAMSUNG_EXYNOS_EHCI ,"samsung,exynos-ehci" ),COMPAT (SAMSUNG_EXYNOS_USB_PHY ,"samsung,exynos-usb-phy" ),COMPAT (MAXIM_MAX77686_PMIC ,"maxim,max77686_pmic" ), +COMPAT (SAMSUNG_EXYNOS_UART ,"samsung,exynos-uart" ), +COMPAT (SAMSUNG_EXYNOS_MSHC ,"samsung,exynos-mshc" ), +COMPAT (SAMSUNG_EXYNOS_I2S ,"samsung,exynos-i2s" ), + COMPAT(SAMSUNG_PINCTRL, "samsung,pinctrl"),Do these match the kernel names?
Quoted 7 lines
In kernel these are mentioned as ""samsung,exynos5250-dw-mshc"" & "samsung,exynos4210-uart".
I wanted to keep it consistent with others like "samsung,exynos-ehci", "samsung,exynos-spi" etc.,
hence, made "samsung,exynos-mshc" & "samsung,exynos-uart". Shall I change it ?
Yes, sorry, but I think we should keep things the same as the kernel. Perhaps that should be a separate patch to sync up the names?
Regards,
Simon
Quoted 9 lines
Quoted 5 lines
lib/fdtdec.c static const char * const compat_names[COMPAT_COUNT] · line 64
Quoted 4 lines
lib/fdtdec.c +0
-0};Regards,
Akshay Saraswat