aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorVictor Goldenshtein <victorg@ti.com>2013-09-17 11:41:28 -0400
committerLuciano Coelho <luciano.coelho@intel.com>2013-09-30 14:12:21 -0400
commitef47d3287ca693067e3891aad9c8e62671579592 (patch)
tree2b3cb5988d68b1987a92cfbcfc671c4a9f6f2abc /drivers/net
parent49540d1b8155b5ded98e6b77c5c92b11854c3de7 (diff)
wl18xx: fix boot process in high temperature environment
In addition to existing WCS PLL configuration add and enable also the coex PLL during init phase. This fixes boot failures due to silicon latchup in high temperature environment (>85c). Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Nadim Zubidat <nadimz@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c53
-rw-r--r--drivers/net/wireless/ti/wl18xx/reg.h13
2 files changed, 66 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 7aa0eb848c5a..b47eb620f2f1 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -623,6 +623,18 @@ static const int wl18xx_rtable[REG_TABLE_LEN] = {
623 [REG_RAW_FW_STATUS_ADDR] = WL18XX_FW_STATUS_ADDR, 623 [REG_RAW_FW_STATUS_ADDR] = WL18XX_FW_STATUS_ADDR,
624}; 624};
625 625
626static const struct wl18xx_clk_cfg wl18xx_clk_table_coex[NUM_CLOCK_CONFIGS] = {
627 [CLOCK_CONFIG_16_2_M] = { 8, 121, 0, 0, false },
628 [CLOCK_CONFIG_16_368_M] = { 8, 120, 0, 0, false },
629 [CLOCK_CONFIG_16_8_M] = { 8, 117, 0, 0, false },
630 [CLOCK_CONFIG_19_2_M] = { 10, 128, 0, 0, false },
631 [CLOCK_CONFIG_26_M] = { 11, 104, 0, 0, false },
632 [CLOCK_CONFIG_32_736_M] = { 8, 120, 0, 0, false },
633 [CLOCK_CONFIG_33_6_M] = { 8, 117, 0, 0, false },
634 [CLOCK_CONFIG_38_468_M] = { 10, 128, 0, 0, false },
635 [CLOCK_CONFIG_52_M] = { 11, 104, 0, 0, false },
636};
637
626static const struct wl18xx_clk_cfg wl18xx_clk_table[NUM_CLOCK_CONFIGS] = { 638static const struct wl18xx_clk_cfg wl18xx_clk_table[NUM_CLOCK_CONFIGS] = {
627 [CLOCK_CONFIG_16_2_M] = { 7, 104, 801, 4, true }, 639 [CLOCK_CONFIG_16_2_M] = { 7, 104, 801, 4, true },
628 [CLOCK_CONFIG_16_368_M] = { 9, 132, 3751, 4, true }, 640 [CLOCK_CONFIG_16_368_M] = { 9, 132, 3751, 4, true },
@@ -704,6 +716,23 @@ static int wl18xx_set_clk(struct wl1271 *wl)
704 wl18xx_clk_table[clk_freq].p, wl18xx_clk_table[clk_freq].q, 716 wl18xx_clk_table[clk_freq].p, wl18xx_clk_table[clk_freq].q,
705 wl18xx_clk_table[clk_freq].swallow ? "swallow" : "spit"); 717 wl18xx_clk_table[clk_freq].swallow ? "swallow" : "spit");
706 718
719 /* coex PLL configuration */
720 ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_N,
721 wl18xx_clk_table_coex[clk_freq].n);
722 if (ret < 0)
723 goto out;
724
725 ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_M,
726 wl18xx_clk_table_coex[clk_freq].m);
727 if (ret < 0)
728 goto out;
729
730 /* bypass the swallowing logic */
731 ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_SWALLOW_EN,
732 PLLSH_COEX_PLL_SWALLOW_EN_VAL1);
733 if (ret < 0)
734 goto out;
735
707 ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_N, 736 ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_N,
708 wl18xx_clk_table[clk_freq].n); 737 wl18xx_clk_table[clk_freq].n);
709 if (ret < 0) 738 if (ret < 0)
@@ -745,6 +774,30 @@ static int wl18xx_set_clk(struct wl1271 *wl)
745 PLLSH_WCS_PLL_SWALLOW_EN_VAL2); 774 PLLSH_WCS_PLL_SWALLOW_EN_VAL2);
746 } 775 }
747 776
777 /* choose WCS PLL */
778 ret = wl18xx_top_reg_write(wl, PLLSH_WL_PLL_SEL,
779 PLLSH_WL_PLL_SEL_WCS_PLL);
780 if (ret < 0)
781 goto out;
782
783 /* enable both PLLs */
784 ret = wl18xx_top_reg_write(wl, PLLSH_WL_PLL_EN, PLLSH_WL_PLL_EN_VAL1);
785 if (ret < 0)
786 goto out;
787
788 udelay(1000);
789
790 /* disable coex PLL */
791 ret = wl18xx_top_reg_write(wl, PLLSH_WL_PLL_EN, PLLSH_WL_PLL_EN_VAL2);
792 if (ret < 0)
793 goto out;
794
795 /* reset the swallowing logic */
796 ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_SWALLOW_EN,
797 PLLSH_COEX_PLL_SWALLOW_EN_VAL2);
798 if (ret < 0)
799 goto out;
800
748out: 801out:
749 return ret; 802 return ret;
750} 803}
diff --git a/drivers/net/wireless/ti/wl18xx/reg.h b/drivers/net/wireless/ti/wl18xx/reg.h
index 05dd8bad2746..88de3f2049e3 100644
--- a/drivers/net/wireless/ti/wl18xx/reg.h
+++ b/drivers/net/wireless/ti/wl18xx/reg.h
@@ -114,6 +114,11 @@
114#define PLATFORM_DETECTION 0xA0E3E0 114#define PLATFORM_DETECTION 0xA0E3E0
115#define OCS_EN 0xA02080 115#define OCS_EN 0xA02080
116#define PRIMARY_CLK_DETECT 0xA020A6 116#define PRIMARY_CLK_DETECT 0xA020A6
117#define PLLSH_COEX_PLL_N 0xA02384
118#define PLLSH_COEX_PLL_M 0xA02382
119#define PLLSH_COEX_PLL_SWALLOW_EN 0xA0238E
120#define PLLSH_WL_PLL_SEL 0xA02398
121
117#define PLLSH_WCS_PLL_N 0xA02362 122#define PLLSH_WCS_PLL_N 0xA02362
118#define PLLSH_WCS_PLL_M 0xA02360 123#define PLLSH_WCS_PLL_M 0xA02360
119#define PLLSH_WCS_PLL_Q_FACTOR_CFG_1 0xA02364 124#define PLLSH_WCS_PLL_Q_FACTOR_CFG_1 0xA02364
@@ -128,9 +133,17 @@
128#define PLLSH_WCS_PLL_P_FACTOR_CFG_1_MASK 0xFFFF 133#define PLLSH_WCS_PLL_P_FACTOR_CFG_1_MASK 0xFFFF
129#define PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK 0x000F 134#define PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK 0x000F
130 135
136#define PLLSH_WL_PLL_EN_VAL1 0x7
137#define PLLSH_WL_PLL_EN_VAL2 0x2
138#define PLLSH_COEX_PLL_SWALLOW_EN_VAL1 0x2
139#define PLLSH_COEX_PLL_SWALLOW_EN_VAL2 0x11
140
131#define PLLSH_WCS_PLL_SWALLOW_EN_VAL1 0x1 141#define PLLSH_WCS_PLL_SWALLOW_EN_VAL1 0x1
132#define PLLSH_WCS_PLL_SWALLOW_EN_VAL2 0x12 142#define PLLSH_WCS_PLL_SWALLOW_EN_VAL2 0x12
133 143
144#define PLLSH_WL_PLL_SEL_WCS_PLL 0x0
145#define PLLSH_WL_PLL_SEL_COEX_PLL 0x1
146
134#define WL18XX_REG_FUSE_DATA_1_3 0xA0260C 147#define WL18XX_REG_FUSE_DATA_1_3 0xA0260C
135#define WL18XX_PG_VER_MASK 0x70 148#define WL18XX_PG_VER_MASK 0x70
136#define WL18XX_PG_VER_OFFSET 4 149#define WL18XX_PG_VER_OFFSET 4