diff mbox series

[v2,1/2,RESEND] soc: mediatek: add header for SiP service interface

Message ID 1576468137-17220-2-git-send-email-stanley.chu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series scsi: ufs-mediatek: add device reset implementation | expand

Commit Message

Stanley Chu Dec. 16, 2019, 3:48 a.m. UTC
Add a header for the SiP service interface in order to access
the UFSHCI controller for secure command handling in MediaTek Chipsets.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 include/linux/soc/mediatek/mtk_sip_svc.h | 29 ++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 include/linux/soc/mediatek/mtk_sip_svc.h

Comments

Alim Akhtar Dec. 19, 2019, 6 p.m. UTC | #1
Hi

On Mon, Dec 16, 2019 at 9:19 AM Stanley Chu <stanley.chu@mediatek.com> wrote:
>
> Add a header for the SiP service interface in order to access
> the UFSHCI controller for secure command handling in MediaTek Chipsets.
>
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
>  include/linux/soc/mediatek/mtk_sip_svc.h | 29 ++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 include/linux/soc/mediatek/mtk_sip_svc.h
>
> diff --git a/include/linux/soc/mediatek/mtk_sip_svc.h b/include/linux/soc/mediatek/mtk_sip_svc.h
> new file mode 100644
> index 000000000000..97311959d7d7
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk_sip_svc.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (C) 2019 MediaTek Inc.
> + */
> +#ifndef __MTK_SIP_SVC_H
> +#define __MTK_SIP_SVC_H
> +
> +/* Error Code */
> +#define SIP_SVC_E_SUCCESS               0
> +#define SIP_SVC_E_NOT_SUPPORTED         -1
> +#define SIP_SVC_E_INVALID_PARAMS        -2
> +#define SIP_SVC_E_INVALID_RANGE         -3
> +#define SIP_SVC_E_PERMISSION_DENIED     -4
> +
> +#ifdef CONFIG_ARM64
> +#define MTK_SIP_SMC_CONVENTION          ARM_SMCCC_SMC_64
> +#else
> +#define MTK_SIP_SMC_CONVENTION          ARM_SMCCC_SMC_32
> +#endif
> +
> +#define MTK_SIP_SMC_CMD(fn_id) \
> +       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, MTK_SIP_SMC_CONVENTION, \
> +                          ARM_SMCCC_OWNER_SIP, fn_id)
> +
> +/* UFS related SMC call */
> +#define MTK_SIP_UFS_CONTROL \
> +       MTK_SIP_SMC_CMD(0x276)
> +
How about moving UFS specific stuff to MTK UFS driver and include this
header in driver file?
Rest looks fine.
> +#endif
> --
> 2.18.0
Stanley Chu Dec. 20, 2019, 1:15 a.m. UTC | #2
Hi Alim,

On Fri, 2019-12-20 at 02:00 +0800, Alim Akhtar wrote:
> > +/* UFS related SMC call */
> > +#define MTK_SIP_UFS_CONTROL \
> > +       MTK_SIP_SMC_CMD(0x276)
> > +
> How about moving UFS specific stuff to MTK UFS driver and include this
> header in driver file?
> Rest looks fine.

Thanks so much for your review.

Our intention is to collect all SMC call command types in MediaTek
Chipsets here for easier management.

This is the first time we show this header thus only UFS related stuff
is present here.

> > +#endif
> > --
> > 2.18.0
> 
> 

Thanks,
Stanley
Stanley Chu Dec. 25, 2019, 7:34 a.m. UTC | #3
Hi Alim,

Would you think below explanation is OK to you?

BTW, FYI, this series was combined to the new series "scsi: ufs: add
MediaTek vendor implementations" with this same patch in it.

Thanks,
Stanley


On Fri, 2019-12-20 at 09:15 +0800, Stanley Chu wrote:
> Hi Alim,
> 
> On Fri, 2019-12-20 at 02:00 +0800, Alim Akhtar wrote:
> > > +/* UFS related SMC call */
> > > +#define MTK_SIP_UFS_CONTROL \
> > > +       MTK_SIP_SMC_CMD(0x276)
> > > +
> > How about moving UFS specific stuff to MTK UFS driver and include this
> > header in driver file?
> > Rest looks fine.
> 
> Thanks so much for your review.
> 
> Our intention is to collect all SMC call command types in MediaTek
> Chipsets here for easier management.
> 
> This is the first time we show this header thus only UFS related stuff
> is present here.
> 
> > > +#endif
> > > --
> > > 2.18.0
> > 
> > 
> 
> Thanks,
> Stanley
>
Alim Akhtar Dec. 26, 2019, 8:40 a.m. UTC | #4
Hi Stanley,
Its ok, I will take a look in your new patch set soon.
Thanks

Regards,
Alim

> -----Original Message-----
> From: Stanley Chu <stanley.chu@mediatek.com>
> Sent: 25 December 2019 13:05
> To: Alim Akhtar <alim.akhtar@gmail.com>
> Cc: f.fainelli@gmail.com; linux-scsi@vger.kernel.org; Martin K. Petersen
> <martin.petersen@oracle.com>; Leon Chen (陳文鏘)
> <Leon.Chen@mediatek.com>; Andy Teng ($B{}G!9((B)
> <Andy.Teng@mediatek.com>; James E.J. Bottomley <jejb@linux.ibm.com>;
> Chun-Hung Wu (巫駿宏) <Chun-hung.Wu@mediatek.com>; Kuohong Wang (王
> 國鴻) <kuohong.wang@mediatek.com>; open list <linux-
> kernel@vger.kernel.org>; Avri Altman <avri.altman@wdc.com>; linux-
> mediatek@lists.infradead.org; Peter Wang (王信友)
> <peter.wang@mediatek.com>; Alim Akhtar <alim.akhtar@samsung.com>;
> Matthias Brugger <matthias.bgg@gmail.com>; Pedro Sousa
> <pedrom.sousa@synopsys.com>; linux-arm-kernel@lists.infradead.org; Bean
> Huo (beanhuo) <beanhuo@micron.com>
> Subject: Re: [PATCH v2 1/2 RESEND] soc: mediatek: add header for SiP service
> interface
> 
> Hi Alim,
> 
> Would you think below explanation is OK to you?
> 
> BTW, FYI, this series was combined to the new series "scsi: ufs: add MediaTek
> vendor implementations" with this same patch in it.
> 
> Thanks,
> Stanley
> 
> 
> On Fri, 2019-12-20 at 09:15 +0800, Stanley Chu wrote:
> > Hi Alim,
> >
> > On Fri, 2019-12-20 at 02:00 +0800, Alim Akhtar wrote:
> > > > +/* UFS related SMC call */
> > > > +#define MTK_SIP_UFS_CONTROL \
> > > > +       MTK_SIP_SMC_CMD(0x276)
> > > > +
> > > How about moving UFS specific stuff to MTK UFS driver and include
> > > this header in driver file?
> > > Rest looks fine.
> >
> > Thanks so much for your review.
> >
> > Our intention is to collect all SMC call command types in MediaTek
> > Chipsets here for easier management.
> >
> > This is the first time we show this header thus only UFS related stuff
> > is present here.
> >
> > > > +#endif
> > > > --
> > > > 2.18.0
> > >
> > >
> >
> > Thanks,
> > Stanley
> >
>
diff mbox series

Patch

diff --git a/include/linux/soc/mediatek/mtk_sip_svc.h b/include/linux/soc/mediatek/mtk_sip_svc.h
new file mode 100644
index 000000000000..97311959d7d7
--- /dev/null
+++ b/include/linux/soc/mediatek/mtk_sip_svc.h
@@ -0,0 +1,29 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 MediaTek Inc.
+ */
+#ifndef __MTK_SIP_SVC_H
+#define __MTK_SIP_SVC_H
+
+/* Error Code */
+#define SIP_SVC_E_SUCCESS               0
+#define SIP_SVC_E_NOT_SUPPORTED         -1
+#define SIP_SVC_E_INVALID_PARAMS        -2
+#define SIP_SVC_E_INVALID_RANGE         -3
+#define SIP_SVC_E_PERMISSION_DENIED     -4
+
+#ifdef CONFIG_ARM64
+#define MTK_SIP_SMC_CONVENTION          ARM_SMCCC_SMC_64
+#else
+#define MTK_SIP_SMC_CONVENTION          ARM_SMCCC_SMC_32
+#endif
+
+#define MTK_SIP_SMC_CMD(fn_id) \
+	ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, MTK_SIP_SMC_CONVENTION, \
+			   ARM_SMCCC_OWNER_SIP, fn_id)
+
+/* UFS related SMC call */
+#define MTK_SIP_UFS_CONTROL \
+	MTK_SIP_SMC_CMD(0x276)
+
+#endif