326-v4.14-0001-brcmfmac-Add-support-for-CYW4373-SDIO-USB-chipset.patch 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. From 0ec9eb90feec4933637fbde9d5bfbc3b62aea218 Mon Sep 17 00:00:00 2001
  2. From: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  3. Date: Thu, 3 Aug 2017 17:37:58 +0800
  4. Subject: [PATCH] brcmfmac: Add support for CYW4373 SDIO/USB chipset
  5. Add support for CYW4373 SDIO/USB chipset.
  6. CYW4373 is a 1x1 dual-band 11ac chipset with 20/40/80Mhz channel support.
  7. It's a WiFi/BT combo device.
  8. Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
  9. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
  10. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  11. ---
  12. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
  13. drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 2 ++
  14. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 +++-
  15. drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 9 ++++++++-
  16. drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 3 +++
  17. include/linux/mmc/sdio_ids.h | 1 +
  18. 6 files changed, 18 insertions(+), 2 deletions(-)
  19. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  20. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
  21. @@ -1104,6 +1104,7 @@ static const struct sdio_device_id brcmf
  22. BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
  23. BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
  24. BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
  25. + BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
  26. { /* end: all zeroes */ }
  27. };
  28. MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
  29. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  30. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
  31. @@ -690,6 +690,8 @@ static u32 brcmf_chip_tcm_rambase(struct
  32. case BRCM_CC_4365_CHIP_ID:
  33. case BRCM_CC_4366_CHIP_ID:
  34. return 0x200000;
  35. + case CY_CC_4373_CHIP_ID:
  36. + return 0x160000;
  37. default:
  38. brcmf_err("unknown chip: %s\n", ci->pub.name);
  39. break;
  40. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  41. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
  42. @@ -618,6 +618,7 @@ BRCMF_FW_NVRAM_DEF(43430A1, "brcmfmac434
  43. BRCMF_FW_NVRAM_DEF(43455, "brcmfmac43455-sdio.bin", "brcmfmac43455-sdio.txt");
  44. BRCMF_FW_NVRAM_DEF(4354, "brcmfmac4354-sdio.bin", "brcmfmac4354-sdio.txt");
  45. BRCMF_FW_NVRAM_DEF(4356, "brcmfmac4356-sdio.bin", "brcmfmac4356-sdio.txt");
  46. +BRCMF_FW_NVRAM_DEF(4373, "brcmfmac4373-sdio.bin", "brcmfmac4373-sdio.txt");
  47. static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
  48. BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
  49. @@ -636,7 +637,8 @@ static struct brcmf_firmware_mapping brc
  50. BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1),
  51. BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455),
  52. BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
  53. - BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356)
  54. + BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
  55. + BRCMF_FW_NVRAM_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373)
  56. };
  57. static void pkt_align(struct sk_buff *p, int len, int align)
  58. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
  59. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
  60. @@ -50,6 +50,7 @@ BRCMF_FW_DEF(43143, "brcmfmac43143.bin")
  61. BRCMF_FW_DEF(43236B, "brcmfmac43236b.bin");
  62. BRCMF_FW_DEF(43242A, "brcmfmac43242a.bin");
  63. BRCMF_FW_DEF(43569, "brcmfmac43569.bin");
  64. +BRCMF_FW_DEF(4373, "brcmfmac4373.bin");
  65. static struct brcmf_firmware_mapping brcmf_usb_fwnames[] = {
  66. BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
  67. @@ -58,7 +59,8 @@ static struct brcmf_firmware_mapping brc
  68. BRCMF_FW_ENTRY(BRCM_CC_43238_CHIP_ID, 0x00000008, 43236B),
  69. BRCMF_FW_ENTRY(BRCM_CC_43242_CHIP_ID, 0xFFFFFFFF, 43242A),
  70. BRCMF_FW_ENTRY(BRCM_CC_43566_CHIP_ID, 0xFFFFFFFF, 43569),
  71. - BRCMF_FW_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43569)
  72. + BRCMF_FW_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43569),
  73. + BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373)
  74. };
  75. #define TRX_MAGIC 0x30524448 /* "HDR0" */
  76. @@ -1462,15 +1464,20 @@ static int brcmf_usb_reset_resume(struct
  77. #define LINKSYS_USB_DEVICE(dev_id) \
  78. { USB_DEVICE(BRCM_USB_VENDOR_ID_LINKSYS, dev_id) }
  79. +#define CYPRESS_USB_DEVICE(dev_id) \
  80. + { USB_DEVICE(CY_USB_VENDOR_ID_CYPRESS, dev_id) }
  81. +
  82. static struct usb_device_id brcmf_usb_devid_table[] = {
  83. BRCMF_USB_DEVICE(BRCM_USB_43143_DEVICE_ID),
  84. BRCMF_USB_DEVICE(BRCM_USB_43236_DEVICE_ID),
  85. BRCMF_USB_DEVICE(BRCM_USB_43242_DEVICE_ID),
  86. BRCMF_USB_DEVICE(BRCM_USB_43569_DEVICE_ID),
  87. LINKSYS_USB_DEVICE(BRCM_USB_43235_LINKSYS_DEVICE_ID),
  88. + CYPRESS_USB_DEVICE(CY_USB_4373_DEVICE_ID),
  89. { USB_DEVICE(BRCM_USB_VENDOR_ID_LG, BRCM_USB_43242_LG_DEVICE_ID) },
  90. /* special entry for device with firmware loaded and running */
  91. BRCMF_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID),
  92. + CYPRESS_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID),
  93. { /* end: all zeroes */ }
  94. };
  95. --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
  96. +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
  97. @@ -23,6 +23,7 @@
  98. #define BRCM_USB_VENDOR_ID_BROADCOM 0x0a5c
  99. #define BRCM_USB_VENDOR_ID_LG 0x043e
  100. #define BRCM_USB_VENDOR_ID_LINKSYS 0x13b1
  101. +#define CY_USB_VENDOR_ID_CYPRESS 0x04b4
  102. #define BRCM_PCIE_VENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
  103. /* Chipcommon Core Chip IDs */
  104. @@ -57,6 +58,7 @@
  105. #define BRCM_CC_4365_CHIP_ID 0x4365
  106. #define BRCM_CC_4366_CHIP_ID 0x4366
  107. #define BRCM_CC_4371_CHIP_ID 0x4371
  108. +#define CY_CC_4373_CHIP_ID 0x4373
  109. /* USB Device IDs */
  110. #define BRCM_USB_43143_DEVICE_ID 0xbd1e
  111. @@ -66,6 +68,7 @@
  112. #define BRCM_USB_43242_LG_DEVICE_ID 0x3101
  113. #define BRCM_USB_43569_DEVICE_ID 0xbd27
  114. #define BRCM_USB_BCMFW_DEVICE_ID 0x0bdc
  115. +#define CY_USB_4373_DEVICE_ID 0xbd29
  116. /* PCIE Device IDs */
  117. #define BRCM_PCIE_4350_DEVICE_ID 0x43a3
  118. --- a/include/linux/mmc/sdio_ids.h
  119. +++ b/include/linux/mmc/sdio_ids.h
  120. @@ -39,6 +39,7 @@
  121. #define SDIO_DEVICE_ID_BROADCOM_43455 0xa9bf
  122. #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354
  123. #define SDIO_DEVICE_ID_BROADCOM_4356 0x4356
  124. +#define SDIO_DEVICE_ID_CYPRESS_4373 0x4373
  125. #define SDIO_VENDOR_ID_INTEL 0x0089
  126. #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402