linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP
@ 2021-03-17  3:43 Tzung-Bi Shih
  2021-03-17 19:14 ` Bjorn Andersson
  0 siblings, 1 reply; 4+ messages in thread
From: Tzung-Bi Shih @ 2021-03-17  3:43 UTC (permalink / raw)
  To: ohad, bjorn.andersson
  Cc: linux-remoteproc, matthias.bgg, linux-mediatek, tzungbi, Tinghan Shen

DEVAPC (device access permission control) is a MPU (memory protection
unit) in MT8192.

To restrict SCP accesses to a specific memory range, sets SCP to DEVAPC
domain 3.  ATF (Arm trusted firmware) should setup memory range for the
domain.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
 drivers/remoteproc/mtk_common.h | 2 ++
 drivers/remoteproc/mtk_scp.c    | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
index 61901f5efa05..2aa9fdf5e59b 100644
--- a/drivers/remoteproc/mtk_common.h
+++ b/drivers/remoteproc/mtk_common.h
@@ -51,6 +51,8 @@
 #define MT8192_CORE0_WDT_IRQ		0x10030
 #define MT8192_CORE0_WDT_CFG		0x10034
 
+#define MT8192_SCP_DEVAPC_DOMAIN	0x85080
+
 #define SCP_FW_VER_LEN			32
 #define SCP_SHARE_BUFFER_SIZE		288
 
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 9679cc26895e..50bdec5a97e3 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -374,6 +374,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
 	/* enable MPU for all memory regions */
 	writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
 
+	/* set to DEVAPC (device access permission control) domain 3 */
+	writel(3, scp->reg_base + MT8192_SCP_DEVAPC_DOMAIN);
+
 	return 0;
 }
 
-- 
2.31.0.rc2.261.g7f71774620-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP
  2021-03-17  3:43 [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP Tzung-Bi Shih
@ 2021-03-17 19:14 ` Bjorn Andersson
  2021-03-18  1:27   ` Tzung-Bi Shih
  0 siblings, 1 reply; 4+ messages in thread
From: Bjorn Andersson @ 2021-03-17 19:14 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: ohad, linux-remoteproc, matthias.bgg, linux-mediatek, Tinghan Shen

On Tue 16 Mar 22:43 CDT 2021, Tzung-Bi Shih wrote:

> DEVAPC (device access permission control) is a MPU (memory protection
> unit) in MT8192.
> 
> To restrict SCP accesses to a specific memory range, sets SCP to DEVAPC
> domain 3.  ATF (Arm trusted firmware) should setup memory range for the
> domain.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>

As written here Tinghan is the author of the commit, but the author of
the patch is Tzung-Bi. Please resolve this.

Regards,
Bjorn

> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> ---
>  drivers/remoteproc/mtk_common.h | 2 ++
>  drivers/remoteproc/mtk_scp.c    | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
> index 61901f5efa05..2aa9fdf5e59b 100644
> --- a/drivers/remoteproc/mtk_common.h
> +++ b/drivers/remoteproc/mtk_common.h
> @@ -51,6 +51,8 @@
>  #define MT8192_CORE0_WDT_IRQ		0x10030
>  #define MT8192_CORE0_WDT_CFG		0x10034
>  
> +#define MT8192_SCP_DEVAPC_DOMAIN	0x85080
> +
>  #define SCP_FW_VER_LEN			32
>  #define SCP_SHARE_BUFFER_SIZE		288
>  
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 9679cc26895e..50bdec5a97e3 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -374,6 +374,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
>  	/* enable MPU for all memory regions */
>  	writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
>  
> +	/* set to DEVAPC (device access permission control) domain 3 */
> +	writel(3, scp->reg_base + MT8192_SCP_DEVAPC_DOMAIN);
> +
>  	return 0;
>  }
>  
> -- 
> 2.31.0.rc2.261.g7f71774620-goog
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP
  2021-03-17 19:14 ` Bjorn Andersson
@ 2021-03-18  1:27   ` Tzung-Bi Shih
  2021-03-18  1:33     ` Bjorn Andersson
  0 siblings, 1 reply; 4+ messages in thread
From: Tzung-Bi Shih @ 2021-03-18  1:27 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Ohad Ben-Cohen,
	open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM,
	Matthias Brugger, moderated list:ARM/Mediatek SoC support,
	Tinghan Shen

On Thu, Mar 18, 2021 at 3:14 AM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>
> On Tue 16 Mar 22:43 CDT 2021, Tzung-Bi Shih wrote:
>
> > DEVAPC (device access permission control) is a MPU (memory protection
> > unit) in MT8192.
> >
> > To restrict SCP accesses to a specific memory range, sets SCP to DEVAPC
> > domain 3.  ATF (Arm trusted firmware) should setup memory range for the
> > domain.
> >
> > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
>
> As written here Tinghan is the author of the commit, but the author of
> the patch is Tzung-Bi. Please resolve this.

Tinghan is the co-author of the patch.  Added "Co-developed-by" tag in v2[1].

[1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20210318012416.2816574-1-tzungbi@google.com/

>
> Regards,
> Bjorn
>
> > Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> > ---
> >  drivers/remoteproc/mtk_common.h | 2 ++
> >  drivers/remoteproc/mtk_scp.c    | 3 +++
> >  2 files changed, 5 insertions(+)
> >
> > diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
> > index 61901f5efa05..2aa9fdf5e59b 100644
> > --- a/drivers/remoteproc/mtk_common.h
> > +++ b/drivers/remoteproc/mtk_common.h
> > @@ -51,6 +51,8 @@
> >  #define MT8192_CORE0_WDT_IRQ         0x10030
> >  #define MT8192_CORE0_WDT_CFG         0x10034
> >
> > +#define MT8192_SCP_DEVAPC_DOMAIN     0x85080
> > +
> >  #define SCP_FW_VER_LEN                       32
> >  #define SCP_SHARE_BUFFER_SIZE                288
> >
> > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> > index 9679cc26895e..50bdec5a97e3 100644
> > --- a/drivers/remoteproc/mtk_scp.c
> > +++ b/drivers/remoteproc/mtk_scp.c
> > @@ -374,6 +374,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
> >       /* enable MPU for all memory regions */
> >       writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
> >
> > +     /* set to DEVAPC (device access permission control) domain 3 */
> > +     writel(3, scp->reg_base + MT8192_SCP_DEVAPC_DOMAIN);
> > +
> >       return 0;
> >  }
> >
> > --
> > 2.31.0.rc2.261.g7f71774620-goog
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP
  2021-03-18  1:27   ` Tzung-Bi Shih
@ 2021-03-18  1:33     ` Bjorn Andersson
  0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2021-03-18  1:33 UTC (permalink / raw)
  To: Tzung-Bi Shih
  Cc: Ohad Ben-Cohen,
	open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM,
	Matthias Brugger, moderated list:ARM/Mediatek SoC support,
	Tinghan Shen

On Wed 17 Mar 20:27 CDT 2021, Tzung-Bi Shih wrote:

> On Thu, Mar 18, 2021 at 3:14 AM Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >
> > On Tue 16 Mar 22:43 CDT 2021, Tzung-Bi Shih wrote:
> >
> > > DEVAPC (device access permission control) is a MPU (memory protection
> > > unit) in MT8192.
> > >
> > > To restrict SCP accesses to a specific memory range, sets SCP to DEVAPC
> > > domain 3.  ATF (Arm trusted firmware) should setup memory range for the
> > > domain.
> > >
> > > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> >
> > As written here Tinghan is the author of the commit, but the author of
> > the patch is Tzung-Bi. Please resolve this.
> 
> Tinghan is the co-author of the patch.  Added "Co-developed-by" tag in v2[1].
> 

Perfect, thank you!

> [1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20210318012416.2816574-1-tzungbi@google.com/
> 
> >
> > Regards,
> > Bjorn
> >
> > > Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
> > > ---
> > >  drivers/remoteproc/mtk_common.h | 2 ++
> > >  drivers/remoteproc/mtk_scp.c    | 3 +++
> > >  2 files changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h
> > > index 61901f5efa05..2aa9fdf5e59b 100644
> > > --- a/drivers/remoteproc/mtk_common.h
> > > +++ b/drivers/remoteproc/mtk_common.h
> > > @@ -51,6 +51,8 @@
> > >  #define MT8192_CORE0_WDT_IRQ         0x10030
> > >  #define MT8192_CORE0_WDT_CFG         0x10034
> > >
> > > +#define MT8192_SCP_DEVAPC_DOMAIN     0x85080
> > > +
> > >  #define SCP_FW_VER_LEN                       32
> > >  #define SCP_SHARE_BUFFER_SIZE                288
> > >
> > > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> > > index 9679cc26895e..50bdec5a97e3 100644
> > > --- a/drivers/remoteproc/mtk_scp.c
> > > +++ b/drivers/remoteproc/mtk_scp.c
> > > @@ -374,6 +374,9 @@ static int mt8192_scp_before_load(struct mtk_scp *scp)
> > >       /* enable MPU for all memory regions */
> > >       writel(0xff, scp->reg_base + MT8192_CORE0_MEM_ATT_PREDEF);
> > >
> > > +     /* set to DEVAPC (device access permission control) domain 3 */
> > > +     writel(3, scp->reg_base + MT8192_SCP_DEVAPC_DOMAIN);
> > > +
> > >       return 0;
> > >  }
> > >
> > > --
> > > 2.31.0.rc2.261.g7f71774620-goog
> > >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-18  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17  3:43 [PATCH] remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP Tzung-Bi Shih
2021-03-17 19:14 ` Bjorn Andersson
2021-03-18  1:27   ` Tzung-Bi Shih
2021-03-18  1:33     ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).