devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] brcmfmac: OOB interrupt support
@ 2014-06-16 17:56 Hans de Goede
       [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Hans de Goede @ 2014-06-16 17:56 UTC (permalink / raw)
  To: John W. Linville
  Cc: Arend van Spriel, Chen-Yu Tsai,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

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"

Regards,

Hans

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
       [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-06-16 17:56   ` Hans de Goede
       [not found]     ` <1402941407-8210-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-06-16 17:56   ` [PATCH v2 2/4] brcmfmac: add device tree support for SDIO devices Hans de Goede
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Hans de Goede @ 2014-06-16 17:56 UTC (permalink / raw)
  To: John W. Linville
  Cc: Arend van Spriel, Chen-Yu Tsai,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

From: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

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 <meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Reviewed-by: Franky (Zhenhui) Lin <frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Reviewed-by: Daniel (Deognyoun) Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Reviewed-by: Pieter-Paul Giesberts <pieterpg-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
[hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
 on how to handle this yet]
[hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: move from bindings/staging to bindings]
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 .../bindings/net/wireless/brcm,bcm43xx-fmac.txt    | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
new file mode 100644
index 0000000..6a0aaf2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
@@ -0,0 +1,29 @@
+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,bcm43xx-fmac".
+
+Optional properties:
+ - brcm,drive-strength : drive strength used for SDIO pins on device.
+	(default = 6mA).
+ - 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:
+
+bcm4335 {
+	compatible = "brcm,bcm43xx-fmac";
+	brcm,drive-strength = <4>;
+	interrupt-parent = <&gpx2>;
+	interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+	interrupt-names = "host-wake";
+};
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/4] brcmfmac: add device tree support for SDIO devices
       [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-06-16 17:56   ` [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices Hans de Goede
@ 2014-06-16 17:56   ` Hans de Goede
  2014-06-16 17:56   ` [PATCH v2 3/4] brcmfmac: Fix some wrong register defines Hans de Goede
  2014-06-16 17:56   ` [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362 Hans de Goede
  3 siblings, 0 replies; 14+ messages in thread
From: Hans de Goede @ 2014-06-16 17:56 UTC (permalink / raw)
  To: John W. Linville
  Cc: Arend van Spriel, Chen-Yu Tsai,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

From: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>

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.

Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
[arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org: conditionalize more of-code, use driver debug routines]
Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
[hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
 on how to handle this yet]
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 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

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/Makefile b/drivers/net/wireless/brcm80211/brcmfmac/Makefile
index 98e67c1..e2752cb 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/Makefile
+++ b/drivers/net/wireless/brcm80211/brcmfmac/Makefile
@@ -44,3 +44,5 @@ brcmfmac-$(CONFIG_BRCMDBG) += \
 		dhd_dbg.o
 brcmfmac-$(CONFIG_BRCM_TRACING) += \
 		tracepoint.o
+brcmfmac-$(CONFIG_OF) += \
+		of.o
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index a16e644..0fc707c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -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);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c
new file mode 100644
index 0000000..78ff906
--- /dev/null
+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
+#include <linux/mmc/card.h>
+#include <linux/platform_data/brcmfmac-sdio.h>
+#include <linux/mmc/sdio_func.h>
+
+#include <defs.h>
+#include "dhd_dbg.h"
+#include "sdio_host.h"
+
+void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev)
+{
+	struct device *dev = sdiodev->dev;
+	struct device_node *np = dev->of_node;
+	int irq;
+	u32 irqf;
+	u32 val;
+
+	if (!np || !of_device_is_compatible(np, "brcm,bcm43xx-fmac"))
+		return;
+
+	sdiodev->pdata = devm_kzalloc(dev, sizeof(*sdiodev->pdata), GFP_KERNEL);
+	if (!sdiodev->pdata)
+		return;
+
+	irq = irq_of_parse_and_map(np, 0);
+	if (irq < 0) {
+		brcmf_err("interrupt could not be mapped: err=%d\n", irq);
+		devm_kfree(dev, sdiodev->pdata);
+		return;
+	}
+	irqf = irqd_get_trigger_type(irq_get_irq_data(irq));
+
+	sdiodev->pdata->oob_irq_supported = true;
+	sdiodev->pdata->oob_irq_nr = irq;
+	sdiodev->pdata->oob_irq_flags = irqf;
+
+	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
+		sdiodev->pdata->drive_strength = val;
+}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.h b/drivers/net/wireless/brcm80211/brcmfmac/of.h
new file mode 100644
index 0000000..5f7c355
--- /dev/null
+++ b/drivers/net/wireless/brcm80211/brcmfmac/of.h
@@ -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 */
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/4] brcmfmac: Fix some wrong register defines
       [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-06-16 17:56   ` [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices Hans de Goede
  2014-06-16 17:56   ` [PATCH v2 2/4] brcmfmac: add device tree support for SDIO devices Hans de Goede
@ 2014-06-16 17:56   ` Hans de Goede
  2014-06-16 17:56   ` [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362 Hans de Goede
  3 siblings, 0 replies; 14+ messages in thread
From: Hans de Goede @ 2014-06-16 17:56 UTC (permalink / raw)
  To: John W. Linville
  Cc: Arend van Spriel, Chen-Yu Tsai,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
index 3deab79..6e6a366 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
@@ -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 */
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                     ` (2 preceding siblings ...)
  2014-06-16 17:56   ` [PATCH v2 3/4] brcmfmac: Fix some wrong register defines Hans de Goede
@ 2014-06-16 17:56   ` Hans de Goede
       [not found]     ` <1402941407-8210-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  3 siblings, 1 reply; 14+ messages in thread
From: Hans de Goede @ 2014-06-16 17:56 UTC (permalink / raw)
  To: John W. Linville
  Cc: Arend van Spriel, Chen-Yu Tsai,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Hans de Goede

It 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

I'm not entirely sure if this specific to the AP6210 module, or if this
should be done for all BCM43362 sdio devices.

Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 0fc707c..58e86a5 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -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;
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
       [not found]     ` <1402941407-8210-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-06-16 20:53       ` Florian Fainelli
       [not found]         ` <CAGVrzcZBzDTfnd6o0ib1FBvBK2VPNitS=rpb4jDkjF=T7Fy=DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Florian Fainelli @ 2014-06-16 20:53 UTC (permalink / raw)
  To: Hans de Goede
  Cc: John W. Linville, devicetree, open list:ATHEROS ATH5K WIR...,
	linux-sunxi, Chen-Yu Tsai, Arend van Spriel,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

2014-06-16 10:56 GMT-07:00 Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> From: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>
> 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 <meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Franky (Zhenhui) Lin <frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Daniel (Deognyoun) Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Reviewed-by: Pieter-Paul Giesberts <pieterpg-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
>  on how to handle this yet]
> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: move from bindings/staging to bindings]
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  .../bindings/net/wireless/brcm,bcm43xx-fmac.txt    | 29 ++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>
> diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
> new file mode 100644
> index 0000000..6a0aaf2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
> @@ -0,0 +1,29 @@
> +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,bcm43xx-fmac".

In general, the use of a wildcard compatible string is discouraged
over the use of a more descriptive compatible string. So you should
find out what is the first chip that is compatible, and use that
compatible string as long as that compatibility remains.

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

It would not hurt if you did specify the unit of the
"brcm,drive-strength" property here. Also, if the default is 6, maybe
the example below should be fixed to reflect that so people do not
think that writing 4 to a register = 6 mA.

> + - 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:
> +
> +bcm4335 {
> +       compatible = "brcm,bcm43xx-fmac";
> +       brcm,drive-strength = <4>;
> +       interrupt-parent = <&gpx2>;
> +       interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
> +       interrupt-names = "host-wake";
> +};
> --
> 2.0.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



-- 
Florian

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
       [not found]         ` <CAGVrzcZBzDTfnd6o0ib1FBvBK2VPNitS=rpb4jDkjF=T7Fy=DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-06-17  6:32           ` Hans de Goede
       [not found]             ` <539FE0EC.5090003-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Hans de Goede @ 2014-06-17  6:32 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: John W. Linville, devicetree, open list:ATHEROS ATH5K WIR...,
	linux-sunxi, Chen-Yu Tsai, Arend van Spriel,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

Hi,

On 06/16/2014 10:53 PM, Florian Fainelli wrote:
> 2014-06-16 10:56 GMT-07:00 Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>> From: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>
>> 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 <meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>> Reviewed-by: Franky (Zhenhui) Lin <frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>> Reviewed-by: Daniel (Deognyoun) Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>> Reviewed-by: Pieter-Paul Giesberts <pieterpg-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>> Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
>>  on how to handle this yet]
>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: move from bindings/staging to bindings]
>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>  .../bindings/net/wireless/brcm,bcm43xx-fmac.txt    | 29 ++++++++++++++++++++++
>>  1 file changed, 29 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>> new file mode 100644
>> index 0000000..6a0aaf2
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>> @@ -0,0 +1,29 @@
>> +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,bcm43xx-fmac".
> 
> In general, the use of a wildcard compatible string is discouraged
> over the use of a more descriptive compatible string. So you should
> find out what is the first chip that is compatible, and use that
> compatible string as long as that compatibility remains.

Right, Arend, what should we use then ?

>> +
>> +Optional properties:
>> + - brcm,drive-strength : drive strength used for SDIO pins on device.
>> +       (default = 6mA).
> 
> It would not hurt if you did specify the unit of the
> "brcm,drive-strength" property here. Also, if the default is 6, maybe
> the example below should be fixed to reflect that so people do not
> think that writing 4 to a register = 6 mA.

Ok will fix in the next version.

> 
>> + - 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:
>> +
>> +bcm4335 {
>> +       compatible = "brcm,bcm43xx-fmac";
>> +       brcm,drive-strength = <4>;
>> +       interrupt-parent = <&gpx2>;
>> +       interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
>> +       interrupt-names = "host-wake";
>> +};
>> --
>> 2.0.0
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> 
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
       [not found]             ` <539FE0EC.5090003-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-06-17  7:49               ` Arend van Spriel
       [not found]                 ` <539FF2FA.8050304-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Arend van Spriel @ 2014-06-17  7:49 UTC (permalink / raw)
  To: Hans de Goede, Florian Fainelli
  Cc: John W. Linville, devicetree, open list:ATHEROS ATH5K WIR...,
	linux-sunxi, Chen-Yu Tsai,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

On 17-06-14 08:32, Hans de Goede wrote:
> Hi,
>
> On 06/16/2014 10:53 PM, Florian Fainelli wrote:
>> 2014-06-16 10:56 GMT-07:00 Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>>> From: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>
>>> 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 <meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> Reviewed-by: Franky (Zhenhui) Lin <frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> Reviewed-by: Daniel (Deognyoun) Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> Reviewed-by: Pieter-Paul Giesberts <pieterpg-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
>>>   on how to handle this yet]
>>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: move from bindings/staging to bindings]
>>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>> ---
>>>   .../bindings/net/wireless/brcm,bcm43xx-fmac.txt    | 29 ++++++++++++++++++++++
>>>   1 file changed, 29 insertions(+)
>>>   create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> new file mode 100644
>>> index 0000000..6a0aaf2
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> @@ -0,0 +1,29 @@
>>> +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,bcm43xx-fmac".
>>
>> In general, the use of a wildcard compatible string is discouraged
>> over the use of a more descriptive compatible string. So you should
>> find out what is the first chip that is compatible, and use that
>> compatible string as long as that compatibility remains.
>
> Right, Arend, what should we use then ?

In earlier discussions, we ended up with this compatible string. The 
properties are generic enough to be covered by this 'wildcard' string. 
However, I am not religious about it so if you feel strongly for an 
explicit string it could be brcm,bcm4329-fmac, but it does not have my 
preference.

>>> +
>>> +Optional properties:
>>> + - brcm,drive-strength : drive strength used for SDIO pins on device.
>>> +       (default = 6mA).
>>
>> It would not hurt if you did specify the unit of the
>> "brcm,drive-strength" property here. Also, if the default is 6, maybe
>> the example below should be fixed to reflect that so people do not
>> think that writing 4 to a register = 6 mA.
>
> Ok will fix in the next version.
>

I agree that explicitly specifying the unit of the property is a good 
addition. If that is done I don't think it is necessary to change the 
value used in the example.

Regards,
Arend

>>
>>> + - 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:
>>> +
>>> +bcm4335 {
>>> +       compatible = "brcm,bcm43xx-fmac";
>>> +       brcm,drive-strength = <4>;
>>> +       interrupt-parent = <&gpx2>;
>>> +       interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
>>> +       interrupt-names = "host-wake";
>>> +};
>>> --
>>> 2.0.0
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>>
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found]     ` <1402941407-8210-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-06-17 11:49       ` Arend van Spriel
       [not found]         ` <53A02B5A.3070409-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  2014-06-18 20:38       ` Arend van Spriel
  1 sibling, 1 reply; 14+ messages in thread
From: Arend van Spriel @ 2014-06-17 11:49 UTC (permalink / raw)
  To: Hans de Goede, John W. Linville
  Cc: Chen-Yu Tsai, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On 16-06-14 19:56, Hans de Goede wrote:
> It 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
>
> I'm not entirely sure if this specific to the AP6210 module, or if this
> should be done for all BCM43362 sdio devices.

Hi Hans,

I was still not sure about this one so I asked around. Apart from the 
nvram settings I emailed earlier one more is needed:

sd_gpout=1
sd_oobonly=1
sd_gpval=1
*muxenab=0x11*

Could you give that a try?

Regards,
Arend

> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> index 0fc707c..58e86a5 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> @@ -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;
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found]         ` <53A02B5A.3070409-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2014-06-17 14:32           ` Hans de Goede
       [not found]             ` <53A05168.9010604-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Hans de Goede @ 2014-06-17 14:32 UTC (permalink / raw)
  To: Arend van Spriel, John W. Linville
  Cc: Chen-Yu Tsai, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Hi,

On 06/17/2014 01:49 PM, Arend van Spriel wrote:
> On 16-06-14 19:56, Hans de Goede wrote:
>> It 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
>>
>> I'm not entirely sure if this specific to the AP6210 module, or if this
>> should be done for all BCM43362 sdio devices.
> 
> Hi Hans,
> 
> I was still not sure about this one so I asked around. Apart from the nvram settings I emailed earlier one more is needed:
> 
> sd_gpout=1
> sd_oobonly=1
> sd_gpval=1
> *muxenab=0x11*
> 
> Could you give that a try?

I seriously doubt that is going to do anything at all, all 4 these keywords do not
show up when running strings on brcmfmac43362-sdio.bin, where as all the
keywords used in the brcmfmac43362-sdio.txt shipped with the android on ap6210
equipped boards do show up, confirming that the keywords are encoded in plain text
in the firmware file.

Let me know if want me to give it a try anyways and I'll do so.

Perhaps these keywords need a newer firmware version then the one in the
linux-firmware repository ?

Regards,

Hans

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found]             ` <53A05168.9010604-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2014-06-17 16:37               ` Arend van Spriel
  0 siblings, 0 replies; 14+ messages in thread
From: Arend van Spriel @ 2014-06-17 16:37 UTC (permalink / raw)
  To: Hans de Goede, John W. Linville
  Cc: Chen-Yu Tsai, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On 17-06-14 16:32, Hans de Goede wrote:
> Hi,
>
> On 06/17/2014 01:49 PM, Arend van Spriel wrote:
>> On 16-06-14 19:56, Hans de Goede wrote:
>>> It 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
>>>
>>> I'm not entirely sure if this specific to the AP6210 module, or if this
>>> should be done for all BCM43362 sdio devices.
>>
>> Hi Hans,
>>
>> I was still not sure about this one so I asked around. Apart from the nvram settings I emailed earlier one more is needed:
>>
>> sd_gpout=1
>> sd_oobonly=1
>> sd_gpval=1
>> *muxenab=0x11*
>>
>> Could you give that a try?
>
> I seriously doubt that is going to do anything at all, all 4 these keywords do not
> show up when running strings on brcmfmac43362-sdio.bin, where as all the
> keywords used in the brcmfmac43362-sdio.txt shipped with the android on ap6210
> equipped boards do show up, confirming that the keywords are encoded in plain text
> in the firmware file.
>
> Let me know if want me to give it a try anyways and I'll do so.
>
> Perhaps these keywords need a newer firmware version then the one in the
> linux-firmware repository ?

I will checkout the firmware release and see what is built there.

Thanks,
Arend

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found]     ` <1402941407-8210-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2014-06-17 11:49       ` Arend van Spriel
@ 2014-06-18 20:38       ` Arend van Spriel
       [not found]         ` <53A1F8D1.1050204-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 14+ messages in thread
From: Arend van Spriel @ 2014-06-18 20:38 UTC (permalink / raw)
  To: Hans de Goede, John W. Linville
  Cc: Chen-Yu Tsai, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

On 16-06-14 19:56, Hans de Goede wrote:
> It 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
>
> I'm not entirely sure if this specific to the AP6210 module, or if this
> should be done for all BCM43362 sdio devices.

Bit late response but it took some digging. It turns out this is done 
for all bcm43362 in internal/proprietary driver.

+Reviewed-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> index 0fc707c..58e86a5 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> @@ -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"

Not sure why chip.h is needed here.

>   #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);

I don't like the assumption that chipcommon core register space is 
always at SI_ENUM_BASE although it is for BCM43362. Let's keep it for now.

> +			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;
>

Regards,
Arend

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices
       [not found]                 ` <539FF2FA.8050304-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2014-06-20 14:27                   ` Hans de Goede
  0 siblings, 0 replies; 14+ messages in thread
From: Hans de Goede @ 2014-06-20 14:27 UTC (permalink / raw)
  To: Arend van Spriel, Florian Fainelli
  Cc: John W. Linville, devicetree, open list:ATHEROS ATH5K WIR...,
	linux-sunxi, Chen-Yu Tsai,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org

Hi,

On 06/17/2014 09:49 AM, Arend van Spriel wrote:
> On 17-06-14 08:32, Hans de Goede wrote:
>> Hi,
>>
>> On 06/16/2014 10:53 PM, Florian Fainelli wrote:
>>> 2014-06-16 10:56 GMT-07:00 Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>>>> From: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>>
>>>> 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 <meuleman-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>> Reviewed-by: Franky (Zhenhui) Lin <frankyl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>> Reviewed-by: Daniel (Deognyoun) Kim <dekim-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>> Reviewed-by: Pieter-Paul Giesberts <pieterpg-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>> Signed-off-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
>>>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: drop clk / reg_on gpio handling, as there is no consensus
>>>>   on how to handle this yet]
>>>> [hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org: move from bindings/staging to bindings]
>>>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>>> ---
>>>>   .../bindings/net/wireless/brcm,bcm43xx-fmac.txt    | 29 ++++++++++++++++++++++
>>>>   1 file changed, 29 insertions(+)
>>>>   create mode 100644 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> new file mode 100644
>>>> index 0000000..6a0aaf2
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>>> @@ -0,0 +1,29 @@
>>>> +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,bcm43xx-fmac".
>>>
>>> In general, the use of a wildcard compatible string is discouraged
>>> over the use of a more descriptive compatible string. So you should
>>> find out what is the first chip that is compatible, and use that
>>> compatible string as long as that compatibility remains.
>>
>> Right, Arend, what should we use then ?
> 
> In earlier discussions, we ended up with this compatible string. The properties are generic enough to be covered by this 'wildcard' string. However, I am not religious about it so if you feel strongly for an explicit string it could be brcm,bcm4329-fmac, but it does not have my preference.

It is not something I really feel strong about, but as Florian
rightfully points out using wildcard strings is something which
is more or less not done in devicetree land, the idea being that
just using the lowest model, makes it easier to later add different
bindings for later models if that turns out to be necessary.

So I've changed the compatibility string to brcm,bcm4329-fmac for v3
of this patch-set.

Regards,

Hans

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362
       [not found]         ` <53A1F8D1.1050204-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2014-06-20 14:28           ` Hans de Goede
  0 siblings, 0 replies; 14+ messages in thread
From: Hans de Goede @ 2014-06-20 14:28 UTC (permalink / raw)
  To: Arend van Spriel, John W. Linville
  Cc: Chen-Yu Tsai, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw

Hi,

On 06/18/2014 10:38 PM, Arend van Spriel wrote:
> On 16-06-14 19:56, Hans de Goede wrote:
>> It 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
>>
>> I'm not entirely sure if this specific to the AP6210 module, or if this
>> should be done for all BCM43362 sdio devices.
> 
> Bit late response but it took some digging. It turns out this is done for all bcm43362 in internal/proprietary driver.
> 
> +Reviewed-by: Arend van Spriel <arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

Thanks, I've updated the commit msg with this info and added
your Reviewed-by for v3 of this patch-set.

>> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>> ---
>>   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> index 0fc707c..58e86a5 100644
>> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> @@ -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"
> 
> Not sure why chip.h is needed here.

For the CORE_CC_REG macro used below.

> 
>>   #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);
> 
> I don't like the assumption that chipcommon core register space is always at SI_ENUM_BASE although it is for BCM43362. Let's keep it for now.

Ok.

> 
>> +            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;
>>
> 
> Regards,
> Arend

Regards,

Hans

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-06-20 14:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-16 17:56 [PATCH v2 0/4] brcmfmac: OOB interrupt support Hans de Goede
     [not found] ` <1402941407-8210-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-16 17:56   ` [PATCH v2 1/4] dt: bindings: add bindings for Broadcom bcm43xx sdio devices Hans de Goede
     [not found]     ` <1402941407-8210-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-16 20:53       ` Florian Fainelli
     [not found]         ` <CAGVrzcZBzDTfnd6o0ib1FBvBK2VPNitS=rpb4jDkjF=T7Fy=DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-17  6:32           ` Hans de Goede
     [not found]             ` <539FE0EC.5090003-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-17  7:49               ` Arend van Spriel
     [not found]                 ` <539FF2FA.8050304-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2014-06-20 14:27                   ` Hans de Goede
2014-06-16 17:56   ` [PATCH v2 2/4] brcmfmac: add device tree support for SDIO devices Hans de Goede
2014-06-16 17:56   ` [PATCH v2 3/4] brcmfmac: Fix some wrong register defines Hans de Goede
2014-06-16 17:56   ` [PATCH v2 4/4] brcmfmac: Fix OOB interrupt not working for BCM43362 Hans de Goede
     [not found]     ` <1402941407-8210-5-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-17 11:49       ` Arend van Spriel
     [not found]         ` <53A02B5A.3070409-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2014-06-17 14:32           ` Hans de Goede
     [not found]             ` <53A05168.9010604-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-06-17 16:37               ` Arend van Spriel
2014-06-18 20:38       ` Arend van Spriel
     [not found]         ` <53A1F8D1.1050204-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2014-06-20 14:28           ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).