diff options
author | Shahar Levi <shahar_levi@ti.com> | 2011-03-06 09:32:07 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-04-19 09:19:46 -0400 |
commit | 5aa42346bba2e385674eb1dd4019dfce4c2ef771 (patch) | |
tree | 5750f7ed69c94acb6a9012f9da713f5eaa88899d | |
parent | b9b0fdead0e8d964a534e5b09f40d8bd4bf7dfe8 (diff) |
wl12xx: 1281/1283 support - Add Definitions
Definitions to support wl128x:
- New FW file name
- Chip ID
- New PLL Configuration Algorithm macros that will be used at wl128x
boot stage
- Rename NVS macro name: wl127x and wl128x are using the same NVS
file name. However, the ini parameters between them are
different. The driver will validate the correct NVS size in
wl1271_boot_upload_nvs().
[Cleaned up some of the definitions. -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/boot.h | 48 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/conf.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/reg.h | 15 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/sdio.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/sdio_test.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/spi.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 8 |
8 files changed, 64 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.h b/drivers/net/wireless/wl12xx/boot.h index 17229b86fc71..1f5ee31dc0b1 100644 --- a/drivers/net/wireless/wl12xx/boot.h +++ b/drivers/net/wireless/wl12xx/boot.h | |||
@@ -74,4 +74,52 @@ struct wl1271_static_data { | |||
74 | #define FREF_CLK_POLARITY_BITS 0xfffff8ff | 74 | #define FREF_CLK_POLARITY_BITS 0xfffff8ff |
75 | #define CLK_REQ_OUTN_SEL 0x700 | 75 | #define CLK_REQ_OUTN_SEL 0x700 |
76 | 76 | ||
77 | /* PLL configuration algorithm for wl128x */ | ||
78 | #define SYS_CLK_CFG_REG 0x2200 | ||
79 | /* Bit[0] - 0-TCXO, 1-FREF */ | ||
80 | #define MCS_PLL_CLK_SEL_FREF BIT(0) | ||
81 | /* Bit[3:2] - 01-TCXO, 10-FREF */ | ||
82 | #define WL_CLK_REQ_TYPE_FREF BIT(3) | ||
83 | #define WL_CLK_REQ_TYPE_PG2 (BIT(3) | BIT(2)) | ||
84 | /* Bit[4] - 0-TCXO, 1-FREF */ | ||
85 | #define PRCM_CM_EN_MUX_WLAN_FREF BIT(4) | ||
86 | |||
87 | #define TCXO_ILOAD_INT_REG 0x2264 | ||
88 | #define TCXO_CLK_DETECT_REG 0x2266 | ||
89 | |||
90 | #define TCXO_DET_FAILED BIT(4) | ||
91 | |||
92 | #define FREF_ILOAD_INT_REG 0x2084 | ||
93 | #define FREF_CLK_DETECT_REG 0x2086 | ||
94 | #define FREF_CLK_DETECT_FAIL BIT(4) | ||
95 | |||
96 | /* Use this reg for masking during driver access */ | ||
97 | #define WL_SPARE_REG 0x2320 | ||
98 | #define WL_SPARE_VAL BIT(2) | ||
99 | /* Bit[6:5:3] - mask wl write SYS_CLK_CFG[8:5:2:4] */ | ||
100 | #define WL_SPARE_MASK_8526 (BIT(6) | BIT(5) | BIT(3)) | ||
101 | |||
102 | #define PLL_LOCK_COUNTERS_REG 0xD8C | ||
103 | #define PLL_LOCK_COUNTERS_COEX 0x0F | ||
104 | #define PLL_LOCK_COUNTERS_MCS 0xF0 | ||
105 | #define MCS_PLL_OVERRIDE_REG 0xD90 | ||
106 | #define MCS_PLL_CONFIG_REG 0xD92 | ||
107 | #define MCS_SEL_IN_FREQ_MASK 0x0070 | ||
108 | #define MCS_SEL_IN_FREQ_SHIFT 4 | ||
109 | #define MCS_PLL_CONFIG_REG_VAL 0x73 | ||
110 | |||
111 | #define MCS_PLL_M_REG 0xD94 | ||
112 | #define MCS_PLL_N_REG 0xD96 | ||
113 | #define MCS_PLL_M_REG_VAL 0xC8 | ||
114 | #define MCS_PLL_N_REG_VAL 0x07 | ||
115 | |||
116 | #define SDIO_IO_DS 0xd14 | ||
117 | |||
118 | /* SDIO/wSPI DS configuration values */ | ||
119 | #define HCI_IO_DS_8MA 0 | ||
120 | #define HCI_IO_DS_4MA 1 /* default */ | ||
121 | #define HCI_IO_DS_6MA 2 | ||
122 | #define HCI_IO_DS_2MA 3 | ||
123 | /* end PLL configuration algorithm for wl128x */ | ||
124 | |||
77 | #endif | 125 | #endif |
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h index 856a8a2fff4f..a00f22c6c74f 100644 --- a/drivers/net/wireless/wl12xx/conf.h +++ b/drivers/net/wireless/wl12xx/conf.h | |||
@@ -1004,7 +1004,9 @@ enum { | |||
1004 | CONF_REF_CLK_19_2_E, | 1004 | CONF_REF_CLK_19_2_E, |
1005 | CONF_REF_CLK_26_E, | 1005 | CONF_REF_CLK_26_E, |
1006 | CONF_REF_CLK_38_4_E, | 1006 | CONF_REF_CLK_38_4_E, |
1007 | CONF_REF_CLK_52_E | 1007 | CONF_REF_CLK_52_E, |
1008 | CONF_REF_CLK_38_4_M_XTAL, | ||
1009 | CONF_REF_CLK_26_M_XTAL, | ||
1008 | }; | 1010 | }; |
1009 | 1011 | ||
1010 | enum single_dual_band_enum { | 1012 | enum single_dual_band_enum { |
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 8b3c8d196b03..b0c49352b56f 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -838,7 +838,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl) | |||
838 | const struct firmware *fw; | 838 | const struct firmware *fw; |
839 | int ret; | 839 | int ret; |
840 | 840 | ||
841 | ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl)); | 841 | ret = request_firmware(&fw, WL12XX_NVS_NAME, wl1271_wl_to_dev(wl)); |
842 | 842 | ||
843 | if (ret < 0) { | 843 | if (ret < 0) { |
844 | wl1271_error("could not get nvs file: %d", ret); | 844 | wl1271_error("could not get nvs file: %d", ret); |
diff --git a/drivers/net/wireless/wl12xx/reg.h b/drivers/net/wireless/wl12xx/reg.h index 990960771528..440a4ee9cb42 100644 --- a/drivers/net/wireless/wl12xx/reg.h +++ b/drivers/net/wireless/wl12xx/reg.h | |||
@@ -207,6 +207,8 @@ | |||
207 | 207 | ||
208 | #define CHIP_ID_1271_PG10 (0x4030101) | 208 | #define CHIP_ID_1271_PG10 (0x4030101) |
209 | #define CHIP_ID_1271_PG20 (0x4030111) | 209 | #define CHIP_ID_1271_PG20 (0x4030111) |
210 | #define CHIP_ID_1283_PG10 (0x05030101) | ||
211 | #define CHIP_ID_1283_PG20 (0x05030111) | ||
210 | 212 | ||
211 | #define ENABLE (REGISTERS_BASE + 0x5450) | 213 | #define ENABLE (REGISTERS_BASE + 0x5450) |
212 | 214 | ||
@@ -452,24 +454,11 @@ | |||
452 | #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200 | 454 | #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200 |
453 | #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400 | 455 | #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400 |
454 | 456 | ||
455 | /* | ||
456 | * NOTE: USE_ACTIVE_HIGH compilation flag should be defined in makefile | ||
457 | * for platforms using active high interrupt level | ||
458 | */ | ||
459 | #ifdef USE_ACTIVE_HIGH | ||
460 | #define HI_CFG_DEF_VAL \ | 457 | #define HI_CFG_DEF_VAL \ |
461 | (HI_CFG_UART_ENABLE | \ | 458 | (HI_CFG_UART_ENABLE | \ |
462 | HI_CFG_RST232_ENABLE | \ | 459 | HI_CFG_RST232_ENABLE | \ |
463 | HI_CFG_CLOCK_REQ_SELECT | \ | 460 | HI_CFG_CLOCK_REQ_SELECT | \ |
464 | HI_CFG_HOST_INT_ENABLE) | 461 | HI_CFG_HOST_INT_ENABLE) |
465 | #else | ||
466 | #define HI_CFG_DEF_VAL \ | ||
467 | (HI_CFG_UART_ENABLE | \ | ||
468 | HI_CFG_RST232_ENABLE | \ | ||
469 | HI_CFG_CLOCK_REQ_SELECT | \ | ||
470 | HI_CFG_HOST_INT_ENABLE) | ||
471 | |||
472 | #endif | ||
473 | 462 | ||
474 | #define REF_FREQ_19_2 0 | 463 | #define REF_FREQ_19_2 0 |
475 | #define REF_FREQ_26_0 1 | 464 | #define REF_FREQ_26_0 1 |
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c index b1c7d031c391..1b6a1adb81af 100644 --- a/drivers/net/wireless/wl12xx/sdio.c +++ b/drivers/net/wireless/wl12xx/sdio.c | |||
@@ -343,4 +343,5 @@ MODULE_LICENSE("GPL"); | |||
343 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); | 343 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); |
344 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); | 344 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); |
345 | MODULE_FIRMWARE(WL1271_FW_NAME); | 345 | MODULE_FIRMWARE(WL1271_FW_NAME); |
346 | MODULE_FIRMWARE(WL128X_FW_NAME); | ||
346 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); | 347 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); |
diff --git a/drivers/net/wireless/wl12xx/sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c index 9fcbd3dd8490..01adf1b1003b 100644 --- a/drivers/net/wireless/wl12xx/sdio_test.c +++ b/drivers/net/wireless/wl12xx/sdio_test.c | |||
@@ -227,7 +227,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl) | |||
227 | const struct firmware *fw; | 227 | const struct firmware *fw; |
228 | int ret; | 228 | int ret; |
229 | 229 | ||
230 | ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl)); | 230 | ret = request_firmware(&fw, WL12XX_NVS_NAME, wl1271_wl_to_dev(wl)); |
231 | 231 | ||
232 | if (ret < 0) { | 232 | if (ret < 0) { |
233 | wl1271_error("could not get nvs file: %d", ret); | 233 | wl1271_error("could not get nvs file: %d", ret); |
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index ffc745b17f4d..80295f55f23f 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c | |||
@@ -490,5 +490,6 @@ MODULE_LICENSE("GPL"); | |||
490 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); | 490 | MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); |
491 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); | 491 | MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); |
492 | MODULE_FIRMWARE(WL1271_FW_NAME); | 492 | MODULE_FIRMWARE(WL1271_FW_NAME); |
493 | MODULE_FIRMWARE(WL128X_FW_NAME); | ||
493 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); | 494 | MODULE_FIRMWARE(WL1271_AP_FW_NAME); |
494 | MODULE_ALIAS("spi:wl1271"); | 495 | MODULE_ALIAS("spi:wl1271"); |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 86be83e25ec5..a2e899d4e1aa 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -131,9 +131,15 @@ extern u32 wl12xx_debug_level; | |||
131 | 131 | ||
132 | 132 | ||
133 | #define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin" | 133 | #define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin" |
134 | #define WL128X_FW_NAME "ti-connectivity/wl128x-fw.bin" | ||
134 | #define WL1271_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin" | 135 | #define WL1271_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin" |
135 | 136 | ||
136 | #define WL1271_NVS_NAME "ti-connectivity/wl1271-nvs.bin" | 137 | /* |
138 | * wl127x and wl128x are using the same NVS file name. However, the | ||
139 | * ini parameters between them are different. The driver validates | ||
140 | * the correct NVS size in wl1271_boot_upload_nvs(). | ||
141 | */ | ||
142 | #define WL12XX_NVS_NAME "ti-connectivity/wl1271-nvs.bin" | ||
137 | 143 | ||
138 | #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) | 144 | #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) |
139 | #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff)) | 145 | #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff)) |