aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl12xx
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2012-11-27 08:51:56 -0500
committerLuciano Coelho <coelho@ti.com>2012-12-04 09:36:10 -0500
commit986f3aa1666b4ef1e9e30672c73e19742b8abfd9 (patch)
treeffe6e672b185ebd183518d4377d82d89142a5c64 /drivers/net/wireless/ti/wl12xx
parent7230341f254c9bce39e9576362f18b94854bc779 (diff)
wlcore/wl12xx: move wl12xx chip ID defines to the lower driver
Move wl12xx-specific chip ID macros to the wl12xx driver and rename them to 127X and 128X for clarity since both the "1" (2.4GHz) and the "3" (2.4GHz and 5GHz) variants use the same chip ID. Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl12xx')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c26
-rw-r--r--drivers/net/wireless/ti/wl12xx/wl12xx.h6
2 files changed, 19 insertions, 13 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index aa73ada06463..82440e1eb59c 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -607,7 +607,7 @@ static int wl127x_prepare_read(struct wl1271 *wl, u32 rx_desc, u32 len)
607{ 607{
608 int ret; 608 int ret;
609 609
610 if (wl->chip.id != CHIP_ID_1283_PG20) { 610 if (wl->chip.id != CHIP_ID_128X_PG20) {
611 struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map; 611 struct wl1271_acx_mem_map *wl_mem_map = wl->target_mem_map;
612 struct wl127x_rx_mem_pool_addr rx_mem_addr; 612 struct wl127x_rx_mem_pool_addr rx_mem_addr;
613 613
@@ -637,7 +637,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
637 int ret = 0; 637 int ret = 0;
638 638
639 switch (wl->chip.id) { 639 switch (wl->chip.id) {
640 case CHIP_ID_1271_PG10: 640 case CHIP_ID_127X_PG10:
641 wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete", 641 wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
642 wl->chip.id); 642 wl->chip.id);
643 643
@@ -658,7 +658,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
658 WL127X_MINOR_VER); 658 WL127X_MINOR_VER);
659 break; 659 break;
660 660
661 case CHIP_ID_1271_PG20: 661 case CHIP_ID_127X_PG20:
662 wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", 662 wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
663 wl->chip.id); 663 wl->chip.id);
664 664
@@ -680,7 +680,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
680 WL127X_MINOR_VER); 680 WL127X_MINOR_VER);
681 break; 681 break;
682 682
683 case CHIP_ID_1283_PG20: 683 case CHIP_ID_128X_PG20:
684 wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)", 684 wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)",
685 wl->chip.id); 685 wl->chip.id);
686 wl->plt_fw_name = WL128X_PLT_FW_NAME; 686 wl->plt_fw_name = WL128X_PLT_FW_NAME;
@@ -697,7 +697,7 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
697 WL128X_MAJOR_VER, WL128X_SUBTYPE_VER, 697 WL128X_MAJOR_VER, WL128X_SUBTYPE_VER,
698 WL128X_MINOR_VER); 698 WL128X_MINOR_VER);
699 break; 699 break;
700 case CHIP_ID_1283_PG10: 700 case CHIP_ID_128X_PG10:
701 default: 701 default:
702 wl1271_warning("unsupported chip id: 0x%x", wl->chip.id); 702 wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
703 ret = -ENODEV; 703 ret = -ENODEV;
@@ -1082,7 +1082,7 @@ static int wl12xx_pre_boot(struct wl1271 *wl)
1082 u32 clk; 1082 u32 clk;
1083 int selected_clock = -1; 1083 int selected_clock = -1;
1084 1084
1085 if (wl->chip.id == CHIP_ID_1283_PG20) { 1085 if (wl->chip.id == CHIP_ID_128X_PG20) {
1086 ret = wl128x_boot_clk(wl, &selected_clock); 1086 ret = wl128x_boot_clk(wl, &selected_clock);
1087 if (ret < 0) 1087 if (ret < 0)
1088 goto out; 1088 goto out;
@@ -1113,7 +1113,7 @@ static int wl12xx_pre_boot(struct wl1271 *wl)
1113 1113
1114 wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk); 1114 wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk);
1115 1115
1116 if (wl->chip.id == CHIP_ID_1283_PG20) 1116 if (wl->chip.id == CHIP_ID_128X_PG20)
1117 clk |= ((selected_clock & 0x3) << 1) << 4; 1117 clk |= ((selected_clock & 0x3) << 1) << 4;
1118 else 1118 else
1119 clk |= (priv->ref_clock << 1) << 4; 1119 clk |= (priv->ref_clock << 1) << 4;
@@ -1167,7 +1167,7 @@ static int wl12xx_pre_upload(struct wl1271 *wl)
1167 /* WL1271: The reference driver skips steps 7 to 10 (jumps directly 1167 /* WL1271: The reference driver skips steps 7 to 10 (jumps directly
1168 * to upload_fw) */ 1168 * to upload_fw) */
1169 1169
1170 if (wl->chip.id == CHIP_ID_1283_PG20) { 1170 if (wl->chip.id == CHIP_ID_128X_PG20) {
1171 ret = wl12xx_top_reg_write(wl, SDIO_IO_DS, HCI_IO_DS_6MA); 1171 ret = wl12xx_top_reg_write(wl, SDIO_IO_DS, HCI_IO_DS_6MA);
1172 if (ret < 0) 1172 if (ret < 0)
1173 goto out; 1173 goto out;
@@ -1293,7 +1293,7 @@ static void
1293wl12xx_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc, 1293wl12xx_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
1294 u32 blks, u32 spare_blks) 1294 u32 blks, u32 spare_blks)
1295{ 1295{
1296 if (wl->chip.id == CHIP_ID_1283_PG20) { 1296 if (wl->chip.id == CHIP_ID_128X_PG20) {
1297 desc->wl128x_mem.total_mem_blocks = blks; 1297 desc->wl128x_mem.total_mem_blocks = blks;
1298 } else { 1298 } else {
1299 desc->wl127x_mem.extra_blocks = spare_blks; 1299 desc->wl127x_mem.extra_blocks = spare_blks;
@@ -1307,7 +1307,7 @@ wl12xx_set_tx_desc_data_len(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
1307{ 1307{
1308 u32 aligned_len = wlcore_calc_packet_alignment(wl, skb->len); 1308 u32 aligned_len = wlcore_calc_packet_alignment(wl, skb->len);
1309 1309
1310 if (wl->chip.id == CHIP_ID_1283_PG20) { 1310 if (wl->chip.id == CHIP_ID_128X_PG20) {
1311 desc->wl128x_mem.extra_bytes = aligned_len - skb->len; 1311 desc->wl128x_mem.extra_bytes = aligned_len - skb->len;
1312 desc->length = cpu_to_le16(aligned_len >> 2); 1312 desc->length = cpu_to_le16(aligned_len >> 2);
1313 1313
@@ -1371,7 +1371,7 @@ static int wl12xx_hw_init(struct wl1271 *wl)
1371{ 1371{
1372 int ret; 1372 int ret;
1373 1373
1374 if (wl->chip.id == CHIP_ID_1283_PG20) { 1374 if (wl->chip.id == CHIP_ID_128X_PG20) {
1375 u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE; 1375 u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE;
1376 1376
1377 ret = wl128x_cmd_general_parms(wl); 1377 ret = wl128x_cmd_general_parms(wl);
@@ -1458,7 +1458,7 @@ static bool wl12xx_mac_in_fuse(struct wl1271 *wl)
1458 bool supported = false; 1458 bool supported = false;
1459 u8 major, minor; 1459 u8 major, minor;
1460 1460
1461 if (wl->chip.id == CHIP_ID_1283_PG20) { 1461 if (wl->chip.id == CHIP_ID_128X_PG20) {
1462 major = WL128X_PG_GET_MAJOR(wl->hw_pg_ver); 1462 major = WL128X_PG_GET_MAJOR(wl->hw_pg_ver);
1463 minor = WL128X_PG_GET_MINOR(wl->hw_pg_ver); 1463 minor = WL128X_PG_GET_MINOR(wl->hw_pg_ver);
1464 1464
@@ -1514,7 +1514,7 @@ static int wl12xx_get_pg_ver(struct wl1271 *wl, s8 *ver)
1514 u16 die_info; 1514 u16 die_info;
1515 int ret; 1515 int ret;
1516 1516
1517 if (wl->chip.id == CHIP_ID_1283_PG20) 1517 if (wl->chip.id == CHIP_ID_128X_PG20)
1518 ret = wl12xx_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1, 1518 ret = wl12xx_top_reg_read(wl, WL128X_REG_FUSE_DATA_2_1,
1519 &die_info); 1519 &die_info);
1520 else 1520 else
diff --git a/drivers/net/wireless/ti/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h
index 7182bbf6625d..634ad0086c56 100644
--- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
@@ -24,6 +24,12 @@
24 24
25#include "conf.h" 25#include "conf.h"
26 26
27/* WiLink 6/7 chip IDs */
28#define CHIP_ID_127X_PG10 (0x04030101)
29#define CHIP_ID_127X_PG20 (0x04030111)
30#define CHIP_ID_128X_PG10 (0x05030101)
31#define CHIP_ID_128X_PG20 (0x05030111)
32
27/* minimum FW required for driver for wl127x */ 33/* minimum FW required for driver for wl127x */
28#define WL127X_CHIP_VER 6 34#define WL127X_CHIP_VER 6
29#define WL127X_IFTYPE_VER 3 35#define WL127X_IFTYPE_VER 3