Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2630937rdh; Wed, 27 Sep 2023 08:11:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqrP1uVF6U7+8AAty4KW1vS1EQajk5HU0ZR0K1K9gxw5rKIpx3xYYwDFp/yrv/49vxd73r X-Received: by 2002:a17:902:e88b:b0:1c0:bcbc:d66 with SMTP id w11-20020a170902e88b00b001c0bcbc0d66mr4581042plg.7.1695827512447; Wed, 27 Sep 2023 08:11:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695827512; cv=pass; d=google.com; s=arc-20160816; b=hrbnxCkToFgdK9l+blxDwTe2h+kIqD5qLpp7GD6dhAynA1vi5/B9uVnRxcdzkgti7n Xhhyv5wEkt6l5CrEqdj41COQPEc8ak2aT7LJoAJ93MjhhXUOcBfPPvZlIfOirSO/SnSh pmWaSnXu221Oc0xkCoYDXzQFmXIjE2CDPreungZzaJaSQJqLM51WiDW8ZSHFVJ01EgUR qGYwnTeVpBaZM8Os6HRB96+UbkxREiX2Wi2ONLcIJ7hmfDgNA0wLleooMFwe74lO3YBG sosmfQqsvTxZW9IDGSyt1hz4KWV9BwfJwvyAEqQZuhy6IZfUgr/Z1PSqT1Yc6Y0m8VFQ iXmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G4Qg/nbJczaWykdnPsCprrI5TVjM058N/677FUPGEhU=; fh=PhkPLZHnlbS6I+4VLYKKEzEfaQxz9t7w9SK9rKaz9As=; b=DAyzKRRdEBR8kCeNzX6qjK29rThemgfWIYKv6eJLHdGNtpeCRGNfvV2nhopUSR30vm YaBNEwbIBcBb23X3vXoAmZQ7vZtUupblJk7Y4d8wl8yS8ouZptKXv6tER96Uy4byVZG0 dxrBNwRjNcW1xNllqflZY7zyLZ+QP8Dko+pbKEOvwufHTRDTuWvltKlfEH5tkcziKcNE BATdkLK+9RoyYqoaVtbwzAb04lChwOykD+4U9ewZYfPN4/prsKdsRNsSa+u+yspkV4yZ K5EKYR9WJwNr73UQmTSbzhqMRlmUywkDTpnEA8/ukPG4xrZ2EgAKog7k0V6fdzSx3wo9 PtpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LlS7T70Z; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o13-20020a170903210d00b001c0953d0055si1251950ple.262.2023.09.27.08.11.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:11:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LlS7T70Z; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 348D7804C1AB; Wed, 27 Sep 2023 05:27:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231630AbjI0M0j (ORCPT + 99 others); Wed, 27 Sep 2023 08:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbjI0M0g (ORCPT ); Wed, 27 Sep 2023 08:26:36 -0400 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2042.outbound.protection.outlook.com [40.107.241.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2CDFC0; Wed, 27 Sep 2023 05:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULo6z070lhQg1G6xx/NLn9QrGyFZu4P9BYao+pl4B1YvUfw/IMr59VSUAd4rSZdWUHn392TLXGtfjGH2+GxyaeQM0H0AZ7smd8TER/s6f9TncmAIH8Ncr0AlvAQbtvLpJn+JxLWptHPUcTFPwauwgRh2cExmAAXMzzcnLJ1bOC0OfcdInqUZr17YEh5ufRXP0msEZlEVJycT1qTdEysNcrONYKlgz2KZoT2gJj0hAjhVneb8RDUsYuy3Rg6DVyZdwtS9K1RkO9KAI9hm4IN4aWvidsiapBve/zdnmN0FEw8tTcUU9sma7tACC9BVGa+GlhR4dm4GPa3R4GkkiZ4VIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G4Qg/nbJczaWykdnPsCprrI5TVjM058N/677FUPGEhU=; b=VEF4io4uCzOYIMRk9VBozN1mXIbk3hMzBMhs2e/yixNkp538nRiIA2Kw5zdQM0EfHX3GfZROrkvhSdlnt1Tm6OdiPFMzhPvlBjCPscIS1lnWd9y/ugThL5lQ57qF6hAlUuCf7B7uQKLPQ1qw2SssEXareACYt7zDOlMtL9sBwAFiVB71s/+KrDT4MM96/nY93Klp7YtStvpMX45uypsUIgtMT5u8mPqlpzz7MN6C4/i1dMm0PH7t1D+lSFU7NBhu1PMqD2t91fZWlxqaUc1J7EsIhPin01VEUoUZMFqHF/LsQuHOMp5K45/ykCqiQTTXg7rpPLMQUDBQ2EJFLTd9Og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G4Qg/nbJczaWykdnPsCprrI5TVjM058N/677FUPGEhU=; b=LlS7T70ZzeE6nqh4Zl38xSQJeeTuIMxK5YNfbKyE0aYWUTX9YoPgPurybOJu7HWofIhS6FvZFyUWnGCcLHzmNhU00MhftQ4fwKxYf6vJoOB4aV/tkXh8X0q/rOtM7eQmMmiJWz5DozJpmyWLrdnP65y8nYWQcUiW9Kq7xUsObnw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) by AS8PR04MB7704.eurprd04.prod.outlook.com (2603:10a6:20b:296::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.27; Wed, 27 Sep 2023 12:26:32 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::dbc:99b7:7808:f82e]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::dbc:99b7:7808:f82e%7]) with mapi id 15.20.6838.016; Wed, 27 Sep 2023 12:26:32 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, clin@suse.com, conor+dt@kernel.org, pierre.gondois@arm.com, festevam@gmail.com, linux-imx@nxp.com, davem@davemloft.net, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, gaurav.jain@nxp.com, alexander.stein@ew.tq-group.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v6 01/11] Documentation/firmware: added imx/se-fw to other_interfaces Date: Wed, 27 Sep 2023 23:23:51 +0530 Message-Id: <20230927175401.1962733-2-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230927175401.1962733-1-pankaj.gupta@nxp.com> References: <20230927175401.1962733-1-pankaj.gupta@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0128.apcprd02.prod.outlook.com (2603:1096:4:188::20) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|AS8PR04MB7704:EE_ X-MS-Office365-Filtering-Correlation-Id: c946d3d6-b7a1-4f07-9be2-08dbbf54fb87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rQOKg38X1S7iVACD5Cn8S8lnS9oh380e2+DRTXbenj55bIzCgCm+39vuDdH0cOWGQy1RFKm03Op4SyeCNfQxxPrAdvwsfdbd/sw+V2x0aMvXs8cSUXoYiIMsJPz92+ec+TyyYZf6R4lRR/ek2mALzwE3TKHXmp4JPdhoikzv2TnmlqhsC4GHUkW2sB5Y6Td9276JxQ1khySdYKcK8c4FIQrwum5Tpwc7mgMfDgLXvHNwqooQ7U3bAljuTp98mrEpQKItDErhbk1spd1crabSMhnkVyd6n9dbXoyD7lFz6EIO+rIGvhbcn9oyvM9A5knJQhw6TDzcKTjSVw+5/aPCwu2/Tj2W7+uY3yrzAHN07o92qlHhY5Qu8h69/g+bhbn555IFPy/xnr6N1V7tHmGv/bMYg79lJZdBfvLEXn3IvUt+JANozqc889L0Fde9dd3HivQYNs90UOLhhx3EHZZTX7SAttFUgg6Qv3V6IhjmbsnkmN5xRv6Nhh65fZlzwYXmJ9apRV0Gz6W/uzvwDA06K9kZF8RY8PtI5R/cP3VoAvk9gBErP+STrhHhgKgqHPJCcEYsG6PQvRwr4SeXseAhPXiqEKAOcMJQCrulfhjmdZx1XJbjiFyh9YsitpwNtctOkLJnAcOJIX6psTnWleBpXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8630.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(136003)(39860400002)(396003)(376002)(230922051799003)(1800799009)(186009)(451199024)(1076003)(2616005)(6506007)(52116002)(6512007)(44832011)(26005)(8936002)(478600001)(921005)(5660300002)(6666004)(36756003)(4326008)(2906002)(316002)(6636002)(86362001)(66556008)(66946007)(8676002)(41300700001)(38100700002)(38350700002)(66476007)(6486002)(7416002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t6IYxPdF9AF7Ym/iTHWb+96TZFCNS0EOuz6FkIN7W2IDMzT1mqngw8Q8DTbQ?= =?us-ascii?Q?yIUyRX2pNJO9CDlukWAuz3QeHmkdJFLjYp3jobJULIbbEsqjxZxv+nhtQRrF?= =?us-ascii?Q?n8968FXMAWq0bXHJ7jt1+QWOqynGJ6C9cY5JhZjNZXJ7HelQRMlJ1FPevs7j?= =?us-ascii?Q?7yG3xKTBJde259IhrVr/WWWzZJPxZNN7ZJcIxtLjAf5tXtzBwxIeZi94bLaP?= =?us-ascii?Q?KyxEPHeZ8ZjlyyvI9hooHEhpjAScjEJaj/0/N5T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?Q?ismvxkpirp2B1mhp6POtZ7N0P6QslhOh0LOCmPgrLGAkfQ5oId+gIXaIor6+?= =?us-ascii?Q?CghWBTtkl8uETgILGYLCMDpF7xSxXToxh3Irtpb5vaSr0gH09YE8XI2liKe7?= =?us-ascii?Q?CkB0mCd+n3ad3ig4kbCQD58wa3AIGaJlO2LHMlnxt4wuv6GTaxISipktYiP+?= =?us-ascii?Q?jl8SHK9v0aCZaA/8lhfLQlU2AyuSd3P8yEWYPJOC0s8KoUNDjK/GR4TbSgtF?= =?us-ascii?Q?ZiNjPsbg8/I6PgEwvVSaC/88mGZoNUfSacF80d/4tksRIx4WvCy4CpiHMe9P?= =?us-ascii?Q?iYA/g0xSHz0pBQEQZPLJhgFNZa7ak868k2DAtXx3pPu3Mgu9VA4ruFblId5V?= =?us-ascii?Q?8/51wobBxT6eUIg3KZrSKDz9b/f12/VxYWP+7IyGxzGb4lEhSX26BANWEfBO?= =?us-ascii?Q?NoxMJDz2EtLNNS/mIKL9fVLz9iXBVMDyM5BayEiA?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c946d3d6-b7a1-4f07-9be2-08dbbf54fb87 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 12:26:32.3347 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yhlkK3LvVXCn/vu8rrKkc4CyOsq7dtlnBnJMUxop/aAFQoF9ZJx0QQjywDQFcHfBrJHDDkSdJyuYZpAti8H26Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7704 X-Spam-Status: No, score=1.6 required=5.0 tests=DATE_IN_FUTURE_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 27 Sep 2023 05:27:25 -0700 (PDT) X-Spam-Level: * Documented i.MX SoC's Service layer and C_DEV driver for SoC(s) enabled with hardware IP for secure-enclaves like: - edgelock enclave on i.MX93 & i.MX8ULP Signed-off-by: Pankaj Gupta --- .../driver-api/firmware/other_interfaces.rst | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/Documentation/driver-api/firmware/other_interfaces.rst b/Documentation/driver-api/firmware/other_interfaces.rst index 06ac89adaafb..1d21b88ef20e 100644 --- a/Documentation/driver-api/firmware/other_interfaces.rst +++ b/Documentation/driver-api/firmware/other_interfaces.rst @@ -49,3 +49,70 @@ of the requests on to a secure monitor (EL3). .. kernel-doc:: drivers/firmware/stratix10-svc.c :export: + +NXP i.MX Secure Enclave Enabled SoC Service layer and C_DEV driver +------------------------------------------------------------------ +The NXP's i.MX HW IP like EdgeLock-Enclave, creating an embedded secure +enclave within the SoC boundary to enable features like + - HSM + - SHE + - V2X + +SoC enabled with the NXP i.MX secure enclave IP(s) like EdgeLock-Enclave(ELE), +are: i.MX93, i.MX8ULP. + +This driver exposes two interfaces: +- service layer: This layer takes the two mutex locks: + "mu_cmd_lock" is taken to ensure one service is processed at a time. This + lock is not unlocked, till one service processing is complete. Multiple + messages can be exchanged with FW as part of one service processing. + "mu_lock" is taken to ensure one message is sent over MU at a time. This + lock is unlocked, post sending the message. + +- c_dev: + This driver configures multiple misc-devices on the MU, to exchange + messages from User-space application and NXP's Edgelocke Enclave firmware. + The driver ensures that the messages must follow the following protocol + defined. + + Non-Secure + Secure + | + | + +---------+ +-------------+ | + | se_fw.c +<---->+imx-mailbox.c| | + | | | mailbox.c +<-->+------+ +------+ + +---+-----+ +-------------+ | MU X +<-->+ ELE | + | +------+ +------+ + +----------------+ | + | | | + v v | + logical logical | + receiver waiter | + + + | + | | | + | | | + | +----+------+ | + | | | | + | | | | + device_ctx device_ctx device_ctx | + | + User 0 User 1 User Y | + +------+ +------+ +------+ | + |misc.c| |misc.c| |misc.c| | + kernel space +------+ +------+ +------+ | + | + +------------------------------------------------------ | + | | | | + userspace /dev/ele_muXch0 | | | + /dev/ele_muXch1 | | + /dev/ele_muXchY | + | + +When a user sends a command to the firmware, it registers its device_ctx +as waiter of a response from firmware. + +Enclave's Firmware owns the storage management, over linux filesystem. +For this c_dev provisions a dedicated slave device called "receiver". + +.. kernel-doc:: drivers/firmware/imx/se_fw.c + :export: -- 2.34.1