1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Mon, 18 Sep 2023 12:29:09 +0200
3 Subject: [PATCH] net: ethernet: mtk_wed: move mem_region array out of
4 mtk_wed_mcu_load_firmware
6 Remove mtk_wed_wo_memory_region boot structure in mtk_wed_wo.
7 This is a preliminary patch to introduce WED support for MT7988 SoC.
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
13 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
16 #include "mtk_wed_wo.h"
19 +static struct mtk_wed_wo_memory_region mem_region[] = {
20 + [MTK_WED_WO_REGION_EMI] = {
23 + [MTK_WED_WO_REGION_ILM] = {
26 + [MTK_WED_WO_REGION_DATA] = {
30 + [MTK_WED_WO_REGION_BOOT] = {
35 static u32 wo_r32(struct mtk_wed_wo *wo, u32 reg)
37 - return readl(wo->boot.addr + reg);
38 + return readl(mem_region[MTK_WED_WO_REGION_BOOT].addr + reg);
41 static void wo_w32(struct mtk_wed_wo *wo, u32 reg, u32 val)
43 - writel(val, wo->boot.addr + reg);
44 + writel(val, mem_region[MTK_WED_WO_REGION_BOOT].addr + reg);
47 static struct sk_buff *
48 @@ -294,18 +310,6 @@ next:
50 mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
52 - static struct mtk_wed_wo_memory_region mem_region[] = {
53 - [MTK_WED_WO_REGION_EMI] = {
56 - [MTK_WED_WO_REGION_ILM] = {
59 - [MTK_WED_WO_REGION_DATA] = {
64 const struct mtk_wed_fw_trailer *trailer;
65 const struct firmware *fw;
67 @@ -319,11 +323,6 @@ mtk_wed_mcu_load_firmware(struct mtk_wed
71 - wo->boot.name = "wo-boot";
72 - ret = mtk_wed_get_memory_region(wo, &wo->boot);
77 wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL,
79 --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
80 +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
81 @@ -228,7 +228,6 @@ struct mtk_wed_wo_queue {
84 struct mtk_wed_hw *hw;
85 - struct mtk_wed_wo_memory_region boot;
87 struct mtk_wed_wo_queue q_tx;
88 struct mtk_wed_wo_queue q_rx;