aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-09-27 07:31:11 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-28 12:27:31 -0400
commit6bc364315aac6ab256ce3cdc00aa90cb57279a1f (patch)
tree6ac40e1d6d08c0f93c44f95123bb1889012db562
parentf7325b85efe1395b52ef1006dafe3c0d4ff79f15 (diff)
ath6kl: add debug logs for booting
Just to make it easier to find out why boot fails. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.h1
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c71
2 files changed, 63 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 7c34826dd1e0..0fbb0ac2de23 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -38,6 +38,7 @@ enum ATH6K_DEBUG_MASK {
38 ATH6KL_DBG_AGGR = BIT(15), /* aggregation */ 38 ATH6KL_DBG_AGGR = BIT(15), /* aggregation */
39 ATH6KL_DBG_SDIO = BIT(16), 39 ATH6KL_DBG_SDIO = BIT(16),
40 ATH6KL_DBG_SDIO_DUMP = BIT(17), 40 ATH6KL_DBG_SDIO_DUMP = BIT(17),
41 ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
41 ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ 42 ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
42}; 43};
43 44
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index e9785feeea17..876b6b28dd22 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -958,6 +958,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
958 958
959 switch (ie_id) { 959 switch (ie_id) {
960 case ATH6KL_FW_IE_OTP_IMAGE: 960 case ATH6KL_FW_IE_OTP_IMAGE:
961 ath6kl_dbg(ATH6KL_DBG_BOOT, "found otp image ie (%d B)\n",
962 ie_len);
963
961 ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL); 964 ar->fw_otp = kmemdup(data, ie_len, GFP_KERNEL);
962 965
963 if (ar->fw_otp == NULL) { 966 if (ar->fw_otp == NULL) {
@@ -968,6 +971,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
968 ar->fw_otp_len = ie_len; 971 ar->fw_otp_len = ie_len;
969 break; 972 break;
970 case ATH6KL_FW_IE_FW_IMAGE: 973 case ATH6KL_FW_IE_FW_IMAGE:
974 ath6kl_dbg(ATH6KL_DBG_BOOT, "found fw image ie (%d B)\n",
975 ie_len);
976
971 ar->fw = kmemdup(data, ie_len, GFP_KERNEL); 977 ar->fw = kmemdup(data, ie_len, GFP_KERNEL);
972 978
973 if (ar->fw == NULL) { 979 if (ar->fw == NULL) {
@@ -978,6 +984,9 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
978 ar->fw_len = ie_len; 984 ar->fw_len = ie_len;
979 break; 985 break;
980 case ATH6KL_FW_IE_PATCH_IMAGE: 986 case ATH6KL_FW_IE_PATCH_IMAGE:
987 ath6kl_dbg(ATH6KL_DBG_BOOT, "found patch image ie (%d B)\n",
988 ie_len);
989
981 ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL); 990 ar->fw_patch = kmemdup(data, ie_len, GFP_KERNEL);
982 991
983 if (ar->fw_patch == NULL) { 992 if (ar->fw_patch == NULL) {
@@ -990,8 +999,16 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
990 case ATH6KL_FW_IE_RESERVED_RAM_SIZE: 999 case ATH6KL_FW_IE_RESERVED_RAM_SIZE:
991 val = (__le32 *) data; 1000 val = (__le32 *) data;
992 ar->hw.reserved_ram_size = le32_to_cpup(val); 1001 ar->hw.reserved_ram_size = le32_to_cpup(val);
1002
1003 ath6kl_dbg(ATH6KL_DBG_BOOT,
1004 "found reserved ram size ie 0x%d\n",
1005 ar->hw.reserved_ram_size);
993 break; 1006 break;
994 case ATH6KL_FW_IE_CAPABILITIES: 1007 case ATH6KL_FW_IE_CAPABILITIES:
1008 ath6kl_dbg(ATH6KL_DBG_BOOT,
1009 "found firmware capabilities ie (%d B)\n",
1010 ie_len);
1011
995 for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) { 1012 for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) {
996 index = ALIGN(i, 8) / 8; 1013 index = ALIGN(i, 8) / 8;
997 bit = i % 8; 1014 bit = i % 8;
@@ -999,6 +1016,10 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
999 if (data[index] & (1 << bit)) 1016 if (data[index] & (1 << bit))
1000 __set_bit(i, ar->fw_capabilities); 1017 __set_bit(i, ar->fw_capabilities);
1001 } 1018 }
1019
1020 ath6kl_dbg_dump(ATH6KL_DBG_BOOT, "capabilities", "",
1021 ar->fw_capabilities,
1022 sizeof(ar->fw_capabilities));
1002 break; 1023 break;
1003 case ATH6KL_FW_IE_PATCH_ADDR: 1024 case ATH6KL_FW_IE_PATCH_ADDR:
1004 if (ie_len != sizeof(*val)) 1025 if (ie_len != sizeof(*val))
@@ -1006,9 +1027,13 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar)
1006 1027
1007 val = (__le32 *) data; 1028 val = (__le32 *) data;
1008 ar->hw.dataset_patch_addr = le32_to_cpup(val); 1029 ar->hw.dataset_patch_addr = le32_to_cpup(val);
1030
1031 ath6kl_dbg(ATH6KL_DBG_BOOT,
1032 "found patch address ie 0x%d\n",
1033 ar->hw.dataset_patch_addr);
1009 break; 1034 break;
1010 default: 1035 default:
1011 ath6kl_dbg(ATH6KL_DBG_TRC, "Unknown fw ie: %u\n", 1036 ath6kl_dbg(ATH6KL_DBG_BOOT, "Unknown fw ie: %u\n",
1012 le32_to_cpup(&hdr->id)); 1037 le32_to_cpup(&hdr->id));
1013 break; 1038 break;
1014 } 1039 }
@@ -1033,14 +1058,17 @@ static int ath6kl_fetch_firmwares(struct ath6kl *ar)
1033 return ret; 1058 return ret;
1034 1059
1035 ret = ath6kl_fetch_fw_api2(ar); 1060 ret = ath6kl_fetch_fw_api2(ar);
1036 if (ret == 0) 1061 if (ret == 0) {
1037 /* fw api 2 found, use it */ 1062 ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 2\n");
1038 return 0; 1063 return 0;
1064 }
1039 1065
1040 ret = ath6kl_fetch_fw_api1(ar); 1066 ret = ath6kl_fetch_fw_api1(ar);
1041 if (ret) 1067 if (ret)
1042 return ret; 1068 return ret;
1043 1069
1070 ath6kl_dbg(ATH6KL_DBG_BOOT, "using fw api 1\n");
1071
1044 return 0; 1072 return 0;
1045} 1073}
1046 1074
@@ -1071,18 +1099,12 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
1071 (u8 *) &board_address, 4); 1099 (u8 *) &board_address, 4);
1072 } 1100 }
1073 1101
1074 ath6kl_dbg(ATH6KL_DBG_TRC, "board data download addr: 0x%x\n",
1075 board_address);
1076
1077 /* determine where in target ram to write extended board data */ 1102 /* determine where in target ram to write extended board data */
1078 ath6kl_bmi_read(ar, 1103 ath6kl_bmi_read(ar,
1079 ath6kl_get_hi_item_addr(ar, 1104 ath6kl_get_hi_item_addr(ar,
1080 HI_ITEM(hi_board_ext_data)), 1105 HI_ITEM(hi_board_ext_data)),
1081 (u8 *) &board_ext_address, 4); 1106 (u8 *) &board_ext_address, 4);
1082 1107
1083 ath6kl_dbg(ATH6KL_DBG_TRC, "board file download addr: 0x%x\n",
1084 board_ext_address);
1085
1086 if (board_ext_address == 0) { 1108 if (board_ext_address == 0) {
1087 ath6kl_err("Failed to get board file target address.\n"); 1109 ath6kl_err("Failed to get board file target address.\n");
1088 return -EINVAL; 1110 return -EINVAL;
@@ -1107,6 +1129,10 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
1107 board_ext_data_size)) { 1129 board_ext_data_size)) {
1108 1130
1109 /* write extended board data */ 1131 /* write extended board data */
1132 ath6kl_dbg(ATH6KL_DBG_BOOT,
1133 "writing extended board data to 0x%x (%d B)\n",
1134 board_ext_address, board_ext_data_size);
1135
1110 ret = ath6kl_bmi_write(ar, board_ext_address, 1136 ret = ath6kl_bmi_write(ar, board_ext_address,
1111 ar->fw_board + board_data_size, 1137 ar->fw_board + board_data_size,
1112 board_ext_data_size); 1138 board_ext_data_size);
@@ -1131,6 +1157,9 @@ static int ath6kl_upload_board_file(struct ath6kl *ar)
1131 return ret; 1157 return ret;
1132 } 1158 }
1133 1159
1160 ath6kl_dbg(ATH6KL_DBG_BOOT, "writing board file to 0x%x (%d B)\n",
1161 board_address, board_data_size);
1162
1134 ret = ath6kl_bmi_write(ar, board_address, ar->fw_board, 1163 ret = ath6kl_bmi_write(ar, board_address, ar->fw_board,
1135 board_data_size); 1164 board_data_size);
1136 1165
@@ -1159,6 +1188,9 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
1159 1188
1160 address = ar->hw.app_load_addr; 1189 address = ar->hw.app_load_addr;
1161 1190
1191 ath6kl_dbg(ATH6KL_DBG_BOOT, "writing otp to 0x%x (%d B)\n", address,
1192 ar->fw_otp_len);
1193
1162 ret = ath6kl_bmi_fast_download(ar, address, ar->fw_otp, 1194 ret = ath6kl_bmi_fast_download(ar, address, ar->fw_otp,
1163 ar->fw_otp_len); 1195 ar->fw_otp_len);
1164 if (ret) { 1196 if (ret) {
@@ -1179,7 +1211,11 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
1179 1211
1180 ar->hw.app_start_override_addr = address; 1212 ar->hw.app_start_override_addr = address;
1181 1213
1214 ath6kl_dbg(ATH6KL_DBG_BOOT, "app_start_override_addr 0x%x\n",
1215 ar->hw.app_start_override_addr);
1216
1182 /* execute the OTP code */ 1217 /* execute the OTP code */
1218 ath6kl_dbg(ATH6KL_DBG_BOOT, "executing OTP at 0x%x\n", address);
1183 param = 0; 1219 param = 0;
1184 ath6kl_bmi_execute(ar, address, &param); 1220 ath6kl_bmi_execute(ar, address, &param);
1185 1221
@@ -1196,6 +1232,9 @@ static int ath6kl_upload_firmware(struct ath6kl *ar)
1196 1232
1197 address = ar->hw.app_load_addr; 1233 address = ar->hw.app_load_addr;
1198 1234
1235 ath6kl_dbg(ATH6KL_DBG_BOOT, "writing firmware to 0x%x (%d B)\n",
1236 address, ar->fw_len);
1237
1199 ret = ath6kl_bmi_fast_download(ar, address, ar->fw, ar->fw_len); 1238 ret = ath6kl_bmi_fast_download(ar, address, ar->fw, ar->fw_len);
1200 1239
1201 if (ret) { 1240 if (ret) {
@@ -1224,6 +1263,9 @@ static int ath6kl_upload_patch(struct ath6kl *ar)
1224 1263
1225 address = ar->hw.dataset_patch_addr; 1264 address = ar->hw.dataset_patch_addr;
1226 1265
1266 ath6kl_dbg(ATH6KL_DBG_BOOT, "writing patch to 0x%x (%d B)\n",
1267 address, ar->fw_patch_len);
1268
1227 ret = ath6kl_bmi_write(ar, address, ar->fw_patch, ar->fw_patch_len); 1269 ret = ath6kl_bmi_write(ar, address, ar->fw_patch, ar->fw_patch_len);
1228 if (ret) { 1270 if (ret) {
1229 ath6kl_err("Failed to write patch file: %d\n", ret); 1271 ath6kl_err("Failed to write patch file: %d\n", ret);
@@ -1396,6 +1438,15 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
1396 return -EINVAL; 1438 return -EINVAL;
1397 } 1439 }
1398 1440
1441 ath6kl_dbg(ATH6KL_DBG_BOOT,
1442 "target_ver 0x%x target_type 0x%x dataset_patch 0x%x app_load_addr 0x%x\n",
1443 ar->version.target_ver, ar->target_type,
1444 ar->hw.dataset_patch_addr, ar->hw.app_load_addr);
1445 ath6kl_dbg(ATH6KL_DBG_BOOT,
1446 "app_start_override_addr 0x%x board_ext_data_addr 0x%x reserved_ram_size 0x%x",
1447 ar->hw.app_start_override_addr, ar->hw.board_ext_data_addr,
1448 ar->hw.reserved_ram_size);
1449
1399 return 0; 1450 return 0;
1400} 1451}
1401 1452
@@ -1472,6 +1523,8 @@ static int ath6kl_init(struct net_device *dev)
1472 &ar->flag), 1523 &ar->flag),
1473 WMI_TIMEOUT); 1524 WMI_TIMEOUT);
1474 1525
1526 ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n");
1527
1475 if (ar->version.abi_ver != ATH6KL_ABI_VERSION) { 1528 if (ar->version.abi_ver != ATH6KL_ABI_VERSION) {
1476 ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n", 1529 ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n",
1477 ATH6KL_ABI_VERSION, ar->version.abi_ver); 1530 ATH6KL_ABI_VERSION, ar->version.abi_ver);