diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-03-17 09:34:15 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-03-17 13:44:17 -0400 |
commit | 972072aa7992634ec642bf41679a53b7aa060dd1 (patch) | |
tree | 8c5ae9ea935964e7f81cf059e99ad97c1c0b1469 /drivers/net | |
parent | 171239912187fd6262c1bb40ff74ff2b4505938b (diff) |
wil6210: reset on power good
Configure hardware to perform full reset on "power good". This mean,
reset HW on system boot. This improves card stability.
By default this is off.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index bd27bee8241f..684762203a62 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -241,8 +241,9 @@ static void wil_target_reset(struct wil6210_priv *wil) | |||
241 | /* register write */ | 241 | /* register write */ |
242 | #define W(a, v) iowrite32(v, wil->csr + HOSTADDR(a)) | 242 | #define W(a, v) iowrite32(v, wil->csr + HOSTADDR(a)) |
243 | /* register set = read, OR, write */ | 243 | /* register set = read, OR, write */ |
244 | #define S(a, v) iowrite32(ioread32(wil->csr + HOSTADDR(a)) | v, \ | 244 | #define S(a, v) W(a, R(a) | v) |
245 | wil->csr + HOSTADDR(a)) | 245 | /* register clear = read, AND with inverted, write */ |
246 | #define C(a, v) W(a, R(a) & ~v) | ||
246 | 247 | ||
247 | wil->hw_version = R(RGF_USER_FW_REV_ID); | 248 | wil->hw_version = R(RGF_USER_FW_REV_ID); |
248 | rev_id = wil->hw_version & 0xff; | 249 | rev_id = wil->hw_version & 0xff; |
@@ -286,11 +287,14 @@ static void wil_target_reset(struct wil6210_priv *wil) | |||
286 | if (rev_id == 2) | 287 | if (rev_id == 2) |
287 | W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8)); | 288 | W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8)); |
288 | 289 | ||
290 | C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD); | ||
291 | |||
289 | wil_dbg_misc(wil, "Reset completed in %d ms\n", delay); | 292 | wil_dbg_misc(wil, "Reset completed in %d ms\n", delay); |
290 | 293 | ||
291 | #undef R | 294 | #undef R |
292 | #undef W | 295 | #undef W |
293 | #undef S | 296 | #undef S |
297 | #undef C | ||
294 | } | 298 | } |
295 | 299 | ||
296 | void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r) | 300 | void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r) |
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index b376399e68ca..f7d8f0ead23e 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -79,6 +79,8 @@ struct RGF_ICR { | |||
79 | #define RGF_USER_MAC_CPU_0 (0x8801fc) | 79 | #define RGF_USER_MAC_CPU_0 (0x8801fc) |
80 | #define RGF_USER_USER_SCRATCH_PAD (0x8802bc) | 80 | #define RGF_USER_USER_SCRATCH_PAD (0x8802bc) |
81 | #define RGF_USER_FW_REV_ID (0x880a8c) /* chip revision */ | 81 | #define RGF_USER_FW_REV_ID (0x880a8c) /* chip revision */ |
82 | #define RGF_USER_CLKS_CTL_0 (0x880abc) | ||
83 | #define BIT_USER_CLKS_RST_PWGD BIT(11) /* reset on "power good" */ | ||
82 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_0 (0x880b04) | 84 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_0 (0x880b04) |
83 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_1 (0x880b08) | 85 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_1 (0x880b08) |
84 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_2 (0x880b0c) | 86 | #define RGF_USER_CLKS_CTL_SW_RST_VEC_2 (0x880b0c) |