wil6210: enlarge FW mac_rgf_ext section for Sparrow D0
authorLior David <liord@codeaurora.org>
Sun, 21 Jan 2018 09:14:42 +0000 (11:14 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 25 Jan 2018 05:32:30 +0000 (07:32 +0200)
Sparrow D0 chips have slightly larger mac_rgf_ext section
in order to support extra features such as multiple virtual
interfaces.

Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wil6210/pcie_bus.c
drivers/net/wireless/ath/wil6210/wil6210.h
drivers/net/wireless/ath/wil6210/wmi.c

index 750c34edd3f588aa4e25894c9a4cf9712af7aeae..809092a49192362ed036a9db0c673174797ab058 100644 (file)
@@ -43,7 +43,7 @@ int wil_set_capabilities(struct wil6210_priv *wil)
        u8 chip_revision = (wil_r(wil, RGF_USER_REVISION_ID) &
                            RGF_USER_REVISION_ID_MASK);
        int platform_capa;
-       struct fw_map *iccm_section;
+       struct fw_map *iccm_section, *sct;
 
        bitmap_zero(wil->hw_capa, hw_capa_last);
        bitmap_zero(wil->fw_capabilities, WMI_FW_CAPABILITY_MAX);
@@ -54,6 +54,8 @@ int wil_set_capabilities(struct wil6210_priv *wil)
 
        switch (jtag_id) {
        case JTAG_DEV_ID_SPARROW:
+               memcpy(fw_mapping, sparrow_fw_mapping,
+                      sizeof(sparrow_fw_mapping));
                switch (chip_revision) {
                case REVISION_ID_SPARROW_D0:
                        wil->hw_name = "Sparrow D0";
@@ -63,6 +65,12 @@ int wil_set_capabilities(struct wil6210_priv *wil)
 
                        if (wil_fw_verify_file_exists(wil, wil_fw_name))
                                wil->wil_fw_name = wil_fw_name;
+                       sct = wil_find_fw_mapping("mac_rgf_ext");
+                       if (!sct) {
+                               wil_err(wil, "mac_rgf_ext section not found in fw_mapping\n");
+                               return -EINVAL;
+                       }
+                       memcpy(sct, &sparrow_d0_mac_rgf_ext, sizeof(*sct));
                        break;
                case REVISION_ID_SPARROW_B0:
                        wil->hw_name = "Sparrow B0";
@@ -73,8 +81,6 @@ int wil_set_capabilities(struct wil6210_priv *wil)
                        wil->hw_version = HW_VER_UNKNOWN;
                        break;
                }
-               memcpy(fw_mapping, sparrow_fw_mapping,
-                      sizeof(sparrow_fw_mapping));
                wil->rgf_fw_assert_code_addr = SPARROW_RGF_FW_ASSERT_CODE;
                wil->rgf_ucode_assert_code_addr = SPARROW_RGF_UCODE_ASSERT_CODE;
                break;
index 5f9bcfb9bb8602903cadef95f33463fe3f3340d5..836122afb091027fd9c0646f0e55f1c9913d74bc 100644 (file)
@@ -355,6 +355,7 @@ struct fw_map {
 
 /* array size should be in sync with actual definition in the wmi.c */
 extern const struct fw_map sparrow_fw_mapping[SPARROW_FW_MAPPING_TABLE_SIZE];
+extern const struct fw_map sparrow_d0_mac_rgf_ext;
 extern const struct fw_map talyn_fw_mapping[TALYN_FW_MAPPING_TABLE_SIZE];
 extern struct fw_map fw_mapping[MAX_FW_MAPPING_TABLE_SIZE];
 
index 43c5803a35af33b029f987e5f62f0f26d1866860..b31e2514f8c21143f968f945875c7394fd80ceb3 100644 (file)
@@ -113,6 +113,14 @@ const struct fw_map sparrow_fw_mapping[] = {
        {0x800000, 0x804000, 0x940000, "uc_data", false},
 };
 
+/**
+ * @sparrow_d0_mac_rgf_ext - mac_rgf_ext section for Sparrow D0
+ * it is a bit larger to support extra features
+ */
+const struct fw_map sparrow_d0_mac_rgf_ext = {
+       0x88c000, 0x88c500, 0x88c000, "mac_rgf_ext", true
+};
+
 /**
  * @talyn_fw_mapping provides memory remapping table for Talyn
  *