diff options
| author | Yue Ma <yuem@qca.qualcomm.com> | 2013-12-26 23:08:00 -0800 |
|---|---|---|
| committer | Prakash Dhavali <pdhavali@codeaurora.org> | 2014-01-16 21:46:16 -0800 |
| commit | ac7f14d46ec97fd9356c5ce9435b7340a0f899ed (patch) | |
| tree | 0d026a90e4d8c7b5d6d64f1d545b19d384a3fbae | |
| parent | dccbe85b5e81142d43907c94a6a685ca2b66b817 (diff) | |
qcacld: Change target failure dump region and address
Change DRAM and register dump region and address when target failure
happens. Also remove unnecessary prints in the target failure interrupt
handler.
.
Change-Id: Ia40a6afb06669ff10387e00c2664655c45e457bb
CRs-Fixed: 592262
| -rw-r--r-- | CORE/SERVICES/BMI/ol_fw.c | 64 | ||||
| -rw-r--r-- | CORE/SERVICES/BMI/ol_fw.h | 14 |
2 files changed, 34 insertions, 44 deletions
diff --git a/CORE/SERVICES/BMI/ol_fw.c b/CORE/SERVICES/BMI/ol_fw.c index a22f2836d1b6..0aef14f2c40d 100644 --- a/CORE/SERVICES/BMI/ol_fw.c +++ b/CORE/SERVICES/BMI/ol_fw.c @@ -507,6 +507,21 @@ static void ramdump_work_handler(struct work_struct *ramdump) void __iomem *ramdump_base; unsigned long address; unsigned long size; + u_int32_t host_interest_address; + + if (!ramdump_scn) { + printk("No RAM dump will be collected since ramdump_scn is NULL!\n"); + goto out; + } + + if (HIFDiagReadMem(ramdump_scn->hif_hdl, + host_interest_item_address(ramdump_scn->target_type, + offsetof(struct host_interest_s, hi_failure_state)), + (A_UCHAR*) &host_interest_address, sizeof(u_int32_t)) != A_OK) { + printk("HifDiagReadiMem FW Dump Area Pointer failed!\n"); + goto out; + } + printk("Host interest item address: 0x%08X\n", host_interest_address); /* Get RAM dump memory address and size */ if (cnss_get_ramdump_mem(&address, &size)) { @@ -521,16 +536,11 @@ static void ramdump_work_handler(struct work_struct *ramdump) goto out; } - if (ramdump_scn) { - ol_target_coredump(ramdump_scn, ramdump_base, TOTAL_DUMP_SIZE); + ol_target_coredump(ramdump_scn, ramdump_base, TOTAL_DUMP_SIZE); + iounmap(ramdump_base); - printk("%s: RAM dump collecting completed!\n", __func__); - msleep(500); - } else { - printk("No RAM dump will be collected since ramdump_scn is NULL!\n"); - } - - iounmap(ramdump_base); + printk("%s: RAM dump collecting completed!\n", __func__); + msleep(500); out: /* Notify SSR framework the target has crashed. */ @@ -552,7 +562,6 @@ void ol_target_failure(void *instance, A_STATUS status) A_UINT32 reg_dump_values[REGISTER_DUMP_LEN_MAX]; A_UINT32 reg_dump_cnt = 0; A_UINT32 i; -#endif A_UINT32 dbglog_hdr_address; struct dbglog_hdr_s dbglog_hdr; struct dbglog_buf_s dbglog_buf; @@ -561,6 +570,7 @@ void ol_target_failure(void *instance, A_STATUS status) A_UINT8 *dbglog_data; void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); tp_wma_handle wma = vos_get_context(VOS_MODULE_ID_WDA, vos_context); +#endif if (OL_TRGET_STATUS_RESET == scn->target_status) { printk("Target is already asserted, ignore!\n"); @@ -597,7 +607,6 @@ void ol_target_failure(void *instance, A_STATUS status) for (i = 0; i < reg_dump_cnt; i++) { printk("[%02d] : 0x%08X\n", i, reg_dump_values[i]); } -#endif if (HIFDiagReadMem(scn->hif_hdl, host_interest_item_address(scn->target_type, offsetof(struct host_interest_s, hi_dbglog_hdr)), @@ -656,6 +665,7 @@ void ol_target_failure(void *instance, A_STATUS status) adf_os_mem_free(dbglog_data); } +#endif #if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) && defined(CONFIG_CNSS) /* Collect the RAM dump through a workqueue */ @@ -972,49 +982,29 @@ void ol_target_coredump(void *inst, void *memoryBlock, u_int32_t blockLength) struct ol_softc *scn = (struct ol_softc *)inst; char *bufferLoc = memoryBlock; int result = 0; - u_int32_t reg_dump_area = 0; u_int32_t amountRead = 0; u_int32_t sectionCount = 0; u_int32_t pos = 0; u_int32_t readLen = 0; /* - * SECTION = REGISTER - * START = Vary in target type - * LENGTH = 0x6c000 - * * SECTION = DRAM - * START = 0x400000 - * LENGTH = 0x50000 + * START = 0x00400000 + * LENGTH = 0x00070000 * * SECTION = IRAM - * START = 0x980000 - * LENGTH = 0x38000 - * + * START = 0x00980000 + * LENGTH = 0x00038000 */ - if (HIFDiagReadMem(scn->hif_hdl, - host_interest_item_address(scn->target_type, - offsetof(struct host_interest_s, hi_failure_state)), - (A_UCHAR*) ®_dump_area, sizeof(u_int32_t)) != A_OK) { - printk("HifDiagReadiMem FW Dump Area Pointer failed!\n"); - return; - } - printk("Host interest item address: 0x%08X\n", reg_dump_area); - - while ((sectionCount < 3) && (amountRead < blockLength)) { + while ((sectionCount < 2) && (amountRead < blockLength)) { switch (sectionCount) { case 0: - /* REGISTER SECTION */ - pos = reg_dump_area; - readLen = REGISTER_SIZE; - break; - case 1: /* DRAM SECTION */ pos = DRAM_LOCATION; readLen = DRAM_SIZE; break; - case 2: + case 1: /* IRAM SECTION */ pos = IRAM_LOCATION; readLen = IRAM_SIZE; diff --git a/CORE/SERVICES/BMI/ol_fw.h b/CORE/SERVICES/BMI/ol_fw.h index 6a61db8634ac..d9d63614d9b0 100644 --- a/CORE/SERVICES/BMI/ol_fw.h +++ b/CORE/SERVICES/BMI/ol_fw.h @@ -64,17 +64,17 @@ #define PEER_DEFAULT_STATS_UPDATE_PERIOD 500 #if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC) -#define REGISTER_LOCATION 0x4000 -#define REGISTER_SIZE 0x6c000 +#define REGISTER_LOCATION 0x00000000 +#define REGISTER_SIZE 0x00000800 -#define DRAM_LOCATION 0x400000 -#define DRAM_SIZE 0x50000 +#define DRAM_LOCATION 0x00400000 +#define DRAM_SIZE 0x00070000 -#define IRAM_LOCATION 0x980000 -#define IRAM_SIZE 0x38000 +#define IRAM_LOCATION 0x00980000 +#define IRAM_SIZE 0x00038000 #define TOTAL_DUMP_SIZE REGISTER_SIZE + DRAM_SIZE + IRAM_SIZE -#define PCIE_READ_LIMIT 0x5000 +#define PCIE_READ_LIMIT 0x00005000 void ol_target_coredump(void *instance, void* memoryBlock, u_int32_t blockLength); |
