netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] brcmfmac: add new dt entries for SG SDIO settings
@ 2018-03-18 18:41 Alexey Roslyakov
  2018-03-18 18:41 ` [PATCH 2/2] dt: bindings: add new dt entries for brcmfmac Alexey Roslyakov
       [not found] ` <20180318184101.26951-1-alexey.roslyakov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Roslyakov @ 2018-03-18 18:41 UTC (permalink / raw)
  To: kvalo, robh+dt, mark.rutland, arend.vanspriel, franky.lin,
	hante.meuleman, chi-hsien.lin, wright.feng, netdev
  Cc: linux-wireless, devicetree, linux-kernel, brcm80211-dev-list.pdl,
	brcm80211-dev-list, Alexey Roslyakov

There are 3 fields in SDIO settings (quirks) to workaround some of
the SG SDIO host particularities, i.e higher align requirements for
SG items.
All coding is done the long time ago, but there is no way to change the
driver behavior without patching the kernel.
Add missing devicetree entries.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
index aee6e5937c41..0718ca09a40d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
@@ -31,6 +31,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 	int irq;
 	u32 irqf;
 	u32 val;
+	u16 align;
 
 	if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
 	    !of_device_is_compatible(np, "brcm,bcm4329-fmac"))
@@ -39,6 +40,15 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
 	if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
 		sdio->drive_strength = val;
 
+	sdio->broken_sg_support =
+		of_property_read_bool(np, "brcm,broken-sg-support");
+
+	if (of_property_read_u16(np, "brcm,sd-head-align", &align) == 0)
+		sdio->sd_head_align = align;
+
+	if (of_property_read_u16(np, "brcm,sd-sgentry-align", &align) == 0)
+		sdio->sd_sgentry_align = align;
+
 	/* make sure there are interrupts defined in the node */
 	if (!of_find_property(np, "interrupts", NULL))
 		return;
-- 
2.16.1

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

* [PATCH 2/2] dt: bindings: add new dt entries for brcmfmac
  2018-03-18 18:41 [PATCH 1/2] brcmfmac: add new dt entries for SG SDIO settings Alexey Roslyakov
@ 2018-03-18 18:41 ` Alexey Roslyakov
       [not found] ` <20180318184101.26951-1-alexey.roslyakov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Roslyakov @ 2018-03-18 18:41 UTC (permalink / raw)
  To: kvalo, robh+dt, mark.rutland, arend.vanspriel, franky.lin,
	hante.meuleman, chi-hsien.lin, wright.feng, netdev
  Cc: linux-wireless, devicetree, linux-kernel, brcm80211-dev-list.pdl,
	brcm80211-dev-list, Alexey Roslyakov

In case if the host has higher align requirements for SG items, allow
setting device-specific aligns for scatterlist items.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
---
 Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
index 86602f264dce..187b8c1b52a7 100644
--- a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
+++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
@@ -17,6 +17,11 @@ Optional properties:
 	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".
+ - brcm,broken-sg-support : boolean flag to indicate that the SDIO host
+	controller has higher align requirement than 32 bytes for each
+	scatterlist item.
+ - brcm,sd-head-align : alignment requirement for start of data buffer.
+ - brcm,sd-sgentry-align : length alignment requirement for each sg entry.
 
 Example:
 
-- 
2.16.1

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

* Re: [PATCH 1/2] brcmfmac: add new dt entries for SG SDIO settings
       [not found] ` <20180318184101.26951-1-alexey.roslyakov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-03-18 20:01   ` Andrew Lunn
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-03-18 20:01 UTC (permalink / raw)
  To: Alexey Roslyakov
  Cc: kvalo-sgV2jX0FEOL9JmXXK+q4OQ, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	mark.rutland-5wv7dgnIgG8, arend.vanspriel-dY08KVG/lbpWk0Htik3J/w,
	franky.lin-dY08KVG/lbpWk0Htik3J/w,
	hante.meuleman-dY08KVG/lbpWk0Htik3J/w,
	chi-hsien.lin-+wT8y+m8/X5BDgjK7y7TUQ,
	wright.feng-+wT8y+m8/X5BDgjK7y7TUQ,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/w,
	brcm80211-dev-list-+wT8y+m8/X5BDgjK7y7TUQ

> +	if (of_property_read_u16(np, "brcm,sd-head-align", &align) == 0)
> +		sdio->sd_head_align = align;

Hi Alexey

I think you can make this:

	of_property_read_u16(np, "brcm,sd-head-align", &sdio->sd_head_align);

of_property_read_u16() should not touch the destination variable if
the properties does not exist, or if there is an error.

    Andrew

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

end of thread, other threads:[~2018-03-18 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 18:41 [PATCH 1/2] brcmfmac: add new dt entries for SG SDIO settings Alexey Roslyakov
2018-03-18 18:41 ` [PATCH 2/2] dt: bindings: add new dt entries for brcmfmac Alexey Roslyakov
     [not found] ` <20180318184101.26951-1-alexey.roslyakov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-18 20:01   ` [PATCH 1/2] brcmfmac: add new dt entries for SG SDIO settings Andrew Lunn

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).