mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] Add MediaTek APU SMC call Definition
@ 2024-10-24  9:27 Karl.Li
  2024-10-24  9:27 ` [PATCH 1/1] soc: mediatek: Add command for APU SMC call Karl.Li
  0 siblings, 1 reply; 3+ messages in thread
From: Karl.Li @ 2024-10-24  9:27 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, Karl Li,
	Chungying Lu, Project_Global_Chrome_Upstream_Group, Karl Li

From: Karl Li <karl.li@mediatek.com>

Based on tag: next-20241021, linux-next/master

Hello,

This patch introduces the SMC calls for MediaTek APU.

The start and stop sequences of the APU microprocessor are managed within the ARM Trusted Firmware (ATF), which requires a secure and reliable communication channel to issue commands from the non-secure world. This patch adds the necessary infrastructure to issue these SMC calls, ensuring that the APU can be securely managed by the system's software.

Please review and provide feedback.

Best regards

Karl Li (1):
  soc: mediatek: Add command for APU SMC call

 include/linux/soc/mediatek/mtk_apu_secure.h | 32 +++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 include/linux/soc/mediatek/mtk_apu_secure.h

-- 
2.18.0


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

* [PATCH 1/1] soc: mediatek: Add command for APU SMC call
  2024-10-24  9:27 [PATCH 0/1] Add MediaTek APU SMC call Definition Karl.Li
@ 2024-10-24  9:27 ` Karl.Li
  2024-10-24 10:27   ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 3+ messages in thread
From: Karl.Li @ 2024-10-24  9:27 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, Karl Li,
	Chungying Lu, Project_Global_Chrome_Upstream_Group, Karl Li

From: Karl Li <karl.li@mediatek.com>

Add command for APU SMC call.
The APU microprocess's start and stop sequence will process in ATF.

Signed-off-by: Karl Li <karl.li@mediatek.com>
---
 include/linux/soc/mediatek/mtk_apu_secure.h | 32 +++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 include/linux/soc/mediatek/mtk_apu_secure.h

diff --git a/include/linux/soc/mediatek/mtk_apu_secure.h b/include/linux/soc/mediatek/mtk_apu_secure.h
new file mode 100644
index 000000000000..ea491bc24adb
--- /dev/null
+++ b/include/linux/soc/mediatek/mtk_apu_secure.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2024 MediaTek Inc.
+ */
+
+#ifndef __MTK_APU_SECURE_H__
+#define __MTK_APU_SECURE_H__
+
+enum mtk_apusys_kernel_op {
+	MTK_APUSYS_KERNEL_OP_APUSYS_PWR_TOP_ON,			/*  0 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_PWR_TOP_OFF,		/*  1 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_REVISER,		/*  2 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_RESET_MP,		/*  3 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_BOOT,		/*  4 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_START_MP,		/*  5 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_STOP_MP,			/*  6 */
+	MTK_APUSYS_KERNEL_OP_DEVAPC_INIT_RCX,			/*  7 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_SEC_MEM,		/*  8 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_DISABLE_WDT_ISR,		/*  9 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CLEAR_WDT_ISR,		/* 10 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CG_GATING,		/* 11 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CG_UNGATING,		/* 12 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_APUMMU,		/* 13 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_DUMP,		/* 14 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_WRITE,		/* 15 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_W1C,		/* 16 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_COLD_BOOT_CLR_MBOX_DUMMY,	/* 17 */
+	MTK_APUSYS_KERNEL_OP_APUSYS_SETUP_CE_BIN,		/* 18 */
+	MTK_APUSYS_KERNEL_OP_NUM,
+};
+
+#endif
-- 
2.18.0


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

* Re: [PATCH 1/1] soc: mediatek: Add command for APU SMC call
  2024-10-24  9:27 ` [PATCH 1/1] soc: mediatek: Add command for APU SMC call Karl.Li
@ 2024-10-24 10:27   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-10-24 10:27 UTC (permalink / raw)
  To: Karl.Li, Matthias Brugger
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, Chungying Lu,
	Project_Global_Chrome_Upstream_Group

Il 24/10/24 11:27, Karl.Li ha scritto:
> From: Karl Li <karl.li@mediatek.com>
> 
> Add command for APU SMC call.
> The APU microprocess's start and stop sequence will process in ATF.
> 
> Signed-off-by: Karl Li <karl.li@mediatek.com>
> ---
>   include/linux/soc/mediatek/mtk_apu_secure.h | 32 +++++++++++++++++++++

This is firmware stuff!

Please move this file to
include/linux/firmware/mediatek/apu.h or apusys.h

If you expect that the APU will *never* have any non-secure commands, then you
can add the "-secure" suffix (apu-secure.h) - but if there will ever be any
commands that aren't secured, you should not call it xxxx-secure.h

>   1 file changed, 32 insertions(+)
>   create mode 100644 include/linux/soc/mediatek/mtk_apu_secure.h
> 
> diff --git a/include/linux/soc/mediatek/mtk_apu_secure.h b/include/linux/soc/mediatek/mtk_apu_secure.h
> new file mode 100644
> index 000000000000..ea491bc24adb
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk_apu_secure.h
> @@ -0,0 +1,32 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (c) 2024 MediaTek Inc.
> + */
> +
> +#ifndef __MTK_APU_SECURE_H__
> +#define __MTK_APU_SECURE_H__

Please, __MTK --> __MEDIATEK (also because the folder is called "mediatek", anyway)

> +
> +enum mtk_apusys_kernel_op {

here you can keep the prefix as mtk_

> +	MTK_APUSYS_KERNEL_OP_APUSYS_PWR_TOP_ON,			/*  0 */

and MTK_ is ok for those definitions too.

Cheers,
Angelo

> +	MTK_APUSYS_KERNEL_OP_APUSYS_PWR_TOP_OFF,		/*  1 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_REVISER,		/*  2 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_RESET_MP,		/*  3 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_BOOT,		/*  4 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_START_MP,		/*  5 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_STOP_MP,			/*  6 */
> +	MTK_APUSYS_KERNEL_OP_DEVAPC_INIT_RCX,			/*  7 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_SEC_MEM,		/*  8 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_DISABLE_WDT_ISR,		/*  9 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CLEAR_WDT_ISR,		/* 10 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CG_GATING,		/* 11 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_CG_UNGATING,		/* 12 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_RV_SETUP_APUMMU,		/* 13 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_DUMP,		/* 14 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_WRITE,		/* 15 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_LOGTOP_REG_W1C,		/* 16 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_COLD_BOOT_CLR_MBOX_DUMMY,	/* 17 */
> +	MTK_APUSYS_KERNEL_OP_APUSYS_SETUP_CE_BIN,		/* 18 */
> +	MTK_APUSYS_KERNEL_OP_NUM,
> +};
> +
> +#endif



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

end of thread, other threads:[~2024-10-24 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-24  9:27 [PATCH 0/1] Add MediaTek APU SMC call Definition Karl.Li
2024-10-24  9:27 ` [PATCH 1/1] soc: mediatek: Add command for APU SMC call Karl.Li
2024-10-24 10:27   ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®