Files
build/patch/kernel/archive/sunxi-5.15/patches.cypress/0001-non-upstream-add-sg-parameters-dts-parsing.patch

53 lines
2.0 KiB
Diff

From 520405c6e198c757510573cad2965d982eb34de6 Mon Sep 17 00:00:00 2001
From: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Date: Tue, 15 Aug 2017 00:25:14 -0500
Subject: [PATCH 001/179] non-upstream: add sg parameters dts parsing
broken_sg_support, sd_head_align, and sd_sgentry_align are used in
brcmfmac code but not configurable in dts file. Add the parsing logic.
Now they can be configured like below in dts:
brcm,broken_sg_support;
brcm,sd_head_align = /bits/ 16 <4>;
brcm,sd_sgentry_align = /bits/ 16 <4>;
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
---
.../net/wireless/broadcom/brcm80211/brcmfmac/of.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
index 2f7bc3a70c65..7c80958e709b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
@@ -66,7 +66,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
int irq;
int err;
u32 irqf;
- u32 val;
+ u32 val32;
+ u16 val16;
/* Set board-type to the first string of the machine compatible prop */
root = of_find_node_by_path("/");
@@ -100,8 +101,15 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
if (bus_type != BRCMF_BUSTYPE_SDIO)
return;
- if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0)
- sdio->drive_strength = val;
+ if (of_property_read_u32(np, "brcm,drive-strength", &val32) == 0)
+ sdio->drive_strength = val32;
+
+ sdio->broken_sg_support = of_property_read_bool(np,
+ "brcm,broken_sg_support");
+ if (of_property_read_u16(np, "brcm,sd_head_align", &val16) == 0)
+ sdio->sd_head_align = val16;
+ if (of_property_read_u16(np, "brcm,sd_sgentry_align", &val16) == 0)
+ sdio->sd_sgentry_align = val16;
/* make sure there are interrupts defined in the node */
if (!of_find_property(np, "interrupts", NULL))
--
2.17.1