aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-09-12 05:48:09 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-16 11:48:34 -0400
commit639d0b8996aa5913402b846932d57a51a23a40c9 (patch)
tree31fd491363659d9d348c32006639243abbd6f699
parent991b27eaf937a67bb575a95be5c592d9b9109a84 (diff)
ath6kl: read firmware start address from hardware
It's actually possible to read the firmware start address from hardware, that way there's no need to hardcode the address in hardware. Thanks to Chilam Ng for the idea. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c17
-rw-r--r--drivers/net/wireless/ath/ath6kl/target.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index bf0385ec0e05..5865466e884c 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1146,9 +1146,21 @@ static int ath6kl_upload_otp(struct ath6kl *ar)
1146 return ret; 1146 return ret;
1147 } 1147 }
1148 1148
1149 /* read firmware start address */
1150 ret = ath6kl_bmi_read(ar,
1151 ath6kl_get_hi_item_addr(ar,
1152 HI_ITEM(hi_app_start)),
1153 (u8 *) &address, sizeof(address));
1154
1155 if (ret) {
1156 ath6kl_err("Failed to read hi_app_start: %d\n", ret);
1157 return ret;
1158 }
1159
1160 ar->hw.app_start_override_addr = address;
1161
1149 /* execute the OTP code */ 1162 /* execute the OTP code */
1150 param = 0; 1163 param = 0;
1151 address = ar->hw.app_start_override_addr;
1152 ath6kl_bmi_execute(ar, address, &param); 1164 ath6kl_bmi_execute(ar, address, &param);
1153 1165
1154 return ret; 1166 return ret;
@@ -1343,21 +1355,18 @@ static int ath6kl_init_hw_params(struct ath6kl *ar)
1343 case AR6003_REV2_VERSION: 1355 case AR6003_REV2_VERSION:
1344 ar->hw.dataset_patch_addr = AR6003_REV2_DATASET_PATCH_ADDRESS; 1356 ar->hw.dataset_patch_addr = AR6003_REV2_DATASET_PATCH_ADDRESS;
1345 ar->hw.app_load_addr = AR6003_REV2_APP_LOAD_ADDRESS; 1357 ar->hw.app_load_addr = AR6003_REV2_APP_LOAD_ADDRESS;
1346 ar->hw.app_start_override_addr = AR6003_REV2_APP_START_OVERRIDE;
1347 ar->hw.board_ext_data_addr = AR6003_REV2_BOARD_EXT_DATA_ADDRESS; 1358 ar->hw.board_ext_data_addr = AR6003_REV2_BOARD_EXT_DATA_ADDRESS;
1348 ar->hw.reserved_ram_size = AR6003_REV2_RAM_RESERVE_SIZE; 1359 ar->hw.reserved_ram_size = AR6003_REV2_RAM_RESERVE_SIZE;
1349 break; 1360 break;
1350 case AR6003_REV3_VERSION: 1361 case AR6003_REV3_VERSION:
1351 ar->hw.dataset_patch_addr = AR6003_REV3_DATASET_PATCH_ADDRESS; 1362 ar->hw.dataset_patch_addr = AR6003_REV3_DATASET_PATCH_ADDRESS;
1352 ar->hw.app_load_addr = 0x1234; 1363 ar->hw.app_load_addr = 0x1234;
1353 ar->hw.app_start_override_addr = AR6003_REV3_APP_START_OVERRIDE;
1354 ar->hw.board_ext_data_addr = AR6003_REV3_BOARD_EXT_DATA_ADDRESS; 1364 ar->hw.board_ext_data_addr = AR6003_REV3_BOARD_EXT_DATA_ADDRESS;
1355 ar->hw.reserved_ram_size = AR6003_REV3_RAM_RESERVE_SIZE; 1365 ar->hw.reserved_ram_size = AR6003_REV3_RAM_RESERVE_SIZE;
1356 break; 1366 break;
1357 case AR6004_REV1_VERSION: 1367 case AR6004_REV1_VERSION:
1358 ar->hw.dataset_patch_addr = AR6003_REV2_DATASET_PATCH_ADDRESS; 1368 ar->hw.dataset_patch_addr = AR6003_REV2_DATASET_PATCH_ADDRESS;
1359 ar->hw.app_load_addr = AR6003_REV3_APP_LOAD_ADDRESS; 1369 ar->hw.app_load_addr = AR6003_REV3_APP_LOAD_ADDRESS;
1360 ar->hw.app_start_override_addr = AR6003_REV3_APP_START_OVERRIDE;
1361 ar->hw.board_ext_data_addr = AR6004_REV1_BOARD_EXT_DATA_ADDRESS; 1370 ar->hw.board_ext_data_addr = AR6004_REV1_BOARD_EXT_DATA_ADDRESS;
1362 ar->hw.reserved_ram_size = AR6004_REV1_RAM_RESERVE_SIZE; 1371 ar->hw.reserved_ram_size = AR6004_REV1_RAM_RESERVE_SIZE;
1363 break; 1372 break;
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index 7db06a5d9194..c9a76051f042 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -331,13 +331,11 @@ struct host_interest {
331 (((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \ 331 (((target_type) == TARGET_TYPE_AR6003) ? AR6003_VTOP(vaddr) : \
332 (((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0)) 332 (((target_type) == TARGET_TYPE_AR6004) ? AR6004_VTOP(vaddr) : 0))
333 333
334#define AR6003_REV2_APP_START_OVERRIDE 0x944C00
335#define AR6003_REV2_APP_LOAD_ADDRESS 0x543180 334#define AR6003_REV2_APP_LOAD_ADDRESS 0x543180
336#define AR6003_REV2_BOARD_EXT_DATA_ADDRESS 0x57E500 335#define AR6003_REV2_BOARD_EXT_DATA_ADDRESS 0x57E500
337#define AR6003_REV2_DATASET_PATCH_ADDRESS 0x57e884 336#define AR6003_REV2_DATASET_PATCH_ADDRESS 0x57e884
338#define AR6003_REV2_RAM_RESERVE_SIZE 6912 337#define AR6003_REV2_RAM_RESERVE_SIZE 6912
339 338
340#define AR6003_REV3_APP_START_OVERRIDE 0x945d00
341#define AR6003_REV3_APP_LOAD_ADDRESS 0x545000 339#define AR6003_REV3_APP_LOAD_ADDRESS 0x545000
342#define AR6003_REV3_BOARD_EXT_DATA_ADDRESS 0x542330 340#define AR6003_REV3_BOARD_EXT_DATA_ADDRESS 0x542330
343#define AR6003_REV3_DATASET_PATCH_ADDRESS 0x57FF74 341#define AR6003_REV3_DATASET_PATCH_ADDRESS 0x57FF74