Commit c49d9396 authored by Angus Ainslie's avatar Angus Ainslie Committed by Martin Kepplinger
Browse files

wireless: redpine: print the firmware version



The original version layout seems to have changed with the driver upgrade
so print out the old layout as well as the new one.
Signed-off-by: default avatarAngus Ainslie <angus@akkea.ca>
parent 2fe5e46e
...@@ -1479,6 +1479,7 @@ static int rsi_load_firmware(struct rsi_hw *adapter) ...@@ -1479,6 +1479,7 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
#ifdef CONFIG_RS9116_FLASH_MODE #ifdef CONFIG_RS9116_FLASH_MODE
u32 flash_data_start = 0; u32 flash_data_start = 0;
u8 flash_read[RSI_MAX_FLASH_OFFSET_SIZE];
#endif #endif
struct ta_metadata *metadata_p; struct ta_metadata *metadata_p;
int status; int status;
...@@ -1544,6 +1545,30 @@ static int rsi_load_firmware(struct rsi_hw *adapter) ...@@ -1544,6 +1545,30 @@ static int rsi_load_firmware(struct rsi_hw *adapter)
if (flash_data_start == 0x5aa5) { if (flash_data_start == 0x5aa5) {
status = rsi_load_9116_flash_fw(adapter); status = rsi_load_9116_flash_fw(adapter);
mdelay(3000); mdelay(3000);
if ((hif_ops->master_reg_read(adapter,
RSI_FLASH_READ_FW_VER,
(int *)flash_read,
4)) < 0) {
redpine_dbg(ERR_ZONE,
"%s: RSI_FLASH_READ_FW_VER failed\n", __func__);
goto bl_cmd_fail;
}
common->lmac_ver.build_id = (u16)((flash_read[1] << 8) | flash_read[0]);
common->lmac_ver.major = flash_read[2];
common->lmac_ver.minor = flash_read[3];
if ((hif_ops->master_reg_read(adapter,
RSI_FLASH_READ_FW_VER1,
(int *)flash_read,
4)) < 0) {
redpine_dbg(ERR_ZONE,
"%s: RSI_FLASH_READ_FW_VER failed\n", __func__);
goto bl_cmd_fail;
}
common->lmac_ver.chip_id = (u16)((flash_read[3] << 8) | flash_read[2]);
common->lmac_ver.release_num = flash_read[0];
common->lmac_ver.customer_id = flash_read[1];
common->lmac_ver.patch_num = flash_read[2];
rsi_print_version(common);
if (adapter->rsi_host_intf == RSI_HOST_INTF_USB) { if (adapter->rsi_host_intf == RSI_HOST_INTF_USB) {
if (bl_cmd(adapter, POLLING_MODE, if (bl_cmd(adapter, POLLING_MODE,
CMD_PASS, CMD_PASS,
......
...@@ -403,7 +403,10 @@ void rsi_print_version(struct rsi_common *common) ...@@ -403,7 +403,10 @@ void rsi_print_version(struct rsi_common *common)
redpine_dbg(ERR_ZONE, "================ RSI Version Info ==============\n"); redpine_dbg(ERR_ZONE, "================ RSI Version Info ==============\n");
redpine_dbg(ERR_ZONE, "================================================\n"); redpine_dbg(ERR_ZONE, "================================================\n");
if (adapter->device_model == RSI_DEV_9116) { if (adapter->device_model == RSI_DEV_9116) {
redpine_dbg(ERR_ZONE, "FW Version\t: %04x.%x.%x.%x.%04x\n", redpine_dbg(ERR_ZONE, "FW Version\t: %d.%d.%d.%d\n",
common->lmac_ver.major, common->lmac_ver.minor,
common->lmac_ver.release_num,common->lmac_ver.patch_num);
redpine_dbg(ERR_ZONE, "RSI FW Version\t: %04x.%x.%x.%x.%04x\n",
common->lmac_ver.chip_id, common->lmac_ver.major, common->lmac_ver.chip_id, common->lmac_ver.major,
common->lmac_ver.minor, common->lmac_ver.customer_id, common->lmac_ver.minor, common->lmac_ver.customer_id,
common->lmac_ver.build_id); common->lmac_ver.build_id);
......
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
#define RSI_FLASH_READ_WLAN_IMAGE (0x04000000 + 0x20000 + 0x40) #define RSI_FLASH_READ_WLAN_IMAGE (0x04000000 + 0x20000 + 0x40)
#define RSI_LMAC_VER_OFFSET_RS9116 (0x22c0 + 0x40) #define RSI_LMAC_VER_OFFSET_RS9116 (0x22c0 + 0x40)
#define RSI_9116_FLASH_SIZE (4 * 1024 * 1024) #define RSI_9116_FLASH_SIZE (4 * 1024 * 1024)
#define RSI_FLASH_READ_FW_VER 0x00002c04
#define RSI_FLASH_READ_FW_VER1 0x00002c08
#define RSI_MAX_FLASH_OFFSET_SIZE 0x4
#endif #endif
#define REGIN_VALID 0xA #define REGIN_VALID 0xA
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment