All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Stanley Chu <stanley.chu@mediatek.com>,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	avri.altman@wdc.com, alim.akhtar@samsung.com,
	pedrom.sousa@synopsys.com, jejb@linux.ibm.com,
	matthias.bgg@gmail.com
Cc: linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, beanhuo@micron.com,
	kuohong.wang@mediatek.com, peter.wang@mediatek.com,
	chun-hung.wu@mediatek.com, andy.teng@mediatek.com,
	leon.chen@mediatek.com
Subject: Re: [PATCH v1 1/2] soc: mediatek: add header for SiP service interface
Date: Sat, 7 Dec 2019 09:40:50 -0800	[thread overview]
Message-ID: <b3c568f1-d57b-f3f3-b1da-4b312c595fc8@gmail.com> (raw)
In-Reply-To: <1575700748-28191-2-git-send-email-stanley.chu@mediatek.com>



On 12/6/2019 10:39 PM, Stanley Chu wrote:
> Add a header for the SiP service interface defined to access
> the UFSHCI controller handling secure commands in MediaTek Chipsets.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
>  include/linux/soc/mediatek/mtk_sip_svc.h | 26 ++++++++++++++++++++++++
>  1 file changed, 26 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..7b69aa06f58d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk_sip_svc.h
> @@ -0,0 +1,26 @@
> +/* 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_AARCH_BIT           0x40000000
> +#else
> +#define MTK_SIP_SMC_AARCH_BIT           0x00000000
> +#endif

Cannot you use the definitions from include/linux/arm-smccc.h and use
ARM_SMCCC_CALL_CONV_SHIFT here and associated helpers?

> +
> +/* UFS related SMC call */
> +#define MTK_SIP_UFS_CONTROL \
> +	(0x82000276 | MTK_SIP_SMC_AARCH_BIT)

Does bit 31 map to the fast vs. slow call of the ARM SMCCC convention or
does it have a different meaning (should not). Likewise bit 25 would be
ARM_SMMCCC_OWNER_SIP no?

That would leave us with only 0x276 which is a valid function number.
-- 
Florian

WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com>
To: Stanley Chu <stanley.chu@mediatek.com>,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	avri.altman@wdc.com, alim.akhtar@samsung.com,
	pedrom.sousa@synopsys.com, jejb@linux.ibm.com,
	matthias.bgg@gmail.com
Cc: leon.chen@mediatek.com, andy.teng@mediatek.com,
	chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	peter.wang@mediatek.com, linux-arm-kernel@lists.infradead.org,
	beanhuo@micron.com
Subject: Re: [PATCH v1 1/2] soc: mediatek: add header for SiP service interface
Date: Sat, 7 Dec 2019 09:40:50 -0800	[thread overview]
Message-ID: <b3c568f1-d57b-f3f3-b1da-4b312c595fc8@gmail.com> (raw)
In-Reply-To: <1575700748-28191-2-git-send-email-stanley.chu@mediatek.com>



On 12/6/2019 10:39 PM, Stanley Chu wrote:
> Add a header for the SiP service interface defined to access
> the UFSHCI controller handling secure commands in MediaTek Chipsets.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
>  include/linux/soc/mediatek/mtk_sip_svc.h | 26 ++++++++++++++++++++++++
>  1 file changed, 26 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..7b69aa06f58d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk_sip_svc.h
> @@ -0,0 +1,26 @@
> +/* 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_AARCH_BIT           0x40000000
> +#else
> +#define MTK_SIP_SMC_AARCH_BIT           0x00000000
> +#endif

Cannot you use the definitions from include/linux/arm-smccc.h and use
ARM_SMCCC_CALL_CONV_SHIFT here and associated helpers?

> +
> +/* UFS related SMC call */
> +#define MTK_SIP_UFS_CONTROL \
> +	(0x82000276 | MTK_SIP_SMC_AARCH_BIT)

Does bit 31 map to the fast vs. slow call of the ARM SMCCC convention or
does it have a different meaning (should not). Likewise bit 25 would be
ARM_SMMCCC_OWNER_SIP no?

That would leave us with only 0x276 which is a valid function number.
-- 
Florian

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <f.fainelli@gmail.com>
To: Stanley Chu <stanley.chu@mediatek.com>,
	linux-scsi@vger.kernel.org, martin.petersen@oracle.com,
	avri.altman@wdc.com, alim.akhtar@samsung.com,
	pedrom.sousa@synopsys.com, jejb@linux.ibm.com,
	matthias.bgg@gmail.com
Cc: leon.chen@mediatek.com, andy.teng@mediatek.com,
	chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	peter.wang@mediatek.com, linux-arm-kernel@lists.infradead.org,
	beanhuo@micron.com
Subject: Re: [PATCH v1 1/2] soc: mediatek: add header for SiP service interface
Date: Sat, 7 Dec 2019 09:40:50 -0800	[thread overview]
Message-ID: <b3c568f1-d57b-f3f3-b1da-4b312c595fc8@gmail.com> (raw)
In-Reply-To: <1575700748-28191-2-git-send-email-stanley.chu@mediatek.com>



On 12/6/2019 10:39 PM, Stanley Chu wrote:
> Add a header for the SiP service interface defined to access
> the UFSHCI controller handling secure commands in MediaTek Chipsets.
> 
> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
> ---
>  include/linux/soc/mediatek/mtk_sip_svc.h | 26 ++++++++++++++++++++++++
>  1 file changed, 26 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..7b69aa06f58d
> --- /dev/null
> +++ b/include/linux/soc/mediatek/mtk_sip_svc.h
> @@ -0,0 +1,26 @@
> +/* 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_AARCH_BIT           0x40000000
> +#else
> +#define MTK_SIP_SMC_AARCH_BIT           0x00000000
> +#endif

Cannot you use the definitions from include/linux/arm-smccc.h and use
ARM_SMCCC_CALL_CONV_SHIFT here and associated helpers?

> +
> +/* UFS related SMC call */
> +#define MTK_SIP_UFS_CONTROL \
> +	(0x82000276 | MTK_SIP_SMC_AARCH_BIT)

Does bit 31 map to the fast vs. slow call of the ARM SMCCC convention or
does it have a different meaning (should not). Likewise bit 25 would be
ARM_SMMCCC_OWNER_SIP no?

That would leave us with only 0x276 which is a valid function number.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-12-07 17:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-07  6:39 [PATCH v1 0/2] scsi: ufs-mediatek: add device reset implementation Stanley Chu
2019-12-07  6:39 ` Stanley Chu
2019-12-07  6:39 ` Stanley Chu
2019-12-07  6:39 ` [PATCH v1 1/2] soc: mediatek: add header for SiP service interface Stanley Chu
2019-12-07  6:39   ` Stanley Chu
2019-12-07  6:39   ` Stanley Chu
2019-12-07 17:40   ` Florian Fainelli [this message]
2019-12-07 17:40     ` Florian Fainelli
2019-12-07 17:40     ` Florian Fainelli
2019-12-08  5:37     ` Stanley Chu
2019-12-08  5:37       ` Stanley Chu
2019-12-08  5:37       ` Stanley Chu
2019-12-07  6:39 ` [PATCH v1 2/2] scsi: ufs-mediatek: add device reset implementation Stanley Chu
2019-12-07  6:39   ` Stanley Chu
2019-12-07  6:39   ` Stanley Chu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3c568f1-d57b-f3f3-b1da-4b312c595fc8@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andy.teng@mediatek.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=kuohong.wang@mediatek.com \
    --cc=leon.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=pedrom.sousa@synopsys.com \
    --cc=peter.wang@mediatek.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.