diff options
author | Victor Goldenshtein <victorg@ti.com> | 2013-09-17 11:41:29 -0400 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@intel.com> | 2013-09-30 14:12:22 -0400 |
commit | 1f8a1890ed2be9c1e5cfc243426089d0531f5bde (patch) | |
tree | c5f307ce56b8db5e7692803cb2d62305859b44b1 /drivers/net/wireless/ti/wl18xx/main.c | |
parent | ef47d3287ca693067e3891aad9c8e62671579592 (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/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 42 |
1 files changed, 36 insertions, 6 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 | ||
1231 | static 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 | |||
1231 | static int wl18xx_get_pg_ver(struct wl1271 *wl, s8 *ver) | 1257 | static 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; |