From patchwork Mon Dec 16 03:48:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 11293339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2E596C1 for ; Mon, 16 Dec 2019 03:49:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE4BC24680 for ; Mon, 16 Dec 2019 03:49:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Hcg4n26T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfLPDtI (ORCPT ); Sun, 15 Dec 2019 22:49:08 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:59019 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726784AbfLPDtH (ORCPT ); Sun, 15 Dec 2019 22:49:07 -0500 X-UUID: df0c230293fb41a081926df5560ca889-20191216 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=12E3/w0zLzo1lHYmnmqiu5tF62G08uQTQTzZ3/Kf2H4=; b=Hcg4n26TzyXS2za9aCm9jXFWqGKH+nprJ8AKZgv48EIE7QYfOVTj+i06ntAOWFkNnxAYzOQmTOmKwtQQRdhgwfEeFuhR5zWUVC/mRMWDE0GEHYg4Mm914Bksb3rTUHEfREnfCVT/WuUIeoNhNdHqI/UeBCNW0innOCA0JB1EDbA=; X-UUID: df0c230293fb41a081926df5560ca889-20191216 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1215728100; Mon, 16 Dec 2019 11:48:59 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 16 Dec 2019 11:48:36 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 16 Dec 2019 11:48:59 +0800 From: Stanley Chu To: , , , , , , , CC: , , , , , , , , , Stanley Chu Subject: [PATCH v2 1/2 RESEND] soc: mediatek: add header for SiP service interface Date: Mon, 16 Dec 2019 11:48:56 +0800 Message-ID: <1576468137-17220-2-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1576468137-17220-1-git-send-email-stanley.chu@mediatek.com> References: <1576468137-17220-1-git-send-email-stanley.chu@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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) + +#endif