From patchwork Wed Nov 27 14:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Liu X-Patchwork-Id: 11264185 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 0293C15AB for ; Wed, 27 Nov 2019 14:23:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D76F3206F0 for ; Wed, 27 Nov 2019 14:23:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="EzTjMomL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727172AbfK0OXS (ORCPT ); Wed, 27 Nov 2019 09:23:18 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:1717 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727110AbfK0OXQ (ORCPT ); Wed, 27 Nov 2019 09:23:16 -0500 X-UUID: 695ff62ccf764860acc752bf81681567-20191127 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=XT/G2yriU9FAqiGTOGeP2soGRJGALmOSQNcBdYat3Dk=; b=EzTjMomLjrDJ5/9WWmqbjZgmsu+NzkWxfFfvjs6w62V67LKwajdEgB9WkwIS5/dlc4zOCec2xbrE9DkdI+HNls0WsOFG0TsaQLpUtmyIYESRXmQZQd1b80F5bxvNRam/cPVO/Dgg/XpKIKibT3C5HSoqmxKK0jGnc/JUM2gH8K4=; X-UUID: 695ff62ccf764860acc752bf81681567-20191127 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 555486096; Wed, 27 Nov 2019 22:23:10 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Nov 2019 22:23:05 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 27 Nov 2019 22:23:03 +0800 From: Neal Liu To: Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang CC: Neal Liu , Crystal Guo , , , , , , Subject: [PATCH v5 1/3] soc: mediatek: add SMC fid table for SIP interface Date: Wed, 27 Nov 2019 22:22:56 +0800 Message-ID: <1574864578-467-2-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1574864578-467-1-git-send-email-neal.liu@mediatek.com> References: <1574864578-467-1-git-send-email-neal.liu@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 1. Add a header file to provide SIP interface to ATF 2. Add hwrng SMC fid Signed-off-by: Neal Liu --- include/linux/soc/mediatek/mtk_sip_svc.h | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 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 0000000..8cc8b5c --- /dev/null +++ b/include/linux/soc/mediatek/mtk_sip_svc.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2019 MediaTek Inc. + */ + +#ifndef _MTK_SECURE_API_H_ +#define _MTK_SECURE_API_H_ + +#include + +/* 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_DENY -4 + +#ifdef CONFIG_ARM64 +#define MTK_SIP_SMC_AARCH_BIT BIT(30) +#else +#define MTK_SIP_SMC_AARCH_BIT 0 +#endif + +/******************************************************************************* + * Defines for Mediatek runtime services func ids + ******************************************************************************/ + +/* Security related SMC call */ +/* HWRNG */ +#define MTK_SIP_KERNEL_GET_RND \ + (0x8200026A | MTK_SIP_SMC_AARCH_BIT) + +#endif /* _MTK_SECURE_API_H_ */