From patchwork Fri Oct 12 06:06:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10637939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DE8717E1 for ; Fri, 12 Oct 2018 06:03:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B5042BD1B for ; Fri, 12 Oct 2018 06:03:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A8D22BE7F; Fri, 12 Oct 2018 06:03:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED2442BD1B for ; Fri, 12 Oct 2018 06:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=CV878hE7USBI5jzu/G0z0stT/Xz5GGzZ0Zzp59bQy6U=; b=mez 4DzS1p/5dbGwA41N022/ssVo/aGwpub/VrwfnMz41BIT/JB67VAnb53VIETviUEgKlWupR0AuTPBb p4n8Ko/BF0j591JRhKd5Kq4pz3RvdVyd327+ZsdO2cu63J+Qfg6rAlmMm2UTPYvaghO/PFp8EP2lA I4/hhh5g8s2BcIvIGC+gy835iSexrYDEA3DHjUB3RcttIbKV703gB9xHK3pYCvvLa9UQYz9ooKHQz haHLd8yMzAYxPM7nGvAlogr+6WQjOBPDOc2TsjR3cVFgVOZEc7UnDMacTxKUKWyCJnP3puysU2x67 DUI01rcJgWItfKINGJxnVaYBZ7pnjzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAqXz-0006w5-Mk; Fri, 12 Oct 2018 06:03:39 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAqXv-0006up-Sx for ath10k@lists.infradead.org; Fri, 12 Oct 2018 06:03:37 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 93AF160B73; Fri, 12 Oct 2018 06:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539324205; bh=FqaoSBWvfkfNpaqEdxtYbB33p87DCux4QmKZ4iVv7cI=; h=From:To:Cc:Subject:Date:From; b=goijiLqwvhWYQD+Hv6mlE4s6mDf2uTwlDeT4Qy0Jw1YHCCJtHmjX6pcJth/rn2a16 H2qkSBKMplVBPBMKrqjHrR69c5qW/ptSjd0f/JI3kb4onaJuzbjD2xy4onjEUWofIt dmJsCFpbS6D0l9kPADLtvgDbW+Di+ucTJ/5xHvFE= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 591786072E; Fri, 12 Oct 2018 06:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539324205; bh=FqaoSBWvfkfNpaqEdxtYbB33p87DCux4QmKZ4iVv7cI=; h=From:To:Cc:Subject:Date:From; b=goijiLqwvhWYQD+Hv6mlE4s6mDf2uTwlDeT4Qy0Jw1YHCCJtHmjX6pcJth/rn2a16 H2qkSBKMplVBPBMKrqjHrR69c5qW/ptSjd0f/JI3kb4onaJuzbjD2xy4onjEUWofIt dmJsCFpbS6D0l9kPADLtvgDbW+Di+ucTJ/5xHvFE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 591786072E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath10k@lists.infradead.org Subject: [PATCH 1/2] ath10k: Add memory dump support for QCA4019 Date: Fri, 12 Oct 2018 11:36:36 +0530 Message-Id: <1539324397-10597-1-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181011_230335_985517_8A3D6010 X-CRM114-Status: UNSURE ( 9.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anilkumar Kolli , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds firmware crash memory dump support for QCA4019. Tested on: QCA4019 firmware 10.4-3.2.1.1-00017 Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath10k/coredump.c | 103 +++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/net/wireless/ath/ath10k/coredump.c index 4d28063052fe..1ccc73c6ef12 100644 --- a/drivers/net/wireless/ath/ath10k/coredump.c +++ b/drivers/net/wireless/ath/ath10k/coredump.c @@ -867,6 +867,101 @@ }, }; +static const struct ath10k_mem_section ipq4019_soc_reg_range[] = { + {0x080000, 0x080004}, + {0x080020, 0x080024}, + {0x080028, 0x080050}, + {0x0800d4, 0x0800ec}, + {0x08010c, 0x080118}, + {0x080284, 0x080290}, + {0x0802a8, 0x0802b8}, + {0x0802dc, 0x08030c}, + {0x082000, 0x083fff} +}; + +static const struct ath10k_mem_region qca4019_hw10_mem_regions[] = { + { + .type = ATH10K_MEM_REGION_TYPE_DRAM, + .start = 0x400000, + .len = 0x68000, + .name = "DRAM", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_REG, + .start = 0xC0000, + .len = 0x40000, + .name = "SRAM", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_REG, + .start = 0x98000, + .len = 0x50000, + .name = "IRAM", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_IOREG, + .start = 0x30000, + .len = 0x7000, + .name = "APB REG 1", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_IOREG, + .start = 0x3f000, + .len = 0x3000, + .name = "APB REG 2", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_IOREG, + .start = 0x43000, + .len = 0x3000, + .name = "WIFI REG", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_IOREG, + .start = 0x4A000, + .len = 0x5000, + .name = "CE REG", + .section_table = { + .sections = NULL, + .size = 0, + }, + }, + { + .type = ATH10K_MEM_REGION_TYPE_REG, + .start = 0x080000, + .len = 0x083fff - 0x080000, + .name = "REG_TOTAL", + .section_table = { + .sections = ipq4019_soc_reg_range, + .size = ARRAY_SIZE(ipq4019_soc_reg_range), + }, + }, +}; + static const struct ath10k_hw_mem_layout hw_mem_layouts[] = { { .hw_id = QCA6174_HW_1_0_VERSION, @@ -945,7 +1040,13 @@ .size = ARRAY_SIZE(qca99x0_hw20_mem_regions), }, }, - + { + .hw_id = QCA4019_HW_1_0_DEV_VERSION, + .region_table = { + .regions = qca4019_hw10_mem_regions, + .size = ARRAY_SIZE(qca4019_hw10_mem_regions), + }, + }, }; static u32 ath10k_coredump_get_ramdump_size(struct ath10k *ar) From patchwork Fri Oct 12 06:06:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10637941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E56915E2 for ; Fri, 12 Oct 2018 06:03:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D6452BD1B for ; Fri, 12 Oct 2018 06:03:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 213722BE7F; Fri, 12 Oct 2018 06:03:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAD942BD1B for ; Fri, 12 Oct 2018 06:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NZYRHMPDyyP8cDh4w/71Niw937OQ9kS6Y76yGNwIroo=; b=Ka9XDG6PnD5wE0CIMr/BAkSy3p UJfr0yxZ3tqXrqrwaoeMCEHL1DliIuVirckrqVA/xThkU3LF1v6H7YfgOPWlJRZX/qUG777pVMZ93 UQ/44YH/ShKfUY78O1LHL+L6lgCH5685Bh/nZSvmI7U43NHoa8nKnZbAMX/fopQaMqnKK6QfN396T 58vCpERfZxs4XspQXjR8IYvZBk5anZYlSJwslzfS8VXOszmvsDuJCT8UOluGIL7y+OxsbAlzumA7c Q/W9+UBdzeuitFxeIcFzdIIFssRukHaRGd+mGQuhaM7tNhfGsgLQSoznNocj5+nNe7qfTr4DDtnEK +OvCGyIw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAqYE-00072R-6R; Fri, 12 Oct 2018 06:03:54 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAqY8-0006vz-1j for ath10k@lists.infradead.org; Fri, 12 Oct 2018 06:03:52 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BF50B60C55; Fri, 12 Oct 2018 06:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539324217; bh=FV4vPwUbrinK6mzsodiXjaNC/+XJ+DMkWCjWVm/QyaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=exuV+WEegjbqZEj+ylUXmD675weVRtoFG2LpoSGAxdVjA4nCaeBsfW+KwlLzCXBZR IOeyMB8zKIMK6/NTWfdufu+0w/0h8H+ZkG876fdcszQjje8tZNjpyb2NH2So5HYreW 8m2LOB0al2H3e3eiErlAlFLLL1z/p32pDdk//3ek= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6E5176072E; Fri, 12 Oct 2018 06:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539324217; bh=FV4vPwUbrinK6mzsodiXjaNC/+XJ+DMkWCjWVm/QyaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=exuV+WEegjbqZEj+ylUXmD675weVRtoFG2LpoSGAxdVjA4nCaeBsfW+KwlLzCXBZR IOeyMB8zKIMK6/NTWfdufu+0w/0h8H+ZkG876fdcszQjje8tZNjpyb2NH2So5HYreW 8m2LOB0al2H3e3eiErlAlFLLL1z/p32pDdk//3ek= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6E5176072E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: assign proper firmware crash dump structure Date: Fri, 12 Oct 2018 11:36:37 +0530 Message-Id: <1539324397-10597-2-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1539324397-10597-1-git-send-email-akolli@codeaurora.org> References: <1539324397-10597-1-git-send-email-akolli@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181011_230348_154612_13F0D46A X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anilkumar Kolli , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ar->target_version is same for QCA99x0, QCA4019, QCA9888 and QCA9984, this eneded up in assgning the wrong hw_mem_layouts. This patch adds additional hw_rev check to assign correct hw_mem_layouts. Tested on: QCA4019 firmware 10.4-3.2.1.1-00017 QCA9984 firmware 10.4-3.5.3-00057 Signed-off-by: Anilkumar Kolli --- drivers/net/wireless/ath/ath10k/coredump.c | 15 ++++++++++++++- drivers/net/wireless/ath/ath10k/coredump.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/net/wireless/ath/ath10k/coredump.c index 1ccc73c6ef12..eadae2f9206b 100644 --- a/drivers/net/wireless/ath/ath10k/coredump.c +++ b/drivers/net/wireless/ath/ath10k/coredump.c @@ -965,6 +965,7 @@ static const struct ath10k_hw_mem_layout hw_mem_layouts[] = { { .hw_id = QCA6174_HW_1_0_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw10_mem_regions, .size = ARRAY_SIZE(qca6174_hw10_mem_regions), @@ -972,6 +973,7 @@ }, { .hw_id = QCA6174_HW_1_1_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw10_mem_regions, .size = ARRAY_SIZE(qca6174_hw10_mem_regions), @@ -979,6 +981,7 @@ }, { .hw_id = QCA6174_HW_1_3_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw10_mem_regions, .size = ARRAY_SIZE(qca6174_hw10_mem_regions), @@ -986,6 +989,7 @@ }, { .hw_id = QCA6174_HW_2_1_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw21_mem_regions, .size = ARRAY_SIZE(qca6174_hw21_mem_regions), @@ -993,6 +997,7 @@ }, { .hw_id = QCA6174_HW_3_0_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw30_mem_regions, .size = ARRAY_SIZE(qca6174_hw30_mem_regions), @@ -1000,6 +1005,7 @@ }, { .hw_id = QCA6174_HW_3_2_VERSION, + .hw_rev = ATH10K_HW_QCA6174, .region_table = { .regions = qca6174_hw30_mem_regions, .size = ARRAY_SIZE(qca6174_hw30_mem_regions), @@ -1007,6 +1013,7 @@ }, { .hw_id = QCA9377_HW_1_1_DEV_VERSION, + .hw_rev = ATH10K_HW_QCA9377, .region_table = { .regions = qca6174_hw30_mem_regions, .size = ARRAY_SIZE(qca6174_hw30_mem_regions), @@ -1014,6 +1021,7 @@ }, { .hw_id = QCA988X_HW_2_0_VERSION, + .hw_rev = ATH10K_HW_QCA988X, .region_table = { .regions = qca988x_hw20_mem_regions, .size = ARRAY_SIZE(qca988x_hw20_mem_regions), @@ -1021,6 +1029,7 @@ }, { .hw_id = QCA9984_HW_1_0_DEV_VERSION, + .hw_rev = ATH10K_HW_QCA9984, .region_table = { .regions = qca9984_hw10_mem_regions, .size = ARRAY_SIZE(qca9984_hw10_mem_regions), @@ -1028,6 +1037,7 @@ }, { .hw_id = QCA9888_HW_2_0_DEV_VERSION, + .hw_rev = ATH10K_HW_QCA9888, .region_table = { .regions = qca9984_hw10_mem_regions, .size = ARRAY_SIZE(qca9984_hw10_mem_regions), @@ -1035,6 +1045,7 @@ }, { .hw_id = QCA99X0_HW_2_0_DEV_VERSION, + .hw_rev = ATH10K_HW_QCA99X0, .region_table = { .regions = qca99x0_hw20_mem_regions, .size = ARRAY_SIZE(qca99x0_hw20_mem_regions), @@ -1042,6 +1053,7 @@ }, { .hw_id = QCA4019_HW_1_0_DEV_VERSION, + .hw_rev = ATH10K_HW_QCA4019, .region_table = { .regions = qca4019_hw10_mem_regions, .size = ARRAY_SIZE(qca4019_hw10_mem_regions), @@ -1088,7 +1100,8 @@ const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k return NULL; for (i = 0; i < ARRAY_SIZE(hw_mem_layouts); i++) { - if (ar->target_version == hw_mem_layouts[i].hw_id) + if (ar->target_version == hw_mem_layouts[i].hw_id && + ar->hw_rev == hw_mem_layouts[i].hw_rev) return &hw_mem_layouts[i]; } diff --git a/drivers/net/wireless/ath/ath10k/coredump.h b/drivers/net/wireless/ath/ath10k/coredump.h index 3baaf9d2cbcd..5dac653e1649 100644 --- a/drivers/net/wireless/ath/ath10k/coredump.h +++ b/drivers/net/wireless/ath/ath10k/coredump.h @@ -165,6 +165,7 @@ struct ath10k_mem_region { */ struct ath10k_hw_mem_layout { u32 hw_id; + u32 hw_rev; struct { const struct ath10k_mem_region *regions;