aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2015-02-15 07:02:31 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-02-27 03:15:14 -0500
commit9a5511b58b25aaf4cba61d9144229d2987a5135c (patch)
tree1a3fe715b78a4a0539aa0f778b2e765728b34ce7
parent2cd0f021b847c4c366dcb064600d8e37944ad84f (diff)
wil6210: remove support for old hardware
Hardware older than Sparrow B0 obsolete. There is no WiFi product that uses this hardware. Recent firmware does not support it either. Remove driver support. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/wil6210/ethtool.c34
-rw-r--r--drivers/net/wireless/ath/wil6210/interrupt.c45
-rw-r--r--drivers/net/wireless/ath/wil6210/main.c58
-rw-r--r--drivers/net/wireless/ath/wil6210/pcie_bus.c20
-rw-r--r--drivers/net/wireless/ath/wil6210/wil6210.h8
5 files changed, 42 insertions, 123 deletions
diff --git a/drivers/net/wireless/ath/wil6210/ethtool.c b/drivers/net/wireless/ath/wil6210/ethtool.c
index 4c44a82c34d7..0ea695ff98ad 100644
--- a/drivers/net/wireless/ath/wil6210/ethtool.c
+++ b/drivers/net/wireless/ath/wil6210/ethtool.c
@@ -50,27 +50,19 @@ static int wil_ethtoolops_get_coalesce(struct net_device *ndev,
50 50
51 wil_dbg_misc(wil, "%s()\n", __func__); 51 wil_dbg_misc(wil, "%s()\n", __func__);
52 52
53 if (test_bit(hw_capability_advanced_itr_moderation, 53 tx_itr_en = ioread32(wil->csr +
54 wil->hw_capabilities)) { 54 HOSTADDR(RGF_DMA_ITR_TX_CNT_CTL));
55 tx_itr_en = ioread32(wil->csr + 55 if (tx_itr_en & BIT_DMA_ITR_TX_CNT_CTL_EN)
56 HOSTADDR(RGF_DMA_ITR_TX_CNT_CTL)); 56 tx_itr_val =
57 if (tx_itr_en & BIT_DMA_ITR_TX_CNT_CTL_EN) 57 ioread32(wil->csr +
58 tx_itr_val = 58 HOSTADDR(RGF_DMA_ITR_TX_CNT_TRSH));
59 ioread32(wil->csr + 59
60 HOSTADDR(RGF_DMA_ITR_TX_CNT_TRSH)); 60 rx_itr_en = ioread32(wil->csr +
61 61 HOSTADDR(RGF_DMA_ITR_RX_CNT_CTL));
62 rx_itr_en = ioread32(wil->csr + 62 if (rx_itr_en & BIT_DMA_ITR_RX_CNT_CTL_EN)
63 HOSTADDR(RGF_DMA_ITR_RX_CNT_CTL)); 63 rx_itr_val =
64 if (rx_itr_en & BIT_DMA_ITR_RX_CNT_CTL_EN) 64 ioread32(wil->csr +
65 rx_itr_val = 65 HOSTADDR(RGF_DMA_ITR_RX_CNT_TRSH));
66 ioread32(wil->csr +
67 HOSTADDR(RGF_DMA_ITR_RX_CNT_TRSH));
68 } else {
69 rx_itr_en = ioread32(wil->csr + HOSTADDR(RGF_DMA_ITR_CNT_CRL));
70 if (rx_itr_en & BIT_DMA_ITR_CNT_CRL_EN)
71 rx_itr_val = ioread32(wil->csr +
72 HOSTADDR(RGF_DMA_ITR_CNT_TRSH));
73 }
74 66
75 cp->tx_coalesce_usecs = tx_itr_val; 67 cp->tx_coalesce_usecs = tx_itr_val;
76 cp->rx_coalesce_usecs = rx_itr_val; 68 cp->rx_coalesce_usecs = rx_itr_val;
diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c
index a6f923086f31..d5a651bb800e 100644
--- a/drivers/net/wireless/ath/wil6210/interrupt.c
+++ b/drivers/net/wireless/ath/wil6210/interrupt.c
@@ -166,9 +166,16 @@ void wil_unmask_irq(struct wil6210_priv *wil)
166/* target write operation */ 166/* target write operation */
167#define W(a, v) do { iowrite32(v, wil->csr + HOSTADDR(a)); wmb(); } while (0) 167#define W(a, v) do { iowrite32(v, wil->csr + HOSTADDR(a)); wmb(); } while (0)
168 168
169static 169void wil_configure_interrupt_moderation(struct wil6210_priv *wil)
170void wil_configure_interrupt_moderation_new(struct wil6210_priv *wil)
171{ 170{
171 wil_dbg_irq(wil, "%s()\n", __func__);
172
173 /* disable interrupt moderation for monitor
174 * to get better timestamp precision
175 */
176 if (wil->wdev->iftype == NL80211_IFTYPE_MONITOR)
177 return;
178
172 /* Disable and clear tx counter before (re)configuration */ 179 /* Disable and clear tx counter before (re)configuration */
173 W(RGF_DMA_ITR_TX_CNT_CTL, BIT_DMA_ITR_TX_CNT_CTL_CLR); 180 W(RGF_DMA_ITR_TX_CNT_CTL, BIT_DMA_ITR_TX_CNT_CTL_CLR);
174 W(RGF_DMA_ITR_TX_CNT_TRSH, wil->tx_max_burst_duration); 181 W(RGF_DMA_ITR_TX_CNT_TRSH, wil->tx_max_burst_duration);
@@ -206,42 +213,8 @@ void wil_configure_interrupt_moderation_new(struct wil6210_priv *wil)
206 BIT_DMA_ITR_RX_IDL_CNT_CTL_EXT_TIC_SEL); 213 BIT_DMA_ITR_RX_IDL_CNT_CTL_EXT_TIC_SEL);
207} 214}
208 215
209static
210void wil_configure_interrupt_moderation_lgc(struct wil6210_priv *wil)
211{
212 /* disable, use usec resolution */
213 W(RGF_DMA_ITR_CNT_CRL, BIT_DMA_ITR_CNT_CRL_CLR);
214
215 wil_info(wil, "set ITR_TRSH = %d usec\n", wil->rx_max_burst_duration);
216 W(RGF_DMA_ITR_CNT_TRSH, wil->rx_max_burst_duration);
217 /* start it */
218 W(RGF_DMA_ITR_CNT_CRL,
219 BIT_DMA_ITR_CNT_CRL_EN | BIT_DMA_ITR_CNT_CRL_EXT_TICK);
220}
221
222#undef W 216#undef W
223 217
224void wil_configure_interrupt_moderation(struct wil6210_priv *wil)
225{
226 wil_dbg_irq(wil, "%s()\n", __func__);
227
228 /* disable interrupt moderation for monitor
229 * to get better timestamp precision
230 */
231 if (wil->wdev->iftype == NL80211_IFTYPE_MONITOR)
232 return;
233
234 if (test_bit(hw_capability_advanced_itr_moderation,
235 wil->hw_capabilities))
236 wil_configure_interrupt_moderation_new(wil);
237 else {
238 /* Advanced interrupt moderation is not available before
239 * Sparrow v2. Will use legacy interrupt moderation
240 */
241 wil_configure_interrupt_moderation_lgc(wil);
242 }
243}
244
245static irqreturn_t wil6210_irq_rx(int irq, void *cookie) 218static irqreturn_t wil6210_irq_rx(int irq, void *cookie)
246{ 219{
247 struct wil6210_priv *wil = cookie; 220 struct wil6210_priv *wil = cookie;
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index acbbd272a41e..95755a551796 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -516,8 +516,6 @@ static int wil_target_reset(struct wil6210_priv *wil)
516{ 516{
517 int delay = 0; 517 int delay = 0;
518 u32 x; 518 u32 x;
519 bool is_reset_v2 = test_bit(hw_capability_reset_v2,
520 wil->hw_capabilities);
521 519
522 wil_dbg_misc(wil, "Resetting \"%s\"...\n", wil->hw_name); 520 wil_dbg_misc(wil, "Resetting \"%s\"...\n", wil->hw_name);
523 521
@@ -533,52 +531,39 @@ static int wil_target_reset(struct wil6210_priv *wil)
533 /* Clear Fw Download notification */ 531 /* Clear Fw Download notification */
534 C(RGF_USER_USAGE_6, BIT(0)); 532 C(RGF_USER_USAGE_6, BIT(0));
535 533
536 if (is_reset_v2) { 534 S(RGF_CAF_OSC_CONTROL, BIT_CAF_OSC_XTAL_EN);
537 S(RGF_CAF_OSC_CONTROL, BIT_CAF_OSC_XTAL_EN); 535 /* XTAL stabilization should take about 3ms */
538 /* XTAL stabilization should take about 3ms */ 536 usleep_range(5000, 7000);
539 usleep_range(5000, 7000); 537 x = R(RGF_CAF_PLL_LOCK_STATUS);
540 x = R(RGF_CAF_PLL_LOCK_STATUS); 538 if (!(x & BIT_CAF_OSC_DIG_XTAL_STABLE)) {
541 if (!(x & BIT_CAF_OSC_DIG_XTAL_STABLE)) { 539 wil_err(wil, "Xtal stabilization timeout\n"
542 wil_err(wil, "Xtal stabilization timeout\n" 540 "RGF_CAF_PLL_LOCK_STATUS = 0x%08x\n", x);
543 "RGF_CAF_PLL_LOCK_STATUS = 0x%08x\n", x); 541 return -ETIME;
544 return -ETIME;
545 }
546 /* switch 10k to XTAL*/
547 C(RGF_USER_SPARROW_M_4, BIT_SPARROW_M_4_SEL_SLEEP_OR_REF);
548 /* 40 MHz */
549 C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_CAR_AHB_SW_SEL);
550
551 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_0, 0x3ff81f);
552 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_1, 0xf);
553 } 542 }
543 /* switch 10k to XTAL*/
544 C(RGF_USER_SPARROW_M_4, BIT_SPARROW_M_4_SEL_SLEEP_OR_REF);
545 /* 40 MHz */
546 C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_CAR_AHB_SW_SEL);
547
548 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_0, 0x3ff81f);
549 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_1, 0xf);
554 550
555 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000); 551 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);
556 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F); 552 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F);
557 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 553 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x000000f0);
558 is_reset_v2 ? 0x000000f0 : 0x00000170);
559 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FE00); 554 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FE00);
560 555
561 if (is_reset_v2) { 556 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_0, 0x0);
562 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_0, 0x0); 557 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_1, 0x0);
563 W(RGF_USER_CLKS_CTL_EXT_SW_RST_VEC_1, 0x0);
564 }
565 558
566 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0); 559 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0);
567 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0); 560 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0);
568 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0); 561 W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0);
569 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); 562 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
570 563
571 if (is_reset_v2) { 564 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000003);
572 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000003); 565 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00008000); /* reset A2 PCIE AHB */
573 /* reset A2 PCIE AHB */
574 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00008000);
575 } else {
576 W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000001);
577 W(RGF_PCIE_LOS_COUNTER_CTL, BIT(6) | BIT(8));
578 W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00008000);
579 }
580 566
581 /* TODO: check order here!!! Erez code is different */
582 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); 567 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
583 568
584 /* wait until device ready. typical time is 20..80 msec */ 569 /* wait until device ready. typical time is 20..80 msec */
@@ -592,9 +577,6 @@ static int wil_target_reset(struct wil6210_priv *wil)
592 } 577 }
593 } while (!(x & BIT_BL_READY)); 578 } while (!(x & BIT_BL_READY));
594 579
595 if (!is_reset_v2)
596 W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8));
597
598 C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD); 580 C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD);
599 581
600 wil_dbg_misc(wil, "Reset completed in %d ms\n", delay * RST_DELAY); 582 wil_dbg_misc(wil, "Reset completed in %d ms\n", delay * RST_DELAY);
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c
index f7c165d35343..25343cffe229 100644
--- a/drivers/net/wireless/ath/wil6210/pcie_bus.c
+++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c
@@ -39,18 +39,6 @@ void wil_set_capabilities(struct wil6210_priv *wil)
39 bitmap_zero(wil->hw_capabilities, hw_capability_last); 39 bitmap_zero(wil->hw_capabilities, hw_capability_last);
40 40
41 switch (rev_id) { 41 switch (rev_id) {
42 case JTAG_DEV_ID_MARLON_B0:
43 wil->hw_name = "Marlon B0";
44 wil->hw_version = HW_VER_MARLON_B0;
45 break;
46 case JTAG_DEV_ID_SPARROW_A0:
47 wil->hw_name = "Sparrow A0";
48 wil->hw_version = HW_VER_SPARROW_A0;
49 break;
50 case JTAG_DEV_ID_SPARROW_A1:
51 wil->hw_name = "Sparrow A1";
52 wil->hw_version = HW_VER_SPARROW_A1;
53 break;
54 case JTAG_DEV_ID_SPARROW_B0: 42 case JTAG_DEV_ID_SPARROW_B0:
55 wil->hw_name = "Sparrow B0"; 43 wil->hw_name = "Sparrow B0";
56 wil->hw_version = HW_VER_SPARROW_B0; 44 wil->hw_version = HW_VER_SPARROW_B0;
@@ -62,13 +50,6 @@ void wil_set_capabilities(struct wil6210_priv *wil)
62 } 50 }
63 51
64 wil_info(wil, "Board hardware is %s\n", wil->hw_name); 52 wil_info(wil, "Board hardware is %s\n", wil->hw_name);
65
66 if (wil->hw_version >= HW_VER_SPARROW_A0)
67 set_bit(hw_capability_reset_v2, wil->hw_capabilities);
68
69 if (wil->hw_version >= HW_VER_SPARROW_B0)
70 set_bit(hw_capability_advanced_itr_moderation,
71 wil->hw_capabilities);
72} 53}
73 54
74void wil_disable_irq(struct wil6210_priv *wil) 55void wil_disable_irq(struct wil6210_priv *wil)
@@ -305,7 +286,6 @@ static void wil_pcie_remove(struct pci_dev *pdev)
305} 286}
306 287
307static const struct pci_device_id wil6210_pcie_ids[] = { 288static const struct pci_device_id wil6210_pcie_ids[] = {
308 { PCI_DEVICE(0x1ae9, 0x0301) },
309 { PCI_DEVICE(0x1ae9, 0x0310) }, 289 { PCI_DEVICE(0x1ae9, 0x0310) },
310 { PCI_DEVICE(0x1ae9, 0x0302) }, /* same as above, firmware broken */ 290 { PCI_DEVICE(0x1ae9, 0x0302) }, /* same as above, firmware broken */
311 { /* end: all zeroes */ }, 291 { /* end: all zeroes */ },
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index cfe43d212e1f..97422e7854d3 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -241,16 +241,10 @@ struct RGF_BL {
241 #define BIT_CAF_OSC_DIG_XTAL_STABLE BIT(0) 241 #define BIT_CAF_OSC_DIG_XTAL_STABLE BIT(0)
242 242
243#define RGF_USER_JTAG_DEV_ID (0x880b34) /* device ID */ 243#define RGF_USER_JTAG_DEV_ID (0x880b34) /* device ID */
244 #define JTAG_DEV_ID_MARLON_B0 (0x0612072f)
245 #define JTAG_DEV_ID_SPARROW_A0 (0x0632072f)
246 #define JTAG_DEV_ID_SPARROW_A1 (0x1632072f)
247 #define JTAG_DEV_ID_SPARROW_B0 (0x2632072f) 244 #define JTAG_DEV_ID_SPARROW_B0 (0x2632072f)
248 245
249enum { 246enum {
250 HW_VER_UNKNOWN, 247 HW_VER_UNKNOWN,
251 HW_VER_MARLON_B0, /* JTAG_DEV_ID_MARLON_B0 */
252 HW_VER_SPARROW_A0, /* JTAG_DEV_ID_SPARROW_A0 */
253 HW_VER_SPARROW_A1, /* JTAG_DEV_ID_SPARROW_A1 */
254 HW_VER_SPARROW_B0, /* JTAG_DEV_ID_SPARROW_B0 */ 248 HW_VER_SPARROW_B0, /* JTAG_DEV_ID_SPARROW_B0 */
255}; 249};
256 250
@@ -494,8 +488,6 @@ enum {
494}; 488};
495 489
496enum { 490enum {
497 hw_capability_reset_v2 = 0,
498 hw_capability_advanced_itr_moderation = 1,
499 hw_capability_last 491 hw_capability_last
500}; 492};
501 493