Skip to contentSkip to conversation

dt: bindings: add bindings for Broadcom bcm43xx sdio devices

RFC Superseded Arend van Spriel 8 participants 16 messages Feb 10, 2014 – Apr 11, 2014

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 dt: bindings: add bindings for Broadcom bcm43xx sdio devices

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

---
 .../staging/net/wireless/brcm,bcm43xx-fmac.txt     |   37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +37 -0
new file mode 100644
index 0000000..535f343
@@ -0,0 +1,37 @@
+Broadcom BCM43xx Fullmac wireless SDIO devices
+
+This node provides properties for controlling the Broadcom wireless device. The
+node is expected to be specified as a child node to the MMC controller that
+connects the device to the system.
+
+Required properties:
+
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+	the device/module.
+
+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device (default = 6mA).
+ - interrupt-parent : the phandle for the interrupt controller to which the
+	device interrupt (HOST_WAKE) is connected.
+ - interrupts : interrupt specifier encoded according the interrupt controller
+	specified by interrupt-parent property.
+
+Example:
+
+mmc3: mmc@01c20000 {
+	pinctrl-0 = <&mmc3_pins>;
+	pinctrl-1 = <&wifi_host_wake>;
+	vmmc-supply = <&mmc3_supply>;
+	bus-width = <4>;
+
+	bcm4335: bcm4335@0 {
+		compatible = "brcm,bcm43xx-fmac";
+		wlan-supply = <&wlan-reg>;
+		drive-strength = <4>;
+		interrupt-parent = <&gpx2>;
+		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "HOST_WAKE";
+	};
+};
+
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 11 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

Quoted 6 lines

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Hi,

I believe the interrupts and drive-strength properties are Ok. However, letting the platform driver power up the wifi chip does not guarantee proper ordering, does it? I mean, what if the MMC bus was probed before the (non-removable) chip was switched on?

Being able to tie that to the mmc controller would be better IMO. I think this was discussed in Olof's "mmc: add support for power-on sequencing through DT" thread.

Thanks!
ChenYu

Quoted 6 lines

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

#2 lore raw
In reply to Arend van Spriel

Hi Arend,

Quoted 35 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

---
  .../staging/net/wireless/brcm,bcm43xx-fmac.txt     |   37 ++++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644 Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +1 -0
new file mode 100644
index 0000000..535f343
@@ -0,0 +1,37 @@
+Broadcom BCM43xx Fullmac wireless SDIO devices

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +10 -0
+
+This node provides properties for controlling the Broadcom wireless device. The
+node is expected to be specified as a child node to the MMC controller that
+connects the device to the system.
+
+Required properties:
+
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+	the device/module.

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 14

Quoted 3 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
+
+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device (default = 6mA).

This should be a part of the MMC binding, I think. Probably also moved under MMC controller's node, since it's a board-specific property altering the parameters of the MMC controller, not the WLAN chip.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 18

Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+ - interrupt-parent : the phandle for the interrupt controller to which the
+	device interrupt (HOST_WAKE) is connected.
+ - interrupts : interrupt specifier encoded according the interrupt controller
+	specified by interrupt-parent property.

I would also add a clock here, since the BCM43xx chips usually need a 32k clock to operate (or at least the ones I used to work with did). It can be optional, as not all systems can control this clock.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 24

Quoted 6 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +6 -0
+
+Example:
+
+mmc3: mmc@01c20000 {
+	pinctrl-0 = <&mmc3_pins>;
+	pinctrl-1 = <&wifi_host_wake>;

WLAN_HOST_WAKE pin (aka the OOB interrupt) is specific to the WLAN chip, so this should be rather configured in a pinctrl state of the WLAN chip itself.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 28

Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+	vmmc-supply = <&mmc3_supply>;
+	bus-width = <4>;
+
+	bcm4335: bcm4335@0 {

nit: Why @0, if there is no reg property under this node?

Best regards,
Tomasz

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 37

Quoted 10 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +9 -0
+		compatible = "brcm,bcm43xx-fmac";
+		wlan-supply = <&wlan-reg>;
+		drive-strength = <4>;
+		interrupt-parent = <&gpx2>;
+		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "HOST_WAKE";
+	};
+};
+

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Hi,

Quoted 54 lines · Tomasz Figa

Hi Arend,

Quoted 50 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

---
  .../staging/net/wireless/brcm,bcm43xx-fmac.txt     |   37
++++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

diff --git a/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file mode 100644
index 0000000..535f343
--- /dev/null
+++
b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
@@ -0,0 +1,37 @@
+Broadcom BCM43xx Fullmac wireless SDIO devices
+
+This node provides properties for controlling the Broadcom wireless

device. The
+node is expected to be specified as a child node to the MMC controller that

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+connects the device to the system.
+
+Required properties:
+
Quoted 8 lines
Quoted 3 lines

+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+ the device/module.

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

Actually some (I only have one kind) of the chips have 2 GPIO lines, but they are almost always tied together in the module or on the board.

Quoted 4 lines

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Quoted 9 lines
Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
+
+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device (default

= 6mA).

This should be a part of the MMC binding, I think. Probably also moved under MMC controller's node, since it's a board-specific property altering the parameters of the MMC controller, not the WLAN chip.

AFAIK, this controls the drive strength for MMC on the WLAN chip's MMC controller.

Quoted 11 lines
Quoted 6 lines

+ - interrupt-parent : the phandle for the interrupt controller to which the
+ device interrupt (HOST_WAKE) is connected.
+ - interrupts : interrupt specifier encoded according the interrupt controller
+ specified by interrupt-parent property.

I would also add a clock here, since the BCM43xx chips usually need a 32k clock to operate (or at least the ones I used to work with did). It can be optional, as not all systems can control this clock.

2, the main oscillator (MHz range) and the low power clock (32.768 KHz). In the other thread, someone mentioned they had to enable the main oscillator separately.

Quoted 10 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 24

Quoted 6 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +6 -0
+
+Example:
+
+mmc3: mmc@01c20000 {
+       pinctrl-0 = <&mmc3_pins>;
+       pinctrl-1 = <&wifi_host_wake>;

WLAN_HOST_WAKE pin (aka the OOB interrupt) is specific to the WLAN chip, so this should be rather configured in a pinctrl state of the WLAN chip itself.

AFAIK, the pinctrl in tied to the device node, and is selected when the device is registered. The MMC subsystem currently does not register child nodes, so this would be useless.

brcmfmac actually has to walk the whole DT to find the node with the right compatible.

Quoted 7 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 28

Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+       vmmc-supply = <&mmc3_supply>;
+       bus-width = <4>;
+
+       bcm4335: bcm4335@0 {

nit: Why @0, if there is no reg property under this node?

Off chance that you have 2 or more nodes with the same name? The node name should be more generic, too.

This brings about a different problem, how should driver in its current state, differentiate between the two? And brcmfmac only supports one set of platform data ATM.

Cheers
ChenYu

Quoted 4 lines

Best regards,
Tomasz

Quoted 11 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 37

Quoted 10 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +9 -0
+               compatible = "brcm,bcm43xx-fmac";
+               wlan-supply = <&wlan-reg>;
+               drive-strength = <4>;
+               interrupt-parent = <&gpx2>;
+               interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "HOST_WAKE";
+       };
+};
+

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Tomasz Figa
Quoted 63 lines · Tomasz Figa

Hi Arend,

Quoted 48 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

---
  .../staging/net/wireless/brcm,bcm43xx-fmac.txt     |   37
++++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

diff --git a/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

new file mode 100644
index 0000000..535f343
--- /dev/null
+++
b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
@@ -0,0 +1,37 @@
+Broadcom BCM43xx Fullmac wireless SDIO devices
+
+This node provides properties for controlling the Broadcom wireless

device. The
+node is expected to be specified as a child node to the MMC controller that

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 7 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +7 -0
+connects the device to the system.
+
+Required properties:
+
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+    the device/module.

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

Quoted 2 lines

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Not sure I understand. Do you really mean 'chip' or 'wifi module' here. The chip needs to be powered and for that it is hooked up to a host/module provided GPIO (at least that is my understanding).

Quoted 8 lines
Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
+
+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device

(default = 6mA).

This should be a part of the MMC binding, I think. Probably also moved under MMC controller's node, since it's a board-specific property altering the parameters of the MMC controller, not the WLAN chip.

It is an electrical interfacing parameter between MMC controller and the device. The specified drive-strength here is used to configure the PMU on the chip so it is really related to the the chip.

Quoted 11 lines
Quoted 6 lines

+ - interrupt-parent : the phandle for the interrupt controller to which the
+ device interrupt (HOST_WAKE) is connected.
+ - interrupts : interrupt specifier encoded according the interrupt controller
+ specified by interrupt-parent property.

I would also add a clock here, since the BCM43xx chips usually need a 32k clock to operate (or at least the ones I used to work with did). It can be optional, as not all systems can control this clock.

Quoted 10 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 24

Quoted 6 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +6 -0
+
+Example:
+
+mmc3: mmc@01c20000 {
+    pinctrl-0 = <&mmc3_pins>;
+    pinctrl-1 = <&wifi_host_wake>;

WLAN_HOST_WAKE pin (aka the OOB interrupt) is specific to the WLAN chip, so this should be rather configured in a pinctrl state of the WLAN chip itself.

You mean that pinctrl-1 should move inside the "brcm,bcm43xx-fmac" node, right?

Quoted 6 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 28

Quoted 4 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+    vmmc-supply = <&mmc3_supply>;
+    bus-width = <4>;
+
+    bcm4335: bcm4335@0 {

nit: Why @0, if there is no reg property under this node?

I am not fluent with devicetree specifications (yet) nor know all the conventions.

Quoted 2 lines

Best regards,
Tomasz

Thanks,
Arend

Quoted 10 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 37

Quoted 10 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +9 -0
+        compatible = "brcm,bcm43xx-fmac";
+        wlan-supply = <&wlan-reg>;
+        drive-strength = <4>;
+        interrupt-parent = <&gpx2>;
+        interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "HOST_WAKE";
+    };
+};
+

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 64 lines · Arend van Spriel
Quoted 63 lines · Tomasz Figa

Hi Arend,

Quoted 48 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

---
This devicetree binding proposal is intended for platforms with Broadcom wireless device in MMC sdio slot. These devices may have their own interrupt and power line. Also the SDIO drive strength is often hardware dependent and expressed in this binding.

Not sure if this should go in staging or not. Feel free to comment on this proposal.

Regards,
Arend

---
   .../staging/net/wireless/brcm,bcm43xx-fmac.txt     |   37
++++++++++++++++++++
   1 file changed, 37 insertions(+)

create mode 100644
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

diff --git a/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

new file mode 100644
index 0000000..535f343
--- /dev/null
+++
b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
@@ -0,0 +1,37 @@
+Broadcom BCM43xx Fullmac wireless SDIO devices
+
+This node provides properties for controlling the Broadcom wireless

device. The
+node is expected to be specified as a child node to the MMC controller that

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 7 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +7 -0
+connects the device to the system.
+
+Required properties:
+
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+    the device/module.

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

Quoted 6 lines
Quoted 2 lines

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Not sure I understand. Do you really mean 'chip' or 'wifi module' here. The chip needs to be powered and for that it is hooked up to a host/module provided GPIO (at least that is my understanding).

Your binding asks for a regulator, not a simple GPIO, which is all I believe you need for BCM43xx power handling.

Mark (added to Cc), could we get your opinion on this?

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +3 -0
+
+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device

(default = 6mA).

This should be a part of the MMC binding, I think. Probably also moved under MMC controller's node, since it's a board-specific property altering the parameters of the MMC controller, not the WLAN chip.

Quoted 4 lines

It is an electrical interfacing parameter between MMC controller and the device. The specified drive-strength here is used to configure the PMU on the chip so it is really related to the the chip.

Aha, so I misunderstood the description. Anyway, if it's a device-specific property, it should have vendor prefix ("brcm,").

Quoted 22 lines
Quoted 11 lines
Quoted 6 lines

+ - interrupt-parent : the phandle for the interrupt controller to which the
+ device interrupt (HOST_WAKE) is connected.
+ - interrupts : interrupt specifier encoded according the interrupt controller
+ specified by interrupt-parent property.

I would also add a clock here, since the BCM43xx chips usually need a 32k clock to operate (or at least the ones I used to work with did). It can be optional, as not all systems can control this clock.

Quoted 10 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 24

Quoted 6 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +6 -0
+
+Example:
+
+mmc3: mmc@01c20000 {
+    pinctrl-0 = <&mmc3_pins>;
+    pinctrl-1 = <&wifi_host_wake>;

WLAN_HOST_WAKE pin (aka the OOB interrupt) is specific to the WLAN chip, so this should be rather configured in a pinctrl state of the WLAN chip itself.

Quoted 2 lines

You mean that pinctrl-1 should move inside the "brcm,bcm43xx-fmac" node, right?

Yes.

By the way, if not moved to device node, shouldn't it rather be just another entry of pinctrl-0? Also isn't pinctrl-names property missing here?

Quoted 10 lines
Quoted 7 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 28

Quoted 5 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +4 -0
+    vmmc-supply = <&mmc3_supply>;
+    bus-width = <4>;
+
+    bcm4335: bcm4335@0 {

nit: Why @0, if there is no reg property under this node?

I am not fluent with devicetree specifications (yet) nor know all the conventions.

The "@" suffix is reserved for bus constructs, where the unit-address value after "@" corresponds to first address in reg property of the node. Here you could just simply use "bcm4335" or if you somehow manage to have two such chips (which I don't think is likely to happen) then you could use "bcm4335-1".

Best regards,
Tomasz

#9 lore raw
Quoted 10 lines · Tomasz Figa
Quoted 8 lines · Arend van Spriel
Quoted 6 lines · Tomasz Figa

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Quoted 8 lines
Quoted 3 lines

Not sure I understand. Do you really mean 'chip' or 'wifi module' here. The chip needs to be powered and for that it is hooked up to a host/module provided GPIO (at least that is my understanding).

Your binding asks for a regulator, not a simple GPIO, which is all I believe you need for BCM43xx power handling.

Mark (added to Cc), could we get your opinion on this?

If it's a GPIO connected directly to the device it should be using gpiolib, the fact that it happens to have an effect on power rather than (say) just being a reset isn't terribly relevant to anything outside the driver. If it's an external regulator that happens to be controlled using a GPIO on the current system then a regulator is better since another system might use a regulator with a different control interface.

#12 lore raw
In reply to Arend van Spriel

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 11 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +3 -0
 
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+	the device/module.

Ignoring the fact that perhaps this should just be a GPIO instead and assuming it actually make sense for this to be a regulator:

Why "fixed regulator" not just "the regulator". There shouldn't be any requirement for the power supply to the device to be fixed; the driver should (a) set the voltage (which will be a no-op for a fixed regulator already providing that voltage), then (b) enable the regulator. That would allow a PMIC with programmable voltage to be feeding the device.

Now, if this property was really intended to control some enable GPIO on the device, as others have said, this shouldn't be a regulator property but rather a GPIO property. However, there is definitely some power supply fed to the device, so you definitely need /some/ supply property here.

Aren't there other enable GPIOs required? These should be specified in DT.

Doesn't the WiFi chip/module require a (32KHz?) clock? If so, that needs to be represented in DT. Preferably write the binding to require clock-names (name-based lookup) rather than just clocks (index-based lookup).

Quoted 2 lines

+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device (default = 6mA).

As mentioned elsewhere, since that's a binding-specific property, rename it brcm,drive-strength.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 16

Quoted 2 lines

+ - interrupt-parent : the phandle for the interrupt controller to which the

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +1 -0
+	device interrupt (HOST_WAKE) is connected.

That's such a common property, individual bindings don't typically mention it.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 18

Quoted 2 lines

+ - interrupts : interrupt specifier encoded according the interrupt controller

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +1 -0
+	specified by interrupt-parent property.

The description of the property should say which interrupt (name and/or description) it's describing, even if there's only 1.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 26

Quoted 5 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +5 -0
+mmc3: mmc@01c20000 {
+	pinctrl-0 = <&mmc3_pins>;
+	pinctrl-1 = <&wifi_host_wake>;
+	vmmc-supply = <&mmc3_supply>;
+	bus-width = <4>;

None of that is really relevant to this binding, and may vary from SDIO controller to SDIO controller, so may end up being wrong.

I'm not sure whether it makes sense to show the example inside some arbitrary SDIO controller node. Perhaps /just/ put the WiFi node in the example? The text above should be enough to describe that the node should be inside an SDIO controller.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 34

Quoted 7 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +7 -0
+	bcm4335: bcm4335@0 {
+		compatible = "brcm,bcm43xx-fmac";
+		wlan-supply = <&wlan-reg>;
+		drive-strength = <4>;
+		interrupt-parent = <&gpx2>;
+		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "HOST_WAKE";

interrupt-names wasn't documented in the list of properties above. Entries in *-names properties are usually lower-case.

#13 lore raw
Quoted 28 lines · Stephen Warren

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 11 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +3 -0
 
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+	the device/module.

Ignoring the fact that perhaps this should just be a GPIO instead and assuming it actually make sense for this to be a regulator:

Why "fixed regulator" not just "the regulator". There shouldn't be any requirement for the power supply to the device to be fixed; the driver should (a) set the voltage (which will be a no-op for a fixed regulator already providing that voltage), then (b) enable the regulator. That would allow a PMIC with programmable voltage to be feeding the device.

Now, if this property was really intended to control some enable GPIO on the device, as others have said, this shouldn't be a regulator property but rather a GPIO property. However, there is definitely some power supply fed to the device, so you definitely need /some/ supply property here.

Quoted 6 lines

Aren't there other enable GPIOs required? These should be specified in DT.

Doesn't the WiFi chip/module require a (32KHz?) clock? If so, that needs to be represented in DT. Preferably write the binding to require clock-names (name-based lookup) rather than just clocks (index-based lookup).

Hi Stephen,

Thanks for these comments. While I agree with most of them, I am having some difficulty with the DT concept. Essentially, a DT node describes a part of the system. My scope for this change is probably limited wearing my brcmfmac glasses. Am I correct in assuming that a DT node may be processed/used by multiple drivers. As an example, the 32 kHz clock is not something brcmfmac cares about. It simple needs to be available and hooked up to the wlan device. The DT should have another node for this clock which a (common) clock driver picks up. So having it referenced in this node is purely informational, right?

Regards,
Arend

Quoted 44 lines
Quoted 2 lines

+Optional properties:
+ - drive-strength : drive strength used for SDIO pins on device (default = 6mA).

As mentioned elsewhere, since that's a binding-specific property, rename it brcm,drive-strength.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 16

Quoted 2 lines

+ - interrupt-parent : the phandle for the interrupt controller to which the

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +1 -0
+	device interrupt (HOST_WAKE) is connected.

That's such a common property, individual bindings don't typically mention it.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 18

Quoted 2 lines

+ - interrupts : interrupt specifier encoded according the interrupt controller

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +1 -0
+	specified by interrupt-parent property.

The description of the property should say which interrupt (name and/or description) it's describing, even if there's only 1.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 26

Quoted 5 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +5 -0
+mmc3: mmc@01c20000 {
+	pinctrl-0 = <&mmc3_pins>;
+	pinctrl-1 = <&wifi_host_wake>;
+	vmmc-supply = <&mmc3_supply>;
+	bus-width = <4>;

None of that is really relevant to this binding, and may vary from SDIO controller to SDIO controller, so may end up being wrong.

I'm not sure whether it makes sense to show the example inside some arbitrary SDIO controller node. Perhaps /just/ put the WiFi node in the example? The text above should be enough to describe that the node should be inside an SDIO controller.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 34

Quoted 7 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +7 -0
+	bcm4335: bcm4335@0 {
+		compatible = "brcm,bcm43xx-fmac";
+		wlan-supply = <&wlan-reg>;
+		drive-strength = <4>;
+		interrupt-parent = <&gpx2>;
+		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "HOST_WAKE";

interrupt-names wasn't documented in the list of properties above. Entries in *-names properties are usually lower-case.

#14 lore raw

Hi Arend,

Quoted 36 lines · Arend van Spriel
Quoted 28 lines · Stephen Warren

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt line 11

Quoted 11 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt +3 -0
 
+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+	the device/module.

Ignoring the fact that perhaps this should just be a GPIO instead and assuming it actually make sense for this to be a regulator:

Why "fixed regulator" not just "the regulator". There shouldn't be any requirement for the power supply to the device to be fixed; the driver should (a) set the voltage (which will be a no-op for a fixed regulator already providing that voltage), then (b) enable the regulator. That would allow a PMIC with programmable voltage to be feeding the device.

Now, if this property was really intended to control some enable GPIO on the device, as others have said, this shouldn't be a regulator property but rather a GPIO property. However, there is definitely some power supply fed to the device, so you definitely need /some/ supply property here.

Quoted 6 lines

Aren't there other enable GPIOs required? These should be specified in DT.

Doesn't the WiFi chip/module require a (32KHz?) clock? If so, that needs to be represented in DT. Preferably write the binding to require clock-names (name-based lookup) rather than just clocks (index-based lookup).

Quoted 5 lines

Hi Stephen,

Thanks for these comments. While I agree with most of them, I am having some difficulty with the DT concept. Essentially, a DT node describes a part of the system.

That's correct. A DT node represents a component of a system and its contents should contain all resources and other device-specific data required for this device to operate or optional.

Quoted 3 lines

My scope for this change is probably limited wearing
my brcmfmac glasses. Am I correct in assuming that a DT node may be processed/used by multiple drivers.

It may be, but it is usually not. The typical use case for such scheme is a bus-like topology, where devices on the bus are sub-nodes of the bus controller node and may contain some bus-specific information, such as chip select (e.g. SPI), address (e.g. I2C) or maximum bus speed.

Quoted 3 lines

As an example, the 32 kHz clock is
not something brcmfmac cares about. It simple needs to be available and hooked up to the wlan device.

Not really. The driver should care about any resources needed for the device to operate. In this case, a 32 kHz clock even if wired to the chip, sometimes is not operational until it gets ungated. This is not an artificial example, as on many boards I used to work with the 32 kHz clock was driven by a PMIC with clock gating control through I2C, gated by default.

Moreover, (well, 32 kHz might not be the best example) from power saving reasons, it might be a good idea to let the driver control the clock and gate it whenever it is not necessary.

Quoted 3 lines

The DT should have another node for this
clock which a (common) clock driver picks up. So having it referenced in this node is purely informational, right?

You are confusing here provider with consumer. The bcm43xx chip is clearly a consumer of a 32 kHz clock and so its DT node should specify this.

A DT node for a clock, would be a clock provider node and that would be handled by common clock framework in case of Linux indeed. A clock provider node doesn't have to be limited to a single clock, though. In the case I mentioned above, PMIC node would be a clock provider and PMIC driver would register necessary clocks in common clock framework.

Best regards,
Tomasz

#15 lore raw
Quoted 73 lines · Tomasz Figa

Hi Arend,

Quoted 40 lines · Arend van Spriel
Quoted 31 lines · Stephen Warren
Quoted 6 lines · Arend van Spriel

The Broadcom bcm43xx sdio devices are fullmac devices that may be integrated in ARM platforms. Currently, the brcmfmac driver for these devices support use of platform data. This patch specifies the bindings that allow this platform data to be expressed in the devicetree.

Quoted 8 lines

diff --git a/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

+ - compatible : Should be "brcm,bcm43xx-fmac".
+ - wlan-supply : phandle for fixed regulator used to control power for
+ the device/module.

Ignoring the fact that perhaps this should just be a GPIO instead and assuming it actually make sense for this to be a regulator:

Why "fixed regulator" not just "the regulator". There shouldn't be any requirement for the power supply to the device to be fixed; the driver should (a) set the voltage (which will be a no-op for a fixed regulator already providing that voltage), then (b) enable the regulator. That would allow a PMIC with programmable voltage to be feeding the device.

Now, if this property was really intended to control some enable GPIO on the device, as others have said, this shouldn't be a regulator property but rather a GPIO property. However, there is definitely some power supply fed to the device, so you definitely need /some/ supply property here.

Quoted 7 lines

Aren't there other enable GPIOs required? These should be specified in DT.

Doesn't the WiFi chip/module require a (32KHz?) clock? If so, that needs to be represented in DT. Preferably write the binding to require clock-names (name-based lookup) rather than just clocks (index-based lookup).

Quoted 5 lines

Hi Stephen,

Thanks for these comments. While I agree with most of them, I am having some difficulty with the DT concept. Essentially, a DT node describes a part of the system.

That's correct. A DT node represents a component of a system and its contents should contain all resources and other device-specific data required for this device to operate or optional.

Quoted 3 lines

My scope for this change is probably limited wearing
my brcmfmac glasses. Am I correct in assuming that a DT node may be processed/used by multiple drivers.

It may be, but it is usually not. The typical use case for such scheme is a bus-like topology, where devices on the bus are sub-nodes of the bus controller node and may contain some bus-specific information, such as chip select (e.g. SPI), address (e.g. I2C) or maximum bus speed.

Quoted 3 lines

As an example, the 32 kHz clock is
not something brcmfmac cares about. It simple needs to be available and hooked up to the wlan device.

Not really. The driver should care about any resources needed for the device to operate. In this case, a 32 kHz clock even if wired to the chip, sometimes is not operational until it gets ungated. This is not an artificial example, as on many boards I used to work with the 32 kHz clock was driven by a PMIC with clock gating control through I2C, gated by default.

Quoted 3 lines

Moreover, (well, 32 kHz might not be the best example) from power saving reasons, it might be a good idea to let the driver control the clock and gate it whenever it is not necessary.

Hi Tomasz,

Thanks. That clarifies things.

Quoted 8 lines
Quoted 3 lines

The DT should have another node for this
clock which a (common) clock driver picks up. So having it referenced in this node is purely informational, right?

You are confusing here provider with consumer. The bcm43xx chip is clearly a consumer of a 32 kHz clock and so its DT node should specify this.

Quoted 5 lines

A DT node for a clock, would be a clock provider node and that would be handled by common clock framework in case of Linux indeed. A clock provider node doesn't have to be limited to a single clock, though. In the case I mentioned above, PMIC node would be a clock provider and PMIC driver would register necessary clocks in common clock framework.

I see. I figured the provider driver would not do that when the device tree did not contain a consumer. Either, it is now clear what is required from brcmfmac driver regarding clocks and gpios. Just still not sure about the wlan-supply property. Does it depend on the specific platform whether it is a gpio or regulator, ie. should I support both (mutual exclusive or not).

Regards,
Arend
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Chen-Yu Tsai
Quoted 7 lines · Chen-Yu Tsai

Hi,

Quoted 4 lines · Tomasz Figa

Hi Arend,

On 10.02.2014 20:17, Arend van Spriel wrote:

[...]

Quoted 10 lines
Quoted 10 lines

Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt

Quoted 6 lines
Documentation/devicetree/bindings/staging/net/wireless/brcm,bcm43xx-fmac.txt new file +6 -0
+
+Example:
+
+mmc3: mmc@01c20000 {
+       pinctrl-0 =<&mmc3_pins>;
+       pinctrl-1 =<&wifi_host_wake>;

WLAN_HOST_WAKE pin (aka the OOB interrupt) is specific to the WLAN chip, so this should be rather configured in a pinctrl state of the WLAN chip itself.

Hi Chen-Yu,

picking up this thread.

Quoted 3 lines

AFAIK, the pinctrl in tied to the device node, and is selected when the device is registered. The MMC subsystem currently does not register child nodes, so this would be useless.

So if MMC does not register child nodes, brcmfmac will not be probed with of_node set? Have there been patches submitted for this in mmc subsystem recently.

Quoted 2 lines

brcmfmac actually has to walk the whole DT to find the node with the right compatible.

Is it just me or should this be avoided? What if there are multiple entries?

Regards,
Arend

#10 lore raw
In reply to Mark Brown
Quoted 20 lines · Mark Brown
Quoted 10 lines · Tomasz Figa
Quoted 8 lines · Arend van Spriel
Quoted 6 lines · Tomasz Figa

The BCM43xx WLAN chips I used to work always have been controlled by a simple power enable GPIO of the chip itself. Has this changed in newer chips?

If you need to simply toggle a GPIO to control the power, you don't need to use the regulator API at all, controlling the GPIO directly.

Quoted 8 lines
Quoted 3 lines

Not sure I understand. Do you really mean 'chip' or 'wifi module' here. The chip needs to be powered and for that it is hooked up to a host/module provided GPIO (at least that is my understanding).

Your binding asks for a regulator, not a simple GPIO, which is all I believe you need for BCM43xx power handling.

Mark (added to Cc), could we get your opinion on this?

Quoted 8 lines

If it's a GPIO connected directly to the device it should be using gpiolib, the fact that it happens to have an effect on power rather than (say) just being a reset isn't terribly relevant to anything outside the driver. If it's an external regulator that happens to be controlled using a GPIO on the current system then a regulator is better since another system might use a regulator with a different control interface.

From an SDIO point of view, we need to find the corresponding OCR mask

the mmc host driver supports. The OCR mask gives the voltage levels the host supports and it's being used during SDIO initialization while negotiating the voltage level with the SDIO card.

Using a gpio regulator would simplify here, since the driver don't need specific "SDIO hacks" but can use the mmc_regulator_get_supply() API, which calculates the OCR mask, based upon the regulator's supported voltages.

Kind regards
Ulf Hansson

#11 lore raw
Quoted 4 lines · Ulf Hansson

Using a gpio regulator would simplify here, since the driver don't need specific "SDIO hacks" but can use the mmc_regulator_get_supply() API, which calculates the OCR mask, based upon the regulator's supported voltages.

If that makes life easier the driver could also just instantiate a fixed regulator itself rather than requiring that one be put in the DT?

#5 lore raw
In reply to Arend van Spriel
Quoted 7 lines · Chen-Yu Tsai

Hi,

Quoted 4 lines · On Thu, Feb 13, 2014 at 5:13 PM, Tomasz Figa&lt;tomasz.figa@&gt; wrote:

Hi Arend,

On 10.02.2014 20:17, Arend van Spriel wrote:

[...]

Hi Chen-Yu,

picking up this thread.

Quoted 5 lines

AFAIK, the pinctrl in tied to the device node, and is selected when the device
is registered. The MMC subsystem currently does not register child nodes, so
this would be useless.

So if MMC does not register child nodes, brcmfmac will not be probed with of_node set? Have there been patches submitted for this in mmc subsystem recently.

[...]

Sascha Hauer submitted a patch a week ago. Link:
https://lkml.org/lkml/2014/4/3/522 <https://lkml.org/lkml/2014/4/3/522>

--
View this message in context: http://linux-kernel.2935.n7.nabble.com/RFC-dt-bindings-add-bindings-for-Broadcom-bcm43xx-sdio-devices-tp801976p838046.html
Sent from the Linux Kernel mailing list archive at Nabble.com.

#6 lore raw
Quoted 25 lines · Jörg Krause
Quoted 7 lines · Chen-Yu Tsai

Hi,

Quoted 4 lines · On Thu, Feb 13, 2014 at 5:13 PM, Tomasz Figa&lt;tomasz.figa@&gt; wrote:

Hi Arend,

On 10.02.2014 20:17, Arend van Spriel wrote:

[...]

Hi Chen-Yu,

picking up this thread.

Quoted 5 lines

AFAIK, the pinctrl in tied to the device node, and is selected when the device
is registered. The MMC subsystem currently does not register child nodes, so
this would be useless.

So if MMC does not register child nodes, brcmfmac will not be probed with of_node set? Have there been patches submitted for this in mmc subsystem recently.

Quoted 6 lines

[...]

Sascha Hauer submitted a patch a week ago. Link:
https://lkml.org/lkml/2014/4/3/522 <https://lkml.org/lkml/2014/4/3/522>

Thanks, Jörg

It is a partial solution, but it seems to conflict with my change. So thanks for the heads up. I am not convinced whether the GPIO and clock should be bound to the function. They seem more a property of the card/device inserted.

Regards,
Arend

Quoted 9 lines

--
View this message in context: http://linux-kernel.2935.n7.nabble.com/RFC-dt-bindings-add-bindings-for-Broadcom-bcm43xx-sdio-devices-tp801976p838046.html
Sent from the Linux Kernel mailing list archive at Nabble.com.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/