aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c49
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h15
-rw-r--r--drivers/net/wireless/ath/wil6210/wmi.c20
3 files changed, 39 insertions, 45 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index b6400680850a..d5b095d404e1 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -965,6 +965,26 @@ static const struct file_operations fops_sta = {
965}; 965};
966 966
967/*----------------*/ 967/*----------------*/
968static void wil6210_debugfs_init_blobs(struct wil6210_priv *wil,
969 struct dentry *dbg)
970{
971 int i;
972 char name[32];
973
974 for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) {
975 struct debugfs_blob_wrapper *blob = &wil->blobs[i];
976 const struct fw_map *map = &fw_mapping[i];
977
978 if (!map->name)
979 continue;
980
981 blob->data = (void * __force)wil->csr + HOSTADDR(map->host);
982 blob->size = map->to - map->from;
983 snprintf(name, sizeof(name), "blob_%s", map->name);
984 wil_debugfs_create_ioblob(name, S_IRUGO, dbg, blob);
985 }
986}
987
968int wil6210_debugfs_init(struct wil6210_priv *wil) 988int wil6210_debugfs_init(struct wil6210_priv *wil)
969{ 989{
970 struct dentry *dbg = wil->debug = debugfs_create_dir(WIL_NAME, 990 struct dentry *dbg = wil->debug = debugfs_create_dir(WIL_NAME,
@@ -1014,34 +1034,7 @@ int wil6210_debugfs_init(struct wil6210_priv *wil)
1014 debugfs_create_file("link", S_IRUGO, dbg, wil, &fops_link); 1034 debugfs_create_file("link", S_IRUGO, dbg, wil, &fops_link);
1015 debugfs_create_file("info", S_IRUGO, dbg, wil, &fops_info); 1035 debugfs_create_file("info", S_IRUGO, dbg, wil, &fops_info);
1016 1036
1017 wil->rgf_blob.data = (void * __force)wil->csr + 0; 1037 wil6210_debugfs_init_blobs(wil, dbg);
1018 wil->rgf_blob.size = 0xa000;
1019 wil_debugfs_create_ioblob("blob_rgf", S_IRUGO, dbg, &wil->rgf_blob);
1020
1021 wil->fw_code_blob.data = (void * __force)wil->csr + 0x40000;
1022 wil->fw_code_blob.size = 0x40000;
1023 wil_debugfs_create_ioblob("blob_fw_code", S_IRUGO, dbg,
1024 &wil->fw_code_blob);
1025
1026 wil->fw_data_blob.data = (void * __force)wil->csr + 0x80000;
1027 wil->fw_data_blob.size = 0x8000;
1028 wil_debugfs_create_ioblob("blob_fw_data", S_IRUGO, dbg,
1029 &wil->fw_data_blob);
1030
1031 wil->fw_peri_blob.data = (void * __force)wil->csr + 0x88000;
1032 wil->fw_peri_blob.size = 0x18000;
1033 wil_debugfs_create_ioblob("blob_fw_peri", S_IRUGO, dbg,
1034 &wil->fw_peri_blob);
1035
1036 wil->uc_code_blob.data = (void * __force)wil->csr + 0xa0000;
1037 wil->uc_code_blob.size = 0x10000;
1038 wil_debugfs_create_ioblob("blob_uc_code", S_IRUGO, dbg,
1039 &wil->uc_code_blob);
1040
1041 wil->uc_data_blob.data = (void * __force)wil->csr + 0xb0000;
1042 wil->uc_data_blob.size = 0x4000;
1043 wil_debugfs_create_ioblob("blob_uc_data", S_IRUGO, dbg,
1044 &wil->uc_data_blob);
1045 1038
1046 return 0; 1039 return 0;
1047} 1040}
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index 09c36a7a32e0..02205b09fb50 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -144,6 +144,14 @@ struct RGF_ICR {
144#define ISR_MISC_FW_ERROR BIT_DMA_EP_MISC_ICR_FW_INT(3) 144#define ISR_MISC_FW_ERROR BIT_DMA_EP_MISC_ICR_FW_INT(3)
145 145
146/* Hardware definitions end */ 146/* Hardware definitions end */
147struct fw_map {
148 u32 from; /* linker address - from, inclusive */
149 u32 to; /* linker address - to, exclusive */
150 u32 host; /* PCI/Host address - BAR0 + 0x880000 */
151 const char *name; /* for debugfs */
152};
153/* array size should be in sync with actual definition in the wmi.c */
154extern const struct fw_map fw_mapping[6];
147 155
148/** 156/**
149 * mk_cidxtid - construct @cidxtid field 157 * mk_cidxtid - construct @cidxtid field
@@ -425,12 +433,7 @@ struct wil6210_priv {
425 atomic_t isr_count_rx, isr_count_tx; 433 atomic_t isr_count_rx, isr_count_tx;
426 /* debugfs */ 434 /* debugfs */
427 struct dentry *debug; 435 struct dentry *debug;
428 struct debugfs_blob_wrapper fw_code_blob; 436 struct debugfs_blob_wrapper blobs[ARRAY_SIZE(fw_mapping)];
429 struct debugfs_blob_wrapper fw_data_blob;
430 struct debugfs_blob_wrapper fw_peri_blob;
431 struct debugfs_blob_wrapper uc_code_blob;
432 struct debugfs_blob_wrapper uc_data_blob;
433 struct debugfs_blob_wrapper rgf_blob;
434}; 437};
435 438
436#define wil_to_wiphy(i) (i->wdev->wiphy) 439#define wil_to_wiphy(i) (i->wdev->wiphy)
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index a136dab560e2..084c3de21c56 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -65,18 +65,16 @@
65 65
66/** 66/**
67 * @fw_mapping provides memory remapping table 67 * @fw_mapping provides memory remapping table
68 *
69 * array size should be in sync with the declaration in the wil6210.h
68 */ 70 */
69static const struct { 71const struct fw_map fw_mapping[] = {
70 u32 from; /* linker address - from, inclusive */ 72 {0x000000, 0x040000, 0x8c0000, "fw_code"}, /* FW code RAM 256k */
71 u32 to; /* linker address - to, exclusive */ 73 {0x800000, 0x808000, 0x900000, "fw_data"}, /* FW data RAM 32k */
72 u32 host; /* PCI/Host address - BAR0 + 0x880000 */ 74 {0x840000, 0x860000, 0x908000, "fw_peri"}, /* periph. data RAM 128k */
73} fw_mapping[] = { 75 {0x880000, 0x88a000, 0x880000, "rgf"}, /* various RGF 40k */
74 {0x000000, 0x040000, 0x8c0000}, /* FW code RAM 256k */ 76 {0x88b000, 0x88c000, 0x88b000, "rgf_ext"}, /* Pcie_ext_rgf 4k */
75 {0x800000, 0x808000, 0x900000}, /* FW data RAM 32k */ 77 {0x8c0000, 0x949000, 0x8c0000, "upper"}, /* upper area 548k */
76 {0x840000, 0x860000, 0x908000}, /* peripheral data RAM 128k/96k used */
77 {0x880000, 0x88a000, 0x880000}, /* various RGF */
78 {0x88b000, 0x88c000, 0x88b000}, /* Pcie_ext_rgf */
79 {0x8c0000, 0x949000, 0x8c0000}, /* trivial mapping for upper area */
80 /* 78 /*
81 * 920000..930000 ucode code RAM 79 * 920000..930000 ucode code RAM
82 * 930000..932000 ucode data RAM 80 * 930000..932000 ucode data RAM