xmixahlx

linux-0003-rockchip-from-list_manjaro.diff

Feb 16th, 2020
251
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- linux-0003-rockchip-from-list.patch 2020-02-14 05:37:04.106673608 -0800
  2. +++ linux-0003-rockchip-from-list_manjaro.patch 2020-02-16 14:54:03.516383672 -0800
  3. @@ -275,57 +275,6 @@
  4.  
  5. struct hdmi_codec_priv {
  6.  
  7. -From f895f1f4de0b7252f29e7e5779727b303df9e58d Mon Sep 17 00:00:00 2001
  8. -From: schaecsn <schaecsn@gmx.net>
  9. -Date: Sun, 17 Nov 2019 21:24:13 -0800
  10. -Subject: [PATCH] thermal: rockchip: enable hwmon
  11. -
  12. -Enable hwmon for the soc and gpu temperature sensors.
  13. -
  14. -Signed-off-by: Stefan Schaeckeler <schaecsn@gmx.net>
  15. ----
  16. - drivers/thermal/rockchip_thermal.c | 12 +++++++++++-
  17. - 1 file changed, 11 insertions(+), 1 deletion(-)
  18. -
  19. -diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
  20. -index 343c2f5c5a25..e47c60010259 100644
  21. ---- a/drivers/thermal/rockchip_thermal.c
  22. -+++ b/drivers/thermal/rockchip_thermal.c
  23. -@@ -19,6 +19,8 @@
  24. - #include <linux/mfd/syscon.h>
  25. - #include <linux/pinctrl/consumer.h>
  26. -
  27. -+#include "thermal_hwmon.h"
  28. -+
  29. - /**
  30. - * If the temperature over a period of time High,
  31. - * the resulting TSHUT gave CRU module,let it reset the entire chip,
  32. -@@ -1321,8 +1323,15 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
  33. -
  34. - thermal->chip->control(thermal->regs, true);
  35. -
  36. -- for (i = 0; i < thermal->chip->chn_num; i++)
  37. -+ for (i = 0; i < thermal->chip->chn_num; i++) {
  38. - rockchip_thermal_toggle_sensor(&thermal->sensors[i], true);
  39. -+ thermal->sensors[i].tzd->tzp->no_hwmon = false;
  40. -+ error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd);
  41. -+ if (error)
  42. -+ dev_warn(&pdev->dev,
  43. -+ "failed to register sensor %d with hwmon: %d\n",
  44. -+ i, error);
  45. -+ }
  46. -
  47. - platform_set_drvdata(pdev, thermal);
  48. -
  49. -@@ -1344,6 +1353,7 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
  50. - for (i = 0; i < thermal->chip->chn_num; i++) {
  51. - struct rockchip_thermal_sensor *sensor = &thermal->sensors[i];
  52. -
  53. -+ thermal_remove_hwmon_sysfs(sensor->tzd);
  54. - rockchip_thermal_toggle_sensor(sensor, false);
  55. - }
  56. -
  57. -
  58. From b5bcb54fe763aa9f40bae7af7e0629a3a6b93a52 Mon Sep 17 00:00:00 2001
  59. From: Robin Murphy <robin.murphy@arm.com>
  60. Date: Thu, 28 Nov 2019 20:59:27 +0000
  61. @@ -592,551 +541,6 @@
  62. void *priv;
  63. u32 capabilities;
  64.  
  65. -From 943aab648dbd4061511b0f4de544af28710127dc Mon Sep 17 00:00:00 2001
  66. -From: Wright Feng <wright.feng@cypress.com>
  67. -Date: Thu, 12 Dec 2019 00:52:45 +0100
  68. -Subject: [PATCH] brcmfmac: reset two D11 cores if chip has two D11 cores
  69. -
  70. -There are two D11 cores in RSDB chips like 4359. We have to reset two
  71. -D11 cores simutaneously before firmware download, or the firmware may
  72. -not be initialized correctly and cause "fw initialized failed" error.
  73. -
  74. -Signed-off-by: Wright Feng <wright.feng@cypress.com>
  75. -Signed-off-by: Soeren Moch <smoch@web.de>
  76. -Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  77. ----
  78. - .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 50 ++++++++++++++++++++++
  79. - .../wireless/broadcom/brcm80211/brcmfmac/chip.h | 1 +
  80. - .../wireless/broadcom/brcm80211/brcmfmac/pcie.c | 2 +-
  81. - 3 files changed, 52 insertions(+), 1 deletion(-)
  82. -
  83. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  84. -index dd586a96b57a..5e11b30ae337 100644
  85. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  86. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  87. -@@ -433,11 +433,25 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset,
  88. - {
  89. - struct brcmf_chip_priv *ci;
  90. - int count;
  91. -+ struct brcmf_core *d11core2 = NULL;
  92. -+ struct brcmf_core_priv *d11priv2 = NULL;
  93. -
  94. - ci = core->chip;
  95. -
  96. -+ /* special handle two D11 cores reset */
  97. -+ if (core->pub.id == BCMA_CORE_80211) {
  98. -+ d11core2 = brcmf_chip_get_d11core(&ci->pub, 1);
  99. -+ if (d11core2) {
  100. -+ brcmf_dbg(INFO, "found two d11 cores, reset both\n");
  101. -+ d11priv2 = container_of(d11core2,
  102. -+ struct brcmf_core_priv, pub);
  103. -+ }
  104. -+ }
  105. -+
  106. - /* must disable first to work for arbitrary current core state */
  107. - brcmf_chip_ai_coredisable(core, prereset, reset);
  108. -+ if (d11priv2)
  109. -+ brcmf_chip_ai_coredisable(d11priv2, prereset, reset);
  110. -
  111. - count = 0;
  112. - while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) &
  113. -@@ -449,9 +463,30 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset,
  114. - usleep_range(40, 60);
  115. - }
  116. -
  117. -+ if (d11priv2) {
  118. -+ count = 0;
  119. -+ while (ci->ops->read32(ci->ctx,
  120. -+ d11priv2->wrapbase + BCMA_RESET_CTL) &
  121. -+ BCMA_RESET_CTL_RESET) {
  122. -+ ci->ops->write32(ci->ctx,
  123. -+ d11priv2->wrapbase + BCMA_RESET_CTL,
  124. -+ 0);
  125. -+ count++;
  126. -+ if (count > 50)
  127. -+ break;
  128. -+ usleep_range(40, 60);
  129. -+ }
  130. -+ }
  131. -+
  132. - ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL,
  133. - postreset | BCMA_IOCTL_CLK);
  134. - ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL);
  135. -+
  136. -+ if (d11priv2) {
  137. -+ ci->ops->write32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL,
  138. -+ postreset | BCMA_IOCTL_CLK);
  139. -+ ci->ops->read32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL);
  140. -+ }
  141. - }
  142. -
  143. - char *brcmf_chip_name(u32 id, u32 rev, char *buf, uint len)
  144. -@@ -1113,6 +1148,21 @@ void brcmf_chip_detach(struct brcmf_chip *pub)
  145. - kfree(chip);
  146. - }
  147. -
  148. -+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit)
  149. -+{
  150. -+ struct brcmf_chip_priv *chip;
  151. -+ struct brcmf_core_priv *core;
  152. -+
  153. -+ chip = container_of(pub, struct brcmf_chip_priv, pub);
  154. -+ list_for_each_entry(core, &chip->cores, list) {
  155. -+ if (core->pub.id == BCMA_CORE_80211) {
  156. -+ if (unit-- == 0)
  157. -+ return &core->pub;
  158. -+ }
  159. -+ }
  160. -+ return NULL;
  161. -+}
  162. -+
  163. - struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid)
  164. - {
  165. - struct brcmf_chip_priv *chip;
  166. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
  167. -index 7b00f6a59e89..8fa38658e727 100644
  168. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
  169. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
  170. -@@ -74,6 +74,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx,
  171. - const struct brcmf_buscore_ops *ops);
  172. - void brcmf_chip_detach(struct brcmf_chip *chip);
  173. - struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
  174. -+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit);
  175. - struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
  176. - struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub);
  177. - bool brcmf_chip_iscoreup(struct brcmf_core *core);
  178. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  179. -index 6c463475e90b..259b9e8f4300 100644
  180. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  181. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
  182. -@@ -78,7 +78,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
  183. - BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
  184. - };
  185. -
  186. --#define BRCMF_PCIE_FW_UP_TIMEOUT 2000 /* msec */
  187. -+#define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */
  188. -
  189. - #define BRCMF_PCIE_REG_MAP_SIZE (32 * 1024)
  190. -
  191. -
  192. -From 17d07d4ceeb0ecfb0f7df2a6936fe3a8c48f4a60 Mon Sep 17 00:00:00 2001
  193. -From: Chung-Hsien Hsu <stanley.hsu@cypress.com>
  194. -Date: Thu, 12 Dec 2019 00:52:46 +0100
  195. -Subject: [PATCH] brcmfmac: set F2 blocksize and watermark for 4359
  196. -
  197. -Set F2 blocksize to 256 bytes and watermark to 0x40 for 4359. Also
  198. -enable and configure F1 MesBusyCtrl. It fixes DMA error while having
  199. -UDP bi-directional traffic.
  200. -
  201. -Signed-off-by: Chung-Hsien Hsu <stanley.hsu@cypress.com>
  202. -[slightly adapted for rebase on mainline linux]
  203. -Signed-off-by: Soeren Moch <smoch@web.de>
  204. -Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  205. ----
  206. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++++-
  207. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 15 +++++++++++++++
  208. - 2 files changed, 20 insertions(+), 1 deletion(-)
  209. -
  210. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  211. -index fc12598b2dd3..cf171a2aea35 100644
  212. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  213. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  214. -@@ -43,6 +43,7 @@
  215. -
  216. - #define SDIO_FUNC1_BLOCKSIZE 64
  217. - #define SDIO_FUNC2_BLOCKSIZE 512
  218. -+#define SDIO_4359_FUNC2_BLOCKSIZE 256
  219. - /* Maximum milliseconds to wait for F2 to come up */
  220. - #define SDIO_WAIT_F2RDY 3000
  221. -
  222. -@@ -903,6 +904,7 @@ static void brcmf_sdiod_host_fixup(struct mmc_host *host)
  223. - static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
  224. - {
  225. - int ret = 0;
  226. -+ unsigned int f2_blksz = SDIO_FUNC2_BLOCKSIZE;
  227. -
  228. - sdio_claim_host(sdiodev->func1);
  229. -
  230. -@@ -912,7 +914,9 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
  231. - sdio_release_host(sdiodev->func1);
  232. - goto out;
  233. - }
  234. -- ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE);
  235. -+ if (sdiodev->func2->device == SDIO_DEVICE_ID_BROADCOM_4359)
  236. -+ f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE;
  237. -+ ret = sdio_set_block_size(sdiodev->func2, f2_blksz);
  238. - if (ret) {
  239. - brcmf_err("Failed to set F2 blocksize\n");
  240. - sdio_release_host(sdiodev->func1);
  241. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  242. -index 264ad63232f8..21e535072f3f 100644
  243. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  244. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  245. -@@ -42,6 +42,8 @@
  246. - #define DEFAULT_F2_WATERMARK 0x8
  247. - #define CY_4373_F2_WATERMARK 0x40
  248. - #define CY_43012_F2_WATERMARK 0x60
  249. -+#define CY_4359_F2_WATERMARK 0x40
  250. -+#define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB)
  251. -
  252. - #ifdef DEBUG
  253. -
  254. -@@ -4205,6 +4207,19 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
  255. - brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
  256. - &err);
  257. - break;
  258. -+ case SDIO_DEVICE_ID_BROADCOM_4359:
  259. -+ brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n",
  260. -+ CY_4359_F2_WATERMARK);
  261. -+ brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
  262. -+ CY_4359_F2_WATERMARK, &err);
  263. -+ devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL,
  264. -+ &err);
  265. -+ devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
  266. -+ brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
  267. -+ &err);
  268. -+ brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL,
  269. -+ CY_4359_F1_MESBUSYCTRL, &err);
  270. -+ break;
  271. - default:
  272. - brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
  273. - DEFAULT_F2_WATERMARK, &err);
  274. -
  275. -From 674ac87ce4558b0425bfd05a8816c2163ff0df26 Mon Sep 17 00:00:00 2001
  276. -From: Soeren Moch <smoch@web.de>
  277. -Date: Thu, 12 Dec 2019 00:52:47 +0100
  278. -Subject: [PATCH] brcmfmac: fix rambase for 4359/9
  279. -
  280. -Newer 4359 chip revisions need a different rambase address.
  281. -This fixes firmware download on such devices which fails otherwise.
  282. -
  283. -Signed-off-by: Soeren Moch <smoch@web.de>
  284. -Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  285. ----
  286. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++-
  287. - 1 file changed, 2 insertions(+), 1 deletion(-)
  288. -
  289. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  290. -index 5e11b30ae337..36c913893b6d 100644
  291. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  292. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  293. -@@ -712,7 +712,6 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
  294. - case BRCM_CC_43569_CHIP_ID:
  295. - case BRCM_CC_43570_CHIP_ID:
  296. - case BRCM_CC_4358_CHIP_ID:
  297. -- case BRCM_CC_4359_CHIP_ID:
  298. - case BRCM_CC_43602_CHIP_ID:
  299. - case BRCM_CC_4371_CHIP_ID:
  300. - return 0x180000;
  301. -@@ -722,6 +721,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
  302. - case BRCM_CC_4366_CHIP_ID:
  303. - case BRCM_CC_43664_CHIP_ID:
  304. - return 0x200000;
  305. -+ case BRCM_CC_4359_CHIP_ID:
  306. -+ return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000;
  307. - case CY_CC_4373_CHIP_ID:
  308. - return 0x160000;
  309. - default:
  310. -
  311. -From eb76633d7081bab5437d2d481b7e47eeb29f0e57 Mon Sep 17 00:00:00 2001
  312. -From: Soeren Moch <smoch@web.de>
  313. -Date: Thu, 12 Dec 2019 00:52:48 +0100
  314. -Subject: [PATCH] brcmfmac: make errors when setting roaming parameters
  315. - non-fatal
  316. -
  317. -4359 dongles do not support setting roaming parameters (error -52).
  318. -Do not fail the 80211 configuration in this case.
  319. -
  320. -Signed-off-by: Soeren Moch <smoch@web.de>
  321. -Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  322. ----
  323. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 10 ++++------
  324. - 1 file changed, 4 insertions(+), 6 deletions(-)
  325. -
  326. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  327. -index e3ebb7abbdae..3d2fb64f4deb 100644
  328. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  329. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  330. -@@ -5944,19 +5944,17 @@ static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
  331. - roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL);
  332. - err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
  333. - (void *)roamtrigger, sizeof(roamtrigger));
  334. -- if (err) {
  335. -+ if (err)
  336. - bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
  337. -- goto roam_setup_done;
  338. -- }
  339. -
  340. - roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA);
  341. - roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL);
  342. - err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
  343. - (void *)roam_delta, sizeof(roam_delta));
  344. -- if (err) {
  345. -+ if (err)
  346. - bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
  347. -- goto roam_setup_done;
  348. -- }
  349. -+
  350. -+ return 0;
  351. -
  352. - roam_setup_done:
  353. - return err;
  354. -
  355. -From 292a234f90d08ff79afb33171e6474d77eb2484a Mon Sep 17 00:00:00 2001
  356. -From: Soeren Moch <smoch@web.de>
  357. -Date: Thu, 12 Dec 2019 00:52:49 +0100
  358. -Subject: [PATCH] brcmfmac: add support for BCM4359 SDIO chipset
  359. -
  360. -BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it
  361. -supports Real Simultaneous Dual Band feature.
  362. -
  363. -Based on a similar patch by: Wright Feng <wright.feng@cypress.com>
  364. -
  365. -Signed-off-by: Soeren Moch <smoch@web.de>
  366. -Acked-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  367. -Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
  368. ----
  369. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++
  370. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 +
  371. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 ++
  372. - include/linux/mmc/sdio_ids.h | 2 ++
  373. - 4 files changed, 7 insertions(+)
  374. -
  375. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  376. -index cf171a2aea35..2bd71aae4899 100644
  377. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  378. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  379. -@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
  380. - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
  381. - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
  382. - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
  383. -+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359),
  384. - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
  385. - BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
  386. -+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359),
  387. - { /* end: all zeroes */ }
  388. - };
  389. - MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
  390. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  391. -index 36c913893b6d..1a8394c3c901 100644
  392. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  393. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  394. -@@ -1412,6 +1412,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub)
  395. - addr = CORE_CC_REG(base, sr_control0);
  396. - reg = chip->ops->read32(chip->ctx, addr);
  397. - return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
  398. -+ case BRCM_CC_4359_CHIP_ID:
  399. - case CY_CC_43012_CHIP_ID:
  400. - addr = CORE_CC_REG(pmu->base, retention_ctl);
  401. - reg = chip->ops->read32(chip->ctx, addr);
  402. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  403. -index 21e535072f3f..c4012ed58b9c 100644
  404. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  405. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  406. -@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
  407. - BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
  408. - BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
  409. - BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
  410. -+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");
  411. - BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
  412. - BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
  413. -
  414. -@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
  415. - BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
  416. - BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
  417. - BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
  418. -+ BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
  419. - BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
  420. - BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
  421. - };
  422. -diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
  423. -index d1a5d5df02f5..d51a31a59f16 100644
  424. ---- a/include/linux/mmc/sdio_ids.h
  425. -+++ b/include/linux/mmc/sdio_ids.h
  426. -@@ -41,8 +41,10 @@
  427. - #define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
  428. - #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
  429. - #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356
  430. -+#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359
  431. - #define SDIO_DEVICE_ID_CYPRESS_4373 0x4373
  432. - #define SDIO_DEVICE_ID_CYPRESS_43012 43012
  433. -+#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355
  434. -
  435. - #define SDIO_VENDOR_ID_INTEL 0x0089
  436. - #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
  437. -
  438. -From 6c9b1c4f22fa084c22e63775b48734a232e3cd39 Mon Sep 17 00:00:00 2001
  439. -From: Wright Feng <wright.feng@cypress.com>
  440. -Date: Thu, 12 Dec 2019 00:52:50 +0100
  441. -Subject: [PATCH] brcmfmac: add RSDB condition when setting interface
  442. - combinations
  443. -
  444. -With firmware RSDB feature
  445. -1. The maximum support interface is four.
  446. -2. The maximum difference channel is two.
  447. -3. The maximum interfaces of {station/p2p client/AP} are two.
  448. -4. The maximum interface of p2p device is one.
  449. -
  450. -Signed-off-by: Wright Feng <wright.feng@cypress.com>
  451. -Signed-off-by: Soeren Moch <smoch@web.de>
  452. -Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  453. ----
  454. - .../broadcom/brcm80211/brcmfmac/cfg80211.c | 54 ++++++++++++++++++----
  455. - 1 file changed, 46 insertions(+), 8 deletions(-)
  456. -
  457. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  458. -index 3d2fb64f4deb..885201328699 100644
  459. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  460. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  461. -@@ -6452,6 +6452,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
  462. - * #STA <= 1, #AP <= 1, channels = 1, 2 total
  463. - * #AP <= 4, matching BI, channels = 1, 4 total
  464. - *
  465. -+ * no p2p and rsdb:
  466. -+ * #STA <= 2, #AP <= 2, channels = 2, 4 total
  467. -+ *
  468. - * p2p, no mchan, and mbss:
  469. - *
  470. - * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total
  471. -@@ -6463,6 +6466,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
  472. - * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total
  473. - * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
  474. - * #AP <= 4, matching BI, channels = 1, 4 total
  475. -+ *
  476. -+ * p2p, rsdb, and no mbss:
  477. -+ * #STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2,
  478. -+ * channels = 2, 4 total
  479. - */
  480. - static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
  481. - {
  482. -@@ -6470,13 +6477,14 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
  483. - struct ieee80211_iface_limit *c0_limits = NULL;
  484. - struct ieee80211_iface_limit *p2p_limits = NULL;
  485. - struct ieee80211_iface_limit *mbss_limits = NULL;
  486. -- bool mbss, p2p;
  487. -+ bool mbss, p2p, rsdb;
  488. - int i, c, n_combos;
  489. -
  490. - mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS);
  491. - p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P);
  492. -+ rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB);
  493. -
  494. -- n_combos = 1 + !!p2p + !!mbss;
  495. -+ n_combos = 1 + !!(p2p && !rsdb) + !!mbss;
  496. - combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL);
  497. - if (!combo)
  498. - goto err;
  499. -@@ -6487,16 +6495,36 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
  500. -
  501. - c = 0;
  502. - i = 0;
  503. -- c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL);
  504. -+ if (p2p && rsdb)
  505. -+ c0_limits = kcalloc(4, sizeof(*c0_limits), GFP_KERNEL);
  506. -+ else if (p2p)
  507. -+ c0_limits = kcalloc(3, sizeof(*c0_limits), GFP_KERNEL);
  508. -+ else
  509. -+ c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL);
  510. - if (!c0_limits)
  511. - goto err;
  512. -- c0_limits[i].max = 1;
  513. -- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
  514. -- if (p2p) {
  515. -+ if (p2p && rsdb) {
  516. -+ combo[c].num_different_channels = 2;
  517. -+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
  518. -+ BIT(NL80211_IFTYPE_P2P_GO) |
  519. -+ BIT(NL80211_IFTYPE_P2P_DEVICE);
  520. -+ c0_limits[i].max = 2;
  521. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
  522. -+ c0_limits[i].max = 1;
  523. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE);
  524. -+ c0_limits[i].max = 2;
  525. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
  526. -+ BIT(NL80211_IFTYPE_P2P_GO);
  527. -+ c0_limits[i].max = 2;
  528. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
  529. -+ combo[c].max_interfaces = 5;
  530. -+ } else if (p2p) {
  531. - if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
  532. - combo[c].num_different_channels = 2;
  533. - else
  534. - combo[c].num_different_channels = 1;
  535. -+ c0_limits[i].max = 1;
  536. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
  537. - wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
  538. - BIT(NL80211_IFTYPE_P2P_GO) |
  539. - BIT(NL80211_IFTYPE_P2P_DEVICE);
  540. -@@ -6505,16 +6533,26 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
  541. - c0_limits[i].max = 1;
  542. - c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
  543. - BIT(NL80211_IFTYPE_P2P_GO);
  544. -+ combo[c].max_interfaces = i;
  545. -+ } else if (rsdb) {
  546. -+ combo[c].num_different_channels = 2;
  547. -+ c0_limits[i].max = 2;
  548. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
  549. -+ c0_limits[i].max = 2;
  550. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
  551. -+ combo[c].max_interfaces = 3;
  552. - } else {
  553. - combo[c].num_different_channels = 1;
  554. - c0_limits[i].max = 1;
  555. -+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
  556. -+ c0_limits[i].max = 1;
  557. - c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
  558. -+ combo[c].max_interfaces = i;
  559. - }
  560. -- combo[c].max_interfaces = i;
  561. - combo[c].n_limits = i;
  562. - combo[c].limits = c0_limits;
  563. -
  564. -- if (p2p) {
  565. -+ if (p2p && !rsdb) {
  566. - c++;
  567. - i = 0;
  568. - p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL);
  569. -
  570. -From 8c3545f6af6eddc0ef18ef985d96697dac65acc2 Mon Sep 17 00:00:00 2001
  571. -From: Wright Feng <wright.feng@cypress.com>
  572. -Date: Thu, 12 Dec 2019 00:52:51 +0100
  573. -Subject: [PATCH] brcmfmac: not set mbss in vif if firmware does not support
  574. - MBSS
  575. -
  576. -With RSDB mode, FMAC and firmware are able to create 2 or more AP,
  577. -so we should not set mbss in vif structure if firmware does not
  578. -support MBSS feature.
  579. -
  580. -Signed-off-by: Wright Feng <wright.feng@cypress.com>
  581. -Signed-off-by: Soeren Moch <smoch@web.de>
  582. -Reviewed-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  583. ----
  584. - drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++-
  585. - 1 file changed, 3 insertions(+), 1 deletion(-)
  586. -
  587. -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  588. -index 885201328699..8020cf933c5d 100644
  589. ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  590. -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  591. -@@ -5301,6 +5301,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
  592. - struct brcmf_cfg80211_vif *vif_walk;
  593. - struct brcmf_cfg80211_vif *vif;
  594. - bool mbss;
  595. -+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
  596. -
  597. - brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n",
  598. - sizeof(*vif));
  599. -@@ -5313,7 +5314,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
  600. -
  601. - brcmf_init_prof(&vif->profile);
  602. -
  603. -- if (type == NL80211_IFTYPE_AP) {
  604. -+ if (type == NL80211_IFTYPE_AP &&
  605. -+ brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) {
  606. - mbss = false;
  607. - list_for_each_entry(vif_walk, &cfg->vif_list, list) {
  608. - if (vif_walk->wdev.iftype == NL80211_IFTYPE_AP) {
  609. -
  610. From f0ba3ec80e9aff664dfd1def2c14caab9fd72f44 Mon Sep 17 00:00:00 2001
  611. From: Soeren Moch <smoch@web.de>
  612. Date: Thu, 12 Dec 2019 00:52:52 +0100
RAW Paste Data