aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorVictor Goldenshtein <victorg@ti.com>2013-09-17 11:41:29 -0400
committerLuciano Coelho <luciano.coelho@intel.com>2013-09-30 14:12:22 -0400
commit1f8a1890ed2be9c1e5cfc243426089d0531f5bde (patch)
treec5f307ce56b8db5e7692803cb2d62305859b44b1 /drivers/net/wireless/ti
parentef47d3287ca693067e3891aad9c8e62671579592 (diff)
wl18xx: print new RDL versions during boot
Extract and print info for the new RDL 5, 6, 7 and 8. Replace const struct with function which translates the RDL number to string. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Barak Bercovitz <barak@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c42
-rw-r--r--drivers/net/wireless/ti/wl18xx/reg.h20
2 files changed, 46 insertions, 16 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index b47eb620f2f1..d0daca1d23bc 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1228,16 +1228,48 @@ static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl,
1228 } 1228 }
1229} 1229}
1230 1230
1231static const char *wl18xx_rdl_name(enum wl18xx_rdl_num rdl_num)
1232{
1233 switch (rdl_num) {
1234 case RDL_1_HP:
1235 return "183xH";
1236 case RDL_2_SP:
1237 return "183x or 180x";
1238 case RDL_3_HP:
1239 return "187xH";
1240 case RDL_4_SP:
1241 return "187x";
1242 case RDL_5_SP:
1243 return "RDL11 - Not Supported";
1244 case RDL_6_SP:
1245 return "180xD";
1246 case RDL_7_SP:
1247 return "RDL13 - Not Supported (1893Q)";
1248 case RDL_8_SP:
1249 return "18xxQ";
1250 case RDL_NONE:
1251 return "UNTRIMMED";
1252 default:
1253 return "UNKNOWN";
1254 }
1255}
1256
1231static int wl18xx_get_pg_ver(struct wl1271 *wl, s8 *ver) 1257static int wl18xx_get_pg_ver(struct wl1271 *wl, s8 *ver)
1232{ 1258{
1233 u32 fuse; 1259 u32 fuse;
1234 s8 rom = 0, metal = 0, pg_ver = 0, rdl_ver = 0; 1260 s8 rom = 0, metal = 0, pg_ver = 0, rdl_ver = 0, package_type = 0;
1235 int ret; 1261 int ret;
1236 1262
1237 ret = wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]); 1263 ret = wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
1238 if (ret < 0) 1264 if (ret < 0)
1239 goto out; 1265 goto out;
1240 1266
1267 ret = wlcore_read32(wl, WL18XX_REG_FUSE_DATA_2_3, &fuse);
1268 if (ret < 0)
1269 goto out;
1270
1271 package_type = (fuse >> WL18XX_PACKAGE_TYPE_OFFSET) & 1;
1272
1241 ret = wlcore_read32(wl, WL18XX_REG_FUSE_DATA_1_3, &fuse); 1273 ret = wlcore_read32(wl, WL18XX_REG_FUSE_DATA_1_3, &fuse);
1242 if (ret < 0) 1274 if (ret < 0)
1243 goto out; 1275 goto out;
@@ -1245,7 +1277,7 @@ static int wl18xx_get_pg_ver(struct wl1271 *wl, s8 *ver)
1245 pg_ver = (fuse & WL18XX_PG_VER_MASK) >> WL18XX_PG_VER_OFFSET; 1277 pg_ver = (fuse & WL18XX_PG_VER_MASK) >> WL18XX_PG_VER_OFFSET;
1246 rom = (fuse & WL18XX_ROM_VER_MASK) >> WL18XX_ROM_VER_OFFSET; 1278 rom = (fuse & WL18XX_ROM_VER_MASK) >> WL18XX_ROM_VER_OFFSET;
1247 1279
1248 if (rom <= 0xE) 1280 if ((rom <= 0xE) && (package_type == WL18XX_PACKAGE_TYPE_WSP))
1249 metal = (fuse & WL18XX_METAL_VER_MASK) >> 1281 metal = (fuse & WL18XX_METAL_VER_MASK) >>
1250 WL18XX_METAL_VER_OFFSET; 1282 WL18XX_METAL_VER_OFFSET;
1251 else 1283 else
@@ -1257,11 +1289,9 @@ static int wl18xx_get_pg_ver(struct wl1271 *wl, s8 *ver)
1257 goto out; 1289 goto out;
1258 1290
1259 rdl_ver = (fuse & WL18XX_RDL_VER_MASK) >> WL18XX_RDL_VER_OFFSET; 1291 rdl_ver = (fuse & WL18XX_RDL_VER_MASK) >> WL18XX_RDL_VER_OFFSET;
1260 if (rdl_ver > RDL_MAX)
1261 rdl_ver = RDL_NONE;
1262 1292
1263 wl1271_info("wl18xx HW: RDL %d, %s, PG %x.%x (ROM %x)", 1293 wl1271_info("wl18xx HW: %s, PG %d.%d (ROM 0x%x)",
1264 rdl_ver, rdl_names[rdl_ver], pg_ver, metal, rom); 1294 wl18xx_rdl_name(rdl_ver), pg_ver, metal, rom);
1265 1295
1266 if (ver) 1296 if (ver)
1267 *ver = pg_ver; 1297 *ver = pg_ver;
diff --git a/drivers/net/wireless/ti/wl18xx/reg.h b/drivers/net/wireless/ti/wl18xx/reg.h
index 88de3f2049e3..a433a75f3cd7 100644
--- a/drivers/net/wireless/ti/wl18xx/reg.h
+++ b/drivers/net/wireless/ti/wl18xx/reg.h
@@ -147,13 +147,16 @@
147#define WL18XX_REG_FUSE_DATA_1_3 0xA0260C 147#define WL18XX_REG_FUSE_DATA_1_3 0xA0260C
148#define WL18XX_PG_VER_MASK 0x70 148#define WL18XX_PG_VER_MASK 0x70
149#define WL18XX_PG_VER_OFFSET 4 149#define WL18XX_PG_VER_OFFSET 4
150#define WL18XX_ROM_VER_MASK 0x3 150#define WL18XX_ROM_VER_MASK 0x3e00
151#define WL18XX_ROM_VER_OFFSET 0 151#define WL18XX_ROM_VER_OFFSET 9
152#define WL18XX_METAL_VER_MASK 0xC 152#define WL18XX_METAL_VER_MASK 0xC
153#define WL18XX_METAL_VER_OFFSET 2 153#define WL18XX_METAL_VER_OFFSET 2
154#define WL18XX_NEW_METAL_VER_MASK 0x180 154#define WL18XX_NEW_METAL_VER_MASK 0x180
155#define WL18XX_NEW_METAL_VER_OFFSET 7 155#define WL18XX_NEW_METAL_VER_OFFSET 7
156 156
157#define WL18XX_PACKAGE_TYPE_OFFSET 13
158#define WL18XX_PACKAGE_TYPE_WSP 0
159
157#define WL18XX_REG_FUSE_DATA_2_3 0xA02614 160#define WL18XX_REG_FUSE_DATA_2_3 0xA02614
158#define WL18XX_RDL_VER_MASK 0x1f00 161#define WL18XX_RDL_VER_MASK 0x1f00
159#define WL18XX_RDL_VER_OFFSET 8 162#define WL18XX_RDL_VER_OFFSET 8
@@ -214,24 +217,21 @@ enum {
214 NUM_BOARD_TYPES, 217 NUM_BOARD_TYPES,
215}; 218};
216 219
217enum { 220enum wl18xx_rdl_num {
218 RDL_NONE = 0, 221 RDL_NONE = 0,
219 RDL_1_HP = 1, 222 RDL_1_HP = 1,
220 RDL_2_SP = 2, 223 RDL_2_SP = 2,
221 RDL_3_HP = 3, 224 RDL_3_HP = 3,
222 RDL_4_SP = 4, 225 RDL_4_SP = 4,
226 RDL_5_SP = 0x11,
227 RDL_6_SP = 0x12,
228 RDL_7_SP = 0x13,
229 RDL_8_SP = 0x14,
223 230
224 _RDL_LAST, 231 _RDL_LAST,
225 RDL_MAX = _RDL_LAST - 1, 232 RDL_MAX = _RDL_LAST - 1,
226}; 233};
227 234
228static const char * const rdl_names[] = {
229 [RDL_NONE] = "",
230 [RDL_1_HP] = "1853 SISO",
231 [RDL_2_SP] = "1857 MIMO",
232 [RDL_3_HP] = "1893 SISO",
233 [RDL_4_SP] = "1897 MIMO",
234};
235 235
236/* FPGA_SPARE_1 register - used to change the PHY ATPG clock at boot time */ 236/* FPGA_SPARE_1 register - used to change the PHY ATPG clock at boot time */
237#define WL18XX_PHY_FPGA_SPARE_1 0x8093CA40 237#define WL18XX_PHY_FPGA_SPARE_1 0x8093CA40