]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rtw89: mac: move table of mem base addr to common
authorZong-Zhe Yang <kevin_yang@realtek.com>
Mon, 14 Mar 2022 07:12:44 +0000 (15:12 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 6 Apr 2022 07:46:01 +0000 (10:46 +0300)
Previously, mac_mem_base_addr_table was declared in debug.c locally
because it's only used via debugfs to dump mac memory. Now, we plan to
refine SER (system error recover) flow which will also need to dump mac
memory to somewhere as information for error which is catched. So, we
move mac_mem_base_addr_table to mac.c rtw89_mac_mem_base_addrs earlier
as common code.

(no logic is changed)

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220314071250.40292-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/debug.c
drivers/net/wireless/realtek/rtw89/mac.c
drivers/net/wireless/realtek/rtw89/mac.h

index b73cc03cecfd79d5ada7eeee38080e3d605ce35d..09c545497ec5ce7f0892e7ebae9a6fd1d5b1fe42 100644 (file)
@@ -724,26 +724,6 @@ rtw89_debug_priv_mac_mem_dump_select(struct file *filp,
        return count;
 }
 
-static const u32 mac_mem_base_addr_table[RTW89_MAC_MEM_MAX] = {
-       [RTW89_MAC_MEM_AXIDMA]          = AXIDMA_BASE_ADDR,
-       [RTW89_MAC_MEM_SHARED_BUF]      = SHARED_BUF_BASE_ADDR,
-       [RTW89_MAC_MEM_DMAC_TBL]        = DMAC_TBL_BASE_ADDR,
-       [RTW89_MAC_MEM_SHCUT_MACHDR]    = SHCUT_MACHDR_BASE_ADDR,
-       [RTW89_MAC_MEM_STA_SCHED]       = STA_SCHED_BASE_ADDR,
-       [RTW89_MAC_MEM_RXPLD_FLTR_CAM]  = RXPLD_FLTR_CAM_BASE_ADDR,
-       [RTW89_MAC_MEM_SECURITY_CAM]    = SECURITY_CAM_BASE_ADDR,
-       [RTW89_MAC_MEM_WOW_CAM]         = WOW_CAM_BASE_ADDR,
-       [RTW89_MAC_MEM_CMAC_TBL]        = CMAC_TBL_BASE_ADDR,
-       [RTW89_MAC_MEM_ADDR_CAM]        = ADDR_CAM_BASE_ADDR,
-       [RTW89_MAC_MEM_BA_CAM]          = BA_CAM_BASE_ADDR,
-       [RTW89_MAC_MEM_BCN_IE_CAM0]     = BCN_IE_CAM0_BASE_ADDR,
-       [RTW89_MAC_MEM_BCN_IE_CAM1]     = BCN_IE_CAM1_BASE_ADDR,
-       [RTW89_MAC_MEM_TXD_FIFO_0]      = TXD_FIFO_0_BASE_ADDR,
-       [RTW89_MAC_MEM_TXD_FIFO_1]      = TXD_FIFO_1_BASE_ADDR,
-       [RTW89_MAC_MEM_TXDATA_FIFO_0]   = TXDATA_FIFO_0_BASE_ADDR,
-       [RTW89_MAC_MEM_TXDATA_FIFO_1]   = TXDATA_FIFO_1_BASE_ADDR,
-};
-
 static void rtw89_debug_dump_mac_mem(struct seq_file *m,
                                     struct rtw89_dev *rtwdev,
                                     u8 sel, u32 start_addr, u32 len)
@@ -757,7 +737,7 @@ static void rtw89_debug_dump_mac_mem(struct seq_file *m,
        pages = len / MAC_MEM_DUMP_PAGE_SIZE + 1;
        start_page = start_addr / MAC_MEM_DUMP_PAGE_SIZE;
        residue = start_addr % MAC_MEM_DUMP_PAGE_SIZE;
-       base_addr = mac_mem_base_addr_table[sel];
+       base_addr = rtw89_mac_mem_base_addrs[sel];
        base_addr += start_page * MAC_MEM_DUMP_PAGE_SIZE;
 
        for (p = 0; p < pages; p++) {
index 5e554bd9f0368e9c8f6012932794239d3ac48da7..580757bb52cf7f4f4aafe575be998babd106e99e 100644 (file)
 #include "reg.h"
 #include "util.h"
 
+const u32 rtw89_mac_mem_base_addrs[RTW89_MAC_MEM_MAX] = {
+       [RTW89_MAC_MEM_AXIDMA]          = AXIDMA_BASE_ADDR,
+       [RTW89_MAC_MEM_SHARED_BUF]      = SHARED_BUF_BASE_ADDR,
+       [RTW89_MAC_MEM_DMAC_TBL]        = DMAC_TBL_BASE_ADDR,
+       [RTW89_MAC_MEM_SHCUT_MACHDR]    = SHCUT_MACHDR_BASE_ADDR,
+       [RTW89_MAC_MEM_STA_SCHED]       = STA_SCHED_BASE_ADDR,
+       [RTW89_MAC_MEM_RXPLD_FLTR_CAM]  = RXPLD_FLTR_CAM_BASE_ADDR,
+       [RTW89_MAC_MEM_SECURITY_CAM]    = SECURITY_CAM_BASE_ADDR,
+       [RTW89_MAC_MEM_WOW_CAM]         = WOW_CAM_BASE_ADDR,
+       [RTW89_MAC_MEM_CMAC_TBL]        = CMAC_TBL_BASE_ADDR,
+       [RTW89_MAC_MEM_ADDR_CAM]        = ADDR_CAM_BASE_ADDR,
+       [RTW89_MAC_MEM_BA_CAM]          = BA_CAM_BASE_ADDR,
+       [RTW89_MAC_MEM_BCN_IE_CAM0]     = BCN_IE_CAM0_BASE_ADDR,
+       [RTW89_MAC_MEM_BCN_IE_CAM1]     = BCN_IE_CAM1_BASE_ADDR,
+       [RTW89_MAC_MEM_TXD_FIFO_0]      = TXD_FIFO_0_BASE_ADDR,
+       [RTW89_MAC_MEM_TXD_FIFO_1]      = TXD_FIFO_1_BASE_ADDR,
+       [RTW89_MAC_MEM_TXDATA_FIFO_0]   = TXDATA_FIFO_0_BASE_ADDR,
+       [RTW89_MAC_MEM_TXDATA_FIFO_1]   = TXDATA_FIFO_1_BASE_ADDR,
+};
+
 int rtw89_mac_check_mac_en(struct rtw89_dev *rtwdev, u8 mac_idx,
                           enum rtw89_mac_hwmod_sel sel)
 {
index b797667c78c6fc236d5e25e7ee79b26a5fe7491f..fdc5ded23fde3f3a5a9725467583b0b74d3aba7e 100644 (file)
@@ -273,6 +273,8 @@ enum rtw89_mac_mem_sel {
        RTW89_MAC_MEM_INVALID = RTW89_MAC_MEM_LAST,
 };
 
+extern const u32 rtw89_mac_mem_base_addrs[];
+
 enum rtw89_rpwm_req_pwr_state {
        RTW89_MAC_RPWM_REQ_PWR_STATE_ACTIVE = 0,
        RTW89_MAC_RPWM_REQ_PWR_STATE_BAND0_RFON = 1,