diff mbox

[02/13] Documentation: add BCM6328 pincontroller binding documentation

Message ID 1471604025-21575-3-git-send-email-jonas.gorski@gmail.com
State New
Headers show

Commit Message

Jonas Gorski Aug. 19, 2016, 10:53 a.m. UTC
Add binding documentation for the pincontrol core found in BCM6328 SoCs.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 .../bindings/pinctrl/brcm,bcm6328-pinctrl.txt      | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt

Comments

Rob Herring Aug. 19, 2016, 2:14 p.m. UTC | #1
On Fri, Aug 19, 2016 at 12:53:34PM +0200, Jonas Gorski wrote:
> Add binding documentation for the pincontrol core found in BCM6328 SoCs.
> 
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
>  .../bindings/pinctrl/brcm,bcm6328-pinctrl.txt      | 61 ++++++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
> 
> diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
> new file mode 100644
> index 0000000..401224e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
> @@ -0,0 +1,61 @@
> +* Broadcom BCM6328 pin controller
> +
> +Required properties:
> +- compatible: Must be "brcm,bcm6328-pinctrl".
> +- reg: Register specifies of dirout, dat, mode, mux registers.
> +- reg-names: Must be "dirout", "dat", "mode", "mux".
> +- gpio-controller: Identifies this node as a GPIO controller.
> +- #gpio-cells: Must be <2>.
> +
> +Example:
> +
> +pinctrl: pin-controller@10000080 {
> +	compatible = "brcm,bcm6328-pinctrl";
> +	reg = <0x10000080 0x8>,
> +	      <0x10000088 0x8>,
> +	      <0x10000098 0x4>,
> +	      <0x1000009c 0xc>;
> +	reg-names = "dirout", "dat", "mode", "mux";

What's in the holes? Just do one range or perhaps this should be part of 
some larger block.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jonas Gorski Aug. 19, 2016, 2:30 p.m. UTC | #2
Hi

On 19 August 2016 at 16:14, Rob Herring <robh@kernel.org> wrote:
> On Fri, Aug 19, 2016 at 12:53:34PM +0200, Jonas Gorski wrote:
>> Add binding documentation for the pincontrol core found in BCM6328 SoCs.
>>
>> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
>> ---
>>  .../bindings/pinctrl/brcm,bcm6328-pinctrl.txt      | 61 ++++++++++++++++++++++
>>  1 file changed, 61 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
>>
>> diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
>> new file mode 100644
>> index 0000000..401224e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
>> @@ -0,0 +1,61 @@
>> +* Broadcom BCM6328 pin controller
>> +
>> +Required properties:
>> +- compatible: Must be "brcm,bcm6328-pinctrl".
>> +- reg: Register specifies of dirout, dat, mode, mux registers.
>> +- reg-names: Must be "dirout", "dat", "mode", "mux".
>> +- gpio-controller: Identifies this node as a GPIO controller.
>> +- #gpio-cells: Must be <2>.
>> +
>> +Example:
>> +
>> +pinctrl: pin-controller@10000080 {
>> +     compatible = "brcm,bcm6328-pinctrl";
>> +     reg = <0x10000080 0x8>,
>> +           <0x10000088 0x8>,
>> +           <0x10000098 0x4>,
>> +           <0x1000009c 0xc>;
>> +     reg-names = "dirout", "dat", "mode", "mux";
>
> What's in the holes? Just do one range or perhaps this should be part of
> some larger block.

For this particular SoC it's SPI Slave Config; Registers found in the
holes on other SoCs:

* TestControl
* OscControl (just the name, no other documentation what it does)
* Switch LED control (for integrated switches)
* Legacy LED controller
* Reset Controller for the VDSL PHY

And there are also usually quite a few other registers on this block.
This seems to have been treated as a "GPIO and everything else that
isn't large enough for its own block" by Broadcom - with BCM6328/6362
they even introduced a "MISC" block then.


Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Aug. 22, 2016, 12:51 p.m. UTC | #3
On Fri, Aug 19, 2016 at 4:30 PM, Jonas Gorski <jonas.gorski@gmail.com> wrote:
> On 19 August 2016 at 16:14, Rob Herring <robh@kernel.org> wrote:

>>> +pinctrl: pin-controller@10000080 {
>>> +     compatible = "brcm,bcm6328-pinctrl";
>>> +     reg = <0x10000080 0x8>,
>>> +           <0x10000088 0x8>,
>>> +           <0x10000098 0x4>,
>>> +           <0x1000009c 0xc>;
>>> +     reg-names = "dirout", "dat", "mode", "mux";
>>
>> What's in the holes? Just do one range or perhaps this should be part of
>> some larger block.
>
> For this particular SoC it's SPI Slave Config; Registers found in the
> holes on other SoCs:
>
> * TestControl
> * OscControl (just the name, no other documentation what it does)
> * Switch LED control (for integrated switches)
> * Legacy LED controller
> * Reset Controller for the VDSL PHY
>
> And there are also usually quite a few other registers on this block.
> This seems to have been treated as a "GPIO and everything else that
> isn't large enough for its own block" by Broadcom - with BCM6328/6362
> they even introduced a "MISC" block then.

What I would do myself is to put a syscon over this node.

syscon: syscon@10000080 {
    compatible = "broadcom,foo", "syscon";
    reg = <0x10000000 0x100>;
(...)

Or however that looks.

Then use the generic GPIO syscon driver on top of this,
see drivers/gpio/gpio-syscon.c

That driver does not support any pincontrol/muxing but
is a good candidate to handle the GPIO portions.

Syscons are there to handle these composite "misc sys
regs" devices.

You can even spawn subdevices to it by adding the
compatible-string "mfd-simple".

The rest of the subdevices would also have to be syscon
children.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
new file mode 100644
index 0000000..401224e
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
@@ -0,0 +1,61 @@ 
+* Broadcom BCM6328 pin controller
+
+Required properties:
+- compatible: Must be "brcm,bcm6328-pinctrl".
+- reg: Register specifies of dirout, dat, mode, mux registers.
+- reg-names: Must be "dirout", "dat", "mode", "mux".
+- gpio-controller: Identifies this node as a GPIO controller.
+- #gpio-cells: Must be <2>.
+
+Example:
+
+pinctrl: pin-controller@10000080 {
+	compatible = "brcm,bcm6328-pinctrl";
+	reg = <0x10000080 0x8>,
+	      <0x10000088 0x8>,
+	      <0x10000098 0x4>,
+	      <0x1000009c 0xc>;
+	reg-names = "dirout", "dat", "mode", "mux";
+
+	gpio-controller;
+	#gpio-cells = <2>;
+};
+
+Available pins/groups and functions:
+
+name		pins	functions
+-----------------------------------------------------------
+gpio0		0	led
+gpio1		1	led
+gpio2		2	led
+gpio3		3	led
+gpio4		4	led
+gpio5		5	led
+gpio6		6	led, serial_led_data
+gpio7		7	led, serial_led_clk
+gpio8		8	led
+gpio9		9	led
+gpio10		10	led
+gpio11		11	led
+gpio12		12	led
+gpio13		13	led
+gpio14		14	led
+gpio15		15	led
+gpio16		16	led, pcie_clkreq
+gpio17		17	led
+gpio18		18	led
+gpio19		19	led
+gpio20		20	led
+gpio21		21	led
+gpio22		22	led
+gpio23		23	led
+gpio24		24	-
+gpio25		25	ephy0_act_led
+gpio26		26	ephy1_act_led
+gpio27		27	ephy2_act_led
+gpio28		28	ephy3_act_led
+gpio29		29	-
+gpio30		30	-
+gpio31		31	-
+hsspi_cs1	-	hsspi_cs1
+usb_port1	-	usb_host_port, usb_device_port