aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-11-28 06:49:02 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2016-12-01 06:20:36 -0500
commit615788200557d8a555bf7f02a365aee627400912 (patch)
tree70985cd03e729e736fe35b48dd885c024d59227a /drivers/net/wireless/ath
parent1db226ffe1c2ab900cffb1d71f042e565f77775d (diff)
wil6210: add debugfs blobs for UCODE code and data
Added new areas to fw_mappings area for UCODE code and data areas. The new areas are only exposed through debugfs blobs, and mainly needed to access UCODE logs. The change does not affect crash dumps because the newly added areas overlap with the "upper" area which is already dumped. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h3
-rw-r--r--drivers/net/wireless/ath/wil6210/wil_crash_dump.c6
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c39
3 files changed, 33 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index ef95db977bc6..237e1666df2d 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -276,10 +276,11 @@ struct fw_map {
276 u32 to; /* linker address - to, exclusive */ 276 u32 to; /* linker address - to, exclusive */
277 u32 host; /* PCI/Host address - BAR0 + 0x880000 */ 277 u32 host; /* PCI/Host address - BAR0 + 0x880000 */
278 const char *name; /* for debugfs */ 278 const char *name; /* for debugfs */
279 bool fw; /* true if FW mapping, false if UCODE mapping */
279}; 280};
280 281
281/* array size should be in sync with actual definition in the wmi.c */ 282/* array size should be in sync with actual definition in the wmi.c */
282extern const struct fw_map fw_mapping[8]; 283extern const struct fw_map fw_mapping[10];
283 284
284/** 285/**
285 * mk_cidxtid - construct @cidxtid field 286 * mk_cidxtid - construct @cidxtid field
diff --git a/drivers/net/wireless/ath/wil6210/wil_crash_dump.c b/drivers/net/wireless/ath/wil6210/wil_crash_dump.c
index b57d280946e0..d051eea47a54 100644
--- a/drivers/net/wireless/ath/wil6210/wil_crash_dump.c
+++ b/drivers/net/wireless/ath/wil6210/wil_crash_dump.c
@@ -36,6 +36,9 @@ static int wil_fw_get_crash_dump_bounds(struct wil6210_priv *wil,
36 for (i = 1; i < ARRAY_SIZE(fw_mapping); i++) { 36 for (i = 1; i < ARRAY_SIZE(fw_mapping); i++) {
37 map = &fw_mapping[i]; 37 map = &fw_mapping[i];
38 38
39 if (!map->fw)
40 continue;
41
39 if (map->host < host_min) 42 if (map->host < host_min)
40 host_min = map->host; 43 host_min = map->host;
41 44
@@ -73,6 +76,9 @@ int wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest, u32 size)
73 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) { 76 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) {
74 map = &fw_mapping[i]; 77 map = &fw_mapping[i];
75 78
79 if (!map->fw)
80 continue;
81
76 data = (void * __force)wil->csr + HOSTADDR(map->host); 82 data = (void * __force)wil->csr + HOSTADDR(map->host);
77 len = map->to - map->from; 83 len = map->to - map->from;
78 offset = map->host - host_min; 84 offset = map->host - host_min;
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index d289a4d999b7..7585003bef67 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -84,19 +84,29 @@ MODULE_PARM_DESC(led_id,
84 * array size should be in sync with the declaration in the wil6210.h 84 * array size should be in sync with the declaration in the wil6210.h
85 */ 85 */
86const struct fw_map fw_mapping[] = { 86const struct fw_map fw_mapping[] = {
87 {0x000000, 0x040000, 0x8c0000, "fw_code"}, /* FW code RAM 256k */ 87 /* FW code RAM 256k */
88 {0x800000, 0x808000, 0x900000, "fw_data"}, /* FW data RAM 32k */ 88 {0x000000, 0x040000, 0x8c0000, "fw_code", true},
89 {0x840000, 0x860000, 0x908000, "fw_peri"}, /* periph. data RAM 128k */ 89 /* FW data RAM 32k */
90 {0x880000, 0x88a000, 0x880000, "rgf"}, /* various RGF 40k */ 90 {0x800000, 0x808000, 0x900000, "fw_data", true},
91 {0x88a000, 0x88b000, 0x88a000, "AGC_tbl"}, /* AGC table 4k */ 91 /* periph data 128k */
92 {0x88b000, 0x88c000, 0x88b000, "rgf_ext"}, /* Pcie_ext_rgf 4k */ 92 {0x840000, 0x860000, 0x908000, "fw_peri", true},
93 {0x88c000, 0x88c200, 0x88c000, "mac_rgf_ext"}, /* mac_ext_rgf 512b */ 93 /* various RGF 40k */
94 {0x8c0000, 0x949000, 0x8c0000, "upper"}, /* upper area 548k */ 94 {0x880000, 0x88a000, 0x880000, "rgf", true},
95 /* 95 /* AGC table 4k */
96 * 920000..930000 ucode code RAM 96 {0x88a000, 0x88b000, 0x88a000, "AGC_tbl", true},
97 * 930000..932000 ucode data RAM 97 /* Pcie_ext_rgf 4k */
98 * 932000..949000 back-door debug data 98 {0x88b000, 0x88c000, 0x88b000, "rgf_ext", true},
99 /* mac_ext_rgf 512b */
100 {0x88c000, 0x88c200, 0x88c000, "mac_rgf_ext", true},
101 /* upper area 548k */
102 {0x8c0000, 0x949000, 0x8c0000, "upper", true},
103 /* UCODE areas - accessible by debugfs blobs but not by
104 * wmi_addr_remap. UCODE areas MUST be added AFTER FW areas!
99 */ 105 */
106 /* ucode code RAM 128k */
107 {0x000000, 0x020000, 0x920000, "uc_code", false},
108 /* ucode data RAM 16k */
109 {0x800000, 0x804000, 0x940000, "uc_data", false},
100}; 110};
101 111
102struct blink_on_off_time led_blink_time[] = { 112struct blink_on_off_time led_blink_time[] = {
@@ -108,7 +118,7 @@ struct blink_on_off_time led_blink_time[] = {
108u8 led_polarity = LED_POLARITY_LOW_ACTIVE; 118u8 led_polarity = LED_POLARITY_LOW_ACTIVE;
109 119
110/** 120/**
111 * return AHB address for given firmware/ucode internal (linker) address 121 * return AHB address for given firmware internal (linker) address
112 * @x - internal address 122 * @x - internal address
113 * If address have no valid AHB mapping, return 0 123 * If address have no valid AHB mapping, return 0
114 */ 124 */
@@ -117,7 +127,8 @@ static u32 wmi_addr_remap(u32 x)
117 uint i; 127 uint i;
118 128
119 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) { 129 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) {
120 if ((x >= fw_mapping[i].from) && (x < fw_mapping[i].to)) 130 if (fw_mapping[i].fw &&
131 ((x >= fw_mapping[i].from) && (x < fw_mapping[i].to)))
121 return x + fw_mapping[i].host - fw_mapping[i].from; 132 return x + fw_mapping[i].host - fw_mapping[i].from;
122 } 133 }
123 134