pinctrl: sirf: add DT-binding pinmux mapping support
Subsystems (4)
PATCH RESEND 3/3 pinctrl: sirf: add DT-binding pinmux mapping support
From: Barry Song <[email protected]>
This makes us possible to define pinmux mapping in board-specific DTS. prima2.dtsi provides all possible (groups,functions) configuration, and device in .dts select configurations from dtsi files.
Signed-off-by Barry Song <[email protected]>
--- .../devicetree/bindings/pinctrl/pinctrl-sirf.txt | 44 ++++ arch/arm/boot/dts/prima2-evb.dts | 37 ++++ arch/arm/boot/dts/prima2.dtsi | 221 +++++++++++++++++++- arch/arm/mach-prima2/Makefile.boot | 2 + drivers/pinctrl/pinctrl-sirf.c | 58 +++++- 5 files changed, 359 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt create mode 100644 arch/arm/boot/dts/prima2-evb.dts
Documentation/devicetree/bindings/pinctrl/pinctrl-sirf.txt new file +44 -0
@@ -0,0 +1,44 @@ +CSR SiRFprimaII pinmux controller + +Required properties: +- compatible : "sirf,prima2-pinctrl" +- reg : Address range of the pinctrl registers +- interrupts : Interrupts used by every GPIO group +- gpio-controller : Indicates this device is a GPIO controller +- interrupt-controller : Marks the device node as an interrupt controller + +Please refer to pinctrl-bindings.txt in this directory for details of the common +pinctrl bindings used by client devices. + +SiRFprimaII's pinmux nodes act as a container for an abitrary number of subnodes. +Each of these subnodes represents some desired configuration for a group of pins. + +Required subnode-properties: +- sirf,pins : An array of strings. Each string contains the name of a group. +- sirf,function: A string containing the name of the function to mux to the + group. + + Valid values for group and function names can be found from looking at the + group and function arrays in driver files: + drivers/pinctrl/pinctrl-sirf.c + +For example, pinctrl might have subnodes like the following: + uart2_pins_a: uart2 at 0 { + uart { + sirf,pins = "uart2grp"; + sirf,function = "uart2"; + }; + }; + uart2_noflow_pins_a: uart2 at 1 { + uart { + sirf,pins = "uart2_nostreamctrlgrp"; + sirf,function = "uart2_nostreamctrl"; + }; + }; + +For a specific board, if it wants to use uart2 without hardware flow control, +it can add the following to its board-specific .dts file. +uart2: uart at 0xb0070000 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_noflow_pins_a>; +}
arch/arm/boot/dts/prima2-evb.dts new file +37 -0
@@ -0,0 +1,37 @@ +/* + * DTS file for CSR SiRFprimaII Evaluation Board + * + * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company. + * + * Licensed under GPLv2 or later. + */ + +/dts-v1/; + +/include/ "prima2.dtsi" + +/ { + model = "CSR SiRFprimaII Evaluation Board"; + compatible = "sirf,prima2", "sirf,prima2-cb"; + + memory { + reg = <0x00000000 0x20000000>; + }; + + axi { + peri-iobg { + uart at b0060000 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins_a>; + }; + spi at b00d0000 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins_a>; + }; + spi at b0170000 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins_a>; + }; + }; + }; +};
arch/arm/boot/dts/prima2.dtsi +219 -2
233 lines not on this page · raw message
arch/arm/mach-prima2/Makefile.boot +2 -0
@@ -1,3 +1,5 @@ zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 + +dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
drivers/pinctrl/pinctrl-sirf.c +57 -1
81 lines not on this page · raw message
Signature · 6 lines
1.7.0.4 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog