Skip to contentSkip to conversation

remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP

PATCH Superseded Tzung-Bi Shih 2 participants 4 messages Mar 17, 2021 – Mar 18, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc/mediatek: set to DEVAPC domain 3 for MT8192 SCP

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.

---
 drivers/remoteproc/mtk_common.h | 2 ++
 drivers/remoteproc/mtk_scp.c    | 3 +++
 2 files changed, 5 insertions(+)
drivers/remoteproc/mtk_common.h +2 -0
index 61901f5efa05..2aa9fdf5e59b 100644
@@ -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
 
drivers/remoteproc/mtk_scp.c +3 -0
index 9679cc26895e..50bdec5a97e3 100644
@@ -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;
 }
 
Signature · 7 lines
2.31.0.rc2.261.g7f71774620-goog


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw
Quoted 8 lines · Tzung-Bi Shih

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.

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

Regards,
Bjorn

Quoted 36 lines
---
 drivers/remoteproc/mtk_common.h | 2 ++
 drivers/remoteproc/mtk_scp.c    | 3 +++
 2 files changed, 5 insertions(+)
drivers/remoteproc/mtk_common.h +2 -0
index 61901f5efa05..2aa9fdf5e59b 100644
@@ -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
 
drivers/remoteproc/mtk_scp.c +3 -0
index 9679cc26895e..50bdec5a97e3 100644
@@ -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;
 }
 
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#2 lore raw
Quoted 6 lines · Bjorn Andersson
Quoted 3 lines · Tzung-Bi Shih

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

Quoted 8 lines
Quoted 5 lines

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.

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/[email protected]/

Quoted 37 lines

Regards,
Bjorn

Quoted 33 lines
---
 drivers/remoteproc/mtk_common.h | 2 ++
 drivers/remoteproc/mtk_scp.c    | 3 +++
 2 files changed, 5 insertions(+)
drivers/remoteproc/mtk_common.h +2 -0
index 61901f5efa05..2aa9fdf5e59b 100644
@@ -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
 
drivers/remoteproc/mtk_scp.c +3 -0
index 9679cc26895e..50bdec5a97e3 100644
@@ -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;
 }
 
Quoted 3 lines
Quoted 3 lines

--
2.31.0.rc2.261.g7f71774620-goog

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

#3 lore raw
Quoted 12 lines · Tzung-Bi Shih
Quoted 10 lines · Bjorn Andersson
Quoted 7 lines · Tzung-Bi Shih

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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!

Quoted 42 lines

[1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/[email protected]/

Quoted 40 lines

Regards,
Bjorn

Quoted 36 lines
---
 drivers/remoteproc/mtk_common.h | 2 ++
 drivers/remoteproc/mtk_scp.c    | 3 +++
 2 files changed, 5 insertions(+)
drivers/remoteproc/mtk_common.h +2 -0
index 61901f5efa05..2aa9fdf5e59b 100644
@@ -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
 
drivers/remoteproc/mtk_scp.c +3 -1
index 9679cc26895e..50bdec5a97e3 100644
@@ -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