From patchwork Wed Apr 19 17:55:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216762 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 9EB22C77B73 for ; Wed, 19 Apr 2023 12:27:27 +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=zR/WQvS8NJgWGR7bushGBbOYhwQriUNcSXXXkRe+mSc=; b=OVpzDkhRn4MCNz Jk41zdlox51CZyV3fOHAcC4vs3aJtChv9oOGnETcLuXwhqKYLwwsQE/9uMqDR09DEftQ5bl4a1FOE QH+LoxFUfayXhX4waWbuNEhyX29cV7ULxJp0mkDvxGJd63EPcO3ZRiYRaH2vYtmzf2UII9dY6hWye snuqy3zK/eBFL3CU8gob032EnGhPFveCsEIuWBjmRLov77lebPblYHgs6Sv30d6Pdh3TwkSuY3Keu tl7hFpmULYmwCJWuJoRCJy8hg2RXM994kQyXcci2IR8YKK7ZdyMM3S3jFlmnzY1SN2y5We1xX1bdM H4eoz5fcSGgU9FNSxwgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tH-005N4z-2v; Wed, 19 Apr 2023 12:26:27 +0000 Received: from mail-he1eur04on0607.outbound.protection.outlook.com ([2a01:111:f400:fe0d::607] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tE-005N2w-1K for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:26:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oO8gIOcOhrK5vXPeua9KLibnxtL1m+hEnCExXOWA5VyQ5fECE1VD6B/hGK0SnDJtd2PEtYp7r8oX0CnhzuOlM8aD5KkJC/5J0vOFMdOsnm4SUpinixFKSbr+36fjnMYa/kjq/BLAF0Y8y+wEP2ceaN9R4/LB6nkn22UI0y7k8beVrgeAHMz7yqzddjnVqYvR0uSXIqlkjjnWZv76w5N+9+jTg0q6qZOGs4+wXDF9yPz72rxVb6lKKpKUi2CvID/D8xoPuUmp+o+js4x6r0SOo5zapR+W58pOUPGKdTBoj7Y+Fu2ABx3xfP6lsSmP8vckq62Ba6oCXyNd1Hl4N0Lknw== 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=H2Hb9R4fPXVM5ig+jbbVwZ+8b0qF9k+ZngMa0dt3oUs=; b=lVqAc2Nkt5JmHwdeK4yPeVls/NzHgVrx0j2ZeDfMcuIswRDcaY/gmfoNwX0MAu2Gm9Pbahvsda4Kn4BcsUM6xAnPiHHYpzu5I6rhui6PKQiYk1iqbya3RwQxym10RDLjfXcxw9EJHkohQ/sIM8LD8Z7UCFy80iR0PfUyRIOhBIud+cLHqFJFPe1RH6cKDQaNwcEfISejCk5tyj2CTtGz+9xvTkXnhKhrQSBiJ/jBD/8fk1Rh2h2VjnixMSuiimz1Og3VL48c6qgbkZCycbCeJW7oPS/NypSvnGsMfQGMv6mPxFiz1fpinW/+Z1DYCb3JL8KIhQG/xz0wvNsLud1ZDA== 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=H2Hb9R4fPXVM5ig+jbbVwZ+8b0qF9k+ZngMa0dt3oUs=; b=ZRVQkdMObIE2zI2ydnjmlpymT8+hPDPDtjzstQM3DO87yDPecpjaHm9qecGHnejIACoE2T4w1zne1TE14s5QbQONIcdbK0D2feTXqxiG/y8YppKnSZW+PDK5d7KG0461+8N6uUpt02wCPXDnudNC8XNp7iAlixpdmFXM0xsFlGQ= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:19 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:19 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 1/7] doc: device tree binding addition for ele MU Date: Wed, 19 Apr 2023 23:25:32 +0530 Message-Id: <20230419175538.855493-2-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: be5dc848-0a0c-4622-e206-08db40d1474a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hOTekR2Vk45qtgNHaLxNGDFwH2ECt+9AJUGvrvqEGsS9Ay71lQsWrU1f7h3fBzrP+5UGrcpCwsz7vTob8xZKxkf0SYnnrVzzB/aYANC6MBYI0dKzAx7h14cWe+ZDpWLIatNPk2UO7gl08vjFyKmu+wPRFW9JmjVHmBaVamOepqdl/H70+Oar/2QGHA1SVc7lYOhH/ShiiWo/tD4PeqLe/ukRTYjb2NrORuk7lX5K/WZ5YgpzuVj0b/IYfDthd9y4sHN45jOc70BpklhE/jgfAPgchbtDJtwp+Zm+wjOd+EKAR4P8CoC9vStayVpsypqtb7R+vcd2R2AyzeBT3WrPqZzZ9JWWhAMrIyXGAls3rFcwcpowaWTvpcuV/xEU8wzIrxBxFFn3citmXSdOSioLShVol5Dk+k4EbIXu2BAs3RIzcKgjhQjMEL/n3jJDt3ynRgBijpdwz5Tlb+MzT2XRTN05g0O0gSKIbeFbeU+eh4XJIkyV3CDw0lPJqFZodFirk9+hcGPj3lL+mHm1pPePNe5I5B5O9d43r+cHPWT0z6/qh1XWmu7AHRvcTTfCN2HEwHPPJWbjGXQUH27PjPrVoDgHpwewZcvmfT4UvI8jZaM2YZxqF2+NtihVf1A0rhgOf8ObbTdVupi2ecFaqDYGvaWjYfEFDY9fFR9Qzmbjoeg= 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(966005)(6666004)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4a/wfDrkmO/dEteJa/5gQt7RBrdGb3cZZOxDmo73IAakv2VnmHRl/ZxyH+GNi0PiVY8prarkZBT1MvUmW3kwo9VfV6JwuqFGO6LGm8WYFdRLbp+dxkR/zUVNDxD7iGxekzl2QASKxNXvabCOVz7kGs+ledESfTqfzw7PJUCIAnTAuSezEeUiC5nWQYCp3Nv6Cc1VZZtu+CDX9toTGIfTRUqSlpADUbDYQXUKlBErbiaMzB4DZ0ijH0S3SliEC+EHB/hpGCQFlEp13ueGvjTASb1AUe2bmDKhAhdztH5KsMxiL+jxJXFJ9WspYH22rATqadlEBw41k9HZyMNRfYBs/jLUnD9RtCuAYGFIBIv6QJSW4Rvlk80vkexbojzxCzWHLakWe+4wiPaqVvznHMfB7DuWpzkYDCu3QghbnH/01jLAHOigs6OZCnwRnIwgVwy5YcFjE+YvpDN8tYrqvFmcxvRJ7Yx+tJgY7PciLA1MHvQmm6mjuZ5ctNbHstJsxm8dYWtq8KgwLAZYgtveF3pl9VuCRpBoqrgygg5pKXCOFwfLNRb1ZHglNiDjidSzsHkYJz8YMHBQvILBs00DlhIQY1Dr8zoOhfP/GQ+IyZgs067/DXyLEz/xLgtbxq/xzrzOGPeSH8UUGvf7gR/KakbV9/VRjbti1/l623DbbmM9J2fRm6oaSBUQ9zXeRTl+7XYBgE05vWvwh+6uvpeIWWLhjn+8IEKNxccl9Bx66iUD+9QEVyg1gtrDbo3keNW90YYBTjg3w9bZd9VGY4PHynuE2UW+IAR5DMknOwo2iZ1GK9ZxjgUZKy2t+kUBaBJ9l5Of5gbcjeTvRR5c/DwKTrmWA8Ekcu6I+SuHeuptnBaQ68G/EsfoODJ5rmbLVDc1x8ZqkC6Yi09I5d2FGzQXDxGSuGh+PgtlWHauJT2MnMqktuuUluPi5MSuQuwRBCycargJwn9zLz8ihkx06P2Hl/Pg+7Rb6bd6LyeMfJmCEMPtfUW6uxjFJt8tnqaaVU//pTd01Rm4Wk0/YrcyP6X2WkTCgkL9U0AQlhDs+v/VmijrU5tkeEG7rcebiSJReDo8dxUFhYdSeDq8mNvm8bSpogw0bqIokeTVdjcx279IuwSuhjoXTItc8jX61onjQFoJQ5dQDjHiOlImlqZ3eIllJOPsryquwgWTWxj6ZSjB4wsoLt4b0r5dgQ8j+sCTMn/YH/C0cD5Y/osoPSaJf24L0e2D1bH3yOblYghn0qisyCjRXoeWEEhKyXqIuR4rdpJdFgbhlj8omoq6DOBOvPWkf5tHCs7jdrJ+IuXeMKJjPrMTi4D+tG9yFr9FfVmbaaUClI/My75rmcLuczGBaMw/DAL34lT3ppX8bN9SezwI9sz0MM4wQ1u5Sjvkdp12fvxqq4ysORzmh+2KN7jqlF1DrMLBwQIaQBCBLCnwuBs7BNYW46dHHmzNocZbpANEHTJ1yT1NS3z63K181P+M6JnAgZOE7O5DBRm/eZFlNOdWOw3MelNEDowcgc64J/VWe8Id/2PQnCIyEb3ULcoIymgAZ0CnsQ/Y2atOwID0Bbuk5Wd00pGe7B897HRFUys79FMjVWec X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be5dc848-0a0c-4622-e206-08db40d1474a X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:19.3807 (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: 1RKrDc2zZQ1x8TolXwuu0Yn91LrjEnITzhV0kjQtRnzcZEyj86aJg38IfjSmZRqZ19ezKSiynYCp/FexODhHXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052624_457539_18BE1CA5 X-CRM114-Status: GOOD ( 17.97 ) 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 Documentation update with addition of new device tree for NXP ele-mu (Edgelock Enclave Message Unit), driver. Signed-off-by: Pankaj Gupta --- .../bindings/arm/freescale/fsl,ele_mu.yaml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml b/Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml new file mode 100644 index 000000000000..8c4cc32f62ab --- /dev/null +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml @@ -0,0 +1,139 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/freescale/fsl,ele_mu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX EdgeLock Enclave MUAP driver + +maintainers: + - Pankaj Gupta + +description: | + + NXP i.MX EdgeLock Enclave Message Unit Driver. + The Messaging Unit module enables two processing elements within the SoC to + communicate and coordinate by passing messages (e.g., data, status and control) + through its interfaces. + + The NXP i.MX EdgeLock Enclave Message Unit (ELE-MUAP) is specifically targeted + for use between application core and Edgelocke Enclave. It allows to send + messages to the EL Enclave using a shared mailbox. + + The messages must follow the 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 ELE, it registers its device_ctx as + waiter of a response from ELE. + + 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 on NXP SoC, where current possible + value, i.e., supported SoC(s) are imx8ulp, imx93. + +properties: + compatible: + enum: + - fsl,imx-ele + - fsl,imx93-ele + + mboxes: + description: + List of <&phandle type channel> - 4 channels for TX, 4 channels for RX, + 1 channel for TXDB + maxItems: 9 + + mbox-names: + items: + - const: tx + - const: rx + + fsl,ele_mu_did: + description: + Owner of message-unit, is identified via Domain ID or did. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [0, 1, 2, 3, 4, 5, 6, 7] + + fsl,ele_mu_id: + description: + Identifier to the message-unit among the multiple message-unit that exists on SoC. + It is used to create the channels, default to 2 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [0, 1, 2, 3] + + fsl,ele_max_users: + description: + Number of misclleneous devices to be created, default to 4 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + fsl,cmd_tag: + description: + Tag in message header for commands on this MU, default to 0x17 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint8 + - enum: [0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e] + + fsl,rsp_tag: + description: + Tag in message header for responses on this MU, default to 0xe1 + allOf: + - $ref: /schemas/types.yaml#/definitions/uint8 + - enum: [0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8] + +required: + - compatible + - mboxes + - mbox-names + +additionalProperties: false + +examples: + - | + ele_mu: ele_mu { + compatible = "fsl,imx93-ele"; + mbox-names = "tx", "rx"; + mboxes = <&s4muap 2 0 + &s4muap 3 0>; + + fsl,ele_mu_id = <1>; + fsl,ele_max_users = <4>; + fsl,cmd_tag = /bits/ 8 <0x17>; + fsl,rsp_tag = /bits/ 8 <0xe1>; + }; From patchwork Wed Apr 19 17:55:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216764 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 D986AC6FD18 for ; Wed, 19 Apr 2023 12:27:33 +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=ZF+L/gS045+9fSmhfppBvr0LDXCOrulOiHFjH3eGvbU=; b=daA/kd+WT9TQDy 1z8IMg1YjJr+wyCW1pa1tkHh9h/mneAOYj1+vHlwQ6hkmgc6xGOnxdSrj5P5o3L3Z69fodwvFmUVl Lf33leoXDSxUOwighOQpJucGouM1+UDYaNzBaF3m9BE6Lo648HDvri9OJLK/pXucR+wKqmuAYaybN 0cWGRnY3Pf1hgCLnr2vEYBaQyhyR/ebUktGo8JipUCEBipYgTC1JGZMVV3YttZn9asAcK7bBWw2KC sKSnXUt9d4ndMo7ugAZuHv7ChxXttmqqLNOx5bN+12FMmL5n9rqCE9Cr/0bbROoomG5KYF04ABMYt 9zaIp6uqbMs4ToJW5vkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tR-005N8r-0q; Wed, 19 Apr 2023 12:26:37 +0000 Received: from mail-db3eur04on0615.outbound.protection.outlook.com ([2a01:111:f400:fe0c::615] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tO-005N6e-1S for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:26:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gcHfq8vbFUVQGA472Jk4xAnoxtBzxAXyU+067I+G1qb7r9F4Py+vpo0LXE0SRRm2tctSxHBaEqCkzGAF39bNfw1onOnGWGlseAOjp0v4CzItt9djVeFnnkKcq5M+7TInplXtdjgNewjWKfDh12wU2YvQOnuwpEpmOEkgMULXj6nscxWizfD7VaZRyf1dLlTGvw6qYaZJ+tDb/aRziqLVfA9ZYM4xyBFcrX7nh/y/mKdkk9Ig2ptoBVdM124fZahJEJdQKVRp38O4IJHkxju/BzEwv97Q0z+9TcHlbtLO+QlpaaZ/cha76VVUbA+n80mR8LXkwkFB6rfBaoJpY345DA== 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=dK3gYCfx7/FOWcDGJ5ME50xiIM16l2zl/gfsC5pwF7M=; b=GGfpEylGN3+PX9bi5HY/hMyOxWr67sWB1ERvdgGa8OyBNfZm1Fa8q0jV9ksPSmFDn149DlGFVe0R5/7gm0BSuY8+RDzrh2TvE9a4pjQ0pHr6hocO9KehhNsN9gdH8Ow7u9oOkcdm/7d+hPyEMlhPl1nSjWufxxJUNOu8R6X9JroIeqSp2m0FBfKOMHBf+d7ypkIEN+akJMT+9w17AqhY7zE2Ib+AnJ+vs11JpoOlJTDBekBsXLXiE9Z6doDtRnuPAvL2ZPhep5TbUil2g3EsqrSoobJYF9VHtR8LEIZtCZf1/QP+rCfyRJdV+ulbk385DtvrS7WrzEANcuJCu2P+SQ== 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=dK3gYCfx7/FOWcDGJ5ME50xiIM16l2zl/gfsC5pwF7M=; b=Y5qIsNZXIeG4+lcJSbI1qeRwRaQeDyS3/dSBWgqFX1mSCC4JxZP1GKi2cr4ZcnF2mjMyB0bn9qSPhiLMak43gJMLQnMegJyIYfQD8dIFhclgpI+23rkzGZ+w2SV45QAVv4yYTJ7YnZWEupLk88hKtQbmCs+x35E+Pb7tt6lox3Y= 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 PAXPR04MB8912.eurprd04.prod.outlook.com (2603:10a6:102:20f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.21; Wed, 19 Apr 2023 12:26:30 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:30 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 2/7] arm64: dts: imx93-11x11-evk: added ele-mu Date: Wed, 19 Apr 2023 23:25:33 +0530 Message-Id: <20230419175538.855493-3-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8912:EE_ X-MS-Office365-Filtering-Correlation-Id: cbac9f11-c518-4557-8ed3-08db40d14dd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9pcwhofFTGqxWqXQA/bZwbXuZWALISY0V2FfP1dDMVnkkda6fsesyxVrs8pzJxNY3a+/EHR55kPEhOcGa58i3l6aWOACI9tY1IcMLEG78gY8js7Qg92QXsbU3f0rThYv8aIYfxfyLg2xyhYYupu5MB6ItgYuRe0VoA2xoDLeX8dRxPlNnXLzSaPcXtS18dlf9VF1ODMpbAPfvdf5uVZ/eh3lrdO+hwzwyXeQ2i0a5dSq6ccCvhUWrsFPzrAWyV9cMG35toePgTGlH3zJPmZkIZFon4ys/9UBlaCdAkXVfyy7Kpi6pbtQw24eLK4kRzK1wUrrErRnuskNiJCwlDhrR4zdJE5gcaIGWGOeOONunwETXpSz4Qgx3lc2PR9hH+tEsWD2bIKpHMJoev+FCvUxHROJhc0FEMk9FV9R2pNnEjw98AQIbEjkN6qS+kpS5y77HFTvFirUqc/D2AuLN0zt6xeA7zPcwsLG6bV41ANDW2FOT2xElx9jBNIYq4M+0LxbJwrVV14Exy+TPgHw+iJfwEiSrtliZQrQaaayJGg6JUAnTbVCun7tew322AiHj5bup6eWjLjO54QYSAS5eCQC03+zmI8vRHvwiVje/pblmuji6ccYYh58T0nVbdXuL3uH 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:(13230028)(4636009)(136003)(346002)(366004)(396003)(39860400002)(376002)(451199021)(44832011)(5660300002)(8676002)(8936002)(41300700001)(316002)(4326008)(66476007)(66556008)(66946007)(4744005)(2906002)(6636002)(478600001)(86362001)(26005)(38100700002)(38350700002)(921005)(36756003)(6486002)(52116002)(83380400001)(6506007)(1076003)(186003)(6512007)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SS9ZeEDgK+GjkKz3za910MtWFynrRsU8HFXn/fgWkRnZ1C52EewczigT7s+rUyhCwuB9IegrXigABkHJuTBsLGsZvbC6AsqiaXIH9tYrVnYjkb+UompJp7YZZwnSWP2M2mcl0CkyMksxdHQKGRno5UTXV4xTjA/N/qimLBrNzHrxyfTdTn3VfytZ7zRI6m6CUDd/WKteKX+q18b7oQjbOzWEBclf2KSP7E+gFrbnOWMU16X2HjuI8XBpy/9pXadd/nE5mgxT78tMmfVDiUz6erx+9lLjbhOyToOyd3zIThfH6XhyCgG9Sav8PHigMZ/S1W6r0SMbUX8/N9a6WsVEV8g7Qwxr+N7Pt/vvULzV57muGVSkh0vEPhDxo9xalOPzgr9CyO4LDj99Y0IqemcE/bQiLOHJ9YyJgiqpbNssadfwgB7fvZNTGYUhJNcoO+CN/QRthNL4HwbEbLuRhdMzVv4C/qpeSMTv7vsqEbWitwS3lwbn+li623mLuNGr4u5P9HjE2RwKxJH9SGlisg6xzar07LDU6ZIompcO2xXWxNRvZRBlBgFnlmImbN/ZFEgcsPC2a3/RUvUq77w2SYqdFZmSdD80gYYMoxqcpYx0tSGlRMAyYkZeWydFZHpOYOBqPDfJnH+WGs7QW57G0Lf+C5jlAZVCw/xZ1tOclKec8SdZKMPWdiEhxnYK5vcGgfocFTU5j6u54t7byaxybqe37KCT9DpvbsaRBPEWubhcYb73jG17ONLes5CFtx7FpOvOqizxZk/KUv14mzbs+LgWFyGcwHsL2N+Fjnb+bbnbtSgiktKPmtubAaVCHjDqMOrinGR7ehqwKSzGykasgBWWd7AyRlNu0ptPC4HLoWBwTdeFqQIFJhgrusezFtZgZ5kNsdUQfe6k0hF+RD6ki9gdEWVH6ShExgeyQzOV/9aGgwSXgzCNTWRaQgpz2Ca2bWfvpag/O6/YtaudNU3o7F5QaFVqBfjpofuF0P/EqxoSJo1Xm1i3OliAYFwy5GDeYm57BR/HVi1ncMJPTIC7KvPuCpz91AVr6kAnRZxp6VVFEqo+WYRDZdOrFW3qS3rALL15We8gXdGCxkuiuxetpjrKyYsmFplwAFtoQcns5T/6wU/HOkG/T0R5gluSsMFkTvSLCGh1Tz9+TkC345rYmpLVCRInNQUOcEpHsJA7Jz4ZLh6n4Nsl7hdRCUx48zAqr3LM9J3BI7dt33KgyZBkgsy3f36ISU46i1mPWtDcoSUzsqstKMLjJJBB7E/anfEAIeX/SgVKL2r4nR0q7C2BqSjNlYPBk+6nMV2CNU+B08/5wKLdgy+3om3VKuI455ssU+Ccpi4tNoCeUARKTwbL02hRrAhLIfpgiSWjfLvm0H+cRBiskL8wvz9cBm6w3YW7DFuRs86u0Okm4Fq5j2g/DKE/I6SBCbr31axXrX61ILLprZ3hQBUDuP5MMaqMDjk6diTmvCL53FGoF6TLdhPjrG2C0kdfZFZRHzz67ZAewqrHI6gGb7kSBzRH39NWSJ00CN2v9EYh6DbwZXbEJeFbiBrdgp0HQBgBc+ZSkkFK0cChY56TCYvMli3RIU7On7QJKiBy X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cbac9f11-c518-4557-8ed3-08db40d14dd2 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:30.5158 (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: xxTLJONY9NVr36LpkmtLvlgj00xFNsWxU8jZFdIj6MmjXsTBbjWYo165JEtv/TrtBGOjB7YLbSb2sKBGDpzK8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8912 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052634_508250_4C18FC34 X-CRM114-Status: GOOD ( 10.79 ) 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 adde support for ele-mu for imx93-11x11-evk. Signed-off-by: Pankaj Gupta --- arch/arm64/boot/dts/freescale/imx93.dtsi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi index 41efd97dd6d6..ffb7cb8ed228 100644 --- a/arch/arm64/boot/dts/freescale/imx93.dtsi +++ b/arch/arm64/boot/dts/freescale/imx93.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* - * Copyright 2022 NXP + * Copyright 2022-2022 NXP */ #include @@ -741,5 +741,14 @@ media_blk_ctrl: system-controller@4ac10000 { #power-domain-cells = <1>; status = "disabled"; }; + ele_mu: ele-mu { + compatible = "fsl,imx93-ele"; + mboxes = <&s4muap 0 0 &s4muap 1 0>; + mbox-names = "tx", "rx"; + fsl,ele_mu_did = <3>; + fsl,ele_mu_id = <2>; + fsl,ele_mu_max_users = <4>; + status = "okay"; + }; }; }; From patchwork Wed Apr 19 17:55:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216763 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 9EBE5C77B73 for ; Wed, 19 Apr 2023 12:27:33 +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=94ltDazXPjnyStcu58CtOyZSReWv0tJj6v8SwBtvuzI=; b=EhEVP9VdBrAfTF ygbIg+1/VCB1JL3rFAfKNo3DUk9FHgeI4wIqI3t7as+7SRv+fHgqZEIbKHIlcRumVnFhi0EjbO0lx nuGrGUZ+OO2kAtxBj2m668C3CwHKIpvFecYGm1rS332Xu96V8Q/FPMmSH6bor86lQxZZosyexzSS3 dpyAzfTT+uEZ9zhD+UrWgfPE6qkdgC4yVWETEPoXfklJecubc3fcyoXbxl0eJduUXx9c2oBM8N+wG 2PHmnfWAZVK05+1rvDZLVMQHkX82ZtImyeamQI75SQIzGw1ZGSRt2lHFu8ZblZ24wOZkdOOi83Xdy 3OlJuuIPgaPem+cxXdtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tX-005NB4-1v; Wed, 19 Apr 2023 12:26:43 +0000 Received: from mail-he1eur04on0606.outbound.protection.outlook.com ([2a01:111:f400:fe0d::606] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tU-005N9L-2y for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:26:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCYw1KfVTsEr0TsW1LS6T8ede8LtScvzAgnjPVlx5zxE1EhV7NCC2VqKSJXaLLhVf0Lrq3fc3D4OZDGumy5p7xJZB/cUBqiuWacn/wRAdGbK742f2ZKhQpOA09xwczHb/d/nYhSYnDFSx9/vklf+QK4UWzA/jSKnCvL4uHoXp4GBk7pktckeqFm5S2UBkvcW1Dhy7Tid0ij8kb5WCfgffo5JTpYVCV8TdRfCxBT6dR4ItwtOz6+iaWEIgth+rHuUICXioJ4U0Evs9x54zYUP12rhTDGpEsVoybQwSpVoabeS1q4LEVLFJRhenPmTt9ImG5uEBZVnAWoxx4+cH7lQqQ== 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=SnrCKd90iOlJl0Ik0f4N/oSjQZQQUwzhdJYr12QdY+4=; b=dt9nEwaQ6MFLwtHVDIg06FDaeCvrBZasw28I9L0NhxcJwOpKhYTltU3MkRk2ZSBBlhANqjGQThwct87Z304mnjqHKKYjMYRiQlWb89hpJ2PsLNHGJj78f/bqNkcKBHRJo1etPD/dlsxU8dPyek6V7akQRpWx2sj1FfKom7od/NQNSlDFTQqKecLvwWpilVqYKrRYY6oEQSvOPdpIrwSh6ul1sqQJRhi1P6QfZFdi/gW3uf2ZBf+358w/tIf9nQEHUcXNc2GcsE729DOVb8e1wgGXHpP18cv4KTzfZzqFY/asyLfi5BXGQwpPFkiaAtGJ63DmbwMy0WF9fe8TnAwbrw== 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=SnrCKd90iOlJl0Ik0f4N/oSjQZQQUwzhdJYr12QdY+4=; b=IO4Z/umIBY3+CrxuksaAmq871kEbJNBDNnrtVdwbx4mGqqtHQO59hqvJuKxxm4ViPloE2vJJrqdpKRDpF1yhFw2i580/+3YtpOOCnUBrdATnw5/rfY+EUDwcrAFkzNkne8mn0FYsjlH5FMGOskqeFtO+eN7LKGbWxoNvB6RdiLM= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:36 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:36 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 3/7] arm64: dts: imx93-11x11-evk: reserved mem-ranges to constrain ele-mu dma-range Date: Wed, 19 Apr 2023 23:25:34 +0530 Message-Id: <20230419175538.855493-4-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: e1e0bc75-5063-43ab-479e-08db40d15188 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YkuZm43+Z9HgVs3rChKit0ZIuiYS1iuI93Cy0X1UVSeup2Fwm5HdQanR2G6axV2CjAEG6rcMZKHYx3QKX/LuwNmIyi0EZuUKofGNWphiGUtEH9l8TRWIy654RkPUYhCVjPK6iOzj+TE9gUaYdgVLfJczept50r9Cfa4e9MmhceXgK7q5U37LxA+lByTM9fa4CKJlzxy9eKWdwB0hnzNNvuUUvb+wHsBY88TvPNv9AM+/cXSyiQPemTWknEbixgOh+oe/xYlgLelTjdRIRfY7JgIKqUZ79b/g8lVgfPIDgHggDdf5QF8hUQlkHn7Xt3oGOtTnQjcPb2z+kiqJgYzxg+jKMmlWrarnrpzBrpGW6ArDJP+jVnGkCWzdRRIKr57Ua7imZIa5j5OfnpX806SWznLbqMIUR2FTXnQLixH84b3OcMhPP5p8gXnCWocJsyU77Od1B3oI5V3cX0YDo7fVp5qtKbecD5R5Y/e6oHAiVfdDgFsNxI7kjZGcRTgMnRInAhsDuq0w1g3GcCUhuZYda1GWtqUndBrRWqsTOuJQySgVIlsNHoYTfQnkIw+2zE6Ev8OG7Z+JkMbVTrE/GwO3Ka301m7HelK2mxBoifrXxQiudM0e4C7DoLfMcPsac6w3F34oepW3uvcH6VtAFTTn4A== 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nwC7yKQkv3vHNyCDLfTlTy8rZcbfSbp3HIqX0wfp1H/SVDWR4z6OJ95azs4qqxEbeUOFavYLd22YVENZIqdzyd0m3ipGciwnR5xz05dXkr6rsWLaUQmAqbdb2dVE02jyLeWlpn6TCi5tBsPNMVWWF7knWU5k5aKWcqaezGaRZBUToQZIvl54JlwgzW5xaZxhYhJLB3z0klYxaOvIwSrG2RPNmypzCVxj0NblPGOpCN3s7Qp9/CRdQs6mk3ATm4wzAeK3Op14e941GiV20Be0SocudKem3RotJjdgvD/g3A92Rs1rFw5aEhPcXi5xxVmG6I400v667rTcRJLnZrMrZDkLcD3c4/QYROVy8VaaR5RRQoIzqAYCombR12nCG+v17PLYnaWnZ5evzO1GkX1YmyDnjclM6/eXWQ5g8S/ZNN1zflZGp0uQn7FWC+l6mGkbxPA6hrqG3GULtUW2CvjPo0XVyQGs5C3qQmu1iXzH30uUSgRACQ9IE435zntZnx9qUs8JUpCRCi/nfrLc7KiASVrVUUHM4VKmojsd0wFOBK3Gj426vO0P2pRXsFBxF3KHPYkeOeWWoZz8hlIXAEuf/1Vlbup9Hd+xuOwzwgCWkvD76RueO95hNEtatmQBKY6/fds6krasCTHmIJMt4DgAECMh3xpXebUjugOtyCdtAlZKvwzWzoCfos/viMldm2kq5v1nwz+vcLM7tqx03joGtDNaRpi1d+esLZfGiwJRULFGoVc2WmQlvp/kuPZx4kG8qbCZaeYwyPUH7PzvdZ08daU1zfKcEkQQc+c5c5+qtoebl11/FgK1mOc+b4ZaJQ83pg0DzTAJZQzeQYJNQhD3U5c8ksVs9jACUYwX6RqHdm0Fk159BdXbGB0ZX/1/pbQ77edUYaZhcNQeOZew6K0cxmMpy3J745r3PXEqYMp8A1y2c0T450O0Gddg1pfqIqRNo/w6mT0LocLAOQE7boVaYl0W3zvVxOJkIarl9B3X56q83L8NhuPU9036dhjLbo2ohOX7DZNEpyOwlttzWar5zSafHlitun/ue8ZxXJONmD8pDGbOHpeYFyPbGg7X6b6CaZI27q8O1VSm6mtOtghXPdo9//NqbLEJAZH5Hk7a8DoTGMkgW+dr3vrWqtD6qzshfxbXvD3jaQeUPd5CQMXqo6WJMhz0nN51BVuU3V7iwJBsqIWYXtCo+G37umEBFDcm7mxKDc9QhHGnPxQmxyQvD+8iUV8di6Ok2ZygCXXs4UYCi9mSjJRghhEikb3s+eph5PZ83iiY79nwbUXw3CB8tn2KQPd5gmG13fw4W2CthvKCgCVu7Q2l8ZY+wCkB0NCtdzE/pZw/98iWLVsIJfL5J6PEmJDfXnoKwo8kG5fBVAvHqxNiTf+QahZYxgRosYxMoRUwvIp5VIXpCe5nqMQCbCky8qgXrBUn7249PyrdN2BIxOfYBmlY3wVxY/IWp7SONryIsQb4I13wfVgMm8FQKkFf2ZLmGF8FD564DT4Y45O5JEqU03P09LvtC7fw+lm208KMRBHJTL4VhWxYVEhNb9JwWPeZvHrnpbKEG1GnUe6l3ja1sYg628TxXshZsd75 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1e0bc75-5063-43ab-479e-08db40d15188 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:36.6663 (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: Jg5ox+H0iRZfnUIKDw4EQKHZueBLWj/76lPCCrs6mF8+xSuhD2dUSOg9a6IEygU+1CixgoHDHZSR5ah5gAmSUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052640_974030_BE1822F2 X-CRM114-Status: GOOD ( 10.36 ) 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 EdgeLock Enclave are has a hardware limitation of restricted access to the DDR memory range: - 0x80000000 0x9FFFFFFF ELE-MU driver requireis 1MB of memory. In this patch the we are reserving 1MB of ddr memory region from the lower 32-bit range. Signed-off-by: Dong Aisheng Signed-off-by: Pankaj Gupta --- arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts index fefb93487291..bb090300829e 100644 --- a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts @@ -7,6 +7,10 @@ #include "imx93.dtsi" +&ele_mu { + memory-region = <&ele_reserved>; +}; + / { model = "NXP i.MX93 11X11 EVK board"; compatible = "fsl,imx93-11x11-evk", "fsl,imx93"; @@ -22,6 +26,17 @@ reg_vref_1v8: regulator-adc-vref { regulator-max-microvolt = <1800000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + ele_reserved: ele-reserved@a4120000 { + compatible = "shared-dma-pool"; + reg = <0 0xa4120000 0 0x100000>; + no-map; + }; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; pinctrl-names = "default"; From patchwork Wed Apr 19 17:55:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216765 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 0DE3EC77B73 for ; Wed, 19 Apr 2023 12:27:41 +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=TcqXxj5dvBiDtwFEoM215YkkRG5MbQD5msRg2L6XWAc=; b=mGqdohLdf2LDBa 8RGveHdvgxT2KqS4uuI4kPlrrOyKG/w3BKso1/UcpPx67jwUBl8/FGeMzlhmVpd/lnGSBNnpgvQrM tjLu2lW7uqtwoUGQ/g7xy9bY7UNZ028bD95SkbzlAeGd5NZvKkXxVrBDd1Touc7xYtXhVj4tTiH/8 ok22+aiHQehGLQIzAbEE/5pNAaCL0IXKTe8MxQxe6M75KMIwBemxHQZowZrM7DjwxdQvYiPpmE9zO X/GRdsXavDWDVZAxOQMPBJPHuWoZojEdG6+/ppeTUkadPd5ZV1GGXsy8+cKhuoAn615KzE4K27POM T+OsH8nqWoiOuwzkRe9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6td-005NDI-1g; Wed, 19 Apr 2023 12:26:49 +0000 Received: from mail-he1eur04on061e.outbound.protection.outlook.com ([2a01:111:f400:fe0d::61e] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6ta-005NB3-2I for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:26:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oSsykTe2lZYFVuU+sIy1IA1+nlze3cRQZRn6JDLp/XlhdHzoUckWSfhcWWNrzAUU/yBaTyJQie9vXk84953FPa2UD3ksusLKJO8m/ZxC3oTC+ILlriF73ePflbFtzhys4/0Pj1dcloocY7C6+b/w1HTIyVga6hOiPwhTf4Zzid4UP+K6eXj+uI3lZxIGHtDbZj8jPFHVkQtpvAem2ToiBliC+BzEJUu8zyb0UP+DwfZPKBFu3mAVRZ3uAvb9MbRNGxERZM0nFTBEIPux7ZWlUQOTOT9uaD2haWcVbTGIABjGyVkgPj01IOnj/Z3Y6gkybG4epJt8BbV+xbOZ+pvmgw== 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=ugIHUpo1Yo8MvrNSkzKzeOS5DG0PsdIc4I8edIbHtZ8=; b=mwup9q258mmFkW7Luu9FY8jOKVSMRHZCSGhsnszZwm7AWdwSCu0f7M6Ms0jgx7m71A33DHTyBxNGrymm1S97gbdqDqEAxAHsu10gvJmDurKc0S3Vfq59N3dOGAVUJFwe2uE6MeHo5YPMeo2zau1Qs2DcCGmjLuLECVwOiP7T4KgnjrbRx2A5BX+2EkYLI1yaGCyRluru5AxcDGFd4YebFGzhq9LMhG+KEvLhXtJpBjOKSsZRSSbCjhp0/ZaTUOcYaWkPuRAbH+iQRaMqVk6UXSUFpu1slGwYZV9iHcgxOIgJk/Bb1OzZTMrowdoxdWQGge25bwfiZVYZoe82nWfA4A== 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=ugIHUpo1Yo8MvrNSkzKzeOS5DG0PsdIc4I8edIbHtZ8=; b=K9EdxwhShohqMqy2F07eArr44aXJEA6nHHvdXCF1u3LQylos7YzAcngLnlTOyTLNA7NMtN4eOeHTIaOMZ4REtYRpxIKAuwg9PuaDkD4qiK7VhZwSt33JTS9Ynx0H1YXsXlFAa2EgVQB96FhqXyQLph3IZ16ndLtW/MsPH3ebZKg= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:42 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:42 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 4/7] arm64: dts: imx8ulp-evk: added ele-mu Date: Wed, 19 Apr 2023 23:25:35 +0530 Message-Id: <20230419175538.855493-5-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: 4da246ca-c912-4978-4552-08db40d154ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9xa2iVxYIQzGHSXztrI5sITuPsCl0eEOp4KqAyEjwBZD14nuqqi4MLCjikJRjg3NP1efBrpAakcA/7B1acqFKa7Wd+X0TiyVmc8opDOO7oUoEv5dc9XtLkQXWVudsJ/8vIYQ+PW5yDqNObwGidPvOzjm7IJwH+8NSJy+h2fX1mnXB6b32ugDT2sux1JnTse6xjeqng+eG5FRStxLgZoHchwnYtdQxlqQTM75oYxfufzyrOMThhSwBYy7KoGscnCc0PBTgGak0xxSx+Xt4RQWiSXY8R2DpAGb2Lp6/K8mxNJDkrg+I/jMlbj38uLBeF3exg8Lrk82EvPFQC53TG/+MUQ/eGZFj0dMaBfEQpwHiENGxPvY6dG6l0wBv3ypgV6+Q54pPBrj1Qo3sG2iDjrhjlFYEqBFt/kE9lBWURHoC2JSZ/qwgOeYxDPJcShljRzkWBZm+4xyeF0NPSrQSlsUdr39GdiW6v0Ai0DwexV+wIADqQykH7QThRLOWeYhWOS8raKm8yDYDPoe76KmjDfZgYxZ+slLkxURqA/57nVhYsBrsBYKil5/RWnbKgT5+7/KYqg6ey7YT5ca+jw73hOgbb0mRFswg998yxCOSBCq1QNESSg84A5pMbBX0Q/0HhLApph/0plQtg6JvdGiRdxuyB8TZxhfpRb2qoWqb1DC63s= 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(6666004)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(86362001)(36756003)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1AvQDLKgZLEr5KHgM19nAey8GoCitzmYIjF8QcGusmOjfn10jA7HyKJNQiRPAtcFRajf+ALpP8LEfSAtHAmogiBxGRLpVaGkN9A04eROQ/urCGWPcQ6Zr2Nie7FMKSoXupg22aesakCz4S90Gi6/pQ+tIu2W6FdtUVbqG2tvERfoVJ1Na+EK7gaqXu97FgSVnGti4Nnnds+Q2zmF7zrLbgcOXfZKCXly1DGVNPb9cI6743Kco2sMpjSrhnAtgq/5aKiadkxm1Is7SLU5xdWmDJdD/mlpDnxO2pDoikwD+6OkmrY11qeyioPfitf5JfD1b+3LCAa/EC1GMEnobBtH/6HcH4CbEsWs/ft9KVkcPjm6I/y6Errv69YBbUHulDuPC6xKK5RoHLGHXRsWsQROxkEbrRe2DxR5+T1CZGunFWvjy4FcHNcKH+9isjWcV8imIaBmvoaivCetf6LC//xMH5BSlH/McfNuuiDraj6yWqhR/SIvuQI0e2S3qnuOCyb5RbavncGnG7kxe7dLPnK1v5lYA1aLlQp6PXL+JjYfWQLqQsxJHMmFwz9EFfxSnCY4mLq30SKtWRdlWVE/KbYnYidqTvggclOr/KnjmaBL3GejbHNlfXsckDRZCRCY0sjkvAUAB+mUG6kI3cE74tK/9S7v+jj5cFMSjVopVeJCxX5DF3oxJ0peub/i6Twp3tu6Jp4XGLamtY1DnEWLnbzXr9EiMNzhNGxX0xUrOxActdiSG/inK1Q7Ri0ohM1bbAMqRUkIecgV5rmjs7Mso5kngM+4PqIGAv6I23seM1cH8x9BG2O9ejACm2OmkTOizVjzo0mScFhiy0akHFsfnhYBZynFxHyeEXl1CNAcqV+bLE3E63ijwHzADRJ/Xt+FEMSSdtY9ZdWRkG9R+FIx5SWiaDExCoBfmNP3Bp8H9rH2eP0f3LI6+OIP9r6zXODDONS/YW8rrORy35g3ej6BOzOit970rY77SRBCLIAd46VCOJ973TMvJ8YSexq8JrcfiS715OiOKnj9mqAxcyNW8S7/WZuYcKtxQqXZ//fAlbDw+hO8LlEWe6FHAv4xk7tME1kNQtYuUWjkJeBGlA6WqDBGagOMp9bxeaBTfTvc6WwflKqPhXPoDEHzGJng6XaN31+AdcMyM7sKbE4b1V9TUvDgELyY1sxduy8UzgqThJ22TWCEwJ3Y//8LgNkAYRpxB8L41mGlhMBMAmEVnO3Ts3UDa5fHqPEpENJBekG3caqAys0ZA12d/M7dWrphoPcdeA5Qno9nZ5yitUSjH9aliC2/mkxECIKoB/MQ8fz/XMsM4teLzC0C2b/6D+030FipVCHCh/yht/pB1cVvDwX0gjK4lkaiDe+2gX5Cl81Fdk98Vie+NNERD8hzxzZaqbNKfUYPPFzbdXpr2ZoKRYRZtnL9ZODsECSBJ+oGxZVyrwqMt4lP+gNHoBa73ijqg1YBJMRW42SqewKUrfcAKxL73+G8s3ep8/Szz7NrLBI8E1pr8Xi1YqpqIf3UcNqOpDX3nZI+Cy8UNIHDqtN0HG1BoZUs+G830dJKvCEcQIYf/CKm7uf8KeBiS5hu6CpG3RB1qLNK X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4da246ca-c912-4978-4552-08db40d154ca X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:42.1246 (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: xKqO8EfxqlIVdniP9p44BMUB2v2YM/mVWI2b9JNPPLNpLcggf2g9rn4GRoBtcYXk6ZAGlUVueXmVEuiphr3GJQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052646_770714_25E08534 X-CRM114-Status: GOOD ( 11.41 ) 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 added support for ele-mu for imx8ulp-evk. Signed-off-by: Pankaj Gupta --- arch/arm64/boot/dts/freescale/imx8ulp.dtsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi index 32193a43ff49..2ab240258a67 100644 --- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi @@ -113,7 +113,7 @@ sosc: clock-sosc { #clock-cells = <0>; }; - sram@2201f000 { + sram0: sram@2201f000 { compatible = "mmio-sram"; reg = <0x0 0x2201f000 0x0 0x1000>; @@ -160,6 +160,17 @@ s4muap: mailbox@27020000 { #mbox-cells = <2>; }; + ele_mu: ele-mu { + compatible = "fsl,imx-ele"; + mboxes = <&s4muap 0 0 &s4muap 1 0>; + mbox-names = "tx", "rx"; + fsl,ele_mu_did = <7>; + fsl,ele_mu_id = <2>; + fsl,ele_mu_max_users = <4>; + status = "okay"; + sram-pool = <&sram0>; + }; + per_bridge3: bus@29000000 { compatible = "simple-bus"; reg = <0x29000000 0x800000>; From patchwork Wed Apr 19 17:55:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216766 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 30F84C77B73 for ; Wed, 19 Apr 2023 12:27:48 +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=6imWF68r5JsILw+Y+wf2sGB3QXMKhT7n8klORbwu7AY=; b=rI4V6Snd2BR8BG 9/E/c0h0iZBpw21e8VAGf/QYCs2+st/k5ZdO2GYRZLl94/Kbm1hIQzNw9AlTq0MdVRt9L1JCEvq3u ndtItI6sL0YDWwPUf+FMc3Z1h2WvWeAiiafE4QdegeXDK4lZ89UdakMpKikdgnHwwfuHRCVSCcdUz eyFZiWCumkEiv5l42ouomEhHDzlKAsrNkA25txyI3dClWu4n9iZym34WCByzxOfrAYkGeIkoxW868 RFRYkv9xnqwolqueB91FLgunBD8yDy1qFf2UETBfqQAjs6N1PVGL84w8drWY1BoqvUnHhW3/qy54M yg+n8MzS6twzsjNNi8bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tm-005NIN-2A; Wed, 19 Apr 2023 12:26:58 +0000 Received: from mail-he1eur04on0618.outbound.protection.outlook.com ([2a01:111:f400:fe0d::618] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tg-005NDG-2K for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:26:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OepVoBdScsGKDN+mXs6YOk5bbGaZt1kbxObLe9Hz1k2+5rljQ3xhh26Xciw4m4fawu4jcI5RQn8a9axNKvvhViy1T3/5AiMSRPs0Ldxek6N9aVLnA5WKmHZrFgJ/JJ8z54Z12aQDT+FPjyw5bESDi7DuH7IBKUlx0keUSKcx9XPqoBb3+4f6hcOOo/IETandB9IeNq1J0vZ3Fr0dUy/ebO52RaL2wp/qN/E4p0ChNb9Xw9IbnMHp8J0XF3LhBW9163GskeiEdMTfiqgC49uWdDJJo4kUZsCXWVETf04O2T6j07ZbbkxgwvV1cvvOecsfGqGYB1/z8vxwy66EavaOQw== 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=DFyzIxZnvOaPzlmylq1VEd/n8LVahEENfFCZeDmv1cM=; b=SynpDb8EvxLv0LYAkocBl02kcxCguuqsmc5se7SVunIdT5Sxhmc9CSu5OShD5hTY4vAAxQuxMvyHsndqIZ2KxjS/UtdYzZ9TjzFeQ1c5QMa6Kj4R1y7gB4Cp6UMQ9dvwGHVcJLveiBE3VIjxTJLCe0pn02vcMf4c8SuPdpfE2cSpiLj4oUH6KWcP53+T6XVS5ukg+iwY2hkRIXd9tcHVAK4TKj0QSJHdgYIdyTX1BdD0BcdRS4SE0FIthAewspzjaGqrTTTzWl7MVymCraRk/vJ/Qex7nBPHPKTdgLCjho/axLN1cyZUfes50ZI2qDVNGVKyJmMuLxoWdyaMx4xQwQ== 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=DFyzIxZnvOaPzlmylq1VEd/n8LVahEENfFCZeDmv1cM=; b=Il0YP8fdDP32LGv8gNfnbx6xG+VYMtuT6zPMcRAtXobYY4Lg42doZkURtH5zgNi+oR/N1Jpy0KtMGFBtzs4dYpU8iYXzbPdtv84y9EI1RofwlO0CUrYU6mjxaZQbMQ1iQdF4snR+qqpdubLbYb7gZj3AjqSmhN407ilEJp27ylo= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:47 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:47 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 5/7] arm64: dts: imx8ulp-evk: reserved mem-ranges to constrain ele-mu dma-range Date: Wed, 19 Apr 2023 23:25:36 +0530 Message-Id: <20230419175538.855493-6-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: bb127714-519e-407d-f7c0-08db40d15813 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DIy1tCId79T+d6yZuxhpUlQK5bYcitnyiZGamxUijpWzkjPEUuL8525NkHF3ZAX7cBcYqdtmE4gzjZaVpYAH5CKQ+nTxaAGrVg2lZa4T+Qq4WZQBYHgIdOhkfok9u5UeOxRI2E+r/SeDOvpDKYkl5XlPkRwauC7Wk7/DllGMrlbfv0fqvNNTwPIYBRmIgtwt+ur3TUVbcTWgQKHsci3JAyrGpJiNCdwryz+ZAns2Riyw+G9+CbXMp4ZnZJhLkvOoTeNvxCIivQewXaup5tscZnu0UDrj7qG95clmeXE9f6MJknxBSbCKVKDAQ+oW/wOTUXDAmB+V+rcCBB+dHG9bBoPEPHg1y/sJyve5b+12bSFfMUPZHRrT3kQVpSkxB89an2cJoeEH6oYbffjnfGeyE9R3kQPZlPtWafgYRFOe83aUCuiM/M1OBVH0lz34Gf1r4sdOJUKQ/rt49EnfniGK8OCWu9cJAo9CHZcUFLSqKm+wJdP9DycDfjFiAWySVnI2gV9rh+15eRraJd0HKfhyFjVLHevIF6fkdrf7Y5moI3mRog5JoBWx0pZRwdY9qcro7rk6OxJ0sYe3ijwe+J0l4Z3IJJu1cepq/g7mubVCoxn1syEm5hK5aqlsbNrT9yR0S6UZ0pg97gRqUiu4igMqlVy8niSdISTaOXSJhKCmfPM= 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(6666004)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(86362001)(36756003)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q8w/PVDPnLPJxd6BEMHnbmQGjnyeaSV+ZgRdmXQFrzWLLf4xym+8UqaYpYkd8k8cqHflgokHuLcEAl3eDUHW/pw3efrEOj8ZTaybTyfnWU6nfnz12wTORNU3o9Y3rD5Y1wRPP85eemu0pCmkXgKwqcTUluG+09ABe5+YDbvkyw18cgFTXzW8ofz3vvT8zwXTw/gnOtVcf5kzLAm7ml5ihMC+DNV4m05+IqEs9wcEPIW5Mq0HP9tpr908FvzZFbECjBGT8zs7H1Z3hYdDoDxgSuB4jSaYfocYY22HisBQYehFKHZqrAIGrYg2DJZPdZShaV33epKuqcEsZgn8jH2d7SpGZd8Hi9oQCI4yHYMsZqYbju74qPyBqsTR2Yf3GU9mRn6OF2fBmYpL9NSJ8h/qqojrnoxBb7O+2AhztPoYWVoLOYBeAxVgchTPFrWxWeelgvUZajTF1vBN4g0fsegQwFz/bzZDj/+ccAfxq0bw9Wfrau5kgtplSH++Tze6+FTm5BF8xPp301ZxojA0Ls1UxkYO7aLE47F5PKI392gqFm4x65f/O6/1FFi4yN8f4Dribj1OhwsaO4MsS9uWAUbfnhuBED/MvEGFC9o+Gwy631/672LFvD1SNHl80xotYkdVOgFLdiq/lvmLs+mMnzoSNMfKit83elfvnBwIpkYZTqw/17VtstW2smt4XCx211rYU2xzVKmo9NvvC1AFY56MOXPe7yb+Rexeib09y4qVTNxv+fpNU7dX1Q8ovqYveSpXsEN7OWKyhOcN36q16NuZtUTSuZ1SmThuevITaVa5lELo0ni39/GeZSetAy2AMX17EaZJ1s6kNVkFO16qwGkWLwxZxqeHCIuKeEqK9mc5/rC4EUhBStq9P87OxtRfldzVTSkW9gRjAMTxjS+mvdyFxw6aYSi6j7bR8gD93WYdQH9XEXpiBSSzH4zJ4XZs3q+kUnhygT4e1TtVbykWaldbhQtaSi2DWR2EysD11HBrlkR7fPirGeJlJ7/1S8hlVqgeWzhsXKSLk5oyHdTkOtoEcmbhtOu4nt7Kwk+efFUG9r5jteCt5YNpB91zeVGp2sHiMCumLqU8Tk38ysNlr+QcxLEYg6SD1lerAakePm7s8QC14kefcG07MJjaApDjnkYiwPNRh6xEA6dkfsl1xEifJJd/qw/ap37hR52c1K3+yR/4NTcWqqOOSp84lzI640yGNPAdpMIksIFdMBsnasS1J2aQKXQq7hl5BXQG6TJETHok1F0OE0BenCzBu6zNnlasSVq+7bAsLY7d8ngTtajG127uYHnM2Vn+DHS1driy3mT3T6e7ZptqSIopTMScjHaCyaRlPFiyg+2tXYrn0D3Rwl3MMqiP99PpLffnVxuBqf8jKzkA98DNznIR9po6Jw0sSNkVyUiZDXCGtDvV0YQLSje+avgWceZ4Z5q2ll6Hltdq14yCf4pOv5poknklhRpec9jhlKfpbFY/XHGzwB6WV4zpYx17CQ1QiOypiVCauzQL71mDNtYX0J4p/9Kflox5NYbo+DevIu3EttYRqok2o7NCIO3ZFBpoxAqelSkecuo3gfzBotMJbddQzVeXrkAT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb127714-519e-407d-f7c0-08db40d15813 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:47.6468 (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: gLoNfYsm+ybPyMtxPr42SgLCqP0Wpeww6FFhRGBL+2zCC35IitAvS53miKYdX+mgChIQXgFQ/56gK4JueDVpKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052652_762264_3A5B7D30 X-CRM114-Status: GOOD ( 10.52 ) 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 EdgeLock Enclave are has a hardware limitation of restricted access to the DDR memory range: - 0x90000000 - 0xAFFFFFFF ELE-MU driver requireis 1MB of memory. In this patch the we are reserving 1MB of ddr memory region from the lower 32-bit range. Signed-off-by: Dong Aisheng Signed-off-by: Pankaj Gupta --- arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts index f1c6d933a17c..d2a39e9aa951 100644 --- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts @@ -19,6 +19,17 @@ memory@80000000 { device_type = "memory"; reg = <0x0 0x80000000 0 0x80000000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ele_reserved: ele-reserved@90000000 { + compatible = "shared-dma-pool"; + reg = <0 0x90000000 0 0x100000>; + no-map; + }; + }; clock_ext_rmii: clock-ext-rmii { compatible = "fixed-clock"; @@ -53,6 +64,10 @@ &usdhc0 { status = "okay"; }; +&ele_mu { + memory-region = <&ele_reserved>; +}; + &fec { pinctrl-names = "default", "sleep"; pinctrl-0 = <&pinctrl_enet>; From patchwork Wed Apr 19 17:55:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216768 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 50790C77B73 for ; Wed, 19 Apr 2023 12:28:56 +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=P7q0igzbxG4CHK7W+Okpf83klPqjN1tVm8q5ZEG4tLo=; b=QwuEIRZ97HXyU3 U5bkqJoK6WDCJ3S/tq/rMulmJHlA7fynS2F77aQt+ljTSez3TSps6nyXT3CH4Ka1iekDovJR9/2ay aSVBCJj4aIW8iOLI2RCw5qfa0+R7Bee02hbtrFRt3LRKSkGU6xHY+5FDIY1X/6o6GR+Dpo+eC25nV 0sZuOeQTyln3tBI3EVwziQ+BXmxIRPaXVjjorUbdXocYmUqcRxOrmtbp2StalyLt92xK0XVs65WOJ SJYc6FZewcvA0TuxNVo4Z5q03Hx8LqDKUbAtGgchhfRo0NRcmTCYcSQy65pjNlK9vkzESGglNDZfL LFsrM8p9skg6aKWczgZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tv-005NLy-12; Wed, 19 Apr 2023 12:27:07 +0000 Received: from mail-he1eur04on0618.outbound.protection.outlook.com ([2a01:111:f400:fe0d::618] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tk-005NDG-0y for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:27:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I36ny9FfdE59P1JoQds0ht8xLzlMaKK790+kAqxsNJTkyBjXdUXNiS+EB771BSnvn0mD/21U4GHUi6SLSaoe3cOmpI+EuLl+HaRKSyVdlsM06A3KGDLQDBxiU9fkqAQ6FyKhc0AnGBx/dLHeRQxzAO4yWNHtIWaamoymvfQy/RDF+yWXeoxAlm/eKC+NVLT06UHtYVUYas26YNHt/xwKR7YvsIma3xo43mKK3LzlpYd4iNbaI8H8hGzhlSrCHv7/xGF77Pe1RShg+q++sC/x0/vii800gEHsL3h7Rqx0nhZeppdvbDZd1oIlG8w43Np34wcCcKCdTMIEbJKm76Tcsw== 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=5fIj7uff9uI9H1FO2AtHCUFoOsQYmQJCsyMEaNjxrtU=; b=I/dDXHmKo2uiZlKa9RQebGiC+Yndp4lZpXYpH6MKMWGdrGbRaZBu1VR6iFvWr9L3h/9Su/6gGz6GKrCR6RNL2QK+vBGaIycKEgMR9Y8uC7ygzMaRI18Ki9jyUWEi+KA83ZqFPNyCTXMZuQDJucNn5mSeGuzW33Hgu7V+9+c1r6AOqYZJhAV6/y+WiJDgE91B7HoMH5+VF02Ib0JVUpMmpm3L8TwT+vw7Ycyy/Zv0iQFfz0vM73F6LRCdPFh4ZWy/AwuTnIXTLU8E5wWWtmbXgxuQ/HwMBYpgncaBVQs1vkCUDjN955SiHbcogYGHdW8hhbqzVIlUJKM5d1Rqnf9WWA== 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=5fIj7uff9uI9H1FO2AtHCUFoOsQYmQJCsyMEaNjxrtU=; b=EwP0w82GgHlHcguDnv2MKywtjKClhsNVMzJuTgISTqHpQY80Nm8MyxEHDvd1fHxXCMNBGAMVXBvfEeMoxdetttz0KBWWA4ANcvLsJHVex8lstboHnuFtAmcNvQsb9T/Z+H6ivMGOtT7ZUSGGX1E8CaYZcToRofwqD6CpCsM7vFA= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:53 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:53 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta , kernel test robot Subject: [PATCH v2 6/7] firmware: imx: add ELE MU driver support Date: Wed, 19 Apr 2023 23:25:37 +0530 Message-Id: <20230419175538.855493-7-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b3029fd-1ae3-4ad4-92f8-08db40d15b6e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 95t6bVYre6R8Yluk4DZRHsZINnbBUZqp47mRcxQ582yvPOWuYcEhXvH4PtTmSbTuHVXA4YWX09eBwxMDZYGdyyZvBH6VxkGkF6Pbb8M7RjwDa88dwDuJ4rAWnFL22vVSzvg9g92TEug2Twr7tHL5O7NbaRrC+ngtdA4BScD7xPDgu4cJ2TiYkL43bWS99F4uq6dfPwjmYf0b1lZyT4OuzKcLk4Og1lBNflz//EAfW4j3ciuB/tqJBRffn3+dBJEdxTzeLZhaERwMzR1fWc40Te0pt4rNpzRAvxiObaaQClU1DdpuiuetRiN7admPNXVsgf2RvkdEhut3zNgPrXSnYMqq21CdF/VU0ptfU6L6GaJJzsRaBO6cwO7S9/f7/8eo8w37Jf+J/uNLO2CfrFsqctAfMFUIhwnMxCJj970dJJ3+dX+XPE/RZdE79N8pfrfPeEOjYepH8cNGAwA1T9qvLo/UD9FrmJ1hxk5Yidn9WdCpTcRsbWZ3U6Y0hX3NUTqZMsc4cCQBEfNxRg7nN31w53ov28V9/Xm2Q/5b5H1QinR6XdngKfp+hFwdvuRWMaShXmAXEwIUagD8qCdfQS8wl507fq45ehwgZZcljNJaA03JTC8OfMCFW0Pwa0gw7VR9KL4hTJSiXXl9aialaV/KGg== 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(54906003)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(6666004)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(7416002)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(30864003)(86362001)(36756003)(579004)(559001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fhPOKBMkpI7p1c4kUPAJzo/gqSSXaqDQmscJHvQ0XpeAtzPPW9bWdUIf5oxT2Uz9Bo6hHRiR6naTgHVR5tJfcP6phHsf0vvQbLiQP8NsrOYdQ8JSX7aGusLvNGJ5BUIzWjnhh8bbdOzgLW0Db7uTgLuJ7JrDFv2U7Y+CLCWM2UlSi90SNTHjKnLnX3IUmxqUvFzJ42IudYuRVHYeJKDsD46HPfaVtuGxtypgvGuS4BCwP+b//sEUWXD4n9j5pSOBwOUC/vAFKjFxqGnKXl6ee52IgXZzTQ9aHdhOFhPAGJRtgJFWLUVyWbmdv+4xJhgw2HUtaR5WvuwkvHR4jjqKIUQESq+PIHQ1aaVjI0J3FDviFIGsWXUXkW5kFTVAQxCt6aeJmKL4CTL07ZcZtvV4jjSfcWYWAQhsy4nFb0dLczSpXtU/7HEqKy3ekZ7j71c1cIzGYjJ78LcwRjO2L5mwfSfgSi8HSL3T0YCWaTWyZqQ1GR3msHSxwVwKT4jfdW+pJaIpC4KFVY8tpvBkXF27pWKuPPxqXcWOTg1XzEWKE99DiyTqi3f7QaDsXCMoUWVcyNtAPZD0kdhcHvOX11Fi02shxg5ewNHHm6FS7+0AR4RJB0c6J6AHBs2e7oGKf6Q/5XXMlxnuirmFuK9/45SsFGm5+bPgaDkk62jA1daUoy3gR7bwZsQL8IWSi/5USNFWSM7SDDfVGHZJN7at7L5p3qMqbTFPpazDyMS6Z8/K+6WdUx8Jo2TqrBrRyXjKl6/oyfZkj7grO1mgd9E/72I46mAN91QLvRY8/xVFsHrofmbrDi+/9KOX65iZhk+kvLH9LO1qWRqsGFAG+Nx2Er1ukPQk4Onxng8aquX2GK/YMlnL7WAJwhEbb9GQ3EmvFmg4Xj8GUvbuAPN7CnMkXhJhgdjn3ABNPA0XzpwBvMVYrtxkDSy0E7Sj+ItuhFQddrTGJjUBNecZmJUByl9OXinpBp8qt+ACDIOwb81gpbcyiUgW/nitNM8IjOCF0g/EqO4mI19k2EIG8YDy8t2WKbXromopvX5v7rhgeDIukJWfj9H1ic+8jh4mRM+/oKSg67O5SdQGWENWtnit98kGAg3zXf5ddN23/BbmEqRi1gN4wO0rfqZMmBtA5RNbvHvf8+gWSqpp8jeAyMir8q55sNgQmueB/7erp8081rJhW77oLOOpRcXHx1spBDKe5YU/jPo4hpC2OH1gdMQuYGknMhYmj0Eo2JkgzLUJAMsWRLDWnjDbqBRcUA55KsiDZE0klQJrRDkHE/RAbJeW8VZKqZVM1gGJ/BMoP8YMlVrNmFhB7C7GP/QOw/jekWuwrJx1564D0RXt855kviG8fDxJOwHswzBVG4MSYSpZAV4tYEpsMdkqYyRf/6sqO9aAs3x+kityD6g+JoEL3WRQQEpc267mKyvGFs4NeNBaibKd9KOOFQyjS0w29tGq3pO5gH3BVmvZ4tjJFh089OCJY/4/wqUV8KZSJDkBKPqF4niQ2rSlqwffQIGEE/AM5mwJQW5FMsaQx3XlD3b50gHcg4upbStelaMH18fe2O2NXZqhBT3K0mNr5N/o7/2/TrYig+JLz2oF X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b3029fd-1ae3-4ad4-92f8-08db40d15b6e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:53.3088 (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: XMWcWkMbpAlcK/vUwBpxVX/Fr8+ByzpVSEv0taoGk8mCiMhw2bNmpZcjEKo6/k6U1B+lHu5HqDA9qTHUr51Gog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052656_558165_407A0C5E X-CRM114-Status: GOOD ( 26.27 ) 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 Edgelock Enclave Message Unit (ELE MU), is a message based communication channel, to communicated with ELE Firmware. This runs on a dedicated MU present between application core and ELE H/W IP. It exists on some i.MX processors. e.g. i.MX8ULP, i.MX93 This patch implements the mail-box based communication with ELE firmware. Signed-off-by: Gaurav Jain Signed-off-by: Pankaj Gupta Reported-by: kernel test robot --- drivers/firmware/imx/Kconfig | 11 + drivers/firmware/imx/Makefile | 2 + drivers/firmware/imx/ele_base_msg.c | 378 ++++++ drivers/firmware/imx/ele_mu.c | 1285 +++++++++++++++++++++ drivers/firmware/imx/ele_mu.h | 174 +++ include/linux/firmware/imx/ele_base_msg.h | 67 ++ include/linux/firmware/imx/ele_mu_ioctl.h | 52 + 7 files changed, 1969 insertions(+) create mode 100644 drivers/firmware/imx/ele_base_msg.c create mode 100644 drivers/firmware/imx/ele_mu.c create mode 100644 drivers/firmware/imx/ele_mu.h create mode 100644 include/linux/firmware/imx/ele_base_msg.h create mode 100644 include/linux/firmware/imx/ele_mu_ioctl.h diff --git a/drivers/firmware/imx/Kconfig b/drivers/firmware/imx/Kconfig index c027d99f2a59..eef6c6a8b61d 100644 --- a/drivers/firmware/imx/Kconfig +++ b/drivers/firmware/imx/Kconfig @@ -28,3 +28,14 @@ config IMX_SCU_PD depends on IMX_SCU help The System Controller Firmware (SCFW) based power domain driver. + +config IMX_EL_ENCLAVE + tristate "i.MX Embedded EdgeLock Enclave support." + depends on IMX_MBOX && ARCH_MXC && ARM64 + default m if ARCH_MXC + + help + It is possible to use APIs exposed by the iMX EdgeLock Enclave like base, HSM & + SHE using the SAB protocol via the shared Messaging Unit. This driver exposes + these interfaces via a set of file descriptors allowing to configure shared + memory, send and receive messages. diff --git a/drivers/firmware/imx/Makefile b/drivers/firmware/imx/Makefile index b76acbade2a0..886385e79bf2 100644 --- a/drivers/firmware/imx/Makefile +++ b/drivers/firmware/imx/Makefile @@ -2,3 +2,5 @@ obj-$(CONFIG_IMX_DSP) += imx-dsp.o obj-$(CONFIG_IMX_SCU) += imx-scu.o misc.o imx-scu-irq.o rm.o imx-scu-soc.o obj-$(CONFIG_IMX_SCU_PD) += scu-pd.o +el_enclave-objs = ele_mu.o ele_base_msg.o +obj-${CONFIG_IMX_EL_ENCLAVE} += el_enclave.o diff --git a/drivers/firmware/imx/ele_base_msg.c b/drivers/firmware/imx/ele_base_msg.c new file mode 100644 index 000000000000..34221288dfd1 --- /dev/null +++ b/drivers/firmware/imx/ele_base_msg.c @@ -0,0 +1,378 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021-2023 NXP + */ + +#include +#include + +#include +#include + +#include "ele_mu.h" + +/* Fill a command message header with a given command ID and length in bytes. */ +static int plat_fill_cmd_msg_hdr(struct mu_hdr *hdr, + uint8_t cmd, + uint32_t len) +{ + struct ele_mu_priv *priv = NULL; + int err; + + err = get_ele_mu_priv(&priv); + if (err) { + pr_err("Error: iMX EdgeLock Enclave MU, used before probing.\n"); + return err; + } + + hdr->tag = priv->cmd_tag; + hdr->ver = ELE_BASE_API_VERSION; + hdr->command = cmd; + hdr->size = len >> 2; + + return err; +} + +static u32 plat_add_msg_crc(uint32_t *msg, uint32_t msg_len) +{ + uint32_t i; + uint32_t crc = 0; + uint32_t nb_words = msg_len >> 2; + + for (i = 0; i < nb_words - 1; i++) + crc ^= *(msg + i); + + return crc; +} + +int imx_ele_msg_send_rcv(struct ele_mu_priv *priv) +{ + unsigned int wait; + int err; + + mutex_lock(&priv->mu_cmd_lock); + mutex_lock(&priv->mu_lock); + + err = mbox_send_message(priv->tx_chan, &priv->tx_msg); + if (err < 0) { + pr_err("Error: mbox_send_message failure.\n"); + mutex_unlock(&priv->mu_lock); + return err; + } + mutex_unlock(&priv->mu_lock); + + wait = msecs_to_jiffies(1000); + if (!wait_for_completion_timeout(&priv->done, wait)) { + pr_err("Error: wait_for_completion timed out.\n"); + err = -ETIMEDOUT; + } + + mutex_unlock(&priv->mu_cmd_lock); + /* As part of func ele_mu_rx_callback() execution, + * response will copied to ele_msg->rsp_msg. + * + * Lock: (mutex_unlock(&ele_mu_priv->mu_cmd_lock), + * will be unlocked if it is a response. + */ + + return err; +} + +static int read_otp_uniq_id(struct ele_mu_priv *priv, u32 *value) +{ + unsigned int tag, command, size, ver, status; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + + if (tag == priv->rsp_tag && + command == ELE_READ_FUSE_REQ && + size == ELE_READ_FUSE_RSP_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) { + value[0] = priv->rx_msg.data[1]; + value[1] = priv->rx_msg.data[2]; + value[2] = priv->rx_msg.data[3]; + value[3] = priv->rx_msg.data[4]; + return 0; + } + + return -EINVAL; +} + +static int read_fuse_word(struct ele_mu_priv *priv, u32 *value) +{ + unsigned int tag, command, size, ver, status; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + + if (tag == priv->rsp_tag && + command == ELE_READ_FUSE_REQ && + size == ELE_READ_FUSE_REQ_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) { + value[0] = priv->rx_msg.data[1]; + return 0; + } + + return -EINVAL; +} + +int read_common_fuse(uint16_t fuse_id, u32 *value) +{ + struct ele_mu_priv *priv = NULL; + int err; + + err = get_ele_mu_priv(&priv); + if (err) { + pr_err("Error: iMX EdgeLock Enclave MU, used before probing.\n"); + return err; + } + err = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_READ_FUSE_REQ, 8); + if (err) { + pr_err("Error: plat_fill_cmd_msg_hdr failed.\n"); + return err; + } + + priv->tx_msg.data[0] = fuse_id; + err = imx_ele_msg_send_rcv(priv); + if (err < 0) + return err; + + switch (fuse_id) { + case OTP_UNIQ_ID: + err = read_otp_uniq_id(priv, value); + break; + default: + err = read_fuse_word(priv, value); + break; + } + + return err; +} +EXPORT_SYMBOL_GPL(read_common_fuse); + +int ele_ping(void) +{ + struct ele_mu_priv *priv = NULL; + unsigned int tag, command, size, ver, status; + int err; + + err = get_ele_mu_priv(&priv); + if (err) { + pr_err("Error: iMX EdgeLock Enclave MU, used before probing.\n"); + return err; + } + err = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_PING_REQ, 4); + if (err) { + pr_err("Error: plat_fill_cmd_msg_hdr failed.\n"); + return err; + } + + err = imx_ele_msg_send_rcv(priv); + if (err < 0) + return err; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + + if (tag == priv->rsp_tag && command == ELE_PING_REQ && + size == ELE_PING_REQ_MSG_SZ && ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) + return 0; + + return -EAGAIN; +} +EXPORT_SYMBOL_GPL(ele_ping); + +int ele_service_swap(phys_addr_t addr, u32 addr_size, u16 flag) +{ + struct ele_mu_priv *priv; + int ret; + unsigned int tag, command, size, ver, status; + + ret = get_ele_mu_priv(&priv); + if (ret) + return ret; + + ret = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_SERVICE_SWAP_REQ, 24); + if (ret) + return ret; + + priv->tx_msg.data[0] = flag; + priv->tx_msg.data[1] = addr_size; + priv->tx_msg.data[2] = ELE_NONE_VAL; + priv->tx_msg.data[3] = lower_32_bits(addr); + priv->tx_msg.data[4] = plat_add_msg_crc((uint32_t *)&priv->tx_msg, 24); + ret = imx_ele_msg_send_rcv(priv); + if (ret < 0) + return ret; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + if (tag == priv->rsp_tag && + command == ELE_SERVICE_SWAP_REQ && + size == ELE_SERVICE_SWAP_REQ_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) { + if (flag == ELE_IMEM_EXPORT) + return priv->rx_msg.data[1]; + else + return 0; + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(ele_service_swap); + +int ele_get_info(phys_addr_t addr, u32 data_size) +{ + struct ele_mu_priv *priv; + int ret; + unsigned int tag, command, size, ver, status; + + ret = get_ele_mu_priv(&priv); + if (ret) + return ret; + + ret = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_GET_INFO_REQ, 16); + if (ret) + return ret; + + priv->tx_msg.data[0] = upper_32_bits(addr); + priv->tx_msg.data[1] = lower_32_bits(addr); + priv->tx_msg.data[2] = data_size; + ret = imx_ele_msg_send_rcv(priv); + if (ret < 0) + return ret; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + if (tag == priv->rsp_tag && + command == ELE_GET_INFO_REQ && + size == ELE_GET_INFO_REQ_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) + return 0; + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(ele_get_info); + +/* + * ele_get_trng_state() - prepare and send the command to read + * crypto lib and TRNG state + * TRNG state + * 0x1 TRNG is in program mode + * 0x2 TRNG is still generating entropy + * 0x3 TRNG entropy is valid and ready to be read + * 0x4 TRNG encounter an error while generating entropy + * + * CSAL state + * 0x0 Crypto Lib random context initialization is not done yet + * 0x1 Crypto Lib random context initialization is on-going + * 0x2 Crypto Lib random context initialization succeed + * 0x3 Crypto Lib random context initialization failed + * + * returns: csal and trng state. + * + */ +int ele_get_trng_state(void) +{ + struct ele_mu_priv *priv; + int ret; + unsigned int tag, command, size, ver, status; + + /* access ele_mu_priv data structure pointer*/ + ret = get_ele_mu_priv(&priv); + if (ret) + return ret; + + ret = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_GET_TRNG_STATE_REQ, 4); + if (ret) + return ret; + + ret = imx_ele_msg_send_rcv(priv); + if (ret < 0) + return ret; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + if (tag == priv->rsp_tag && + command == ELE_GET_TRNG_STATE_REQ && + size == ELE_GET_TRNG_STATE_REQ_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) { + return (priv->rx_msg.data[1] & CSAL_TRNG_STATE_MASK); + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(ele_get_trng_state); + +/* + * ele_start_rng() - prepare and send the command to start + * initialization of the ELE RNG context + * + * returns: 0 on success. + */ +int ele_start_rng(void) +{ + struct ele_mu_priv *priv; + int ret; + unsigned int tag, command, size, ver, status; + + /* access ele_mu_priv data structure pointer*/ + ret = get_ele_mu_priv(&priv); + if (ret) + return ret; + + ret = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, + ELE_START_RNG_REQ, 4); + if (ret) + return ret; + + ret = imx_ele_msg_send_rcv(priv); + if (ret < 0) + return ret; + + tag = MSG_TAG(priv->rx_msg.header); + command = MSG_COMMAND(priv->rx_msg.header); + size = MSG_SIZE(priv->rx_msg.header); + ver = MSG_VER(priv->rx_msg.header); + status = RES_STATUS(priv->rx_msg.data[0]); + if (tag == priv->rsp_tag && + command == ELE_START_RNG_REQ && + size == ELE_START_RNG_REQ_MSG_SZ && + ver == ELE_BASE_API_VERSION && + status == ELE_SUCCESS_IND) { + return 0; + } + + return -EINVAL; +} +EXPORT_SYMBOL_GPL(ele_start_rng); diff --git a/drivers/firmware/imx/ele_mu.c b/drivers/firmware/imx/ele_mu.c new file mode 100644 index 000000000000..41653429f7e2 --- /dev/null +++ b/drivers/firmware/imx/ele_mu.c @@ -0,0 +1,1285 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021-2023 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ele_mu.h" + +#define ELE_PING_INTERVAL (3600 * HZ) +#define ELE_TRNG_STATE_OK 0x203 +#define ELE_GET_TRNG_STATE_RETRY_COUNT 0x5 + +#define ELE_GET_INFO_BUFF_SZ 0x100 +#define ELE_GET_INFO_READ_SZ 0xA0 +#define ELE_IMEM_SIZE 0x10000 +#define ELE_IMEM_STATE_OK 0xCA +#define ELE_IMEM_STATE_BAD 0xFE +#define ELE_IMEM_STATE_WORD 0x27 +#define ELE_IMEM_STATE_MASK 0x00ff0000 + +#define RESERVED_DMA_POOL BIT(1) + +struct ele_mu_priv *ele_priv_export; + +struct imx_info { + bool socdev; + /* platform specific flag to enable/disable the ELE True RNG */ + bool enable_ele_trng; + bool reserved_dma_ranges; +}; + +static const struct imx_info imx8ulp_info = { + .socdev = true, + .enable_ele_trng = false, + .reserved_dma_ranges = true, +}; + +static const struct imx_info imx93_info = { + .socdev = false, + .enable_ele_trng = true, + .reserved_dma_ranges = true, +}; + +static const struct of_device_id ele_mu_match[] = { + { .compatible = "fsl,imx-ele", .data = (void *)&imx8ulp_info}, + { .compatible = "fsl,imx93-ele", .data = (void *)&imx93_info}, + {}, +}; + +int get_ele_mu_priv(struct ele_mu_priv **export) +{ + if (!ele_priv_export) + return -EPROBE_DEFER; + + *export = ele_priv_export; + return 0; +} +EXPORT_SYMBOL_GPL(get_ele_mu_priv); + +/* + * Callback called by mailbox FW when data are received + */ +static void ele_mu_rx_callback(struct mbox_client *c, void *msg) +{ + struct device *dev = c->dev; + struct ele_mu_priv *priv = dev_get_drvdata(dev); + struct ele_mu_device_ctx *dev_ctx; + bool is_response = false; + int msg_size; + struct mu_hdr header; + + dev_dbg(dev, "Message received on mailbox\n"); + + /* The function can be called with NULL msg */ + if (!msg) { + dev_err(dev, "Message is invalid\n"); + return; + } + + if (IS_ERR(msg)) { + dev_err(dev, "Error during reception of message: %ld\n", + PTR_ERR(msg)); + return; + } + + header.tag = ((u8 *)msg)[TAG_OFFSET]; + header.command = ((u8 *)msg)[CMD_OFFSET]; + header.size = ((u8 *)msg)[SZ_OFFSET]; + header.ver = ((u8 *)msg)[VER_OFFSET]; + + dev_dbg(dev, "Selecting device\n"); + + /* Incoming command: wake up the receiver if any. */ + if (header.tag == priv->cmd_tag) { + dev_dbg(dev, "Selecting cmd receiver\n"); + dev_ctx = priv->cmd_receiver_dev; + } else if (header.tag == priv->rsp_tag) { + if (priv->waiting_rsp_dev) { + dev_dbg(dev, "Selecting rsp waiter\n"); + dev_ctx = priv->waiting_rsp_dev; + is_response = true; + } else { + /* Reading the EdgeLock Enclave response + * to the command sent by other + * linux kernel services. + */ + spin_lock(&priv->lock); + priv->rx_msg = *(struct ele_api_msg *)msg; + complete(&priv->done); + spin_unlock(&priv->lock); + //mutex_unlock(&priv->mu_cmd_lock); + return; + } + } else { + dev_err(dev, "Failed to select a device for message: %.8x\n", + *((u32 *) &header)); + return; + } + + if (!dev_ctx) { + dev_err(dev, "No device context selected for message: %.8x\n", + *((u32 *)&header)); + return; + } + /* Init reception */ + msg_size = header.size; + if (msg_size > MAX_RECV_SIZE) { + devctx_err(dev_ctx, "Message is too big (%d > %d)", msg_size, + MAX_RECV_SIZE); + return; + } + + memcpy(dev_ctx->temp_resp, msg, msg_size * WORD_SZ); + dev_ctx->temp_resp_size = msg_size; + + /* Allow user to read */ + dev_ctx->pending_hdr = dev_ctx->temp_resp[0]; + wake_up_interruptible(&dev_ctx->wq); + + if (is_response) { + priv->waiting_rsp_dev = NULL; + //mutex_unlock(&priv->mu_cmd_lock); + } +} + +static void ele_ping_handler(struct work_struct *work) +{ + int ret; + + ret = ele_ping(); + if (ret) + pr_err("ping ele failed, try again!\n"); + + /* reschedule the delay work */ + schedule_delayed_work(to_delayed_work(work), ELE_PING_INTERVAL); +} +static DECLARE_DELAYED_WORK(ele_ping_work, ele_ping_handler); + +static int imx_soc_device_register(struct platform_device *pdev) +{ + struct soc_device_attribute *attr; + struct soc_device *dev; + struct gen_pool *sram_pool; + u32 *get_info_data; + phys_addr_t get_info_addr; + u32 soc_rev; + u32 v[4]; + int err; + + err = read_common_fuse(OTP_UNIQ_ID, v); + if (err) + return err; + + sram_pool = of_gen_pool_get(pdev->dev.of_node, "sram-pool", 0); + if (!sram_pool) { + pr_err("Unable to get sram pool\n"); + return -EINVAL; + } + + get_info_data = (u32 *)gen_pool_alloc(sram_pool, 0x100); + if (!get_info_data) { + pr_err("Unable to alloc sram from sram pool\n"); + return -ENOMEM; + } + + get_info_addr = gen_pool_virt_to_phys(sram_pool, (ulong)get_info_data); + + attr = kzalloc(sizeof(*attr), GFP_KERNEL); + if (!attr) + return -ENOMEM; + + err = ele_get_info(get_info_addr, 23 * WORD_SZ); + if (err) { + attr->revision = kasprintf(GFP_KERNEL, "A0"); + } else { + soc_rev = (get_info_data[1] & 0xffff0000) >> 16; + if (soc_rev == 0xA100) + attr->revision = kasprintf(GFP_KERNEL, "A1"); + else + attr->revision = kasprintf(GFP_KERNEL, "A0"); + } + + gen_pool_free(sram_pool, (unsigned long)get_info_data, 0x100); + + err = of_property_read_string(of_root, "model", &attr->machine); + if (err) { + kfree(attr); + return -EINVAL; + } + attr->family = kasprintf(GFP_KERNEL, "Freescale i.MX"); + + attr->serial_number + = kasprintf(GFP_KERNEL, "%016llX", (u64)v[3] << 32 | v[0]); + attr->soc_id = kasprintf(GFP_KERNEL, "i.MX8ULP"); + + dev = soc_device_register(attr); + if (IS_ERR(dev)) { + kfree(attr->soc_id); + kfree(attr->serial_number); + kfree(attr->revision); + kfree(attr->family); + kfree(attr->machine); + kfree(attr); + return PTR_ERR(dev); + } + + return 0; +} + +static int ele_do_start_rng(void) +{ + int ret; + int count = ELE_GET_TRNG_STATE_RETRY_COUNT; + + ret = ele_get_trng_state(); + if (ret < 0) { + pr_err("Failed to get trng state\n"); + return ret; + } else if (ret != ELE_TRNG_STATE_OK) { + /* call start rng */ + ret = ele_start_rng(); + if (ret) { + pr_err("Failed to start rng\n"); + return ret; + } + + /* poll get trng state API, ELE_GET_TRNG_STATE_RETRY_COUNT times + * or while trng state != 0x203 + */ + do { + msleep(10); + ret = ele_get_trng_state(); + if (ret < 0) { + pr_err("Failed to get trng state\n"); + return ret; + } + count--; + } while ((ret != ELE_TRNG_STATE_OK) && count); + if (ret != ELE_TRNG_STATE_OK) + return -EIO; + } + + return 0; +} + +/* + * File operations for user-space + */ + +/* Write a message to the MU. */ +static ssize_t ele_mu_fops_write(struct file *fp, const char __user *buf, + size_t size, loff_t *ppos) +{ + struct ele_mu_device_ctx *dev_ctx + = container_of(fp->private_data, + struct ele_mu_device_ctx, + miscdev); + struct ele_mu_priv *ele_mu_priv = dev_ctx->priv; + u32 nb_words = 0; + struct mu_hdr header; + int err; + + devctx_dbg(dev_ctx, "write from buf (%p)%zu, ppos=%lld\n", buf, size, + ((ppos) ? *ppos : 0)); + + if (down_interruptible(&dev_ctx->fops_lock)) + return -EBUSY; + + if (dev_ctx->status != MU_OPENED) { + err = -EINVAL; + goto exit; + } + + if (size < ELE_MU_HDR_SZ) { + devctx_err(dev_ctx, "User buffer too small(%zu < %d)\n", + size, ELE_MU_HDR_SZ); + err = -ENOSPC; + goto exit; + } + + if (size > MAX_MESSAGE_SIZE_BYTES) { + devctx_err(dev_ctx, "User buffer too big(%zu > %d)\n", size, + MAX_MESSAGE_SIZE_BYTES); + err = -ENOSPC; + goto exit; + } + + /* Copy data to buffer */ + err = (int)copy_from_user(dev_ctx->temp_cmd, buf, size); + if (err) { + err = -EFAULT; + devctx_err(dev_ctx, "Fail copy message from user\n"); + goto exit; + } + + print_hex_dump_debug("from user ", DUMP_PREFIX_OFFSET, 4, 4, + dev_ctx->temp_cmd, size, false); + + header = *((struct mu_hdr *) (&dev_ctx->temp_cmd[0])); + + /* Check the message is valid according to tags */ + if (header.tag == ele_mu_priv->cmd_tag) { + /* + * unlocked in ele_mu_receive_work_handler when the + * response to this command is received. + */ + mutex_lock(&ele_mu_priv->mu_cmd_lock); + ele_mu_priv->waiting_rsp_dev = dev_ctx; + } else if (header.tag == ele_mu_priv->rsp_tag) { + /* Check the device context can send the command */ + if (dev_ctx != ele_mu_priv->cmd_receiver_dev) { + devctx_err(dev_ctx, + "Channel not configured to send resp to FW."); + err = -EPERM; + goto exit; + } + } else { + devctx_err(dev_ctx, "The message does not have a valid TAG\n"); + err = -EINVAL; + goto exit; + } + + /* + * Check that the size passed as argument matches the size + * carried in the message. + */ + nb_words = header.size; + if (nb_words << 2 != size) { + devctx_err(dev_ctx, "User buffer too small\n"); + goto exit; + } + + mutex_lock(&ele_mu_priv->mu_lock); + + /* Send message */ + devctx_dbg(dev_ctx, "sending message\n"); + err = mbox_send_message(ele_mu_priv->tx_chan, dev_ctx->temp_cmd); + if (err < 0) { + devctx_err(dev_ctx, "Failed to send message\n"); + goto unlock; + } + + err = nb_words * WORD_SZ; + +unlock: + mutex_unlock(&ele_mu_priv->mu_lock); + +exit: + up(&dev_ctx->fops_lock); + return err; +} + +/* + * Read a message from the MU. + * Blocking until a message is available. + */ +static ssize_t ele_mu_fops_read(struct file *fp, char __user *buf, + size_t size, loff_t *ppos) +{ + struct ele_mu_device_ctx *dev_ctx + = container_of(fp->private_data, + struct ele_mu_device_ctx, + miscdev); + struct ele_mu_priv *ele_mu_priv = dev_ctx->priv; + u32 data_size = 0, size_to_copy = 0; + struct ele_obuf_desc *b_desc; + int err; + struct mu_hdr header; + + devctx_dbg(dev_ctx, "read to buf %p(%zu), ppos=%lld\n", buf, size, + ((ppos) ? *ppos : 0)); + + if (down_interruptible(&dev_ctx->fops_lock)) + return -EBUSY; + + if (dev_ctx->status != MU_OPENED) { + err = -EINVAL; + goto exit; + } + + /* Wait until the complete message is received on the MU. */ + err = wait_event_interruptible(dev_ctx->wq, dev_ctx->pending_hdr != 0); + if (err) { + devctx_err(dev_ctx, "Err[0x%x]:Interrupted by signal.\n", err); + goto exit; + } + + devctx_dbg(dev_ctx, "%s %s\n", __func__, + "message received, start transmit to user"); + + /* Check that the size passed as argument is larger than + * the one carried in the message. + */ + data_size = dev_ctx->temp_resp_size * WORD_SZ; + size_to_copy = data_size; + if (size_to_copy > size) { + devctx_dbg(dev_ctx, "User buffer too small (%zu < %d)\n", + size, size_to_copy); + size_to_copy = size; + } + + /* We may need to copy the output data to user before + * delivering the completion message. + */ + while (!list_empty(&dev_ctx->pending_out)) { + b_desc = list_first_entry_or_null(&dev_ctx->pending_out, + struct ele_obuf_desc, + link); + if (b_desc->out_usr_ptr && b_desc->out_ptr) { + devctx_dbg(dev_ctx, "Copy output data to user\n"); + err = (int)copy_to_user(b_desc->out_usr_ptr, + b_desc->out_ptr, + b_desc->out_size); + if (err) { + devctx_err(dev_ctx, + "Failure copying output data to user."); + err = -EFAULT; + goto exit; + } + } + __list_del_entry(&b_desc->link); + devm_kfree(dev_ctx->dev, b_desc); + } + + header = *((struct mu_hdr *) (&dev_ctx->temp_resp[0])); + + /* Copy data from the buffer */ + print_hex_dump_debug("to user ", DUMP_PREFIX_OFFSET, 4, 4, + dev_ctx->temp_resp, size_to_copy, false); + err = (int)copy_to_user(buf, dev_ctx->temp_resp, size_to_copy); + if (err) { + devctx_err(dev_ctx, "Failed to copy to user\n"); + err = -EFAULT; + goto exit; + } + + err = size_to_copy; + + /* free memory allocated on the shared buffers. */ + dev_ctx->secure_mem.pos = 0; + dev_ctx->non_secure_mem.pos = 0; + + dev_ctx->pending_hdr = 0; + +exit: + if (header.tag == ele_mu_priv->rsp_tag) + mutex_unlock(&ele_mu_priv->mu_cmd_lock); + up(&dev_ctx->fops_lock); + return err; +} + +/* Give access to EdgeLock Enclave, to the memory we want to share */ +static int ele_mu_setup_ele_mem_access(struct ele_mu_device_ctx *dev_ctx, + u64 addr, u32 len) +{ + /* Assuming EdgeLock Enclave has access to all the memory regions */ + int ret = 0; + + if (ret) { + devctx_err(dev_ctx, "Fail find memreg\n"); + goto exit; + } + + if (ret) { + devctx_err(dev_ctx, "Fail set permission for resource\n"); + goto exit; + } + +exit: + return ret; +} + +static int ele_mu_ioctl_get_mu_info(struct ele_mu_device_ctx *dev_ctx, + unsigned long arg) +{ + struct ele_mu_priv *priv = dev_get_drvdata(dev_ctx->dev); + struct ele_mu_ioctl_get_mu_info info; + int err = -EINVAL; + + info.ele_mu_id = (u8)priv->ele_mu_id; + info.interrupt_idx = 0; + info.tz = 0; + info.did = (u8)priv->ele_mu_did; + + devctx_dbg(dev_ctx, + "info [mu_idx: %d, irq_idx: %d, tz: 0x%x, did: 0x%x]\n", + info.ele_mu_id, info.interrupt_idx, info.tz, info.did); + + err = (int)copy_to_user((u8 *)arg, &info, + sizeof(info)); + if (err) { + devctx_err(dev_ctx, "Failed to copy mu info to user\n"); + err = -EFAULT; + goto exit; + } + +exit: + return err; +} + +/* + * Copy a buffer of daa to/from the user and return the address to use in + * messages + */ +static int ele_mu_ioctl_setup_iobuf_handler(struct ele_mu_device_ctx *dev_ctx, + unsigned long arg) +{ + struct ele_obuf_desc *out_buf_desc; + struct ele_mu_ioctl_setup_iobuf io = {0}; + struct ele_shared_mem *shared_mem; + int err = -EINVAL; + u32 pos; + + err = (int)copy_from_user(&io, + (u8 *)arg, + sizeof(io)); + if (err) { + devctx_err(dev_ctx, "Failed copy iobuf config from user\n"); + err = -EFAULT; + goto exit; + } + + devctx_dbg(dev_ctx, "io [buf: %p(%d) flag: %x]\n", + io.user_buf, io.length, io.flags); + + if (io.length == 0 || !io.user_buf) { + /* + * Accept NULL pointers since some buffers are optional + * in FW commands. In this case we should return 0 as + * pointer to be embedded into the message. + * Skip all data copy part of code below. + */ + io.ele_addr = 0; + goto copy; + } + + /* Select the shared memory to be used for this buffer. */ + if (io.flags & ELE_MU_IO_FLAGS_USE_SEC_MEM) { + /* App requires to use secure memory for this buffer.*/ + devctx_err(dev_ctx, "Failed allocate SEC MEM memory\n"); + err = -EFAULT; + goto exit; + } else { + /* No specific requirement for this buffer. */ + shared_mem = &dev_ctx->non_secure_mem; + } + + /* Check there is enough space in the shared memory. */ + if (io.length >= shared_mem->size - shared_mem->pos) { + devctx_err(dev_ctx, "Not enough space in shared memory\n"); + err = -ENOMEM; + goto exit; + } + + /* Allocate space in shared memory. 8 bytes aligned. */ + pos = shared_mem->pos; + shared_mem->pos += round_up(io.length, 8u); + io.ele_addr = (u64)shared_mem->dma_addr + pos; + + if ((io.flags & ELE_MU_IO_FLAGS_USE_SEC_MEM) && + !(io.flags & ELE_MU_IO_FLAGS_USE_SHORT_ADDR)) { + /*Add base address to get full address.*/ + devctx_err(dev_ctx, "Failed allocate SEC MEM memory\n"); + err = -EFAULT; + goto exit; + } + + if (io.flags & ELE_MU_IO_FLAGS_IS_INPUT) { + /* + * buffer is input: + * copy data from user space to this allocated buffer. + */ + err = (int)copy_from_user(shared_mem->ptr + pos, io.user_buf, + io.length); + if (err) { + devctx_err(dev_ctx, + "Failed copy data to shared memory\n"); + err = -EFAULT; + goto exit; + } + /* flush this memory "shared_mem->ptr + pos" + * with size = io.length + */ + } else { + if (io.flags & ELE_MU_IO_FLAGS_IS_IN_OUT) { + err = (int)copy_from_user(shared_mem->ptr + pos, + io.user_buf, + io.length); + if (err) { + devctx_err(dev_ctx, + "Failed copy data to shared-mem.\n"); + err = -EFAULT; + goto exit; + } + } + + /* + * buffer is output: + * add an entry in the "pending buffers" list so data + * can be copied to user space when receiving FW + * response. + */ + out_buf_desc = devm_kmalloc(dev_ctx->dev, + sizeof(*out_buf_desc), + GFP_KERNEL); + + if (!out_buf_desc) { + err = -ENOMEM; + devctx_err(dev_ctx, + "Failed allocating mem for pending buffer\n" + ); + goto exit; + } + + out_buf_desc->out_ptr = shared_mem->ptr + pos; + out_buf_desc->out_usr_ptr = io.user_buf; + out_buf_desc->out_size = io.length; + list_add_tail(&out_buf_desc->link, &dev_ctx->pending_out); + } + +copy: + /* Provide the EdgeLock Enclave address to user space only if success.*/ + err = (int)copy_to_user((u8 *)arg, &io, + sizeof(io)); + if (err) { + devctx_err(dev_ctx, "Failed to copy iobuff setup to user\n"); + err = -EFAULT; + goto exit; + } +exit: + return err; +} + + + +/* Open a char device. */ +static int ele_mu_fops_open(struct inode *nd, struct file *fp) +{ + struct ele_mu_device_ctx *dev_ctx + = container_of(fp->private_data, + struct ele_mu_device_ctx, + miscdev); + int err; + + /* Avoid race if opened at the same time */ + if (down_trylock(&dev_ctx->fops_lock)) + return -EBUSY; + + /* Authorize only 1 instance. */ + if (dev_ctx->status != MU_FREE) { + err = -EBUSY; + goto exit; + } + + /* + * Allocate some memory for data exchanges with S40x. + * This will be used for data not requiring secure memory. + */ + dev_ctx->non_secure_mem.ptr = dmam_alloc_coherent(dev_ctx->dev, + MAX_DATA_SIZE_PER_USER, + &dev_ctx->non_secure_mem.dma_addr, + GFP_KERNEL); + if (!dev_ctx->non_secure_mem.ptr) { + err = -ENOMEM; + devctx_err(dev_ctx, "Failed to map shared memory with S40x\n"); + goto exit; + } + + err = ele_mu_setup_ele_mem_access(dev_ctx, + dev_ctx->non_secure_mem.dma_addr, + MAX_DATA_SIZE_PER_USER); + if (err) { + err = -EPERM; + devctx_err(dev_ctx, + "Failed to share access to shared memory\n"); + goto free_coherent; + } + + dev_ctx->non_secure_mem.size = MAX_DATA_SIZE_PER_USER; + dev_ctx->non_secure_mem.pos = 0; + dev_ctx->status = MU_OPENED; + + dev_ctx->pending_hdr = 0; + + goto exit; + +free_coherent: + dmam_free_coherent(dev_ctx->priv->dev, MAX_DATA_SIZE_PER_USER, + dev_ctx->non_secure_mem.ptr, + dev_ctx->non_secure_mem.dma_addr); + +exit: + up(&dev_ctx->fops_lock); + return err; +} + +/* Close a char device. */ +static int ele_mu_fops_close(struct inode *nd, struct file *fp) +{ + struct ele_mu_device_ctx *dev_ctx = container_of(fp->private_data, + struct ele_mu_device_ctx, miscdev); + struct ele_mu_priv *priv = dev_ctx->priv; + struct ele_obuf_desc *out_buf_desc; + + /* Avoid race if closed at the same time */ + if (down_trylock(&dev_ctx->fops_lock)) + return -EBUSY; + + /* The device context has not been opened */ + if (dev_ctx->status != MU_OPENED) + goto exit; + + /* check if this device was registered as command receiver. */ + if (priv->cmd_receiver_dev == dev_ctx) + priv->cmd_receiver_dev = NULL; + + /* check if this device was registered as waiting response. */ + if (priv->waiting_rsp_dev == dev_ctx) { + priv->waiting_rsp_dev = NULL; + mutex_unlock(&priv->mu_cmd_lock); + } + + /* Unmap secure memory shared buffer. */ + if (dev_ctx->secure_mem.ptr) + devm_iounmap(dev_ctx->dev, dev_ctx->secure_mem.ptr); + + dev_ctx->secure_mem.ptr = NULL; + dev_ctx->secure_mem.dma_addr = 0; + dev_ctx->secure_mem.size = 0; + dev_ctx->secure_mem.pos = 0; + + /* Free non-secure shared buffer. */ + dmam_free_coherent(dev_ctx->priv->dev, MAX_DATA_SIZE_PER_USER, + dev_ctx->non_secure_mem.ptr, + dev_ctx->non_secure_mem.dma_addr); + + dev_ctx->non_secure_mem.ptr = NULL; + dev_ctx->non_secure_mem.dma_addr = 0; + dev_ctx->non_secure_mem.size = 0; + dev_ctx->non_secure_mem.pos = 0; + + while (!list_empty(&dev_ctx->pending_out)) { + out_buf_desc = list_first_entry_or_null(&dev_ctx->pending_out, + struct ele_obuf_desc, + link); + __list_del_entry(&out_buf_desc->link); + devm_kfree(dev_ctx->dev, out_buf_desc); + } + + dev_ctx->status = MU_FREE; + +exit: + up(&dev_ctx->fops_lock); + return 0; +} + +/* IOCTL entry point of a char device */ +static long ele_mu_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) +{ + struct ele_mu_device_ctx *dev_ctx + = container_of(fp->private_data, + struct ele_mu_device_ctx, + miscdev); + struct ele_mu_priv *ele_mu_priv = dev_ctx->priv; + int err = -EINVAL; + + /* Prevent race during change of device context */ + if (down_interruptible(&dev_ctx->fops_lock)) + return -EBUSY; + + switch (cmd) { + case ELE_MU_IOCTL_ENABLE_CMD_RCV: + if (!ele_mu_priv->cmd_receiver_dev) { + ele_mu_priv->cmd_receiver_dev = dev_ctx; + err = 0; + }; + break; + case ELE_MU_IOCTL_GET_MU_INFO: + err = ele_mu_ioctl_get_mu_info(dev_ctx, arg); + break; + case ELE_MU_IOCTL_SHARED_BUF_CFG: + devctx_err(dev_ctx, + "ELE_MU_IOCTL_SHARED_BUF_CFG not supported [0x%x].\n", + err); + break; + case ELE_MU_IOCTL_SETUP_IOBUF: + err = ele_mu_ioctl_setup_iobuf_handler(dev_ctx, arg); + break; + case ELE_MU_IOCTL_SIGNED_MESSAGE: + devctx_err(dev_ctx, + "ELE_MU_IOCTL_SIGNED_MESSAGE not supported [0x%x].\n", + err); + break; + default: + err = -EINVAL; + devctx_dbg(dev_ctx, "IOCTL %.8x not supported\n", cmd); + } + + up(&dev_ctx->fops_lock); + return (long)err; +} + +/* Char driver setup */ +static const struct file_operations ele_mu_fops = { + .open = ele_mu_fops_open, + .owner = THIS_MODULE, + .release = ele_mu_fops_close, + .unlocked_ioctl = ele_mu_ioctl, + .read = ele_mu_fops_read, + .write = ele_mu_fops_write, +}; + +/* interface for managed res to free a mailbox channel */ +static void if_mbox_free_channel(void *mbox_chan) +{ + mbox_free_channel(mbox_chan); +} + +/* interface for managed res to unregister a char device */ +static void if_misc_deregister(void *miscdevice) +{ + misc_deregister(miscdevice); +} + +static int ele_mu_request_channel(struct device *dev, + struct mbox_chan **chan, + struct mbox_client *cl, + const char *name) +{ + struct mbox_chan *t_chan; + int ret = 0; + + t_chan = mbox_request_channel_byname(cl, name); + if (IS_ERR(t_chan)) { + ret = PTR_ERR(t_chan); + if (ret != -EPROBE_DEFER) + dev_err(dev, + "Failed to request chan %s ret %d\n", name, + ret); + goto exit; + } + + ret = devm_add_action(dev, if_mbox_free_channel, t_chan); + if (ret) { + dev_err(dev, "failed to add devm removal of mbox %s\n", name); + goto exit; + } + + *chan = t_chan; + +exit: + return ret; +} + +static int ele_mu_probe(struct platform_device *pdev) +{ + struct ele_mu_device_ctx *dev_ctx; + struct device *dev = &pdev->dev; + struct ele_mu_priv *priv; + struct device_node *np; + const struct of_device_id *of_id = of_match_device(ele_mu_match, dev); + struct imx_info *info = (of_id != NULL) ? (struct imx_info *)of_id->data + : NULL; + int max_nb_users = 0; + char *devname; + int ret; + int i; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) { + ret = -ENOMEM; + dev_err(dev, "Fail allocate mem for private data\n"); + goto exit; + } + priv->dev = dev; + dev_set_drvdata(dev, priv); + + /* + * Get the address of MU to be used for communication with the SCU + */ + np = pdev->dev.of_node; + if (!np) { + dev_err(dev, "Cannot find MU User entry in device tree\n"); + ret = -EOPNOTSUPP; + goto exit; + } + + /* Initialize the mutex. */ + mutex_init(&priv->mu_cmd_lock); + mutex_init(&priv->mu_lock); + + /* TBD */ + priv->cmd_receiver_dev = NULL; + priv->waiting_rsp_dev = NULL; + + ret = of_property_read_u32(np, "fsl,ele_mu_did", &priv->ele_mu_did); + if (ret) { + ret = -EINVAL; + dev_err(dev, "%s: Not able to read ele_mu_did", __func__); + goto exit; + } + + ret = of_property_read_u32(np, "fsl,ele_mu_id", &priv->ele_mu_id); + if (ret) { + ret = -EINVAL; + dev_err(dev, "%s: Not able to read ele_mu_id", __func__); + goto exit; + } + + ret = of_property_read_u32(np, "fsl,ele_mu_max_users", &max_nb_users); + if (ret) { + dev_warn(dev, "%s: Not able to read mu_max_user", __func__); + max_nb_users = S4_MUAP_DEFAULT_MAX_USERS; + } + + ret = of_property_read_u8(np, "fsl,cmd_tag", &priv->cmd_tag); + if (ret) { + dev_warn(dev, "%s: Not able to read cmd_tag", __func__); + priv->cmd_tag = DEFAULT_MESSAGING_TAG_COMMAND; + } + + ret = of_property_read_u8(np, "fsl,rsp_tag", &priv->rsp_tag); + if (ret) { + dev_warn(dev, "%s: Not able to read rsp_tag", __func__); + priv->rsp_tag = DEFAULT_MESSAGING_TAG_RESPONSE; + } + + /* Mailbox client configuration */ + priv->ele_mb_cl.dev = dev; + priv->ele_mb_cl.tx_block = false; + priv->ele_mb_cl.knows_txdone = true; + priv->ele_mb_cl.rx_callback = ele_mu_rx_callback; + + ret = ele_mu_request_channel(dev, &priv->tx_chan, + &priv->ele_mb_cl, "tx"); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to request tx channel\n"); + + goto exit; + } + + ret = ele_mu_request_channel(dev, &priv->rx_chan, + &priv->ele_mb_cl, "rx"); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to request rx channel\n"); + + goto exit; + } + + priv->max_dev_ctx = max_nb_users; + priv->ctxs = devm_kzalloc(dev, sizeof(dev_ctx) * max_nb_users, + GFP_KERNEL); + + /* Create users */ + for (i = 0; i < max_nb_users; i++) { + dev_ctx = devm_kzalloc(dev, sizeof(*dev_ctx), GFP_KERNEL); + if (!dev_ctx) { + ret = -ENOMEM; + dev_err(dev, + "Fail to allocate memory for device context\n"); + goto exit; + } + + dev_ctx->dev = dev; + dev_ctx->status = MU_FREE; + dev_ctx->priv = priv; + + priv->ctxs[i] = dev_ctx; + + /* Default value invalid for an header. */ + init_waitqueue_head(&dev_ctx->wq); + + INIT_LIST_HEAD(&dev_ctx->pending_out); + sema_init(&dev_ctx->fops_lock, 1); + + devname = devm_kasprintf(dev, GFP_KERNEL, "ele_mu%d_ch%d", + priv->ele_mu_id, i); + if (!devname) { + ret = -ENOMEM; + dev_err(dev, + "Fail to allocate memory for misc dev name\n"); + goto exit; + } + + dev_ctx->miscdev.name = devname; + dev_ctx->miscdev.minor = MISC_DYNAMIC_MINOR; + dev_ctx->miscdev.fops = &ele_mu_fops; + dev_ctx->miscdev.parent = dev; + ret = misc_register(&dev_ctx->miscdev); + if (ret) { + dev_err(dev, "failed to register misc device %d\n", + ret); + goto exit; + } + + ret = devm_add_action(dev, if_misc_deregister, + &dev_ctx->miscdev); + if (ret) { + dev_err(dev, + "failed[%d] to add action to the misc-dev\n", + ret); + goto exit; + } + } + + init_completion(&priv->done); + spin_lock_init(&priv->lock); + + ele_priv_export = priv; + + if (info && info->reserved_dma_ranges) { + ret = of_reserved_mem_device_init(dev); + if (ret) { + dev_err(dev, + "failed to init reserved memory region %d\n", + ret); + priv->flags &= (~RESERVED_DMA_POOL); + goto exit; + } + priv->flags |= RESERVED_DMA_POOL; + } + + if (info && info->socdev) { + ret = imx_soc_device_register(pdev); + if (ret) { + dev_err(dev, + "failed[%d] to register SoC device\n", ret); + goto exit; + } + + /* allocate buffer where ELE store encrypted IMEM */ + priv->imem.buf = dmam_alloc_coherent(dev, ELE_IMEM_SIZE, + &priv->imem.phyaddr, + GFP_KERNEL); + if (!priv->imem.buf) { + dev_err(dev, + "Failed dmam-alloc to store encrypted IMEM.\n"); + ret = -ENOMEM; + goto exit; + } + } + + /* start ele rng */ + ret = ele_do_start_rng(); + if (ret) + dev_err(dev, "Failed to start ele rng\n"); + + if (!ret && info && info->enable_ele_trng) { + ret = ele_trng_init(dev); + if (ret) + dev_err(dev, "Failed to init ele-trng\n"); + } + + /* + * A ELE ping request must be send at least once every day(24 hours), + * so setup a delay work with 1 hour interval + * to ping ELE periodically. + */ + schedule_delayed_work(&ele_ping_work, ELE_PING_INTERVAL); + + dev_set_drvdata(dev, priv); + return devm_of_platform_populate(dev); + +exit: + /* if execution control reaches here, ele-mu probe fail. + * hence doing the cleanup + */ + if (priv->flags & RESERVED_DMA_POOL) { + of_reserved_mem_device_release(dev); + priv->flags &= (~RESERVED_DMA_POOL); + } + return ret; +} + +static int ele_mu_remove(struct platform_device *pdev) +{ + struct ele_mu_priv *priv; + + cancel_delayed_work_sync(&ele_ping_work); + priv = dev_get_drvdata(&pdev->dev); + mbox_free_channel(priv->tx_chan); + mbox_free_channel(priv->rx_chan); + + /* free the buffer in ele-mu remove, previously allocated + * in ele-mu probe to store encrypted IMEM + */ + if (priv->imem.buf) { + dmam_free_coherent(&pdev->dev, + ELE_IMEM_SIZE, + priv->imem.buf, + priv->imem.phyaddr); + priv->imem.buf = NULL; + } + + if (priv->flags & RESERVED_DMA_POOL) { + of_reserved_mem_device_release(&pdev->dev); + priv->flags &= (~RESERVED_DMA_POOL); + } + + return 0; +} + +#ifdef CONFIG_PM_SLEEP +static int ele_mu_suspend(struct device *dev) +{ + struct ele_mu_priv *priv = dev_get_drvdata(dev); + const struct of_device_id *of_id = of_match_device(ele_mu_match, dev); + struct imx_info *info = (of_id != NULL) ? (struct imx_info *)of_id->data + : NULL; + + if (info && info->socdev) { + int ret; + + /* EXPORT command will save encrypted IMEM to given address, + * so later in resume, IMEM can be restored from the given + * address. + * + * Size must be at least 64 kB. + */ + ret = ele_service_swap(priv->imem.phyaddr, + ELE_IMEM_SIZE, + ELE_IMEM_EXPORT); + if (ret < 0) + dev_err(dev, "Failed to export IMEM\n"); + else { + priv->imem.size = ret; + dev_info(dev, + "Exported %d bytes of encrypted IMEM\n", + ret); + } + } + + return 0; +} + +static int ele_mu_resume(struct device *dev) +{ + struct ele_mu_priv *priv = dev_get_drvdata(dev); + int i; + const struct of_device_id *of_id = of_match_device(ele_mu_match, dev); + struct imx_info *info = (of_id != NULL) ? (struct imx_info *)of_id->data + : NULL; + + for (i = 0; i < priv->max_dev_ctx; i++) + wake_up_interruptible(&priv->ctxs[i]->wq); + + if (info && info->socdev) { + struct gen_pool *sram_pool; + u32 *get_info_buf; + phys_addr_t get_info_phyaddr; + u32 imem_state; + int ret; + + ret = ele_do_start_rng(); + if (ret) + return ret; + + /* allocate buffer to get info from ELE */ + sram_pool = of_gen_pool_get(dev->of_node, "sram-pool", 0); + if (!sram_pool) { + dev_err(dev, "Unable to get sram pool\n"); + return -EINVAL; + } + + get_info_buf = (u32 *)gen_pool_alloc(sram_pool, + ELE_GET_INFO_BUFF_SZ); + if (!get_info_buf) { + dev_err(dev, "Unable to alloc sram from sram pool\n"); + return -ENOMEM; + } + get_info_phyaddr = gen_pool_virt_to_phys(sram_pool, + (ulong)get_info_buf); + + /* get info from ELE */ + ret = ele_get_info(get_info_phyaddr, ELE_GET_INFO_READ_SZ); + if (ret) { + dev_err(dev, "Failed to get info from ELE.\n"); + goto exit; + } + + /* Get IMEM state, if 0xFE then import IMEM */ + imem_state = (get_info_buf[ELE_IMEM_STATE_WORD] + & ELE_IMEM_STATE_MASK) >> 16; + if (imem_state == ELE_IMEM_STATE_BAD) { + /* IMPORT command will restore IMEM from the given + * address, here size is the actual size returned by ELE + * during the export operation + */ + ret = ele_service_swap(priv->imem.phyaddr, + priv->imem.size, + ELE_IMEM_IMPORT); + if (ret) { + dev_err(dev, "Failed to import IMEM\n"); + goto exit; + } + } else + goto exit; + + /* After importing IMEM, check if IMEM state is equal to 0xCA + * to ensure IMEM is fully loaded and + * ELE functionality can be used. + */ + ret = ele_get_info(get_info_phyaddr, ELE_GET_INFO_READ_SZ); + if (ret) { + dev_err(dev, "Failed to get info from ELE.\n"); + goto exit; + } + + imem_state = (get_info_buf[ELE_IMEM_STATE_WORD] + & ELE_IMEM_STATE_MASK) >> 16; + if (imem_state == ELE_IMEM_STATE_OK) + dev_info(dev, "Successfully restored IMEM\n"); + else + dev_err(dev, "Failed to restore IMEM\n"); + +exit: + gen_pool_free(sram_pool, (ulong)get_info_buf, ELE_GET_INFO_BUFF_SZ); + } + + return 0; +} +#endif + +static const struct dev_pm_ops ele_mu_pm = { + SET_SYSTEM_SLEEP_PM_OPS(ele_mu_suspend, ele_mu_resume) +}; + +static struct platform_driver ele_mu_driver = { + .driver = { + .name = "fsl-ele-mu", + .of_match_table = ele_mu_match, + .pm = &ele_mu_pm, + }, + .probe = ele_mu_probe, + .remove = ele_mu_remove, +}; +MODULE_DEVICE_TABLE(of, ele_mu_match); + +module_platform_driver(ele_mu_driver); + +MODULE_AUTHOR("Pankaj Gupta "); +MODULE_DESCRIPTION("iMX Secure Enclave MU Driver."); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/firmware/imx/ele_mu.h b/drivers/firmware/imx/ele_mu.h new file mode 100644 index 000000000000..371a3c635f50 --- /dev/null +++ b/drivers/firmware/imx/ele_mu.h @@ -0,0 +1,174 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021-2022 NXP + */ + +#ifndef ELE_MU_H +#define ELE_MU_H + +#include +#include +#include + +/* macro to log operation of a misc device */ +#define miscdev_dbg(p_miscdev, fmt, va_args...) \ + ({ \ + struct miscdevice *_p_miscdev = p_miscdev; \ + dev_dbg((_p_miscdev)->parent, "%s: " fmt, (_p_miscdev)->name, \ + ##va_args); \ + }) + +#define miscdev_info(p_miscdev, fmt, va_args...) \ + ({ \ + struct miscdevice *_p_miscdev = p_miscdev; \ + dev_info((_p_miscdev)->parent, "%s: " fmt, (_p_miscdev)->name, \ + ##va_args); \ + }) + +#define miscdev_err(p_miscdev, fmt, va_args...) \ + ({ \ + struct miscdevice *_p_miscdev = p_miscdev; \ + dev_err((_p_miscdev)->parent, "%s: " fmt, (_p_miscdev)->name, \ + ##va_args); \ + }) +/* macro to log operation of a device context */ +#define devctx_dbg(p_devctx, fmt, va_args...) \ + miscdev_dbg(&((p_devctx)->miscdev), fmt, ##va_args) +#define devctx_info(p_devctx, fmt, va_args...) \ + miscdev_info(&((p_devctx)->miscdev), fmt, ##va_args) +#define devctx_err(p_devctx, fmt, va_args...) \ + miscdev_err((&(p_devctx)->miscdev), fmt, ##va_args) + +#define MSG_TAG(x) (((x) & 0xff000000) >> 24) +#define MSG_COMMAND(x) (((x) & 0x00ff0000) >> 16) +#define MSG_SIZE(x) (((x) & 0x0000ff00) >> 8) +#define MSG_VER(x) ((x) & 0x000000ff) +#define RES_STATUS(x) ((x) & 0x000000ff) +#define MAX_DATA_SIZE_PER_USER (65 * 1024) +#define S4_DEFAULT_MUAP_INDEX (2) +#define S4_MUAP_DEFAULT_MAX_USERS (4) + +#define DEFAULT_MESSAGING_TAG_COMMAND (0x17u) +#define DEFAULT_MESSAGING_TAG_RESPONSE (0xe1u) + +//#define ELE_MU_IO_FLAGS_IS_INPUT (0x01u) +//#define ELE_MU_IO_FLAGS_IS_OUTPUT (0x02u) +//#define ELE_MU_IO_FLAGS_IS_IN_OUT (0x08u) + +#define ELE_MU_IO_FLAGS_USE_SEC_MEM (0x02u) +#define ELE_MU_IO_FLAGS_USE_SHORT_ADDR (0x04u) + +struct ele_imem_buf { + u8 *buf; + phys_addr_t phyaddr; + u32 size; +}; + +struct ele_obuf_desc { + u8 *out_ptr; + u8 *out_usr_ptr; + u32 out_size; + struct list_head link; +}; + +/* Status of a char device */ +enum mu_device_status_t { + MU_FREE, + MU_OPENED +}; + +struct ele_shared_mem { + dma_addr_t dma_addr; + u32 size; + u32 pos; + u8 *ptr; +}; + +/* Private struct for each char device instance. */ +struct ele_mu_device_ctx { + struct device *dev; + struct ele_mu_priv *priv; + struct miscdevice miscdev; + + enum mu_device_status_t status; + wait_queue_head_t wq; + struct semaphore fops_lock; + + u32 pending_hdr; + struct list_head pending_out; + + struct ele_shared_mem secure_mem; + struct ele_shared_mem non_secure_mem; + + u32 temp_cmd[MAX_MESSAGE_SIZE]; + u32 temp_resp[MAX_RECV_SIZE]; + u32 temp_resp_size; + struct notifier_block ele_notify; +}; + +/* Header of the messages exchange with the EdgeLock Enclave */ +struct mu_hdr { + u8 ver; + u8 size; + u8 command; + u8 tag; +} __packed; + +#define ELE_MU_HDR_SZ 4 +#define TAG_OFFSET (ELE_MU_HDR_SZ - 1) +#define CMD_OFFSET (ELE_MU_HDR_SZ - 2) +#define SZ_OFFSET (ELE_MU_HDR_SZ - 3) +#define VER_OFFSET (ELE_MU_HDR_SZ - 4) + +struct ele_api_msg { + u32 header; /* u8 Tag; u8 Command; u8 Size; u8 Ver; */ + u32 data[ELE_MSG_DATA_NUM]; +}; + +struct ele_mu_priv { + struct ele_mu_device_ctx *cmd_receiver_dev; + struct ele_mu_device_ctx *waiting_rsp_dev; + /* + * prevent parallel access to the MU registers + * e.g. a user trying to send a command while the other one is + * sending a response. + */ + struct mutex mu_lock; + /* + * prevent a command to be sent on the MU while another one is still + * processing. (response to a command is allowed) + */ + struct mutex mu_cmd_lock; + struct device *dev; + u32 ele_mu_did; + u32 ele_mu_id; + u8 cmd_tag; + u8 rsp_tag; + + struct mbox_client ele_mb_cl; + struct mbox_chan *tx_chan, *rx_chan; + struct ele_api_msg tx_msg, rx_msg; + struct completion done; + spinlock_t lock; + /* Flag to retain the state of initialization done at + * the time of ele-mu probe. + */ + int flags; + int max_dev_ctx; + struct ele_mu_device_ctx **ctxs; + struct ele_imem_buf imem; +}; + +int get_ele_mu_priv(struct ele_mu_priv **export); + +int imx_ele_msg_send_rcv(struct ele_mu_priv *priv); +#ifdef CONFIG_IMX_ELE_TRNG +int ele_trng_init(struct device *dev); +#else +static inline int ele_trng_init(struct device *dev) +{ + return 0; +} +#endif + +#endif diff --git a/include/linux/firmware/imx/ele_base_msg.h b/include/linux/firmware/imx/ele_base_msg.h new file mode 100644 index 000000000000..ec9b9df49889 --- /dev/null +++ b/include/linux/firmware/imx/ele_base_msg.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021 NXP + * + * Header file for the ELE Base API(s). + */ + +#ifndef ELE_BASE_MSG_H +#define ELE_BASE_MSG_H + +#include + +#define WORD_SZ 4 +#define MAX_RECV_SIZE 31 +#define MAX_RECV_SIZE_BYTES (MAX_RECV_SIZE * WORD_SZ) +#define MAX_MESSAGE_SIZE 31 +#define MAX_MESSAGE_SIZE_BYTES (MAX_MESSAGE_SIZE * WORD_SZ) + +#define MESSAGING_VERSION_7 0x7 +#define ELE_NONE_VAL 0x0 + +#define ELE_PING_REQ 0x1 +#define ELE_PING_REQ_MSG_SZ 0x02 + +#define ELE_OEM_CNTN_AUTH_REQ 0x87 +#define ELE_VERIFY_IMAGE_REQ 0x88 +#define ELE_RELEASE_CONTAINER_REQ 0x89 + +#define ELE_READ_FUSE_REQ 0x97 +#define ELE_READ_FUSE_RSP_MSG_SZ 0x07 +#define ELE_READ_FUSE_REQ_MSG_SZ 0x03 + +#define OTP_UNIQ_ID 0x01 +#define OTFAD_CONFIG 0x2 + +#define ELE_GET_INFO_REQ 0xDA +#define ELE_GET_INFO_REQ_MSG_SZ 0x02 + +#define ELE_SERVICE_SWAP_REQ 0xDF +#define ELE_SERVICE_SWAP_REQ_MSG_SZ 0x03 + +#define ELE_START_RNG_REQ 0xA3 +#define ELE_START_RNG_REQ_MSG_SZ 0x02 + +#define ELE_GET_TRNG_STATE_REQ 0xA4 +#define ELE_GET_TRNG_STATE_REQ_MSG_SZ 0x03 + +#define ELE_GET_RANDOM_REQ 0xCD +#define CSAL_TRNG_STATE_MASK 0x0000ffff + +#define ELE_BASE_API_VERSION 0x6 +#define ELE_SUCCESS_IND 0xD6 +#define ELE_FAILURE_IND 0x29 + +#define ELE_MSG_DATA_NUM 10 + +#define ELE_IMEM_EXPORT 0x1 +#define ELE_IMEM_IMPORT 0x2 + +int read_common_fuse(uint16_t fuse_index, u32 *value); +int ele_ping(void); +int ele_get_info(phys_addr_t addr, u32 data_size); +int ele_service_swap(phys_addr_t addr, u32 addr_size, u16 flag); +int ele_start_rng(void); +int ele_get_trng_state(void); + +#endif diff --git a/include/linux/firmware/imx/ele_mu_ioctl.h b/include/linux/firmware/imx/ele_mu_ioctl.h new file mode 100644 index 000000000000..3ad93ded23ed --- /dev/null +++ b/include/linux/firmware/imx/ele_mu_ioctl.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause*/ +/* + * Copyright 2019-2022 NXP + */ + +#ifndef ELE_MU_IOCTL_H +#define ELE_MU_IOCTL_H + +/* IOCTL definitions. */ + +struct ele_mu_ioctl_setup_iobuf { + u8 *user_buf; + u32 length; + u32 flags; + u64 ele_addr; +}; + +struct ele_mu_ioctl_shared_mem_cfg { + u32 base_offset; + u32 size; +}; + +struct ele_mu_ioctl_get_mu_info { + u8 ele_mu_id; + u8 interrupt_idx; + u8 tz; + u8 did; +}; + +struct ele_mu_ioctl_signed_message { + u8 *message; + u32 msg_size; + u32 error_code; +}; + +#define ELE_MU_IO_FLAGS_IS_OUTPUT (0x00u) +#define ELE_MU_IO_FLAGS_IS_INPUT (0x01u) +#define ELE_MU_IO_FLAGS_USE_SEC_MEM (0x02u) +#define ELE_MU_IO_FLAGS_USE_SHORT_ADDR (0x04u) +#define ELE_MU_IO_FLAGS_IS_IN_OUT (0x08u) + +#define ELE_MU_IOCTL 0x0A /* like MISC_MAJOR. */ +#define ELE_MU_IOCTL_ENABLE_CMD_RCV _IO(ELE_MU_IOCTL, 0x01) +#define ELE_MU_IOCTL_SHARED_BUF_CFG _IOW(ELE_MU_IOCTL, 0x02, \ + struct ele_mu_ioctl_shared_mem_cfg) +#define ELE_MU_IOCTL_SETUP_IOBUF _IOWR(ELE_MU_IOCTL, 0x03, \ + struct ele_mu_ioctl_setup_iobuf) +#define ELE_MU_IOCTL_GET_MU_INFO _IOR(ELE_MU_IOCTL, 0x04, \ + struct ele_mu_ioctl_get_mu_info) +#define ELE_MU_IOCTL_SIGNED_MESSAGE _IOWR(ELE_MU_IOCTL, 0x05, \ + struct ele_mu_ioctl_signed_message) +#endif From patchwork Wed Apr 19 17:55:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13216767 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 42F20C6FD18 for ; Wed, 19 Apr 2023 12:28:00 +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=10XhhWTR5pj0IOnCxu/9UG4r8Bl8i6Q2NL29+X1zypU=; b=zEDi/XD3CISJ51 7Ixvua3Ong34iPRkW6zCqfnGERMe1WABg+6Xc6l5UyObTyc0Yq7UOvWp8MyUJM/JYMdqAPlfqVhWw y7V34olfFO8b1rFxYvcx6eWDi2spIX3yfHWAJan3XWdBTtK2AeNPSj0EWyE33uzZkd1CLF5fVX8+W LHvkCu77cp5XH6MklVlcRyFg2tmx+UUDrWLpeT1Izh6YPX5UdtXs5+1B2mGWNQQtsG93pZx0rK+CU Q8FyWqOum2twJk32Gddp2FaA0GFHgNa8usGcpz+xFfU+Enr1O3lFGfOjsOiS+onjFIjKcuEFUxPDJ g7VPA4fMjG8ZB5IZBKHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp6u0-005NP6-1n; Wed, 19 Apr 2023 12:27:12 +0000 Received: from mail-he1eur04on0618.outbound.protection.outlook.com ([2a01:111:f400:fe0d::618] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp6tt-005NDG-2t for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 12:27:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YNohnLL/Wv2NAhUeDpPt5QnSI27FaOdyEna8N6R1hFWacdpT/EWWv4nK91Cg4L/TAj6OmkVcuw5A7c7m4qBpUzrMWuCPBXdYq6l9hJcUyUG5iQp1oJfCWKJqZLN/6d6GqJwjnq2GOFd13a5CvE/y3/0CYgEgVCk/H+Z6sIEzXOT5LlC6jioKj3/R2juG2NxLZMeXAUck6bMYYO+6G4P+lNl6XgstvT/klFVb8h6RXCPB1EUwJe8lXm3J0I1FR0r5Qj3h5JKJX5WljQ6oJ3bWtcxMJJU6dR5vRdt71zkM33yUM4jxG1aHagaHRm47+TE/L/eFXAaL5RebttzHB6Kxwg== 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=7dBZFctoi+HaxjOjd8B9Bvo86l9CZ9XFJYprHXz/0+U=; b=PFwcGS+3FR3Ok7IQn3TCYGecLTu6LYjryZ3HBhLfL+rFnEAIKiQvEjhb0n7XZPd/qGoKLESSDeV0x88QKyiNtjTxly7bVmF2Sbzby0R9DQheNZNyEUOOHM3PEpsZNbt8lSy8r5IJRR26BQ4yzz+4Z289sd+ZiLV4lGAdlD8NEspchQ8fGyh8anTZY9BaKklEsXWN4hnBnGKqXc3VIxSL2jgXZaWSbgwt+VlyOuBeX7ibVnOhVJHmBNyXUivZ7eWv1wITcDNjlxcBZ+1pFPB/2Yc/6PCkTrhs0ctxmxZE87kZCCf1O0CVXXeP31WGEC0JhiqHX3YJSbEj3Wm8gpsGhQ== 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=7dBZFctoi+HaxjOjd8B9Bvo86l9CZ9XFJYprHXz/0+U=; b=Z/xr+hwbSbV4a4LYMafX43pat/X9mUzt2BzAjVHEGt/IqvjxkD60yeIZGl+0olw/u0LWSDdJZD7qfxQg6u+CAvt0rbEpGIqbIX83seM4deC+cmGwoWG0XdgM+JmnNRGiEQMW9BvMKGSRx/VcFu2D4rjH0v7JXT9V+2hGjWWHYvE= 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 PR3PR04MB7386.eurprd04.prod.outlook.com (2603:10a6:102:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Wed, 19 Apr 2023 12:26:59 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::bb08:83bc:69ce:21ed%9]) with mapi id 15.20.6298.030; Wed, 19 Apr 2023 12:26:58 +0000 From: Pankaj Gupta To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, gaurav.jain@nxp.com, sahil.malhotra@nxp.com, aisheng.dong@nxp.com, V.Sethi@nxp.com Cc: Pankaj Gupta Subject: [PATCH v2 7/7] MAINTAINERS: Added maintainer details Date: Wed, 19 Apr 2023 23:25:38 +0530 Message-Id: <20230419175538.855493-8-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419175538.855493-1-pankaj.gupta@nxp.com> References: <20230419175538.855493-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SI2PR06CA0008.apcprd06.prod.outlook.com (2603:1096:4:186::23) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PR3PR04MB7386:EE_ X-MS-Office365-Filtering-Correlation-Id: 497d0195-bb9e-43c0-2e4a-08db40d15eb6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o2CiAkPUF9tccGdpz+yJxRWK2JaLLaWCYnMIGEeysiix0U9wS/FvaiG8yB7kniHF5D4rEWLkoJ9UWpoorpHiac2ha+WnoXCDsP0S0B2qr5IEoQkOYDuAf2mbVyRKsgLop0tcKEt0zOIJjdqRK42wcajpgORNxEPAnjHgyxeUHbyW9ydhx5pfiLlzcBqo2FzwWQo/NQpV/IZW5D9I+pjf9pG7LlSFRj7n/DowyIW3/4KPBE6x/UgyWn8NqZolk7a3tdzTZVmhHiBk4Y5oX/tyI7HucD0OQw0jUalql+Sn0bugpcsOWYESmMKv9ETOdVkwXLUKzOKanhjlOlAVANwkyPFiFnYcap29X6Ov+U8A7f/1TBhhPHJWWRPJlhiq3bd5y4vYHPwhR8jot0wMwnAKyWHAK0jOcNphFQFPkkCOxRLvGUACvKCk4BZk36q5gnOoBA2twpal/Qr+IsptnXLf0cMH/HBHQISXn7NuyO0RMRBaXSxCYXpjVot0dsPVxpEu0fIy4ylz9o2ryMPdw+Mucva3AqN+gDqVEmCk2j2eIyMAmX/bAEWK7mtaFL0u6lcZ8R9ljGHQ6B4m6w2R9dADmQB6AfSmrHegwlN2kJf6SZm8QJJTDAKPePhB2uwExcRMs3FCYccHbz+q9YlH5libYw== 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:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(6636002)(83380400001)(478600001)(2616005)(52116002)(6486002)(6512007)(6506007)(1076003)(26005)(6666004)(66556008)(4326008)(66476007)(41300700001)(66946007)(921005)(316002)(186003)(5660300002)(44832011)(38100700002)(8676002)(38350700002)(2906002)(8936002)(4744005)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ByWPhJRzvZLGgg5QRFz5p6Bd7v7FPNrGsxGF/4Kq9/Ag2apJrClbX3y/ifsi88yw0638NDXoqJLxDjLW2qMi9w3+AppNiWhr4IazkX8cSOVUukuYDZ4DFF++wo0TDSBg1Yq3Ic097QieeYspOECdX7htTk2AXGqHLJnS99a8qMpfau94ud5w3GSxXVoSZt24ZvxfDrNdQw72EN8FxJ9bqmIMmpMfs2jZ1IV61nJhpuwxqNv2MCNg5gD8hKt4pqxnn5Xc+KccIrFa74+XRTvHhXZ1p8L7BoBZ98CzmhEzVYA1k4bGpzIvM7LSuLPXNNJj0jVD56o8UOlThIoJRfDGFImqfIdHuqCxll9dFdITN7xDSuKhpVvfIVIk1xhdeWBZQjVbm1EC3uQc0KkfPQDgozJjYT1IrQ2d+YiHheVYMkvthlh4Es0VXpYaTgFnxAG5kO+tE/sq2d46QbRM1dj6SJYQxsTPiOUamEDEdgthBVDJ4kX8YI7QRqeJrTXvI7zR5ZH9+aDlhBJCqo9/jYETTykEtfeJ5Z37B+bx35GAPtLFqsiiLrEPzyiBkwnyRk/RU7s/yn/OKvC8pv8FUGyartkiZkZdaPOX53wcrr5smLYsijnbOvIwUCVQ2ekNjFjhXjoTk1UQAFJ4jdcNryJqtAC8+Bpu34GfER4T9TV+U8i+2z7cSxSgdnW1L8erQWZTXfwLAQ7tO7zNSgRzuQBO+c/JaZTIlpo6Dag4QJJpp0rJ2XyLcq4Z7VTXWx6FO9LN3gHR8zHSf5ANzohsURpq52ZtWToa5rozjruR+psJiZr5bxDHBU3J0zSICP0NjzDo7juEJ40kqI7i3DfG9qoUwzn7mIhTlWSPk9TEGbyQ5aJeuXko8x1mU6ie/+jc7wwRvzijMwSuukbAuoRS/KtS4amHYebnudrFW9Qp9cCeXNvjjEvFsMSEt3Cxewof9h2tEJ9iJpU+YpUzkdIx8ACEN+/DvBYHLxC8zlI70jY+b1mbgoE8BuSVtA8i728lCendY3pWkv3tyGN4jiUDbuL9qoM0Sc4hxQGUpl/uHCAz53smB5lVgSr4yiJU5Tq8+s2+hURAON2ZEqqbA8dPX+uSR/aEBHLR6JnmCZCKVM5Y9bqZchjhPjSMFkBFYLkwk0pN6S0YCsdyyqScOmY2YI5ZojGbKRue4BO9rV0t9t3hyWAxecioHgkfOTJQmQKxwimznwzJy1naGajsi9jYymYSGqvJYIGzWOSUyK2ztmQdh+8y08KaJstkOMI9f8NUQj+FQpcTeP7c+wz5Zl5QQ/2J0EnugowTmD3ohKGEGrfXp1hmX2uPKPVQP9A/HMzEK9EqB0Nl+mvtCr/LK9P6a6/xU+6aH6Yq1uXDiQ3zi9lq2m33gaRyUe8jqKAXosj9rFtRdca4U31mqItz3va7M3t/GG0m43q7tn0QGz563zuKmW7mJCBT7BqNvLHlGxK9n2WXLp7gCf2PpaPYIY+MT/SqJIuz7Z6fXlJlBW9WW0B8q1IGvr/FiZ7lSwow6Cpa2yI3jffYyNlfg4ypb3hWo2CcnUZP1LH9x95GymJzakE2TL2hUUbvhuSMBchRmlLQLXfV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 497d0195-bb9e-43c0-2e4a-08db40d15eb6 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:26:58.8050 (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: 9Rwdl0R+jTrODUD3R59xiwmS8p7qKzW55Oy2KnKTuiLsE7QZGWf0oK25XOqCZiWHO5dN2ZJaGMCRBvCz/xq1HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7386 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_052705_935603_7C7D3ACA X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. 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 MAINTAINERS: Added maintainer details for ele-mu driver. Signed-off-by: Pankaj Gupta --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0e64787aace8..59201de85009 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8103,6 +8103,13 @@ S: Maintained F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt F: drivers/crypto/caam/ +NXP Edgelock Enclave MU DRIVER +M: Pankaj Gupta +L: linux-kernel@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml +F: drivers/firmware/imx/ + FREESCALE COLDFIRE M5441X MMC DRIVER M: Angelo Dureghello L: linux-mmc@vger.kernel.org