brcmfmac: OOB interrupt support
Subsystems (2)
v4 cover brcmfmac: OOB interrupt support
Hi All,
Here is v2 of the brcmfmac: OOB interrupt support series.
Changes since v1:
-Post as a stand alone series, rather then together with sunxi pinctrl changes,
etc.
-Add a patch to fixup the names of the register addresses used in the
"brcmfmac: Fix OOB interrupt not working for BCM43362" patch
-Use the new register names in:
"brcmfmac: Fix OOB interrupt not working for BCM43362"
Changes since v2:
-"dt: bindings: add bindings for Broadcom bcm43xx sdio devices"
* changed the compatible string to brcm,bcm4329-fmac
* replaced the dt-bindings example with a real world example
-"brcmfmac: Fix OOB interrupt not working for BCM43362"
* updated commit message with confirmation from broadcom that this is the right thing to do
Regards,
Hans
PATCH v3 1/4 dt: bindings: add bindings for Broadcom bcm43xx sdio devices
From: Arend van Spriel <[email protected]>
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.
[hdegoede at redhat.com: drop clk / reg_on gpio handling, as there is no consensus
on how to handle this yet]
--- .../bindings/net/wireless/brcm,bcm43xx-fmac.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +41 -0
@@ -0,0 +1,41 @@ +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 SDIO controller that +connects the device to the system. + +Required properties: + + - compatible : Should be "brcm,bcm4329-fmac". + +Optional properties: + - brcm,drive-strength : drive strength used for SDIO pins on device in mA + (default = 6). + - interrupt-parent : the phandle for the interrupt controller to which the + device interrupts are connected. + - interrupts : specifies attributes for the out-of-band interrupt (host-wake). + When not specified the device will use in-band SDIO interrupts. + - interrupt-names : name of the out-of-band interrupt, which must be set + to "host-wake". + +Example: + +mmc3: mmc at 01c12000 { + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcmf: bcrmf at 1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <10 8>; /* PH10 / EINT10 */ + interrupt-names = "host-wake"; + }; +};
Signature · 1 line
2.0.0
PATCH v3 1/4 dt: bindings: add bindings for Broadcom bcm43xx sdio devices
Quoted 53 lines · Hans de Goede
From: Arend van Spriel <[email protected]>
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.
Reviewed-by Hante Meuleman <[email protected]>Reviewed-by Franky (Zhenhui) Lin <[email protected]>Reviewed-by Daniel (Deognyoun) Kim <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Arend van Spriel <[email protected]>[hdegoede at redhat.com: drop clk /
reg_ongpio handling, as there is no consensus
on how to handle this yet][hdegoede at redhat.com: move from bindings/staging to bindings]Signed-off-by Hans de Goede <[email protected]>--- .../bindings/net/wireless/brcm,bcm43xx-fmac.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txtDocumentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +25
-0@@ -0,0 +1,41 @@ +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 SDIO controller that +connects the device to the system. + +Required properties: + + - compatible : Should be "brcm,bcm4329-fmac". + +Optional properties: + - brcm,drive-strength : drive strength used for SDIO pins on device in mA + (default = 6). + - interrupt-parent : the phandle for the interrupt controller to which the + device interrupts are connected. + - interrupts : specifies attributes for the out-of-band interrupt (host-wake). + When not specified the device will use in-band SDIO interrupts. + - interrupt-names : name of the out-of-band interrupt, which must be set + to "host-wake". + +Example: + +mmc3: mmc at 01c12000 { + #address-cells = <1>; + #size-cells = <0>;
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt line 35
Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +10
-0+ + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcmf: bcrmf at 1 { + reg = <1>;
I guess the reg property is needed to have this node linked to sdio func 1 dev, right? I would add it to the list of required properties above even if this behaviour is already described in a more generic binding.
Regards,
Arend
Quoted 7 lines
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +6
-0+ compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <10 8>; /* PH10 / EINT10 */ + interrupt-names = "host-wake"; + }; +};
PATCH v3 1/4 dt: bindings: add bindings for Broadcom bcm43xx sdio devices
Hi,
Quoted 59 lines · Arend van Spriel
Quoted 58 lines · Hans de Goede
From: Arend van Spriel <[email protected]>
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.
Reviewed-by Hante Meuleman <[email protected]>Reviewed-by Franky (Zhenhui) Lin <[email protected]>Reviewed-by Daniel (Deognyoun) Kim <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Arend van Spriel <[email protected]>[hdegoede at redhat.com: drop clk /
reg_ongpio handling, as there is no consensus
on how to handle this yet][hdegoede at redhat.com: move from bindings/staging to bindings]Signed-off-by Hans de Goede <[email protected]>--- .../bindings/net/wireless/brcm,bcm43xx-fmac.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txtDocumentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +30
-0@@ -0,0 +1,41 @@ +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 SDIO controller that +connects the device to the system. + +Required properties: + + - compatible : Should be "brcm,bcm4329-fmac". + +Optional properties: + - brcm,drive-strength : drive strength used for SDIO pins on device in mA + (default = 6). + - interrupt-parent : the phandle for the interrupt controller to which the + device interrupts are connected. + - interrupts : specifies attributes for the out-of-band interrupt (host-wake). + When not specified the device will use in-band SDIO interrupts. + - interrupt-names : name of the out-of-band interrupt, which must be set + to "host-wake". + +Example: + +mmc3: mmc at 01c12000 { + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>;
Quoted 8 lines
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt line 35
Quoted 5 lines
Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +5
-0+ non-removable; + status = "okay"; + + brcmf: bcrmf at 1 { + reg = <1>;I guess the reg property is needed to have this node linked to sdio func 1 dev, right?
Right.
Quoted 2 lines
I would add it to the list of required properties above even if this behaviour is already described in a more generic binding.
Then we would also need to describe the need to add:
#address-cells = <1>; #size-cells = <0>;
To the mmc-host node itself, I don't think that that really belongs here, and thus the description of the reg property itself also does not really belong here IMHO.
Regards,
Hans
PATCH v3 1/4 dt: bindings: add bindings for Broadcom bcm43xx sdio devices
In reply to Hans de GoedeAny word from the devicetree folks?
Quoted 73 lines · Hans de Goede
From: Arend van Spriel <[email protected]>
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.
Reviewed-by Hante Meuleman <[email protected]>Reviewed-by Franky (Zhenhui) Lin <[email protected]>Reviewed-by Daniel (Deognyoun) Kim <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Arend van Spriel <[email protected]>[hdegoede at redhat.com: drop clk /
reg_ongpio handling, as there is no consensus
on how to handle this yet][hdegoede at redhat.com: move from bindings/staging to bindings]Signed-off-by Hans de Goede <[email protected]>--- .../bindings/net/wireless/brcm,bcm43xx-fmac.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txtDocumentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +41
-0@@ -0,0 +1,41 @@ +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 SDIO controller that +connects the device to the system. + +Required properties: + + - compatible : Should be "brcm,bcm4329-fmac". + +Optional properties: + - brcm,drive-strength : drive strength used for SDIO pins on device in mA + (default = 6). + - interrupt-parent : the phandle for the interrupt controller to which the + device interrupts are connected. + - interrupts : specifies attributes for the out-of-band interrupt (host-wake). + When not specified the device will use in-band SDIO interrupts. + - interrupt-names : name of the out-of-band interrupt, which must be set + to "host-wake". + +Example: + +mmc3: mmc at 01c12000 { + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcmf: bcrmf at 1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <10 8>; /* PH10 / EINT10 */ + interrupt-names = "host-wake"; + }; +};Signature · 1 line
2.0.0
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.
[linux-sunxi] Re: [PATCH v3 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
Hi,
Quoted 1 line · John W. Linville
Any word from the devicetree folks?
We changed the compatible string from brcm,bcm43xx-fmac to brcm,bcm4329-fmac at their request, that is the only feedback we've gotten from them AFAIK.
Regards,
Hans
Quoted 76 lines · Hans de Goede
Quoted 73 lines
From: Arend van Spriel <[email protected]>
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.
Reviewed-by Hante Meuleman <[email protected]>Reviewed-by Franky (Zhenhui) Lin <[email protected]>Reviewed-by Daniel (Deognyoun) Kim <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Arend van Spriel <[email protected]>[hdegoede at redhat.com: drop clk /
reg_ongpio handling, as there is no consensus
on how to handle this yet][hdegoede at redhat.com: move from bindings/staging to bindings]Signed-off-by Hans de Goede <[email protected]>--- .../bindings/net/wireless/brcm,bcm43xx-fmac.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txtDocumentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt new file +41
-0@@ -0,0 +1,41 @@ +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 SDIO controller that +connects the device to the system. + +Required properties: + + - compatible : Should be "brcm,bcm4329-fmac". + +Optional properties: + - brcm,drive-strength : drive strength used for SDIO pins on device in mA + (default = 6). + - interrupt-parent : the phandle for the interrupt controller to which the + device interrupts are connected. + - interrupts : specifies attributes for the out-of-band interrupt (host-wake). + When not specified the device will use in-band SDIO interrupts. + - interrupt-names : name of the out-of-band interrupt, which must be set + to "host-wake". + +Example: + +mmc3: mmc at 01c12000 { + #address-cells = <1>; + #size-cells = <0>; + + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins_a>; + vmmc-supply = <®_vmmc3>; + bus-width = <4>; + non-removable; + status = "okay"; + + brcmf: bcrmf at 1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&pio>; + interrupts = <10 8>; /* PH10 / EINT10 */ + interrupt-names = "host-wake"; + }; +};Signature · 1 line
2.0.0
PATCH v3 2/4 brcmfmac: add device tree support for SDIO devices
In reply to Hans de GoedeFrom: Chen-Yu Tsai <[email protected]>
brcmfmac devices can use an out-of-band interrupt on a GPIO line. Currently this is specified using platform data. Add support for specifying out-of-band interrupt via device tree.
[hdegoede at redhat.com: drop clk / reg_on gpio handling, as there is no consensus
on how to handle this yet]
--- drivers/net/wireless/brcm80211/brcmfmac/Makefile | 2 + drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 4 ++ drivers/net/wireless/brcm80211/brcmfmac/of.c | 56 ++++++++++++++++++++++++ drivers/net/wireless/brcm80211/brcmfmac/of.h | 22 ++++++++++ 4 files changed, 84 insertions(+) create mode 100644 drivers/net/wireless/brcm80211/brcmfmac/of.c create mode 100644 drivers/net/wireless/brcm80211/brcmfmac/of.h
drivers/net/wireless/brcm80211/brcmfmac/Makefile +2 -0
@@ -44,3 +44,5 @@ brcmfmac-$(CONFIG_BRCMDBG) += \ dhd_dbg.o brcmfmac-$(CONFIG_BRCM_TRACING) += \ tracepoint.o +brcmfmac-$(CONFIG_OF) += \ + of.o
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +4 -0
@@ -43,6 +43,7 @@#include "dhd_bus.h" #include "dhd_dbg.h" #include "sdio_host.h" +#include "of.h" #define SDIOH_API_ACCESS_RETRY_LIMIT 2
@@ -1043,6 +1044,9 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, sdiodev->dev = &sdiodev->func[1 ]->dev; sdiodev->pdata = brcmfmac_sdio_pdata; +if (!sdiodev->pdata) +brcmf_of_probe (sdiodev); +atomic_set (&sdiodev->suspend, false);init_waitqueue_head (&sdiodev->request_word_wait);init_waitqueue_head (&sdiodev->request_buffer_wait);
drivers/net/wireless/brcm80211/brcmfmac/of.c new file +56 -0
56 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmfmac/of.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Copyright (c) 2014 Broadcom Corporation +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +* +* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +#ifdef CONFIG_OF +void brcmf_of_probe (struct brcmf_sdio_dev *sdiodev); +#else +static void brcmf_of_probe (struct brcmf_sdio_dev *sdiodev) +{ +} +#endif /* CONFIG_OF */
Signature · 1 line
2.0.0
PATCH v3 3/4 brcmfmac: Fix some wrong register defines
In reply to Hans de Goede--- drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h +6 -6
@@ -72,12 +72,12 @@#define SBSDIO_SPROM_DATA_HIGH 0x10003/* sprom indirect access addr byte 0 */ #define SBSDIO_SPROM_ADDR_LOW 0x10004 -/* sprom indirect access addr byte 0 */ -#define SBSDIO_SPROM_ADDR_HIGH 0x10005 -/* xtal_pu (gpio) output */ -#define SBSDIO_CHIP_CTRL_DATA 0x10006 -/* xtal_pu (gpio) enable */ -#define SBSDIO_CHIP_CTRL_EN 0x10007 +/* gpio select */ +#define SBSDIO_GPIO_SELECT 0x10005 +/* gpio output */ +#define SBSDIO_GPIO_OUT 0x10006 +/* gpio enable */ +#define SBSDIO_GPIO_EN 0x10007/* rev < 7, watermark for sdio device */ #define SBSDIO_WATERMARK 0x10008/* control busy signal generation */
Signature · 1 line
2.0.0
PATCH v3 4/4 brcmfmac: Fix OOB interrupt not working for BCM43362
In reply to Hans de GoedeIt has taken me a long long time to get the OOB interrupt working on the AP6210 sdio wifi/bt module found on various Allwinner A20 boards. In the end I found these magic register pokes in the cubietruck kernel tree:
https://github.com/cubieboard2/linux-sunxi/commit/7f08ba395617d17e7a711507503d89a50406fe7a
This is also done for the bcm43362 in broadcom's internal/proprietary driver.
--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +16 -0
@@ -39,7 +39,9 @@#include <brcm_hw_ids.h> #include <brcmu_utils.h> #include <brcmu_wifi.h> +#include <chipcommon.h> #include <soc.h> +#include "chip.h" #include "dhd_bus.h" #include "dhd_dbg.h" #include "sdio_host.h"
@@ -119,6 +121,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) {int ret =0 ;u8 data; +u32 addr, gpiocontrol;unsigned long flags;if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) {
@@ -148,6 +151,19 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)sdio_claim_host (sdiodev->func[1 ]); +if (sdiodev->bus_if->chip ==BCM43362_CHIP_ID ) { +/* assign GPIO to SDIO core */ + addr =CORE_CC_REG (SI_ENUM_BASE , gpiocontrol); + gpiocontrol =brcmf_sdiod_regrl (sdiodev, addr, &ret); + gpiocontrol |=0x2 ; +brcmf_sdiod_regwl (sdiodev, addr, gpiocontrol, &ret); + +brcmf_sdiod_regwb (sdiodev,SBSDIO_GPIO_SELECT ,0xf , + &ret); +brcmf_sdiod_regwb (sdiodev,SBSDIO_GPIO_OUT ,0 , &ret); +brcmf_sdiod_regwb (sdiodev,SBSDIO_GPIO_EN ,0x2 , &ret); + } +/* must configure SDIO_CCCR_IENx to enable irq */ data =brcmf_sdiod_regrb (sdiodev, SDIO_CCCR_IENx, &ret); data |=1 <<SDIO_FUNC_1 |1 <<SDIO_FUNC_2 |1 ;
Signature · 1 line
2.0.0
v4 cover brcmfmac: OOB interrupt support
In reply to Hans de GoedeQuoted 3 lines · Hans de Goede
Hi All,
Here is v2 of the brcmfmac: OOB interrupt support series.
I guess this could use an update :-p
Regards,
Arend
Quoted 20 lines
Changes since v1:
(quoted diff) +0
-3-Post as a stand alone series, rather then together with sunxi pinctrl changes, etc. -Add a patch to fixup the names of the register addresses used in the "brcmfmac: Fix OOB interrupt not working for BCM43362" patch -Use the new register names in: "brcmfmac: Fix OOB interrupt not working for BCM43362"Changes since v2:
-"dt: bindings: add bindings for Broadcom bcm43xx sdio devices"
* changed the compatible string to brcm,bcm4329-fmac
* replaced the dt-bindings example with a real world example
-"brcmfmac: Fix OOB interrupt not working for BCM43362"
* updated commit message with confirmation from broadcom that this is the right thing to doRegards,
Hans
v4 cover brcmfmac: OOB interrupt support
In reply to Hans de GoedeThe patch "brcmfmac: Cleanup used device IDs." makes this series not build. Unfortunately, I already merged that one...
Would you mind rebasing/reposting this?
Sorry...
John
Quoted 24 lines · Hans de Goede
Hi All,
Here is v2 of the brcmfmac: OOB interrupt support series.
Changes since v1:
(quoted diff) +0
-3-Post as a stand alone series, rather then together with sunxi pinctrl changes, etc. -Add a patch to fixup the names of the register addresses used in the "brcmfmac: Fix OOB interrupt not working for BCM43362" patch -Use the new register names in: "brcmfmac: Fix OOB interrupt not working for BCM43362"Changes since v2:
-"dt: bindings: add bindings for Broadcom bcm43xx sdio devices"
* changed the compatible string to brcm,bcm4329-fmac
* replaced the dt-bindings example with a real world example
-"brcmfmac: Fix OOB interrupt not working for BCM43362"
* updated commit message with confirmation from broadcom that this is the right thing to doRegards,
Hans
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.