Blame SOURCES/0018-rtw89-add-AXIDMA-and-TX-FIFO-dump-in-mac_mem_dump.patch

56e3f4
From f97fbc5fb6e05ce555777c234f31b70fff32c8dc Mon Sep 17 00:00:00 2001
56e3f4
From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= <ihuguet@redhat.com>
56e3f4
Date: Fri, 21 Jan 2022 08:49:03 +0100
56e3f4
Subject: [PATCH 18/36] rtw89: add AXIDMA and TX FIFO dump in mac_mem_dump
56e3f4
MIME-Version: 1.0
56e3f4
Content-Type: text/plain; charset=UTF-8
56e3f4
Content-Transfer-Encoding: 8bit
56e3f4
56e3f4
Bugzilla: http://bugzilla.redhat.com/2033291
56e3f4
56e3f4
commit 5da7075c1126f70578a111b8ea64d93f56bc84dd
56e3f4
Author: Chia-Yuan Li <leo.li@realtek.com>
56e3f4
Date:   Mon Nov 22 10:11:29 2021 +0800
56e3f4
56e3f4
    rtw89: add AXIDMA and TX FIFO dump in mac_mem_dump
56e3f4
56e3f4
    The AXIDMA is tx/rx packet transmission between PCIE host
56e3f4
    and device, and TX FIFO is MAC TX data.
56e3f4
    We dump them to verify that these memory buffers are correct.
56e3f4
56e3f4
    Signed-off-by: Chia-Yuan Li <leo.li@realtek.com>
56e3f4
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
56e3f4
    Reviewed-by: Larry Finger <Larry.Finger@lwfinger.net>
56e3f4
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
56e3f4
    Link: https://lore.kernel.org/r/20211122021129.4339-1-pkshih@realtek.com
56e3f4
56e3f4
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
56e3f4
---
56e3f4
 drivers/net/wireless/realtek/rtw89/debug.c |  5 +++++
56e3f4
 drivers/net/wireless/realtek/rtw89/mac.h   | 10 ++++++++++
56e3f4
 2 files changed, 15 insertions(+)
56e3f4
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
index 75f10627585b..1e85808aaf4b 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/debug.c
56e3f4
@@ -723,6 +723,7 @@ rtw89_debug_priv_mac_mem_dump_select(struct file *filp,
56e3f4
 }
56e3f4
 
56e3f4
 static const u32 mac_mem_base_addr_table[RTW89_MAC_MEM_MAX] = {
56e3f4
+	[RTW89_MAC_MEM_AXIDMA]	        = AXIDMA_BASE_ADDR,
56e3f4
 	[RTW89_MAC_MEM_SHARED_BUF]	= SHARED_BUF_BASE_ADDR,
56e3f4
 	[RTW89_MAC_MEM_DMAC_TBL]	= DMAC_TBL_BASE_ADDR,
56e3f4
 	[RTW89_MAC_MEM_SHCUT_MACHDR]	= SHCUT_MACHDR_BASE_ADDR,
56e3f4
@@ -735,6 +736,10 @@ static const u32 mac_mem_base_addr_table[RTW89_MAC_MEM_MAX] = {
56e3f4
 	[RTW89_MAC_MEM_BA_CAM]		= BA_CAM_BASE_ADDR,
56e3f4
 	[RTW89_MAC_MEM_BCN_IE_CAM0]	= BCN_IE_CAM0_BASE_ADDR,
56e3f4
 	[RTW89_MAC_MEM_BCN_IE_CAM1]	= BCN_IE_CAM1_BASE_ADDR,
56e3f4
+	[RTW89_MAC_MEM_TXD_FIFO_0]	= TXD_FIFO_0_BASE_ADDR,
56e3f4
+	[RTW89_MAC_MEM_TXD_FIFO_1]	= TXD_FIFO_1_BASE_ADDR,
56e3f4
+	[RTW89_MAC_MEM_TXDATA_FIFO_0]	= TXDATA_FIFO_0_BASE_ADDR,
56e3f4
+	[RTW89_MAC_MEM_TXDATA_FIFO_1]	= TXDATA_FIFO_1_BASE_ADDR,
56e3f4
 };
56e3f4
 
56e3f4
 static void rtw89_debug_dump_mac_mem(struct seq_file *m,
56e3f4
diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h
56e3f4
index 6f3db8a2a9c2..94cd29bd83d7 100644
56e3f4
--- a/drivers/net/wireless/realtek/rtw89/mac.h
56e3f4
+++ b/drivers/net/wireless/realtek/rtw89/mac.h
56e3f4
@@ -227,6 +227,7 @@ enum rtw89_mac_dbg_port_sel {
56e3f4
 /* SRAM mem dump */
56e3f4
 #define R_AX_INDIR_ACCESS_ENTRY 0x40000
56e3f4
 
56e3f4
+#define	AXIDMA_BASE_ADDR		0x18006000
56e3f4
 #define	STA_SCHED_BASE_ADDR		0x18808000
56e3f4
 #define	RXPLD_FLTR_CAM_BASE_ADDR	0x18813000
56e3f4
 #define	SECURITY_CAM_BASE_ADDR		0x18814000
56e3f4
@@ -240,10 +241,15 @@ enum rtw89_mac_dbg_port_sel {
56e3f4
 #define	DMAC_TBL_BASE_ADDR		0x18800000
56e3f4
 #define	SHCUT_MACHDR_BASE_ADDR		0x18800800
56e3f4
 #define	BCN_IE_CAM1_BASE_ADDR		0x188A0000
56e3f4
+#define	TXD_FIFO_0_BASE_ADDR		0x18856200
56e3f4
+#define	TXD_FIFO_1_BASE_ADDR		0x188A1080
56e3f4
+#define	TXDATA_FIFO_0_BASE_ADDR		0x18856000
56e3f4
+#define	TXDATA_FIFO_1_BASE_ADDR		0x188A1000
56e3f4
 
56e3f4
 #define CCTL_INFO_SIZE		32
56e3f4
 
56e3f4
 enum rtw89_mac_mem_sel {
56e3f4
+	RTW89_MAC_MEM_AXIDMA,
56e3f4
 	RTW89_MAC_MEM_SHARED_BUF,
56e3f4
 	RTW89_MAC_MEM_DMAC_TBL,
56e3f4
 	RTW89_MAC_MEM_SHCUT_MACHDR,
56e3f4
@@ -256,6 +262,10 @@ enum rtw89_mac_mem_sel {
56e3f4
 	RTW89_MAC_MEM_BA_CAM,
56e3f4
 	RTW89_MAC_MEM_BCN_IE_CAM0,
56e3f4
 	RTW89_MAC_MEM_BCN_IE_CAM1,
56e3f4
+	RTW89_MAC_MEM_TXD_FIFO_0,
56e3f4
+	RTW89_MAC_MEM_TXD_FIFO_1,
56e3f4
+	RTW89_MAC_MEM_TXDATA_FIFO_0,
56e3f4
+	RTW89_MAC_MEM_TXDATA_FIFO_1,
56e3f4
 
56e3f4
 	/* keep last */
56e3f4
 	RTW89_MAC_MEM_LAST,
56e3f4
-- 
56e3f4
2.13.6
56e3f4