net: ethernet: mtk_wed: move mem_region array out of mtk_wed_mcu_load_firmware
Remove mtk_wed_wo_memory_region boot structure in mtk_wed_wo. This is a preliminary patch to introduce WED support for MT7988 SoC. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
ff0ea57fa3
commit
c6d961aeaa
2 changed files with 18 additions and 20 deletions
|
@ -16,14 +16,30 @@
|
||||||
#include "mtk_wed_wo.h"
|
#include "mtk_wed_wo.h"
|
||||||
#include "mtk_wed.h"
|
#include "mtk_wed.h"
|
||||||
|
|
||||||
|
static struct mtk_wed_wo_memory_region mem_region[] = {
|
||||||
|
[MTK_WED_WO_REGION_EMI] = {
|
||||||
|
.name = "wo-emi",
|
||||||
|
},
|
||||||
|
[MTK_WED_WO_REGION_ILM] = {
|
||||||
|
.name = "wo-ilm",
|
||||||
|
},
|
||||||
|
[MTK_WED_WO_REGION_DATA] = {
|
||||||
|
.name = "wo-data",
|
||||||
|
.shared = true,
|
||||||
|
},
|
||||||
|
[MTK_WED_WO_REGION_BOOT] = {
|
||||||
|
.name = "wo-boot",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
static u32 wo_r32(struct mtk_wed_wo *wo, u32 reg)
|
static u32 wo_r32(struct mtk_wed_wo *wo, u32 reg)
|
||||||
{
|
{
|
||||||
return readl(wo->boot.addr + reg);
|
return readl(mem_region[MTK_WED_WO_REGION_BOOT].addr + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wo_w32(struct mtk_wed_wo *wo, u32 reg, u32 val)
|
static void wo_w32(struct mtk_wed_wo *wo, u32 reg, u32 val)
|
||||||
{
|
{
|
||||||
writel(val, wo->boot.addr + reg);
|
writel(val, mem_region[MTK_WED_WO_REGION_BOOT].addr + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sk_buff *
|
static struct sk_buff *
|
||||||
|
@ -294,18 +310,6 @@ next:
|
||||||
static int
|
static int
|
||||||
mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
||||||
{
|
{
|
||||||
static struct mtk_wed_wo_memory_region mem_region[] = {
|
|
||||||
[MTK_WED_WO_REGION_EMI] = {
|
|
||||||
.name = "wo-emi",
|
|
||||||
},
|
|
||||||
[MTK_WED_WO_REGION_ILM] = {
|
|
||||||
.name = "wo-ilm",
|
|
||||||
},
|
|
||||||
[MTK_WED_WO_REGION_DATA] = {
|
|
||||||
.name = "wo-data",
|
|
||||||
.shared = true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const struct mtk_wed_fw_trailer *trailer;
|
const struct mtk_wed_fw_trailer *trailer;
|
||||||
const struct firmware *fw;
|
const struct firmware *fw;
|
||||||
const char *fw_name;
|
const char *fw_name;
|
||||||
|
@ -319,11 +323,6 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
wo->boot.name = "wo-boot";
|
|
||||||
ret = mtk_wed_get_memory_region(wo, &wo->boot);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* set dummy cr */
|
/* set dummy cr */
|
||||||
wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL,
|
wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL,
|
||||||
wo->hw->index + 1);
|
wo->hw->index + 1);
|
||||||
|
|
|
@ -228,7 +228,6 @@ struct mtk_wed_wo_queue {
|
||||||
|
|
||||||
struct mtk_wed_wo {
|
struct mtk_wed_wo {
|
||||||
struct mtk_wed_hw *hw;
|
struct mtk_wed_hw *hw;
|
||||||
struct mtk_wed_wo_memory_region boot;
|
|
||||||
|
|
||||||
struct mtk_wed_wo_queue q_tx;
|
struct mtk_wed_wo_queue q_tx;
|
||||||
struct mtk_wed_wo_queue q_rx;
|
struct mtk_wed_wo_queue q_rx;
|
||||||
|
|
Loading…
Add table
Reference in a new issue