* [PATCH] remoteproc/mediatek: enable MPU for all memory regions in MT8192 SCP
@ 2020-12-14 5:10 Tzung-Bi Shih
2021-01-06 23:18 ` Mathieu Poirier
0 siblings, 1 reply; 2+ messages in thread
From: Tzung-Bi Shih @ 2020-12-14 5:10 UTC (permalink / raw)
To: ohad, bjorn.andersson
Cc: linux-remoteproc, matthias.bgg, linux-mediatek, tzungbi
Enables MPU for all memory regions in MT8192 SCP.
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
drivers/remoteproc/mtk_common.h | 1 +
drivers/remoteproc/mtk_scp.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
index 94bc54b224ee..5f7cd2336cef 100644
--- a/drivers/remoteproc/mtk_common.h
+++ b/drivers/remoteproc/mtk_common.h
@@ -47,6 +47,7 @@
#define MT8192_CORE0_SW_RSTN_CLR 0x10000
#define MT8192_CORE0_SW_RSTN_SET 0x10004
+#define MT8192_CORE0_MEM_ATT_PREDEF 0x10008
#define MT8192_CORE0_WDT_CFG 0x10034
#define SCP_FW_VER_LEN 32
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index f025aba67abc..130c0b9511df 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -369,6 +369,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
mt8192_power_on_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
mt8192_power_on_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
+ /* enable MPU for all memory regions */
+ writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
+
return 0;
}
--
2.29.2.684.gfbc64c5ab5-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] remoteproc/mediatek: enable MPU for all memory regions in MT8192 SCP
2020-12-14 5:10 [PATCH] remoteproc/mediatek: enable MPU for all memory regions in MT8192 SCP Tzung-Bi Shih
@ 2021-01-06 23:18 ` Mathieu Poirier
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2021-01-06 23:18 UTC (permalink / raw)
To: Tzung-Bi Shih
Cc: ohad, bjorn.andersson, linux-remoteproc, matthias.bgg,
linux-mediatek
On Mon, Dec 14, 2020 at 01:10:47PM +0800, Tzung-Bi Shih wrote:
> Enables MPU for all memory regions in MT8192 SCP.
Ok but how was it working before this patch? Why is this suddently needed? A
changelog that explains all this would certainly be appreciated.
Thanks,
Mathieu
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> ---
> drivers/remoteproc/mtk_common.h | 1 +
> drivers/remoteproc/mtk_scp.c | 3 +++
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
> index 94bc54b224ee..5f7cd2336cef 100644
> --- a/drivers/remoteproc/mtk_common.h
> +++ b/drivers/remoteproc/mtk_common.h
> @@ -47,6 +47,7 @@
>
> #define MT8192_CORE0_SW_RSTN_CLR 0x10000
> #define MT8192_CORE0_SW_RSTN_SET 0x10004
> +#define MT8192_CORE0_MEM_ATT_PREDEF 0x10008
> #define MT8192_CORE0_WDT_CFG 0x10034
>
> #define SCP_FW_VER_LEN 32
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index f025aba67abc..130c0b9511df 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -369,6 +369,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
> mt8192_power_on_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
> mt8192_power_on_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
>
> + /* enable MPU for all memory regions */
> + writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
> +
> return 0;
> }
>
> --
> 2.29.2.684.gfbc64c5ab5-goog
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-06 23:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-14 5:10 [PATCH] remoteproc/mediatek: enable MPU for all memory regions in MT8192 SCP Tzung-Bi Shih
2021-01-06 23:18 ` Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox