wl12xx: 1281/1283 support - Add Definitions
authorShahar Levi <shahar_levi@ti.com>
Sun, 6 Mar 2011 14:32:07 +0000 (16:32 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 19 Apr 2011 13:19:46 +0000 (16:19 +0300)
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>
drivers/net/wireless/wl12xx/boot.h
drivers/net/wireless/wl12xx/conf.h
drivers/net/wireless/wl12xx/main.c
drivers/net/wireless/wl12xx/reg.h
drivers/net/wireless/wl12xx/sdio.c
drivers/net/wireless/wl12xx/sdio_test.c
drivers/net/wireless/wl12xx/spi.c
drivers/net/wireless/wl12xx/wl12xx.h

index 17229b86fc71018ef22d93043f62c56d6d71716b..1f5ee31dc0b176967136ef80c03431934e72a422 100644 (file)
@@ -74,4 +74,52 @@ struct wl1271_static_data {
 #define FREF_CLK_POLARITY_BITS 0xfffff8ff
 #define CLK_REQ_OUTN_SEL       0x700
 
+/* PLL configuration algorithm for wl128x */
+#define SYS_CLK_CFG_REG              0x2200
+/* Bit[0]   -  0-TCXO,  1-FREF */
+#define MCS_PLL_CLK_SEL_FREF         BIT(0)
+/* Bit[3:2] - 01-TCXO, 10-FREF */
+#define WL_CLK_REQ_TYPE_FREF         BIT(3)
+#define WL_CLK_REQ_TYPE_PG2          (BIT(3) | BIT(2))
+/* Bit[4]   -  0-TCXO,  1-FREF */
+#define PRCM_CM_EN_MUX_WLAN_FREF     BIT(4)
+
+#define TCXO_ILOAD_INT_REG           0x2264
+#define TCXO_CLK_DETECT_REG          0x2266
+
+#define TCXO_DET_FAILED              BIT(4)
+
+#define FREF_ILOAD_INT_REG           0x2084
+#define FREF_CLK_DETECT_REG          0x2086
+#define FREF_CLK_DETECT_FAIL         BIT(4)
+
+/* Use this reg for masking during driver access */
+#define WL_SPARE_REG                 0x2320
+#define WL_SPARE_VAL                 BIT(2)
+/* Bit[6:5:3] -  mask wl write SYS_CLK_CFG[8:5:2:4] */
+#define WL_SPARE_MASK_8526           (BIT(6) | BIT(5) | BIT(3))
+
+#define PLL_LOCK_COUNTERS_REG        0xD8C
+#define PLL_LOCK_COUNTERS_COEX       0x0F
+#define PLL_LOCK_COUNTERS_MCS        0xF0
+#define MCS_PLL_OVERRIDE_REG         0xD90
+#define MCS_PLL_CONFIG_REG           0xD92
+#define MCS_SEL_IN_FREQ_MASK         0x0070
+#define MCS_SEL_IN_FREQ_SHIFT        4
+#define MCS_PLL_CONFIG_REG_VAL       0x73
+
+#define MCS_PLL_M_REG                0xD94
+#define MCS_PLL_N_REG                0xD96
+#define MCS_PLL_M_REG_VAL            0xC8
+#define MCS_PLL_N_REG_VAL            0x07
+
+#define SDIO_IO_DS                   0xd14
+
+/* SDIO/wSPI DS configuration values */
+#define HCI_IO_DS_8MA                0
+#define HCI_IO_DS_4MA                1 /* default */
+#define HCI_IO_DS_6MA                2
+#define HCI_IO_DS_2MA                3
+/* end PLL configuration algorithm for wl128x */
+
 #endif
index 856a8a2fff4f5fa7b35fcd295b1367d427b95245..a00f22c6c74f6323645fb2f872d1ead4f97f641b 100644 (file)
@@ -1004,7 +1004,9 @@ enum {
        CONF_REF_CLK_19_2_E,
        CONF_REF_CLK_26_E,
        CONF_REF_CLK_38_4_E,
-       CONF_REF_CLK_52_E
+       CONF_REF_CLK_52_E,
+       CONF_REF_CLK_38_4_M_XTAL,
+       CONF_REF_CLK_26_M_XTAL,
 };
 
 enum single_dual_band_enum {
index 8b3c8d196b03310bc7760340411414b0bbf7e82c..b0c49352b56fe195140bddb5f16194d797d17a2e 100644 (file)
@@ -838,7 +838,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
        const struct firmware *fw;
        int ret;
 
-       ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl));
+       ret = request_firmware(&fw, WL12XX_NVS_NAME, wl1271_wl_to_dev(wl));
 
        if (ret < 0) {
                wl1271_error("could not get nvs file: %d", ret);
index 990960771528e423773a03f6c31d1a9b1caa6a4d..440a4ee9cb4203196471d1f2e3fca3c8f6a663cd 100644 (file)
 
 #define CHIP_ID_1271_PG10              (0x4030101)
 #define CHIP_ID_1271_PG20              (0x4030111)
+#define CHIP_ID_1283_PG10              (0x05030101)
+#define CHIP_ID_1283_PG20              (0x05030111)
 
 #define ENABLE                         (REGISTERS_BASE + 0x5450)
 
 #define HI_CFG_UART_TX_OUT_GPIO_14  0x00000200
 #define HI_CFG_UART_TX_OUT_GPIO_7   0x00000400
 
-/*
- * NOTE: USE_ACTIVE_HIGH compilation flag should be defined in makefile
- *       for platforms using active high interrupt level
- */
-#ifdef USE_ACTIVE_HIGH
 #define HI_CFG_DEF_VAL              \
        (HI_CFG_UART_ENABLE |        \
        HI_CFG_RST232_ENABLE |      \
        HI_CFG_CLOCK_REQ_SELECT |   \
        HI_CFG_HOST_INT_ENABLE)
-#else
-#define HI_CFG_DEF_VAL              \
-       (HI_CFG_UART_ENABLE |        \
-       HI_CFG_RST232_ENABLE |      \
-       HI_CFG_CLOCK_REQ_SELECT |   \
-       HI_CFG_HOST_INT_ENABLE)
-
-#endif
 
 #define REF_FREQ_19_2                       0
 #define REF_FREQ_26_0                       1
index b1c7d031c39163686050d624246190e22ee2e348..1b6a1adb81afef750a378dc208de98c13cdfe56a 100644 (file)
@@ -343,4 +343,5 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
 MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
 MODULE_FIRMWARE(WL1271_FW_NAME);
+MODULE_FIRMWARE(WL128X_FW_NAME);
 MODULE_FIRMWARE(WL1271_AP_FW_NAME);
index 9fcbd3dd8490fd18b1c71fd736e73b7a7c260087..01adf1b1003bd900d07168d50327230014e2203b 100644 (file)
@@ -227,7 +227,7 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
        const struct firmware *fw;
        int ret;
 
-       ret = request_firmware(&fw, WL1271_NVS_NAME, wl1271_wl_to_dev(wl));
+       ret = request_firmware(&fw, WL12XX_NVS_NAME, wl1271_wl_to_dev(wl));
 
        if (ret < 0) {
                wl1271_error("could not get nvs file: %d", ret);
index ffc745b17f4d631f88a98d3531e2f69b6776e6a4..80295f55f23fa72539361328b0125e5cb5d41dcf 100644 (file)
@@ -490,5 +490,6 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
 MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
 MODULE_FIRMWARE(WL1271_FW_NAME);
+MODULE_FIRMWARE(WL128X_FW_NAME);
 MODULE_FIRMWARE(WL1271_AP_FW_NAME);
 MODULE_ALIAS("spi:wl1271");
index 86be83e25ec556c0a8304250e7e4d70fcd990e8b..a2e899d4e1aa48dd1c068f182da672e05b4fe09f 100644 (file)
@@ -131,9 +131,15 @@ extern u32 wl12xx_debug_level;
 
 
 #define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin"
+#define WL128X_FW_NAME "ti-connectivity/wl128x-fw.bin"
 #define WL1271_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin"
 
-#define WL1271_NVS_NAME "ti-connectivity/wl1271-nvs.bin"
+/*
+ * wl127x and wl128x are using the same NVS file name. However, the
+ * ini parameters between them are different.  The driver validates
+ * the correct NVS size in wl1271_boot_upload_nvs().
+ */
+#define WL12XX_NVS_NAME "ti-connectivity/wl1271-nvs.bin"
 
 #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
 #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))