From patchwork Wed Aug 23 07:33:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13361737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2BB9EE49AE for ; Wed, 23 Aug 2023 07:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SxtsUtpr9GSriGVnlO83AXPdGQutjHionfD6tCFgKLA=; b=TBk8CGB0HiX+di YJSS1LkWMQ5cPvAa10GhOl3/6jPuqiyWDahYvUlo9nZ5Rh9lTjhH5+9hWwAQHakxYONs8KCf27Za3 d+xqvnHU3GsDTu9pkeuYTP7QI2IowNx6Wm4bZhdDTFYTy1nUjOWSIrmpet0LZHjptk47lrW16Ze23 4jG5XNbjP1OTRkLm/keOdLNoZcwjzaDpqigocRUyKCEkOH/nIq2E7Dl1kdDXkgCGdea2CW/FFxVzV /pfz+sbPe9gLE69/H33xVWylomjPrOnFAR2lQyyrmmhp9PYejKOu16i7jUwaabWmFH/P49qdIV9iu koS2TqevtlFpBmRb96Gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYiOP-00HTPv-34; Wed, 23 Aug 2023 07:35:05 +0000 Received: from mail-db8eur05on20613.outbound.protection.outlook.com ([2a01:111:f400:7e1a::613] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYiOG-00HTMM-2p for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2023 07:34:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I8xWb7XLIXr8a00twgrMox2hzjtvbaPLmMkW0TSd+McWTuhscLj9x0MvYuoLiuGmvTj6Fqjk0li4KUZIBlA5UWyApJVo2nFCl09eY0E7BP1xgoK0jxGctqKB5VLMR+llWRLBKax/6aOqqtu0wcxpor0SO+2I5N8GM96lgFgHtJU5RJy7mLKLrPneXrfDesQyz6QAI9MpVxi3dVJZGVLd1znwc5+9gDFIerFjbupTjG/GF5wPlne4EmMdL7g2vQDpfoCdNXrhTW4USFj1wpQUQnrOpHBkFbnBOrT6hEq3ShgzPelcQADenLvOhGgmxovGF7QR87XXl5D4YdUxHhT0xg== 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=8l8TtJbn04Mdr3iI565hvFsLTBMD4GO4BsgX8qJDvDc=; b=cFIdVF4XSamkpSx5+G9U4t4USlJSSXKB3PItbSe8f1d19cEm/xIGG08aVmbdaQBzf8x7Wv6zLD8HTpmvZEMGQvU8E+WlgW3f/CJFUPwWg4v3YrL+vI9a9KbWd8waIkdx70e3am4oNjH1lWebl+TmGdBxLUEQDa+JU5Ua6kPUKgELGhEO31W2liG3gH9u+QI79Ps590VZWrJbjuWJiD5l18wtxo3UIf+enrj6Kh+0UTyuEfpqSxXb0+ACaNgSWo4iDwn62v0Tu6R16MrHhXwVFQVKBF/8B2P3ED0LG8Cb09tiBwijwyHrNyG00tY64M+J4tjaAPiCo2DdXDx1sHyBDA== 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=8l8TtJbn04Mdr3iI565hvFsLTBMD4GO4BsgX8qJDvDc=; b=pjsexpeqWywUquGUlF3nRN29ZTAijGr0V2XVQ1DQupjMU9LHqiFj1MLOjFN/I5IT+yxk1jm61EdANodIPO0uc1qv0SZxMwIaOR9jetrnTvpZenTicHhHUGuduvxtllsZjhBiCcOGRxhhvWEBuaB9bmE9eVF6E3MTXsR9SnpuNyM= 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 AS4PR04MB9409.eurprd04.prod.outlook.com (2603:10a6:20b:4e8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Wed, 23 Aug 2023 07:34:51 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::175:d311:2cb4:7915]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::175:d311:2cb4:7915%7]) with mapi id 15.20.6699.026; Wed, 23 Aug 2023 07:34:51 +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, ping.bai@nxp.com, xiaoning.wang@nxp.com, wei.fang@nxp.com, peng.fan@nxp.com, haibo.chen@nxp.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, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v5 01/11] dt-bindings: arm: fsl: add imx-se-fw binding doc Date: Wed, 23 Aug 2023 13:03:20 +0530 Message-Id: <20230823073330.1712721-2-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823073330.1712721-1-pankaj.gupta@nxp.com> References: <20230823073330.1712721-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR01CA0036.apcprd01.prod.exchangelabs.com (2603:1096:4:192::22) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|AS4PR04MB9409:EE_ X-MS-Office365-Filtering-Correlation-Id: f73e00a1-8837-467c-f516-08dba3ab6f7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qLccNkR8/6ilDEOzQKI1GfAUGy+h7krOUYW9Bbs/WRXvtNkj4RYiN5paWfGWoo723NNMfNUj3fNx9AuRpqkRf2ONGsF8bDx7UW11aIN++z9ZhXnsuSNtJzQY1Ea4oJTmt2IbzMgNJ8HhhKKTHb+3pENddYrDsD8R7aXTzcfvy/09GAjewcbhWKCI7XszW9aWGzYHiYsdyCAYjKFIZucFUQNZaUAXlumPVD8LhFDLl5PyvwRp6r6kDOk0hZTlUBpW5MxTzpYf0jkJ7MKdWbUPk+W2FCgkHRbGMX6ECoRLwfIk2IO2C/Ik+/8vG45yVqzbLTA75LCHq/zQJo7i1CEuYsAP1RNsK3f7cfVUv34g/GcDyOuG95khmGc0oQ7KfSiI6wTHspv58R9ckuIjiQtsGHhtT28MsNEi2dhZe1LZDmOyfhXIwDUNOx1W4VjvjlkbmMkF8HxXPEP6Py2ExvDwWeoiIK5X3q/Md9doGkj8W4AfXwT2w1lA/MOYHDsxqOZ+vROjxQqH0h559NlSl77hyH3LLnQC8t9+8x1SOOXyjEem15dnDTb7J1OaMd6KwmSaRLUBND4lk7gCXtuq3Trx6dKv+FoiiRTkkQwYXsvebrwuPND/d/uR23vtOOGBUBzkwVygFpqNhGudZu6RxdapbxtI58pm8z6mvJeXWCNtDGM= 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)(366004)(346002)(376002)(136003)(396003)(39860400002)(451199024)(1800799009)(186009)(2906002)(7416002)(38350700002)(52116002)(38100700002)(6506007)(6486002)(83380400001)(5660300002)(44832011)(26005)(86362001)(8676002)(2616005)(8936002)(4326008)(966005)(316002)(66946007)(6512007)(66556008)(66476007)(6636002)(478600001)(921005)(6666004)(36756003)(1076003)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dpup1Lox3c3Xqt/hI8LwMEQ1HBhs2087cCU+YLpXHhEjzfBmpLqq3WY2KVWpDver2HKRRbcQYcsvmmxG3EoyQ86MPUIa/+yrqVRi1Pt+9puPg23IKNB1dHB7riFxA6owJ+x4GN5rmydB8no0gn291LBJ961g6ZWac4W1I08NVavSdTHXMhVYooY2ibELUFWa87hNBrquGpeNiAdMNV7W+udfZFLUwrrjDXxA5xEfJHXotbZ/xW43Ef1Bsg6IaLqvENHPtrZ0IW4tphpdrd1tGgT3UlPwwT0PjJsKmKKZXOk1b5aVxYJ9wWWTl+CpqVAe7dfqeSvt4g1vwYH0FZ4Z+WN8UzNXDVUmaO3JAO5ES/BGzvBtxN2o1yMDn3Q2E3WH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Ops0kSAL04Mbcn+CB+B8ksBaCI5Lc6llG1sPLNEhlWa3L2B1jq4P6c+9FsBoVVa5PQTmuxPMru5n4dkMyIyUajYM+DUlsoVm7+ryiXsFM0zTARr5SqB2PgL17Pd+69N2AbQ9cASxf1Gp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f73e00a1-8837-467c-f516-08dba3ab6f7f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2023 07:34:51.1049 (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: A+kAUc8Eah6YQDLQHEVwWxorGhNkz9h9h47XpP6ckbmANfXjjP5NumgiTy1tOZ7DRS0Un6MyAWFAbBV3AxM3JA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9409 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230823_003456_915811_D19D4539 X-CRM114-Status: GOOD ( 17.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The NXP's i.MX EdgeLock Enclave, a HW IP creating an embedded secure enclave within the SoC boundary to enable features like - HSM - SHE - V2X Communicates via message unit with linux kernel. This driver is enables communication ensuring well defined message sequence protocol between Application Core and enclave's firmware. Driver configures multiple misc-device on the MU, for multiple user-space applications can communicate on single MU. It exists on some i.MX processors. e.g. i.MX8ULP, i.MX93 etc. Signed-off-by: Pankaj Gupta --- .../bindings/firmware/fsl,imx-se-fw.yaml | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml diff --git a/Documentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml b/Documentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml new file mode 100644 index 000000000000..f7230f93e56d --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/fsl,imx-se-fw.yaml @@ -0,0 +1,121 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/fsl,imx-se-fw.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX EdgeLock Enclave Firmware (ELEFW) + +maintainers: + - Pankaj Gupta + +description: + The NXP's i.MX EdgeLock Enclave, a HW IP creating an embedded + secure enclave within the SoC boundary to enable features like + - HSM + - SHE + - V2X + + It uses message unit to communicate and coordinate to pass messages + (e.g., data, status and control) through its interfaces. + + 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 + | + | + +---------+ +-------------+ | + | ele_mu.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. + + A user can be registered as receiver of command from the ELE. + Create char devices in /dev as channels of the form /dev/ele_muXchY with X + the id of the driver and Y for each users. It allows to send and receive + messages to the NXP EdgeLock Enclave IP firmware on NXP SoC, where current + possible value, i.e., supported SoC(s) are imx8ulp, imx93. + +properties: + compatible: + enum: + - fsl,imx8ulp-se-fw + - fsl,imx93-se-fw + + mboxes: + description: + All MU channels must be within the same MU instance. Cross instances are + not allowed. Users need to ensure that used MU instance does not conflict + with other execution environments. + items: + - description: TX0 MU channel + - description: RX0 MU channel + + mbox-names: + items: + - const: tx + - const: rx + + fsl,mu-did: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + By design, Domain is a clean separated processing island with separate power, + clocking and peripheral; but with a tightly integrated bus fabric for efficient + communication. The Domain to which this message-unit is associated, is identified + via Domain ID or did. + + sram-pool: + items: + - description: SRAM memory instance. + + memory-region: + items: + - description: Reserved memory region that can be accessed by firmware. Used for + exchanging the buffers between driver and firmware. + +required: + - compatible + - mboxes + - mbox-names + - mu-id + +additionalProperties: false + +examples: + - | + ele_fw: se-fw { + compatible = "fsl,imx8ulp-se-fw"; + mbox-names = "tx", "rx"; + mboxes = <&s4muap 0 0>, <&s4muap 1 0>; + fsl,mu-id = <2>; + };