From patchwork Fri Jun 16 18:11: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: 13282759 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 AA0C5EB64DA for ; Fri, 16 Jun 2023 12:59:18 +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=JjIx51bRpM////IGigqY5AIWQK2F8QqCzvZok/07nBk=; b=OL/5SAoNeyy8EO W84fFzxtXIYbz7kvCyaT72yd9ifKfnVteYh9zJ8frxz9kcKrUQ4bqcJeV+lGPbNFYT4qQBSgxELiV EERC0r1031E+R3cqTq1o7rQPPrvaiP0GUJMnIu/TdlrcjD5Ar+ai6FfUr+WNPaSKd8JmSHILubnnX G8d8ZxPhdLNX3B8X/X/PlzvUoRJTrybqCdqgbNGlOHASOorVPWNHfxzR3PFd7RHPGw2RlvMkpZieL R1B7i6MbRhZfIKWKJL+LeXtXxU1BkE2k8dnCPBeXZxe439z4wp4yJwLroSJQF1jhBEaRPXQ200J7B JJEcmibltWIWsCdQ1ZuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA92W-000cnX-35; Fri, 16 Jun 2023 12:58:56 +0000 Received: from mail-db8eur05on20622.outbound.protection.outlook.com ([2a01:111:f400:7e1a::622] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA92N-000cij-38 for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:58:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GO7P3SUjoEHJq9/deKGoGXoDx/Qr2ud3lswUxm2+VMmtRv3wfOK4WE7C3vQdF3UBS9Psfhqf5Dq5DVK2uTt95h33vT4RaGqPOZh63cv/y1/CY37EmfCPnGVXAHfjNnewoFCnTeQO2u13RG3KelurUGa5Py0GKqtmIl6wtdrG+3aYuu3IKhZTCLQxRoSZHz2Mvw/83jQ0zFNANh05Ym7ToyGnVU0PjkNMuEakiZTYe39UOYv5N0Uwk88Gh8uEU3sPeW/N8AsrmpJ5fwD4n52IP4mdtZYFnndX7wCVqUYBVMAXhiWdrPT1UMmUeyOEYASNssKNaeBhHKkZoGwefRGcjw== 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=n1fhPRIZOPPL6zUY6w4eSpTu9xFM7irWNsi7ifWfsS0=; b=dUxnPUhQy4ahtZbTDMxQbSd8NrIzO6obS3+4RZXaujADwk50QzAidCorkdVSTehBU61O/h7GtolWXEEqwUUMbLy6Rhv+yIBiLQLWoE8tneid7XeNynjnTqcfZI/mr8aBx2pS0NS/jo7pg3DMYnX4ubUjo+blxixDGbzv2UQem8AK3KsvqJi/7QDI35f0T67NJ+Y3DUkT2Nlih3aWLLTa3ZB1dk0qlj7H3AFtiFti8gao8TDzkfu9iipsgFESQ+FKArbNSErx7F5yafDhDbCn63xhXGyHkXcmzjBwAs3FqL8yePSbZ+FUGukztOjuIkqdFM6kqiFimSL5B5mwe5I3fQ== 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=n1fhPRIZOPPL6zUY6w4eSpTu9xFM7irWNsi7ifWfsS0=; b=nXLN8bMtg/UWzQBMcppexiKijo4I4EZbEsIjQ8WQeTg84bKTkzT1uka4+jq1dFlttigwa27MXGyhsYwWNOBLr5jS+nXA3ecU13iUozKfvfGBJO+GlM1VOR7BZOrMFmUpUaRGQgZIC7G98FhNF3g2zcQjf8eJxnOeKxV3N3YZLGo= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:42:55 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:42:55 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta Subject: [PATCH v3 1/7] dt-bindings: arm: fsl: add mu binding doc Date: Fri, 16 Jun 2023 23:41:38 +0530 Message-Id: <20230616181144.646500-2-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: d4a5de26-3b6e-49c5-542a-08db6e6734ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q5Qc8/nVCq2mUqmkl9JhcQcZbPPGNTVQeLdIz4IbNF5EUkpyb/oX2ztus/t1mWdQVxSaKL+AyiL2P3LbcqoU7zeGfu4ZlO5PQWN7bsm0N/6PIRxtmS+jvtBM5LZjCY319LYnBtgGN//4kpl3AWzGcNVRirigRRNGdlo8NKx5HrDYZvHZ7ZDqttcYNhOc3+zkLXDyYsyOKz8ZqFi1CJnSWxxhfSEE2ylqatj5efhSAyyBVZGuve7naQDiMkqF/n8z8yS1m8vXor/uwHWwCqda1Ef/LcCjUQZyZwgt6Q91WGGKvYGWt/atURA2WAXf/9BN+6KzoQkbhX2/Lz8Rg4/y619SEMjYzWD2BlRLmx9p5AQxToL7I3sCGQcie18ybnzkXsaHMc2TWNfR6nYqApmzLJ2WKEZ5wOQq9WLG+45ZeFA8RjKpBTDhCtqtOWDqiQLmQ92jqq3Ft4NS8cJh65agivBkscx906Sn637C/qt+dVingaIgorjn7fxC692WSvYtOZ9Ee7zRObTXbGcZFzJu9UlZTtJilJOWjcUUz8AUN7t33U2kJ5OhuwRyTOms1KZhz/3iVeNFvMwJXqrJJQDBy0YUgTHWg5KAsgl1B+nItRS/0H7BFDQQwwc9hWGZfwg6nDMKBCLHP/9jHacJ+ZMgh9q3jTXmBvnE99HfvuehsG8= 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(8936002)(41300700001)(8676002)(966005)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XMcTFZVTi0QnQ+by3RqCyf9rNFjOxCW7vNajsuLPQTAr3I1eaaIvu+SqRAi/9fgyfOCHL7U956wkHhKBJJcTnS7Y9NAYHewnAzkq6Lq8l7akKfDH7TbWrRgy39ZdO7ypZ281ZDHaIqLCH0q64MLtctcF1FFmuZEHgDJndV73EA7DKEn3o4YvjZ5hm3TeKoglzS4nP02a8mVuXK7B0ZS89G3EFqiPZ/VexqQK6I15R1nt9qNUekGHookVkU5EOMGyvlc1EmkHzxZwHTN4kGAeOOzMEd9wthLN+9Aa7Spo7A3rEB7NPUIGM0yTookUlpavMKXpH7CBlqce7NYnnBq3VgfP04REYI+rI1IrX/VCJ12d1brB1NZxHuSL+IyyR/wcRMce5NfR0TcMnwq4gLQtV/rjUEkNQX2WBwQCoVxDhj9Oa8wyNuwOEcx1Sy/7mqjmFMzjm/2eo/z38GaESi2PGPNScDf/7mNRBAK/6HiSm1n+VNyu64vsRHtlc1DRkMPA+yUAcVSajE6rPtUHH9wQIApaduHNL1d+lrYMtGxQevADxmh0LzdOQF0Myl/4mj8zUAAffN+tHk6x1oIDR2LhRCG3W0EquCHxc3ffMZI48nqguv5AODEjl32w44H17AjLnxuMHNkc9XR3+PUZ4XDBM8D06ZSlBxwkGD1xFH2+06ZMbNYZFWkU7W0SHDea0ZMsGSU0foOO1vwhnMrH2G3YI9TtiI4XtvTN/uFaryqpSOONi1yW2yte2Y0Roj58FC9wAzrSm2I5fx7s7PnEtLNIqyGoxbOxNjxFPmvcro4WES5qMid202SMcaZf3BAjqo/iqIykuZKwKboezNuihtcJO8Z2MCh+SoJfaBEpSukcG/ybA332R5k6Kkb6BNeJ6qRIRe97xbIL9bpvazFnkG9N3HQS3sFjw1ijnOq35o3Qe+g85UtAAGHGtKynbCJypTD69L2Kzyagna6K+HMwbxHwD9MzQWZP82QqyfZZqTa7sCkD8y+ukWUAVDYUjlMEgVyzHyHYNt3vPjAfiSnv75tTsHFl7gI7YnmdFFOOLVR9d5yKSrpIEkDWyaoB59JFOni0QqSpQjfdLo3QMfCrvnqTHW5vmo/LkbbnhCeJZj1u59TSP2XPzj+JqaboskDB1F9tXPPAjYdUzK7xZFBLBzdphmbVc4quCKjn/j35ftH19acMvIQlTrZmRmunJahccmFA6pE3v356GH61FVX6NmzV7HClicfbgRb4f/rBbSwHSclOjNR3fz6j+73cY8VjiGhiJtgH8bieT0Y/22sQspIGvp22faBV4gn3AH2hf5bfGhTK0T5IXy1Hgzllxk8W+8uLcS56B0UEzbChPE74cZyNkDlozA2In5FoH81QMaceMD/eTm9nOR1cWUXqRmT7ulnzL9Ey7wj2pBip0iJYlaTRr8CuEJz3O4wf0NbsbZqpKjW5UyIZCQzQzghNeIlsyMF6yVnYHTlNT1XICXK7A7aqu4xsHK0wDCAtnHyVLryq8hPWjuCVm9h6fs3TA4aXpTlq9+J/1jVXrsjD0ruVx2I4QLB5zubrWsnDnjB86O/ORMLJJzgqAjDk3SSjhQYdbcpb X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4a5de26-3b6e-49c5-542a-08db6e6734ec X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:42:55.3162 (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: ahDo/ITaoz7kmL/JxDd25KlFc17qDUzrNq6a0L5w7rTqEUosOXvdGrS9VsRkAPn+Zxb6636K0ku6cNW67zkmCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_055848_012991_F3820F11 X-CRM114-Status: GOOD ( 18.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The NXP i.MX Message Unit enables two processing elements to communicate & co-ordinate with each other. This driver is used to communicate between Application Core and NXP HSM IPs like NXP EdgeLock Enclave etc. It exists on some i.MX processors. e.g. i.MX8ULP, i.MX93 etc. Signed-off-by: Pankaj Gupta --- .../bindings/arm/freescale/fsl,ele_mu.yaml | 144 ++++++++++++++++++ 1 file changed, 144 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..29e309a88899 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml @@ -0,0 +1,144 @@ +# 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: + A list of phandles of TX MU channels followed by a list of phandles of + RX MU channels. The number of expected tx and rx channels is 1 TX, and + 1 RX channels. All MU channels must be within the same MU instance. + Cross instances are not allowed. The MU instance to be used is S4MUAP + for imx8ulp & imx93. Users need to ensure that used MU instance does not + conflict with other execution environments. + items: + - description: TX0 MU channel + - description: RX0 MU channel + + mbox-names: + items: + - const: tx + - const: rx + + fsl,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 Fri Jun 16 18:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282755 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 70F5CEB64D8 for ; Fri, 16 Jun 2023 12:57:54 +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=C1eH6qLXYf25IK4k3MivUTORNu4N1lvwQKCNJYVw6Uo=; b=1xXymfJhDt8Dwj 3ioCsWkTVoJiUMT479QyBjknrOpRdYV+VesQ8aHPr4LMVlkaMAviRZjgiQlRUJhgvR2evTy20Awch m3+vSc/83+nCNB2r/qaVrmaKgwz88cYRHh1OP1PP1wse2mhqIMOAR6z3q/zfn0BKoHhBO2mWKKhAn kwiXlM2MhjQxnaAeP0KF6/nFdah+moE6Rwll6R8a5X5xtGn87Du95i0Pu8anK6uvh4D8fq/iriQej 4Y0bYpNtlyqiE/6XkgH9nSLfFbxTQ5gt/vt4Ycmb5vR2Xte/fVac06JzFhBe4NgflAfCWqrxHvLeB Ue62VX3PHJunkuA4S0Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA919-000cPZ-1w; Fri, 16 Jun 2023 12:57:31 +0000 Received: from mail-vi1eur04on060a.outbound.protection.outlook.com ([2a01:111:f400:fe0e::60a] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA917-000cOu-0i for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:57:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbYLaPZBkNNrmSq9HW6OD/C8cUNGxQ/CPK52z0lpyESCm5+BRZEtTBVFpxcjrSCDjuPAyDUPKqW2ZyxzdycLVMra0VMA8gb80T9t3fUCVp2wc59ulgVRDEu8K4t9fNdcrC8moLdUklEECNy91v8GxlqAxipn/Pq3ZE85UhnkQ5vEo8GpYmjLfSmh8EgrwQuJc6GzpO2wpZjAkLuoTnXSx9dzJ3ESVBy2yjeNOg4KeqUY20pJdUzer/XRs0D5EgbYv2XbJ7vKFlREr5+z0OixToas9luluJr94QQ6YguLVO8bpemh3YCI5b+2++qrzMz4Dj1AYy9evePHFTU3teQJqg== 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=qU/hXQmbgoFBqB7do2xjcaTLcO9DvPxSQl+o250+gcU=; b=oCLmpOqMD7z1Xm90KN8WlTAfD9wmGwWYjs+r7xDiv+ylw6ouqI4/qlRtTSoKpfpDSb9vQ/xcuu3kYZeLUHEopeM3K9FyqRElfQDOOw6ACCOiULF8QUndPbs+qwmSC5KcIywtEAdnMrNb5o6xLvLhS2dHdJdcjP2BbzQ3Q2sK3HoX9EZZzcZKUSATCrzuAc4HDGn2w8AC6avW57K01N9uc+WjzwCuc149Fc1OeBTtXl0Tl65gMlIxvTWLjzGqzWjLykOpkS3n38uugezGJ/wrH3KQoSTFKOYHta2RLPfnnlBSNsNiGx04bXgsNCwtUhPkpw4FnCZh8NcTZsos6KOITQ== 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=qU/hXQmbgoFBqB7do2xjcaTLcO9DvPxSQl+o250+gcU=; b=lNfC1/mGpfmglmsHUO30tl1tqD/2kJGE6po3A53j8Bb9VT8hy/VIFLrzoGdyd963Y77weii2UnezpXlhflS2U+lqf4NuSWiAqxHU6coBAXwnMaZu+Ttwqp9VqM9+eCUHTtbfPgcrKC9tnorw6dgun60M4XWwE9FssnQXd/bPcKw= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:42:59 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:42:59 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta Subject: [PATCH v3 2/7] arm64: dts: imx93-11x11-evk: added ele-mu Date: Fri, 16 Jun 2023 23:41:39 +0530 Message-Id: <20230616181144.646500-3-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: def2bccc-030a-4f98-6a8a-08db6e673747 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c9REVDW9EbwzBjT9iUtAjZxQHjo03IROzl8HSQmjQrTr49DISr2wFQU5E/P9EraQENW5xqn6h7Uyiaj+xBgPxgerI6U5haJg9DLvTJfn/+AtF8bLnC0P7kN4eCyTHytLVisXzP2hM6vJTT4WhXAgmYA32F6gnxeuecy3svaYTyXcmxTUnvly4OTfbnmgViXj1/UPO92tGoL4LsGJrf73OfcZmqUYwedptVEnimMVzB7pIwcPhkqjZWAIp/zZkp9ge+Tl/V5SiLtkkcaJrJWwLSc1OkpIY6hxqhZQLv+dQnihAv2CVKHRvKxbv62hLmXGEl3KH9zPXzvxQTZqWc11L28lECrRsLQIiQ3gBSguBg+sht7UHbWpPF33jqzNYVrXDCGAxIodxuc647ExZ2/EhTjSa+omzM2LY4HepKYL4edEQFCDCoEwYuqWetjLTnbvkVk6kI3cO38BwFwu3zAPlwx0H4nhEm1UrcdlIeze6/RwshNeyc75/mzG1AovYVCfOD+1JsXTouPu0MX66o7mBqRoN4Noqwp0my+EX2QXnPnvV1LufdT6NU1+1XKJBaNqziib+J6Lt4ek9H8YQI0UpkYntrnxmysVB9ea2bSnZCLp3oHIVnk1a8jXfozcX9GToaTcvcUQLINYjDJKuGJuwA== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(4744005)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BGGjDVuonOynVwDNZv8FT2mXMDQnu0+XhaGBpszG7Tn/H3HarSHGgWOsyOtP2whkKlVSTohSbC5oUcpmP5mejKOeaXFGAbTyvvK94aC8JrkhdFN1ekZDkZBsetEn4Jv/Jen9rZ+F8y+7EOu239qBMcAl5uf6sr0zZ46XiT45GaWLn7sVtj5UxPSu/A0AATfNLzE0wCnDaGlRxZeVOJdxzTPzjfLjI0kv1Fed9eSDphnpTdjoD4MNajXUZtDKhKKlEJdBq0runx03JENW1H1vzLYmWU8sevN+pR8OHSzFDvFzLjYZ69Q6XeU80KrvHwnOQD7+kzJXmvgbHlh+RMtZU/sINNlP0CVlPPzlYMQoZTBeCLAKAIETcK8oSaAz9vMfhmMKhmKrDfbEqil1Us1VBREc9tXdpPempgYKnUaUwz5FEijtwiuW+l0TaUOOjJMiThI+XcoUWJCE3BYdimuoRsIr2T7GY1M/oLFIVD+LEQP3VZt119c5pNVikJ01nkkFMTBaUuD7Or43aSY7oGNt825SZK7uhajetlc1wXdAuezyzHTiUqh/qryqB0A+z30KKlh0Pk3/WZ3fzkEOxhFdCzvDEHrPaU0zn12tuZIdabIGoVgpyEnrMFu8tyr4dufbDADG5LynUpFuE5lTG76QdEzMtm61AqQW4MgDAZ7dMS+msTTesPr3HCNe24+9HYo7KZbTmBlJ4VRYr3g548Uz8JDgUbjkmiW6FW5+YMWia1eLziRaYAA6pMBddbgueP9RQkszO5vGglJ7dZQLTZSNr3Vr31YBNuT6WMx9BzjKUoj0K0+LNyEUkuBe4sFIFJzmn39BrHVvXngAczXvxAM6zWSnspetcU3xVAQmTLVV2Qaq7qU888Kuvho4qh0Q3A4cYKXHKccVOVQSx6ThHXS+Xra3+FmN6LH2eOo11j1T33Ybg6xSyiib3TsdxmqDTl6ntSriAQgdQAQ4tUfd4dhdiOwYS9FtSjZWuzOz4PM3fVguRhtryLC2sMleGPWPPO7JcAEVwzOMUzm9/j48ayzIJry3BiqGpO+EhejjZstlQOZwuhmJyGcm+CJ+pkeUJLnOmeyNbIeQ/ykrL+Vr439a6pOjHDUsCn9D8yomwQRa1hIOepGTiAx9IeUrMqeqpSjIgJrcHEw/Rjvl6YIE1aTknP2Tk5ixXZDH+cF8v9U1d2YLNkJ1MzNI3onpZ/1Cpz46O8Q56ddyJuC0NE5R67kjeDyjsKJUisXEqxlbq7zoTjr9sz9Ejoo4EJX/+9JY+JLdgAlbpbMtX0SfvVKyWs7/eMSb1cZA7olRo/5mrzTxKEVUlTUfvhTVTpANX94K68OO87hAJkB1Quf2byEQVKFjw/xVi5JN7wAUp3AhyumdY4PHTHO65Os19FuLHHlR/so82xrYJmK77gM0Ku2r7l7hD7HCGqHh8j2/hZb29ufFgTfBAp8qXmpdkRm8FGDIE09bRHOzxk1LT7FeFg/Yzj19U/8oHTz2LdeKjV2cEAicYICjGAzpX7SlTdaoG7OnlBrZb17pmHc6En9woTFdoPipFMNnD2+UxO87LZiI7WGDfSpTuUyH/ARWOcB6CDeJ21lq X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: def2bccc-030a-4f98-6a8a-08db6e673747 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:42:59.4413 (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: OeXheiLd54x79sfJvl7/UVbnR4WwjBXR5bufKGVY0mH2LVAPXjKCqETi32YT5D3zIOuzvAuxakCzpGXoxbwwmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_055729_265259_6796F474 X-CRM114-Status: GOOD ( 10.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org adde support for ele-mu for imx93-11x11-evk. Signed-off-by: Pankaj Gupta --- arch/arm64/boot/dts/freescale/imx93.dtsi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi index e8d49660ac85..03ee20cf74ce 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-2023 NXP */ #include @@ -788,5 +788,15 @@ 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 Fri Jun 16 18:11:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282746 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 4010DEB64D7 for ; Fri, 16 Jun 2023 12:43:30 +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=hrxerlfzXICt7X 2RV8X/j99kyb8jEPyNhWlp/FnofLAZZlCVtT/Wi5hVNBKTVwgbhNTR0tDn37/ewqCIfezuhcQH+SC quPZdBotuvEb6WzeUQ7t4iipaZkrSg01E04S7Trx1057wDcYc2pUPNkXZcJ4oZk4ehjlXTlEINQq7 Bn6AtZlRxEioT0jcao3fBEpoaJvYeYfGbhzbDizzU5cRDmIMOoswMkFDP1BH1H+eowA+HECZhYkPQ uCl3BRW2odakmUCtO4RFHUy/Yg+DL4OkjNXOSIMDrsrJ9h0ZdTjwU4rWlvvq6cPAOl8zevp3agT/J wYCSgsPlmWwhyOEEQQLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA8nG-000as4-2n; Fri, 16 Jun 2023 12:43:10 +0000 Received: from mail-db5eur02on20624.outbound.protection.outlook.com ([2a01:111:f400:fe12::624] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA8nE-000arN-1Z for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:43:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WHylA8aeS7SiQTuxi+Jf/TUGFQehVrsfLcpClDwJRZABM8zLmC6O8iYyw/BPdSYACTJvU9m4pOOpSfTLmSKgmP2EWNdetQqYjbHEua2LTkOdWFI8tZyIinplu3s9NqNd+I2VVruO8ZxNGaY6p3t2blU5edX4Wz8AqEj54a3Y8cwbAWWFAqf8CLCUZTf6AStvmY1g4+cjhRZ8crNG/2D+aTaa8N0AQ713Fix3wnOcpADpGWKm57n6h2MCMQvPMRCc1qyH7vncSa8C0DHuYIIvPR/rzXqLebyJ19wBwP8AzOsVtFT5OSsELy7lz0SJtUKKiZoylftUf5RsTNO3lQdgvg== 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=W/LxQ0I4WGIolD4s0+23AqRlqFfi2tUGP/a1UkbDGrp0myUDRqnUq82FggOd3NfUdn1WqCSOttGVq+Y75xG6XCzdgBUhoT6E3HMvSJZH+nIkmTVBIO1UcAcHadzLH2mGFGsfaA4LYrYbgSAnMVtDDzzbdQGOlGGni7pVfDwtcG7SN8SCP95QC06x8F0z2jAiyv33EY3xUGRFYSzg+/jNg17Vatr9dKHFkeoGyIwvZuTgJUEKk8FSNb8FXAOxLzwgHZ6sGU2BbDhx+V19vyZ4MWssAmhp0oseKjFgW+km8rvAajGBAIf8vbTVAXwM9tx81fdVlbHpBtfTV4g8gNoE+g== 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=A3k8QpHzKCAM8bkRdhsbkatZilJ9CYO41AMs72B17u1ekSSQBRBmf2y17LOt92jw/pzz3zrDi0j7493qPf2L/HVCGvOLkafrXF/OOhlYxi17mGIKVT2eVGNv3XkqPEdoC/IyuAPDznEzHAlySHEfRurTnyf66fy+tNyfa3Y+slw= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:43:03 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:43:03 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta , Dong Aisheng Subject: [PATCH v3 3/7] arm64: dts: imx93-11x11-evk: reserved mem-ranges to constrain ele-mu dma-range Date: Fri, 16 Jun 2023 23:41:40 +0530 Message-Id: <20230616181144.646500-4-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: 876ff24a-afe9-4499-18d2-08db6e6739de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HP7gGG6qLqh8Kwuh//eYOSAC2YKl8QEfT58RkbRiEL3FbvdYwLulTzEJBch5vCi356JKCbhjjDuQjjF1xPWAnKX/mYTZGatwDSJgqbdqUBZDTX0zg75yCLczYDAj0CHeeCvUXCsHZSEeybVybiHZor9O4LxROkaVpQawOv6gdQ7DlmCVzVQRHDffAEYajfU/mI92z9yJvXtPygV+fcA9iKkkqEIicNOxSZ/H5F4CxKZsHjvVjyCOeqzcXGZYa48XGXSUTKcJwRyBpGOSNmwt+0Da/lhA98NhXY9VSYJO315E01Hjqy5FLjZgQldmE9BwTPkehXxO/1YeDiGNffKmkOZW3XjoqjXREjXyYrmFYkXZZJQbElmSBsGSNZTCch0YWcr78ORpNcx0u+BT6qfcmkkfjEvvLo6BSiregKouzvX/KOyF0g0Fk6RpbWh45GaTV97nNu5oG+YuDrV9Z8QnnLrGTrimIyaAJTx8TJAfM/ZQV9LOrLlQ2+wuX7uLhInrr6Cz9GFcEj4Duy+hE+KblkP05jfK+4kUIwo7rc8z5MzvjPDhD1y2I2mOkTHP69HdlAXlIZVBDexi8ZdHbvdYkCkzZXTEQyKpfqYCENVLDqfTOCunURNe+DTa0bm4UP11q17o6tlJ5o+ATyv5HYybrw== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(54906003)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r5LLgxtjhM/3UekAMk4gLZh3DZWcbY1cQ/Tuidag0bFkShLCn89LDIry45NYpzVOitSa4NitfM8rgK/cD5HYzF6d8ytj9ZC+VZv40nLsZJEOlH3XohWTJkeDVfifj+ucqfZX435c/2aBQHheHeuvBLjpk2Q88135nsgZTG8VlqBOVHh5OBnch8qdu3eGenCGnMQKkW9g1cWlhG5RW3oj6WEsUXE5YTmAymq7K1jZ7kVz2yxvqcUbw7334Tg0f6jSRcP4uprVgxgW/C668kY2tYMaApVu9fNL1pfMubQ0Q8C6eLBYrhT4w/emvMvSjMXZRmfGZV+XAjCGh7H8SvYJcve+RImz9t78NNirNuQea1ooiNil2F7iG0qT+npAzBVAnznpFSwfysnklMMn0gd5XIqVKu1dgoyBZD588KuHInRrYAGRFXMnaZQFyFEojW4Ezyl0JEuSl+1Gbw6d/dMc+cdt9p/5qp8MPDejOJFrg8tc5y/UG2/GS4k/le4BWGTaGu2TWFNxRmn2bSsNFGJS+X64SrrkLZ6H7W/6Fy0Wq3Z/WnLcEnxW/gaNm/suhamlDI8POimtfIbfZ62vlhNX94CK/l25i5ZG1pBeQzH1b1AkuVfMQ/rdG1lPwQQC2RV4IqxevWkpb5robVZkFxmayi8VzcuDvZ522vCm/oEqHJmnUqH+WrpI7QAr2CuRPP/GYcPfu1204709pccQuHZ2Qg1czaJHey0yJuCZg0/+rVWIlmSzX1lli1yk6ZhWyI6lC5JULDhQmt7w5J1BLIv5l62gMb8LGzPgBQE3sb+JAJqEchxmLxOuwOgAvjBTTHu8rZK3rI6hfrb/AXSa5up7H1+PiaO1TXsSlloJlhro1GLbNGgE6n79MwXWRygFUaqpPDeyvKAPPSzABM5e3i2KVVHZ8QUGHXpb4pZ5qfxh4LsCar13iO9PNbZRVOs9t4rezDaKF3iJ0vhCtxHLch0KajY8G/EX0p5Vnzdv4mx3wy4A0+nJL16OIIscg+MQG1GoT9+F6WcIH+YGxFTDyXKFKRzr4JBwv8kgA6ytbf2CzAvDmMKK69/vrts76Ekr1BONspWhbd3a5u3aU87zavuPPO0+3l70qb6o2VZ/KemqnUZm1LhIXBY1vD/Zf5ri+iiPmpiY9je9hGNaZInvKdo1//P3WdHR2uvIfQHr66/zSrUUFm8JUOdfI1iC5CTktSyFl/7feGxM8gyEwPZCcJ5wt1b7ldoFpADtSpsQv62YFnBUMN8sfLvgIyLv8GNgFAHPoY9u9euMj/d90MIHWFfgqvhiBp6pVREZU9+Ymsh/M19tcEEGMkLHachrGwJkt/QsyPBE0A1ve+rhQHsnlk62kelf9tRQHMEWk/uZiyCePBum/Q/pl9zp/SE3PDPGMdCQqqYzL9EUwi9/fT4lAFPRh+RuVVbK3/9Aqe+6c/S3sfe8exta0szjm8XkpEuIJCgLRGPUxpwQEM4SEmi/Bzcha0dOtKNqcXCk8YmVR1F7Jq9BfG/XG+4eXNOrEClAmMGhgTbslbs4XfKlgK8LqkcYQdZG6tK2GT2bvUlH1gVDIQzd1GQAxBoYoFPvso2egEge X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 876ff24a-afe9-4499-18d2-08db6e6739de X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:43:03.7723 (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: Z+ctXFnb+fgZQydLJM/2z2BLPLpllTYSZBjNf6rSQIkFidGk3k31i3m72dUTm4oHe+UUy9J2Vp6TnaxQ2ziJFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_054308_527286_9CCA0465 X-CRM114-Status: UNSURE ( 9.55 ) 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 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 Fri Jun 16 18:11:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282747 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 91552EB64D7 for ; Fri, 16 Jun 2023 12:43:43 +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=9gAWLpcjtC9p3510JfOAUU1sP3UAU9qL/jgcwgF6apw=; b=YNnViqfZ5GEZiN mDRF+/5gGE6b8AvdODnYOx48bpFHfC8EuI0JrxeanB4mvmCXfUxVJz6iq8l+9Z98quEY0n073HIeW ngxCtgrPMqCCDpNog3yDIiNoQg7C3g68KVFKv9Y0m+zohoCk6zy9KnO63hAkJiFfszpOwd/utgHBN KbUx6dYaSuaRk4ADRZxlC1ZqAcAm20IPbRC5IWoWrQcY+QZFrLh+iwNo5Ud4895I0HmdeuWxWwcWF RWTCaQN0N85JMmDPOXf3BXtddI3TfbDhkWF9qSVY4fdg8iKe4KjTuHnK+74NO0IftOFmZJYyZvq08 P7YAoAZYTSd/xK5o0QZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA8nO-000auJ-27; Fri, 16 Jun 2023 12:43:18 +0000 Received: from mail-db5eur02on20624.outbound.protection.outlook.com ([2a01:111:f400:fe12::624] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA8nF-000arN-3A for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:43:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WaUXE9kwjml1NYunxvdEWR7+Kt3Yt+0RzbRRS4Fy2S90pQMjNYFbeHiu4IW9UzlIzAkUxseP1FjnGrjsCOjsFnJ+1a85OZbi2LXHuHfofW2FBOUvpEKgC0v05JdHVvizol0sO7QDScAFgwPAYIhaIvhj0cmVRHAwfKCOaV56G46fDk2qg146l9NQQ8NChYbJu0GQql8rGL2kjsbKRtHERqK1iqFD+FufafzJn9yPlgYjy9o54KtAn2J3EqpA7Orr0yCcsUKjXWis3fidkztvtxZGoslZaXdE3AHKS7XIleiNiWFhhJ9Dcd8dgjD5FtIV7qkY11s9FzpKrRpCyMG0oQ== 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=YapWrsBhDH/ndHGmJ06GdubLWFL1ZFWZAoEnNferzhU=; b=A3MtpquSS+Z4yTCC2Ur/nNyi5oTYiK3M59W6Wf5/GbinuUVpG49+lrek4HsZ390OyTG8HeSP+pP2fgLVGrq5Ye6FF1T3x8YVeXpn0Oyr3nyq8Y4yg2FuvUgedP8oOxMCYMwH7qKRYk6055Obd9jJKHSxR9Atijx/Xcci4yXx3uaSzCquU1aYUFhEfL84XO8q4N10FfhpzVarxW0azG4F/NSu7+BuEss5wVWJbwiYgBSr4jxJzpwaw4ZEMWsYrBHGxxLlLfL1flgGeu1vysmo6OUWS9Kc7gpdiHroEd20yDKY51HpBqD1c/3aIDMK6dOJykw4Qbztpc/49Rc3UU92mw== 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=YapWrsBhDH/ndHGmJ06GdubLWFL1ZFWZAoEnNferzhU=; b=i5/IY0m+6sED+wTsNxOuhTNXLQbu4JHP4nroQ74PxLFzEoG86M2lFlZ6MccVKw+wiMtxCWzMSDKTP7gNjuINLjKWTjO+RkYmpzInWkZWMcXfwtbJzJHa5RrLd0nFYEEWlxvcA1FM7JiRWbs4st7qpGWvTxaKeSixz1mUk8KaEiQ= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:43:08 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:43:08 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta Subject: [PATCH v3 4/7] arm64: dts: imx8ulp-evk: added ele-mu Date: Fri, 16 Jun 2023 23:41:41 +0530 Message-Id: <20230616181144.646500-5-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bc84457-9837-4250-a34c-08db6e673c4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4VF1DQo3eSOwY1zOa8bpJiZywRoAOsEJm58Rw7vlnME3Cgm//6Y4aljVIT7iHJn6x1ag2/LiwBdhZCSFgsYencHqlYJKT44DA9waNfjH3NA83tsvD3ZHtMZ6Fx6T4N70Dun9+J8UGu6U0wlnG3X2TD16QGIW6f/OEkv6N08GilOSpCntE9KP4b7WjojjkHirA6olkpAF8WM5PfA3lUT80G+zXEuziI4YT2+jnh4GAxPy0QNeiEhd2W0Khob/L7/BP2f04juOxkSR7EWNBmd5c1RQwVeEAYEbyIpPI4aHa5S4SPtPt4WeBD/70bME8VE4VVF+w8PqtsXG5vWuUGuFl9kNvo/Ufpa1V1OhTMdCO6rRikFimycYB+nmHXoaZ+yuxdF8dqgDEdHh3FudcP3PlhaK2XZNH/Dug+aBVHMfjlDO4NrD04r00m+FdnTjMORWQBmEOpeAB1hIg3AzwG8TpVRGMXFUzvkqj4Un3PutmlHzGgP+eu+x+4TTl6zNlTjxxx+9iYfPxCscK/vYTSxZu02Z4/2Wc0jVdRhkPdxoob0StJ/Y7OncZ+oVbMffsujHWyhqfglsHytXYmTUx0xZGECJBfDNGZBzPqqAkSB9PI+8sYgL5oVhHl52LUj88HtjC9W9gRxztq7HEn7m0IGi8qPgT/+HkHLzOmr/LLpMJfU= 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4nkwC+uLctojiTh1MwBPIDtlXM3AB45qSrDVz5Ug4T4X2ymWKveuetbZyZ4knjJlBWfGE+Rnns3Hm+6BycEAI1bGNI1RqTQ02NCHIHIvn9ZshHInardzY0hWav+wQkHMCtzaOGz0HI/AP6bF4/8fXF3PNPt8WR62wTICGDJxTDdYz3p8hSf/SzRtm0axDxz0pEWvp+7lPjjF81hfxojtdIj+feCcAUqa/DyomTfL6CP2hzuu5M+wE2WLcknCM0YVss4GIQuX0sw71yKsxaZ88s65QUUnHYbCkma3WrckQQGRmGXRkZo0UmbcsrtlqlU0WnRCyeg4uHSwMI5C0d6CIep6GZN1gcpONajVu22b2sr1ptXu33Z8FSyzcfTMCwrtnHyWl1ZPKfzvFBSUR2wMpXaGNqZ5srXOUfZPA1Y1twv2U+i7eNxJ9DbSFBhDWmRQeqxXYzdSAmPrBQnIBvty/fIC467El0+0nOYcIgmr6JIuPh4Vp8X7wAdJh7qsvYMmjr2FzsyB/H6cHpjtdCPchkF+baQGa3+Pib4ew9AWNO7KeipyWJu4kwOBUyX7wCaLf8xeYOIQYsZiKguu1a2HRomqWW7y6mkcW9PKTjOfEJg8o3AD5rsu7aZFyOLBxnC07+sGyncyvILOkUKxT2dRuBcPbROZPswiyA7xKNpNVdftWegiA46lyCToeJ3Byc8CYMamT8n52/HrFohcFMCcyLLyDX7tuYlbUWcFXTFJH8JzQowKCQ6ISL4K2aGGfswmDtzb8bSerKD8XreSALeGZ/7ynBFxKBtD80PB3W8170QYP9JXb0nQT1cr4asqU7fRCleMwcM8ALVbYaEY0tuK9VRK4N9TNEhzVTwDp3q/P78xnfbBivYk+LWVV/YamIX0nBbIdzUl8N3RHrYW96dHLsL2ABF3yD8d4GgKYMKkhudXwxxOCSdLmPhI+tWyKwhwQJ9CEtEMIRocoYE+d8JT7TiMvQ+NUaKUBzhR4RcvOI7G2kYFsk91/FcnGdDvPbwFnr74pDnL7nzwmsrLV1YQpZhR20TXU5/gjlecHnuBhEWx/BGv+7CUSnByHhu9dsFgbfnszyT2lLMzlLZsUuHy8lcAZpm+Q6e6k/aYl+kbQzs6rK8/1HYPjI8INASdTt+uPddRcdr8Ik1TGOfi6oXzBu9ZphYMyw+pKwMsZDN/CrSdCSvO3DTAgM0Eu7Ujbdc8ihEyX6zV2sEwBJ6fsFj3jyD09xucOKoZPdfPOz1nj+VntnqSJMjznuNA3D4us/QJ6nTNNeJoz9BIZb1pMdQvda7l0rDF+bvMKWJ+PmVY5CxualPZy2Mb705I6Vu/c6Th2rIkbPDbzdF4lkSZQM2Hzr1ISqq+BppBB74NfuryOgU00By3VseLJ1L5AvKUMQJyvm9uWO2rPXPY6Bz3UI4TeiEWJq/Z97i2js7bwAcXhHLQRpPn8RI1q5iRlGozMeYWXFlWLeuLvNDdqb2EihxFKbKwFxs/n7D25p3hvd5vmLiHeh+LZlXm97qlwCdkcN9S4naOVSZVmExpMtk9rMUHv1G5N34HEol/2LqESl5H7gsl+3s/DQKmnRUe8+/qANfs X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc84457-9837-4250-a34c-08db6e673c4e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:43:07.9535 (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: NCX5WdzLrVaARaElzCWAtQivvyU/yVYf5xpZG771/m/exEqLnjaWVu/kpgMmlC9dQ3lsQPdJRMj7TwDTezwCgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_054310_018953_08C5CCFC 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 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 ce8de81cac9a..cbc2769e4c8c 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>; + sram-pool = <&sram0>; + status = "okay"; + }; + per_bridge3: bus@29000000 { compatible = "simple-bus"; reg = <0x29000000 0x800000>; From patchwork Fri Jun 16 18:11:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282757 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 7B973EB64D7 for ; Fri, 16 Jun 2023 12:58:51 +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=3Fnm9gKXYfVjO+ ijcqxT7GMdBWnhxzCYzG5EqTxoI5CjRud9I5CJZBJpq42NE6/5s44zg0uAk3OJWBPperpgPCOT9ch HkLyPL2o83/a7kgHo7zSrMs3e0UFubW53P2kxWBbDew3lkCN85jn2HEbTddZSt2rV0vcqo0CYTqWQ xy3e57LyWHgidDKuco25KCMY7PCVkDMFaQfm1PgT9tYsk6/aP9RU54RCMvfVw6Fowwwfn4ZmkGRsi t/cuKjAJTDb4oO+v2I8hOENkBCQtrE3BL5vWE+zOKx4p07/Spcw/XMKQBYX/a48hOU0qR4YQXt0h/ OByo30WJXgs9czE99ptA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA926-000cfv-1R; Fri, 16 Jun 2023 12:58:30 +0000 Received: from mail-db8eur05on20617.outbound.protection.outlook.com ([2a01:111:f400:7e1a::617] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA923-000cer-2Z for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:58:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hU8wpk56nVb57VOwnN4U9BHiS/w2UJdy7MuZ881wfjDaVjc2RCWeFhekNWcngVH7TTTlrW9GQkJ0YT+fqlziZQ9jn++FiWnYtNjlWwfT8h/Mxr0oWa6keGoBwUB9oJllzypJs8K96H8pzWiQsJtNeHb+W9GrASFTRd+HBkYgB2l66FQtAX8LO+nJ9BnG7xPoca2Gj/WtURMLfZwjnEhc6iQQlO/8nmTSNw2amiveOKCzsbZUgkN2a/HeAkwJxFJJne22mAO4I0dBaNOnuqzCgIRiZCOHt8IXQ4ppLtCfIg69glsjbRdWgtL/9IoQ8SD13sMAWaaDOCinmeOTpxgaUw== 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=MdxFHS/fPFhlXA2ewB2foujE88n8C1Mrh0gvDH9wBtpww+kALlAi2u7XjDLC1Lskzhr8956zSt9RWFQmP4Q8V1qDebAHIEV/cEb0AJjh9u3Ex3sD14wmE0LpP1mmFcdm4jbrwvXJi+rwYP2FbFKM8IO8tk6eu2QlFuZehmy06RlzJ54Ds9zfauOjMofViGNZjUnhRw/qWUamRbxHVYojTOaA6t8OgwMCxDCIR10bf3FEv1wEACjqFEfmYO177E/YPzuR+jmceLEsHN9yDRcQMObLsmXCIoGdNBUD24SF7Cdz/4o0XJfHjiJDxrZsScH/66rUIKpH+Zwb0WzHOvBwjw== 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=UEem+tGx7FQYk/kcx7qpVL9kNM8GexGetCBY3geWBzD/ox74s9BoZheEQaGCcSNtaQcaNo9WZ8qronfp9fEM+ALTjhy99ZeNSQsfmDTDx8+/2QK5qbRkkyPm0VVj8QDzvN+LpxiyGRuy00ACJ/N2A/wC4Nt3KoYID/WFVYswm+8= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:43:12 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:43:12 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta , Dong Aisheng Subject: [PATCH v3 5/7] arm64: dts: imx8ulp-evk: reserved mem-ranges to constrain ele-mu dma-range Date: Fri, 16 Jun 2023 23:41:42 +0530 Message-Id: <20230616181144.646500-6-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: ee48780f-a573-4fa1-ec64-08db6e673f01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XLXiGYD6NIhVz690ePOUEhG7G+9KSPnDujrVh9xo67bScRhKzwugPwiYmbdCfes0YPOxn4HnR63J51z0I+AaocggAtMTem7MWHHSV+cZN89SIenPYuG910K/myozbheiVam7gTEsNboro8ozK5OksDXvjkLyePQc04gFAYSMrnrAuGfvTgnCm38pnGh8pbwW74vNRsjxc/Wn25q4eJIIqBE5HRYu8bUAQF2UdCT8/8i33SAYH7+U283sgPZ7e26qcwKkYQO/KIdQt+ilv9F5CRKrsyWCxGOOm7WRoW9ZPMLfiU4MBLkVfkNNXY462fQK6afCxDhDMJe4sVJpuwGfS3FpKYNU8Sebh4VbVHs3CccStnxgMMorwzLxfpPw/ozUnlcjXqwNPCMZj6z7N6ZCe1K/dGJTUCnjmqzKvwXZTEiDAouGOPoeOqIQaLd1nbGPTy2EUqHmsXXEsttm36IWHNUPW4KcAu/+jzk8uUmpCN0sHY+2Q1seERdsLnBDPn38X6k75ecsnEOh8KaA2ojlQOsX6Zvqo4lYKfXA9cC1F3MDi2ZkqlEs1Ak/dcU8IYptGqGAsrk8A73dqVY6D6OjjUwqMlVUZtoInXJUIXGB2wOqvZnb4PncQ8Xvkd5yMBpi1ZnQNc94XBnwQsHDsZ/5r/PTPv+/VoOGJNtK9/Vgx+Q= 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(54906003)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sK72NMIOQutw7fx5GF6mjHUa2X7W5jNzMnyPzJHA0e2U2GQpvPqLeVWf1eF/wL/ns/1fLgVxzOqRuqNqwYXwN7fQUdd8uc2gKMoWruYk2a+GJdMo/xhyE8z4fA2rX6+VJzWX3Z0TI3Kuy/R0yoQCz5QLIHhnNV9vZ6aLi5I6bXim8dg/LZ4r3O11mO0KQjiKmT+OVTlEX7JjFmiFlHCa2ZvkA2PSkUtsbYKNrRdcuk32JvxJyOAELrTpd1VpugWtUvpGXZHhKgTlL3ob6kj6B+KpGIp7vNt68zmfsBy5jv/lleMVGPXOKbLxjVIxnhwmM4lCCDVh2BRXKyLWMx9oN4sutKMCkRNY+e+pRDKKwZFydeCo/BpM7GZs0KTYeXAdzLyobA+g1Isq6iVoBUyWiIrN1ZrkVmoc59lMbgz7KhGt+G/jvd+3EszzU8NesdHihSm9QdhZojgoDkq5l62JHjYUTzkIebqS770q+zXKM36MgUe+9JBu2Ao9QPVtaS/qaTDVk5rvVJjtJIMXBOv2gw5K/tQSj3vUIBqIeSO4jmJD07kAScvAvgKzBzqq5YUm0wykgod6s/z1pmXfuTjpVYrk3GCXc1An69xgcE0Dd0PRr8rfb+/GI+Bcbz84cE1WMfKngIB2u+ZfBlFcmifyZsr3beP/RvQ30ZQEyjwGykllVXSKn6yA/6GMt+3Yfo0Ajm8SqtfEvhBDsd7eQjj1rj7wMyM2tEFffhpPchvs4tOpuw5Ij8oBBJzdi9UMl9xNewvjJmDEt1uqDLFj1n6UFX4J96WWenDrAJcuWdvyd1H1epcasLSrXsbWBVZUqwo1AldrkVQcPiNIDrktYpnn1Nk1/SLuOEpGvy1GTWpw4mIrM4OQd+MOe7Ysh5mibtTtIOVJ6CuB2cA7HhGZjumA1O+6MzxFALYCoGhikN4DxXYalfxaftsB6eX91gPoaeuC7eq6SXlvvxDJ5Gw/1WuUj+ImfcsZKn7qJUAiiBUwkdXhrMGUSs9RxzWDUd3/9CpTAh0j2orEIZK/dkVry9+wVdfLL5H4IOQMWrKuOIrQu19VEQJNbTo4Pz9/pNw8tqMUpYY3YzUnmBzBq/fnD5SuFO4hUbnGaTKd76NvYw4mcRutq8ka/ufgLgD5ttg5ohub4ssYCYqKSgriLPMLtETsPdd8poDWWYn/KFD9WKRV8p6ncgsav22EL9o5ZcIQ/Jf0eGTri86w6hFFSFNuN/8A+wgedLcAAurVZGla6Z+vKRHCY1fvurmGWrdgH+b2zifMO9rDFc/fQblGlGkGfDUER23E+eehPP/OtsM2bru8tmS5CosK6AIm6sLbFOUbCqbHpz4BZitKC/fGWnxVlv58Sy79rlqt5KibuBNYK1G9rzqnUVHArfy8NXpCxOSwMsHneVgnAJf/iTafHtiuOcSaacP6Gmryij5UAOxq9cXrQbErKfUuGyP5bKS8Io56PFeztnOddwK+jwMj3YbbnEVGT/R+TW++Qxu2vjfu9XKLMeBEdJUvyzaRH/bC8w0zepMd69C+f0apiYFMc4GJk9FXaG2Sm449rf8+Ve02mp/jbbRCbmnfBbPcYdZBNXuGAUqk X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee48780f-a573-4fa1-ec64-08db6e673f01 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:43:12.3922 (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: Ft3tWsXJc3Whv3AGzA57C9LFNJa8az2z7Tr62wy+1KGGVx58SpdTtARto0YqrWmVQzlxYTPQeMuXx5eKF1GgBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_055827_838802_EE7F60B7 X-CRM114-Status: UNSURE ( 9.61 ) 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 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 Fri Jun 16 18:11:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282758 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 5795DEB64D8 for ; Fri, 16 Jun 2023 12:59:16 +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=J3dJ4VdNOUxzHcWG7/x0Xez4nzjgP1hHwEsejTCrRTM=; b=Xgub6DGofpgMzc dkdv67QHNftxEM2K+jjdwIzIWlGIvXosszc4zA3HWBONN4onu8O8FR+8jzURJfnSLMVOWETqU4pgi WKxNaYfurvHO24hWJRJncPrh1t3GmYyQdo54Bn6icOSPY5VLbZAHBoWIZMsj+MVnViWJXoSMx6A6e aWC5uyoAP9OeMPAvW0T6lT9XWcE52qf48q9J7n3AHsJbQ2qBjl/T7PlKq03bfjoTvnIPjTaRe4iB0 jEFKg5rc1SXiRN6caUvmdf8htVe5Z+0LXI8IChgHiLc6sCbcglixvUm1TqEEPD/yURiBpLVp0oox+ 3PVWmt+6fSdmDUXrR/Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA92P-000ckr-1V; Fri, 16 Jun 2023 12:58:49 +0000 Received: from mail-db8eur05on20622.outbound.protection.outlook.com ([2a01:111:f400:7e1a::622] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA92I-000cij-1i for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:58:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HlBn6Up3bOukjOamrDolTBquQmDGndtk97t/RsFG4I3H1chEgiM1ciK3gLp+qtXCIwcW7BiTHxVxZZClMwXty1h5kvfNN5OYbJ6NilnjDvEpEMNFMrSYBrpWxZD3D5NHVeA/Xl8KngUd+RTMltLqJOu0a0vAs1Xe5UqLmDn+M9IyrUecXoob6YX0HZW0VpSmh4xqP39Ll8vBZkuRAU+6jOXImYwMxaGonsmvSeAfdNN1i/Z/rsegg1A9/eN9CczdfHaqLJGP/eU7Tw4qgVMIGVDQm4tVSvtT6RqiG372WyLZg+YrGYyZ1FOMuQd4fHXH0SHURblWQJ/W852V/GMnUQ== 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=iZSq5QBqg1uxMuM/fhGw3hwMPsCFgnbQtOzRDuOj4MU=; b=UIfq9HESqd7O2aHkzpASUs33ketbZcD3fhYRu+yiDI0ihl72W8PkWknVuup5/R/uSFmqDnIQA5tDf/uHzCLq4kbEAbiQ0+7mz4NKRim3HKoOIOJZjXuj4sJVo4ljCF2gPfQtZ4D1QYn0lU76OyLX3oP/MQqh/dwvjCbmHZwBZTqxZGntlVz0ZS0GFeP6HeSXodBLHwx5ncmXHBPm+FZ4kDa4K8iAFmaYZMLSl9NGOp9fm27neFAWAbn89EYl2qOLw/ulIjcF3tiFnHtKcRRhuUhbg/w996cZKSWPQbJFMhwKI0epk4TEAOP0IZ1yX5p2U7eJ5N9ehghZEDwM+ArvbQ== 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=iZSq5QBqg1uxMuM/fhGw3hwMPsCFgnbQtOzRDuOj4MU=; b=LL1ehaOcBd+QX2OXkUk20jLgzSuHx7P7Gbq5R43mwd94vR7Z/oOTbOLCXDQc93ZumbVYk5FFsOkwLCalxDg52EsqLIb7oy3pbbqfiVMLPn91447pcEXvdicl77fonxS1ZxEOePA/h9olGmQg4V6plWiMOaO+tgTRq1R8nozp8ko= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:43:16 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:43:16 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta , kernel test robot Subject: [PATCH v3 6/7] firmware: imx: add ELE MU driver support Date: Fri, 16 Jun 2023 23:41:43 +0530 Message-Id: <20230616181144.646500-7-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: 1532a027-63c5-4ffa-387f-08db6e674196 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u/bRsqc5dwu1oG47CCKWe+Wze65WW8wU2FQzcA1axhoTvVU9Q67H/NOcLIjJkumqGmKIcJZ8xTyxoy9cZi8yNf3QlfXRKngK2YUxxxDI86xOTVZ2iBq9QdVjYQ4qLJUMGXaiqdKluINVg0qa9hfV119C9iBxH01Lyu9AKj+hBg8wMT/o7y8DUZWnptgdK7po+Turae8PeOKgWEHk4jjqreDfsR/4MReyfGddAHMg+Epxd4qM2Kc3M10z08j3xOu6YAAnvhssjY5ZEt344kdLr4GlJ9TrIMc912srFNb2aRH2Zha/rDXFdBj5mVm81aTC3yuoKMQiipfwYL6SuBxjo+iPVgsWckSOYgqZjbKr0iNMmKwtJNCeI7lQqb6cB1jKtniDRi7slRNWf/AufsNZKwD2Nb3fpBUMgZqbCklDOHjWYIBzQh6JWKImQsNaI6S+/lewMZY8/PTwJXeICi7uS97YfSqPkc7W+mxW0er9hlB1KzLgGKeogqx3gAw7he3BGTRwTJn4Cctca4Yv25FVToMG1o3NLsDKcRmx+IZ4ZRryYIsbOlmbHaZpFgS17pAVIthquBk8ZzIVb2ppvI2wvG1AgBHXJ4Gna+mNUN0cypB93OlpBQLvsiUhoJJT91KhiLUrj1OGGHwRksEIkYpebQ== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(54906003)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(30864003)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003)(579004)(559001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xTuyNsKPsg2aoQXU5Wq3gNxjtQyMq3+H7pQZt4yvp8s2N3T8clLzYEdCjCFqLHQEQ7WR9E0aVkzcZfiidh7TPsKNefp1X8mCvY6SAGXsAvJ6ofuiYlwmopXq6t4Oi4mNObo+Bo4iTbHjjdpD9EEoPGWEoaUQBHgbKXZkKq62Z31NwXDWVL2/50FZ7NstnaJ1qFJ69OIsG7f3J7ZlVQ6nIqo2fBTftxeIf2WC/W0pkuNbd/kkCbHzwBqdFInV+3nHCPY1zE0tyIC3LOxgRP1TMb17QRAMglKKl31P2Xq1Q5LN4QBfaV5pNg5/vIeFwQujDk3aIFKsi5Q5k267ddcrSTxVRYX65bjwuQT1168BvuPj4jWtEHihc9KW4Yf8vi0nue6Og6/b9TMm70FwELXjjHBYrdLuw9UK0suU7BTmmdhNoewjVYTOMKS76x1knP87Q1ooHC8xVf9QzxLuZuP4YKSJ+jmnRwDpCfpgDjTsgGk0h+zTyqIzmM4tOUVbz2y/nJxAugoGYZDTPyUmSw5yre+FAZP5MIKPj/daHuZYBdo9NdVKjjCK1xRU18XaMb5Abc5zem4G9IP9TsANZhboDq5KEk0Bh6DxeNbnVPriTSclYLnuaR0duglyj5tVg+jRkl0tw7RLuyrDXMKMgB56ihOwVCWVuNNJHG6vzCTme0bWLqk5pzDJxihgZvXVJXdlj4r5S6x9YPskZ9sTiVTi6b0hg25aHw3FA7wPW0979JriUe8f7jQhMWGPAG37E37Ld+tUbEf6o6Ft7UBqqdmwMCrQbbtJmEJQkOWXsweqTKvH+NuRjus4vnBUDmOHvgxERB8K33GA5ltmHcrJjCvrQ6BTi4KHFRGwDi5KG2BfqF2XFqPqEWoFRx6BMD0yNDk+uJnwm0/UTkmDlr6D6crGob90eYrlcIHV4d0+VwkVm5CEpNM0BlUWJ9cnZKHemIWEfN0Nhcg39HAhfQ9+2KwsVwKP+yvcmcmb0nvK7rYRLuhH+2iKC5iMvhEYpoLxWerfXIvaleNcPmXgliRZ8MrYznVrU6nWo6rKUMkHzexPSL9vXcqbPUGIg6JozT4+/dK0LYw04E8jRlaN/oHFOvrNua1RT24M2NniJ5a8N7wb8KURkmg/spGyMYa2NUif0fimWFmSdqMlzw3F19qYEnpdQ4UVlFs7jMRXKv+MWF8DsE7Z+hr1XhB6XNNu5TvZNSfyNe7Uuzz8SOinmtPni9hYYfmZiOZATuLBvPBubJnmjc0UtBD3FxN1IKPyCbwU+R5DC1uHuuQ8KyI3vLhUBi58t4bL7XH/Pum1xPHcAlAKMfDYKk59Wjl374lbYiP3Qvv5PUii5zArVV9vNngFpRFnK7n8veOjZ39Ge/gyjp47ycNGfPMs3GhYKI5JrvEbrnsDJ8LrKsyVLQoQP7gYEt2dJVkkLYiCazDwTzomqyWhDEBVh/ucPuieb7CVJwBh/mMg+rs8+qc840gucdJG37X7TR95o8Q49M05RTfOazt1CAW36x1hUnjS34qjDBsptAgahdVZbhcyp6UTOvHUYXH98Z0mmoHMtWp+kXIfW9eBtYWJmwShCivYo64HQqMhSMgW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1532a027-63c5-4ffa-387f-08db6e674196 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:43:16.7587 (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: WKmI0ui9ZMaM9yArNjNzp6f1vBv219CESYwkDKcadJHbFi9brZjiJhupeLgL9U98fVNchXKd0CWT9WsAWNFWOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_055842_848224_918A6AEF X-CRM114-Status: GOOD ( 24.84 ) 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 | 372 ++++++ drivers/firmware/imx/ele_fw_api.c | 112 ++ drivers/firmware/imx/ele_mu.c | 1442 +++++++++++++++++++++ drivers/firmware/imx/ele_mu.h | 180 +++ include/linux/firmware/imx/ele_base_msg.h | 62 + include/linux/firmware/imx/ele_fw_api.h | 19 + include/linux/firmware/imx/ele_mu_ioctl.h | 52 + 9 files changed, 2252 insertions(+) create mode 100644 drivers/firmware/imx/ele_base_msg.c create mode 100644 drivers/firmware/imx/ele_fw_api.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_fw_api.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..169870ad0fb5 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 ele_fw_api.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..02d7cfbcc948 --- /dev/null +++ b/drivers/firmware/imx/ele_base_msg.c @@ -0,0 +1,372 @@ +// 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); + + 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_fw_api.c b/drivers/firmware/imx/ele_fw_api.c new file mode 100644 index 000000000000..7aafe61b5614 --- /dev/null +++ b/drivers/firmware/imx/ele_fw_api.c @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2023 NXP + */ + +#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 = 0; + + err = get_ele_mu_priv(&priv); + if (err) { + pr_err("Error: iMX EdgeLock Enclave MU is not probed successfully.\n"); + return err; + } + hdr->tag = priv->cmd_tag; + hdr->ver = MESSAGING_VERSION_7; + hdr->command = cmd; + hdr->size = (uint8_t)(len / sizeof(uint32_t)); + + return err; +} + +/* + * ele_get_random() - prepare and send the command to proceed + * with a random number generation operation + * + * returns: size of the rondom number generated + */ +int ele_get_random(struct hwrng *rng, void *data, size_t len, bool wait) +{ + struct ele_mu_priv *priv; + unsigned int tag, command, size, ver, status; + dma_addr_t dst_dma; + u8 *buf; + int ret; + + /* access ele_mu_priv data structure pointer*/ + ret = get_ele_mu_priv(&priv); + if (ret) + return ret; + + buf = dmam_alloc_coherent(priv->dev, len, &dst_dma, GFP_KERNEL); + if (!buf) { + dev_err(priv->dev, "Failed to map destination buffer memory\n"); + return -ENOMEM; + } + + ret = plat_fill_cmd_msg_hdr((struct mu_hdr *)&priv->tx_msg.header, ELE_GET_RANDOM_REQ, 16); + if (ret) + goto exit; + + priv->tx_msg.data[0] = 0x0; + priv->tx_msg.data[1] = dst_dma; + priv->tx_msg.data[2] = len; + ret = imx_ele_msg_send_rcv(priv); + if (ret < 0) + goto exit; + + 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 == 0xe1 && command == ELE_GET_RANDOM_REQ && size == 0x02 && + ver == 0x07 && status == 0xd6) { + memcpy(data, buf, len); + ret = len; + } else + ret = -EINVAL; + +exit: + dmam_free_coherent(priv->dev, len, buf, dst_dma); + return ret; +} + +int ele_init_fw(void) +{ + 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_INIT_FW_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 == 0xe1 && command == ELE_INIT_FW_REQ && size == 0x02 && + ver == 0x06 && status == 0xd6) + return 0; + + return -EINVAL; +} diff --git a/drivers/firmware/imx/ele_mu.c b/drivers/firmware/imx/ele_mu.c new file mode 100644 index 000000000000..a830462d1292 --- /dev/null +++ b/drivers/firmware/imx/ele_mu.c @@ -0,0 +1,1442 @@ +// 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 + +#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 SOC_ID_OF_IMX8ULP 0x084D +#define SOC_ID_OF_IMX93 0x9300 +#define SOC_VER_MASK 0xFFFF0000 +#define SOC_ID_MASK 0x0000FFFF +#define DEVICE_GET_INFO_SZ 0x100 + +#define GET_INFO_SOC_INFO_WORD_OFFSET 1 +#define GET_INFO_UUID_WORD_OFFSET 3 +#define GET_INFO_SL_NUM_MSB_WORD_OFF \ + (GET_INFO_UUID_WORD_OFFSET + 3) +#define GET_INFO_SL_NUM_LSB_WORD_OFF \ + (GET_INFO_UUID_WORD_OFFSET + 0) + +#define RESERVED_DMA_POOL BIT(1) + +struct ele_mu_priv *ele_priv_export; + +struct imx_info { + bool socdev; + uint8_t *pool_name; + /* platform specific flag to enable/disable the ELE True RNG */ + bool start_rng; + bool enable_ele_trng; + bool reserved_dma_ranges; + bool init_fw; + bool imem_mgmt; +}; + +static const struct imx_info imx8ulp_info = { + .socdev = true, + .pool_name = "sram-pool", + .start_rng = true, + .enable_ele_trng = false, + .reserved_dma_ranges = true, + .init_fw = false, + .imem_mgmt = true, +}; + +static const struct imx_info imx93_info = { + .socdev = true, + .pool_name = NULL, + .start_rng = true, + .enable_ele_trng = true, + .reserved_dma_ranges = true, + .init_fw = true, + .imem_mgmt = false, +}; + +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); + 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 << 2); + 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; + +} + +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 phys_addr_t get_phy_buf_mem_pool(struct device_node *of_node, + char *mem_pool_name, + u32 **buf, + uint32_t size) +{ + struct gen_pool *mem_pool = of_gen_pool_get(of_node, + mem_pool_name, 0); + if (!mem_pool) { + pr_err("Unable to get sram pool\n"); + return 0; + } + + *buf = (u32 *)gen_pool_alloc(mem_pool, size); + if (!buf) { + pr_err("Unable to alloc sram from sram pool\n"); + return 0; + } + + return gen_pool_virt_to_phys(mem_pool, (ulong)*buf); +} + +static void free_phybuf_mem_pool(struct device_node *of_node, + char *mem_pool_name, + u32 *buf, + uint32_t size) +{ + struct gen_pool *mem_pool = of_gen_pool_get(of_node, + mem_pool_name, 0); + if (!mem_pool) + pr_err("%s failed: Unable to get sram pool.\n", __func__); + + gen_pool_free(mem_pool, (unsigned long)buf, size); +} + + +static int imx_soc_device_register(struct platform_device *pdev, + struct imx_info *info) +{ + struct soc_device_attribute *attr; + struct soc_device *dev; + phys_addr_t get_info_addr = 0; + u32 *get_info_data = NULL; + u8 major_ver, minor_ver; + int err; + + if (info->pool_name) { + get_info_addr = get_phy_buf_mem_pool(pdev->dev.of_node, + info->pool_name, + &get_info_data, + DEVICE_GET_INFO_SZ); + } else { + get_info_data = dmam_alloc_coherent(&pdev->dev, + DEVICE_GET_INFO_SZ, + &get_info_addr, + GFP_KERNEL); + } + if (!get_info_addr) { + pr_err("Unable to alloc buffer for device info.\n"); + return -ENOMEM; + } + + attr = kzalloc(sizeof(*attr), GFP_KERNEL); + if (!attr) + return -ENOMEM; + + err = ele_get_info(get_info_addr, ELE_GET_INFO_READ_SZ); + if (err) { + attr->revision = kasprintf(GFP_KERNEL, "A0"); + } else { + major_ver = (get_info_data[GET_INFO_SOC_INFO_WORD_OFFSET] + & SOC_VER_MASK) >> 24; + minor_ver = ((get_info_data[GET_INFO_SOC_INFO_WORD_OFFSET] + & SOC_VER_MASK) >> 16) & 0xFF; + if (minor_ver) + attr->revision = kasprintf(GFP_KERNEL, + "%x.%x", + major_ver, + minor_ver); + else + attr->revision = kasprintf(GFP_KERNEL, + "%x", + major_ver); + + switch (get_info_data[GET_INFO_SOC_INFO_WORD_OFFSET] + & SOC_ID_MASK) { + case SOC_ID_OF_IMX8ULP: + attr->soc_id = kasprintf(GFP_KERNEL, + "i.MX8ULP"); + break; + case SOC_ID_OF_IMX93: + attr->soc_id = kasprintf(GFP_KERNEL, + "i.MX93"); + break; + } + } + + 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)get_info_data[GET_INFO_SL_NUM_MSB_WORD_OFF] << 32 + | get_info_data[GET_INFO_SL_NUM_LSB_WORD_OFF]); + + if (info->pool_name) { + free_phybuf_mem_pool(pdev->dev.of_node, info->pool_name, + get_info_data, DEVICE_GET_INFO_SZ); + } else { + dmam_free_coherent(&pdev->dev, + DEVICE_GET_INFO_SZ, + get_info_data, + get_info_addr); + } + + 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 */ + if (copy_from_user(dev_ctx->temp_cmd, buf, size)) { + 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_fops_read when the + * response to this command is read. + */ + 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 << 2; + +unlock: + mutex_unlock(&ele_mu_priv->mu_lock); + +exit: + if (err < 0) + mutex_unlock(&ele_mu_priv->mu_cmd_lock); + 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_buf_desc *b_desc; + int err; + struct mu_hdr header = {0}; + + 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. */ + if (wait_event_interruptible(dev_ctx->wq, dev_ctx->pending_hdr != 0)) { + devctx_err(dev_ctx, "Err[0x%x]:Interrupted by signal.\n", err); + err = -EINTR; + 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 << 2; + 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_buf_desc, + link); + if (!b_desc) + continue; + + if (b_desc->usr_buf_ptr && b_desc->shared_buf_ptr) { + + devctx_dbg(dev_ctx, "Copy output data to user\n"); + if (copy_to_user(b_desc->usr_buf_ptr, + b_desc->shared_buf_ptr, + b_desc->size)) { + devctx_err(dev_ctx, + "Failure copying output data to user."); + err = -EFAULT; + goto exit; + } + } + + if (b_desc->shared_buf_ptr) + memset(b_desc->shared_buf_ptr, 0, b_desc->size); + + __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); + if (copy_to_user(buf, dev_ctx->temp_resp, size_to_copy)) { + 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: + /* + * Clean the used Shared Memory space, + * whether its Input Data copied from user buffers, or + * Data received from FW. + */ + while (!list_empty(&dev_ctx->pending_in) || + !list_empty(&dev_ctx->pending_out)) { + if (!list_empty(&dev_ctx->pending_in)) + b_desc = list_first_entry_or_null(&dev_ctx->pending_in, + struct ele_buf_desc, + link); + else + b_desc = list_first_entry_or_null(&dev_ctx->pending_out, + struct ele_buf_desc, + link); + + if (!b_desc) + continue; + + if (b_desc->shared_buf_ptr) + memset(b_desc->shared_buf_ptr, 0, b_desc->size); + + __list_del_entry(&b_desc->link); + devm_kfree(dev_ctx->dev, b_desc); + } + 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 = priv->ele_mu_id; + info.interrupt_idx = 0; + info.tz = 0; + info.did = 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); + + if (copy_to_user((u8 *)arg, &info, sizeof(info))) { + devctx_err(dev_ctx, "Failed to copy mu info to user\n"); + err = -EFAULT; + goto exit; + } + +exit: + return err; +} + +/* + * Copy a buffer of data 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_buf_desc *b_desc; + struct ele_mu_ioctl_setup_iobuf io = {0}; + struct ele_shared_mem *shared_mem; + int err = 0; + u32 pos; + + if (copy_from_user(&io, (u8 *)arg, sizeof(io))) { + 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 (shared_mem->size < shared_mem->pos + || 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; + } + + memset(shared_mem->ptr + pos, 0, io.length); + if ((io.flags & ELE_MU_IO_FLAGS_IS_INPUT) || + (io.flags & ELE_MU_IO_FLAGS_IS_IN_OUT)) { + /* + * buffer is input: + * copy data from user space to this allocated buffer. + */ + if (copy_from_user(shared_mem->ptr + pos, io.user_buf, + io.length)) { + devctx_err(dev_ctx, + "Failed copy data to shared memory\n"); + err = -EFAULT; + goto exit; + } + } + + b_desc = devm_kmalloc(dev_ctx->dev, sizeof(*b_desc), GFP_KERNEL); + if (!b_desc) { + err = -ENOMEM; + devctx_err(dev_ctx, + "Failed allocating mem for pending buffer\n" + ); + goto exit; + } + + b_desc->shared_buf_ptr = shared_mem->ptr + pos; + b_desc->usr_buf_ptr = io.user_buf; + b_desc->size = io.length; + + if (io.flags & ELE_MU_IO_FLAGS_IS_INPUT) { + /* + * buffer is input: + * add an entry in the "pending input buffers" list so + * that copied data can be cleaned from shared memory + * later. + */ + list_add_tail(&b_desc->link, &dev_ctx->pending_in); + } else { + /* + * buffer is output: + * add an entry in the "pending out buffers" list so data + * can be copied to user space when receiving ELE + * response. + */ + list_add_tail(&b_desc->link, &dev_ctx->pending_out); + } + +copy: + /* Provide the EdgeLock Enclave address to user space only if success.*/ + if (copy_to_user((u8 *)arg, &io, sizeof(io))) { + 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_buf_desc *b_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_in) || + !list_empty(&dev_ctx->pending_out)) { + if (!list_empty(&dev_ctx->pending_in)) + b_desc = list_first_entry_or_null(&dev_ctx->pending_in, + struct ele_buf_desc, + link); + else + b_desc = list_first_entry_or_null(&dev_ctx->pending_out, + struct ele_buf_desc, + link); + + if (!b_desc) + continue; + + if (b_desc->shared_buf_ptr) + memset(b_desc->shared_buf_ptr, 0, b_desc->size); + + __list_del_entry(&b_desc->link); + devm_kfree(dev_ctx->dev, b_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_probe_cleanup(struct platform_device *pdev) +{ + int ret; + int i; + struct device *dev = &pdev->dev; + struct ele_mu_priv *priv = dev_get_drvdata(dev); + + if (!priv) { + ret = -EINVAL; + dev_err(dev, "Invalid ELE-MU Priv data"); + return ret; + } + + if (priv->tx_chan) + mbox_free_channel(priv->tx_chan); + if (priv->rx_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(dev); + priv->flags &= (~RESERVED_DMA_POOL); + } + if (priv->ctxs) { + for (i = 0; i < priv->max_dev_ctx; i++) { + if (priv->ctxs[i]) + devm_kfree(dev, priv->ctxs[i]); + } + devm_kfree(dev, priv->ctxs); + } + devm_kfree(dev, priv); + 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; + char *devname; + uint32_t tmp_dt_value = 0; + 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"); + return ret; + } + memset(priv, 0x0, sizeof(*priv)); + 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); + + priv->cmd_receiver_dev = NULL; + priv->waiting_rsp_dev = NULL; + + ret = of_property_read_u32(np, "fsl,ele_mu_did", &tmp_dt_value); + if (ret) { + ret = -EINVAL; + dev_err(dev, "%s: Not able to read ele_mu_did", __func__); + goto exit; + } + priv->ele_mu_did = tmp_dt_value & 0xFF; + + ret = of_property_read_u32(np, "fsl,ele_mu_id", &tmp_dt_value); + if (ret) { + ret = -EINVAL; + dev_err(dev, "%s: Not able to read ele_mu_id", __func__); + goto exit; + } + priv->ele_mu_id = tmp_dt_value & 0xFF; + + ret = of_property_read_u32(np, "fsl,ele_mu_max_users", &tmp_dt_value); + if (ret) { + dev_warn(dev, "%s: Not able to read mu_max_user", __func__); + priv->max_dev_ctx = S4_MUAP_DEFAULT_MAX_USERS; + } + priv->max_dev_ctx = tmp_dt_value & 0xFF; + + ret = of_property_read_u32(np, "fsl,cmd_tag", &tmp_dt_value); + if (ret) { + dev_warn(dev, "%s: Not able to read cmd_tag", __func__); + tmp_dt_value = DEFAULT_MESSAGING_TAG_COMMAND; + } + priv->cmd_tag = tmp_dt_value & 0xFF; + + ret = of_property_read_u32(np, "fsl,rsp_tag", &tmp_dt_value); + if (ret) { + dev_warn(dev, "%s: Not able to read rsp_tag", __func__); + tmp_dt_value = DEFAULT_MESSAGING_TAG_RESPONSE; + } + priv->rsp_tag = tmp_dt_value & 0xFF; + + /* 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->ctxs = devm_kzalloc(dev, sizeof(dev_ctx) * priv->max_dev_ctx, + GFP_KERNEL); + + if (!priv->ctxs) { + ret = -ENOMEM; + dev_err(dev, "Fail allocate mem for private dev-ctxs.\n"); + goto exit; + } + + /* Create users */ + for (i = 0; i < priv->max_dev_ctx; 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); + INIT_LIST_HEAD(&dev_ctx->pending_in); + 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->init_fw) { + /* start initializing ele fw */ + ret = ele_init_fw(); + if (ret) + dev_err(dev, "Failed to initialize ele fw.\n"); + } + + if (info && info->socdev) { + ret = imx_soc_device_register(pdev, info); + if (ret) { + dev_err(dev, + "failed[%d] to register SoC device\n", ret); + goto exit; + } + } + + if (info && info->imem_mgmt) { + /* 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, + "dmam-alloc-failed: To store encr-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 + */ + return ele_probe_cleanup(pdev); +} + +static int ele_mu_remove(struct platform_device *pdev) +{ + cancel_delayed_work_sync(&ele_ping_work); + ele_probe_cleanup(pdev); + + 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->imem_mgmt) { + 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->imem_mgmt) { + int ret; + u32 imem_state; + u32 *get_info_buf = NULL; + phys_addr_t get_info_phyaddr = 0; + + get_info_phyaddr + = (info->pool_name) ? get_phy_buf_mem_pool(dev->of_node, + info->pool_name, + &get_info_buf, + DEVICE_GET_INFO_SZ) + : 0x0; + + if (!get_info_buf) { + dev_err(dev, "Unable to alloc sram from sram pool\n"); + return -ENOMEM; + } + + ret = ele_do_start_rng(); + if (ret) + goto exit; + + /* 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: + if (info->pool_name && get_info_buf) + free_phybuf_mem_pool(dev->of_node, info->pool_name, + get_info_buf, DEVICE_GET_INFO_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..a8101064d378 --- /dev/null +++ b/drivers/firmware/imx/ele_mu.h @@ -0,0 +1,180 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2021-2023 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 MAX_MESSAGE_SIZE 31 +#define MAX_RECV_SIZE MAX_MESSAGE_SIZE +#define MAX_RECV_SIZE_BYTES (MAX_RECV_SIZE << 2) +#define MAX_MESSAGE_SIZE_BYTES (MAX_MESSAGE_SIZE << 2) +#define ELE_SUCCESS_IND 0xD6 +#define ELE_FAILURE_IND 0x29 + +#define ELE_MSG_DATA_NUM 10 + +#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_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_buf_desc { + u8 *shared_buf_ptr; + u8 *usr_buf_ptr; + u32 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_in; + 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; + u8 ele_mu_did; + u8 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. + */ + uint32_t flags; + u8 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..d344820bbe7f --- /dev/null +++ b/include/linux/firmware/imx/ele_base_msg.h @@ -0,0 +1,62 @@ +/* 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 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_fw_api.h b/include/linux/firmware/imx/ele_fw_api.h new file mode 100644 index 000000000000..74108c7be4a8 --- /dev/null +++ b/include/linux/firmware/imx/ele_fw_api.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2023 NXP + */ + +#ifndef ELE_FW_API_H +#define ELE_FW_API_H + +#include + +#define MESSAGING_VERSION_7 0x7 + +#define ELE_INIT_FW_REQ 0x17 +#define ELE_GET_RANDOM_REQ 0xCD + +int ele_get_random(struct hwrng *rng, void *data, size_t len, bool wait); +int ele_init_fw(void); + +#endif /* ELE_FW_API_H */ 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 Fri Jun 16 18:11:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Gupta X-Patchwork-Id: 13282756 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 7324DEB64D7 for ; Fri, 16 Jun 2023 12:58:10 +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=DdyK+HQlmqBlcUS6p91ifrEG0PtoBsrd5e7cP2b3+bQ=; b=WaTG44wOpSW7QS VN4dWzCgzFMCzij8rgZ7oDU/PAprsbtFClXxAdUd6mHfOLZZWgmHYtibGFxv0yJTkHKpPs5AIJ54z NTKksbd/k8P5rg4JUDEISSyRSzuGawqAgoLb6LUApmPcjug6w77v0NyDr8wHSWEfw83Z4nP9RC29M ADBQ1nX4ChNO1/84TO631RwlpLIOMSiV/xwajt/a7uYYAJP1IsuKtijJaMmlP4oYKrCwvSi+KH+gs Yl6FnNJJZL01jdWzoBmmB8Hq9Aj8y8rDRC5xQrS+y8LlFCAVfwTcXnqkomZ9axmfbzTIPsfUebYgI s1eRnsFhMSLHmZQMnV3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA91N-000cSO-06; Fri, 16 Jun 2023 12:57:45 +0000 Received: from mail-vi1eur04on0622.outbound.protection.outlook.com ([2a01:111:f400:fe0e::622] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qA91K-000cRN-3D for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 12:57:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jtgf6T1/aiNArO2F3kCMZM+BSBt1wRp311FjFr3+nJ6gchOOs+TJ0Ee475+xSZ2lVknKRrEESDlmb7r6YSMVwfhXxLY5tyiqUbD6060D6A2c+AAbitXku9vmtn14cF0REYRLZHzYYO5mXGjXugbAK8mTxw/FWdGvHvNFIXFrGNT20fUiQhX/yNu5hOidiOIDGc9mvNT2I/OxR6+vg1wX2T/bTp4Fb+zuO5BQh17KDl9tm5XKbr3lz1PVzllbKt/btt5dNfJ2nierLrr92SXDzpzj2woelu0x5pjyCuiDL6s2804SxbT0Vzn7OSP+Nx2dvRimh9uKVbeRI9Ls3I+rhg== 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=zTkaHzimDYs5V/v3H50MrtfCLaTZp9hn5ECU0FygbLA=; b=HZXjODKSQgziWN/IGkJNP5zQG+0BGYGvW43IH4DFZKL7GevZCEN2jenI4Lo2WZcRwIrDNaU44skYHCgMCnQ4Ju1/UxcN7hJbJ565778Xhu+NQhiFIxSYrMWn94jg5vweo6mlQLJpUSCxRdMXQEnEwmLTMhPg9K2qsOagNrrJVt+rNGvYBKQr4tZ8aGIKJ9fyTJTiA7ONg18qhxx7iREaEIzwaIOqR9AcorhVQBkrF98oiMimytkiWS99zRDmc/3tvEnNvF33tDENaOctfenmlorrgKVvcnLnrHMPkySF7ZHvj0w3XuCRIU6OplceJrcCJgleMukXMCdgDpRHnOKxDA== 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=zTkaHzimDYs5V/v3H50MrtfCLaTZp9hn5ECU0FygbLA=; b=Fd5hh+efVcCq3xjJ2EESsoIdzKeZrEMuLM+d8Zi/ZEXRrJ2neVmm4YefwmjF2y18jl0CFriUx+D3fDYRMDnQkhMm64KMRnY07WR2xZx4Drf/lth9xz+sl+ccuag2ITzb2pIpQvvN/Q6VPPAFtztv3IWTkr9TyDTlXG9z2ZxSRBY= 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 PAXPR04MB8320.eurprd04.prod.outlook.com (2603:10a6:102:1cf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 12:43:20 +0000 Received: from DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad]) by DU2PR04MB8630.eurprd04.prod.outlook.com ([fe80::413f:a9d5:4c09:9dad%3]) with mapi id 15.20.6500.029; Fri, 16 Jun 2023 12:43:20 +0000 From: Pankaj Gupta To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gaurav.jain@nxp.com, linux-kernel@vger.kernel.org Cc: Pankaj Gupta Subject: [PATCH v3 7/7] MAINTAINERS: Added maintainer details Date: Fri, 16 Jun 2023 23:41:44 +0530 Message-Id: <20230616181144.646500-8-pankaj.gupta@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230616181144.646500-1-pankaj.gupta@nxp.com> References: <20230616181144.646500-1-pankaj.gupta@nxp.com> X-ClientProxiedBy: SG2PR03CA0100.apcprd03.prod.outlook.com (2603:1096:4:7c::28) To DU2PR04MB8630.eurprd04.prod.outlook.com (2603:10a6:10:2dd::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8630:EE_|PAXPR04MB8320:EE_ X-MS-Office365-Filtering-Correlation-Id: 02b04227-439e-41c1-8758-08db6e67440b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hsafLA5/Y31l8mbpcxTs8K0r02PqBknJw356Yzc8KzUFT+T97KU/V8rqc9JuW4viRVgfxphWNm028p5XeAYQT0eoxVoYxLrFUl0koLhCKVbBSOTJ/7Q3k2IJu1LMNexVFbStUaFWg1yFuV78iLsyww64SLMODN9G2BK8weK5M3TPn84FO1F9HpYCq4v9QGTjLMofTo49PXT/SlCXP7S2XD0t0R7kWX9YIe4l2LxmJxKnNr8LqVTO6TYLKboeVCmJtUMKy9eCc9tIvJOa/BBOGV3G+qmYxv/GWkQ8wXkoN3ANW+iCxgVgRLNombCzWyJc1Q6FEobjACvN/4GkuAW3TpflAccHocwmipXRXX50ELVlIrCA1bq+PSVnruao85O42CDdsvn3ZTw8F3W8+Vof3sr6zIcF0egUwXWqtX58KmMTmysZQhEcYmk/GsXlzGR8hnS9bTKX8Sejs0BSwZaRjQ40lniADN+KA3bbQ7wZc5oebcRnR4OAdaOgK67jQS6MyfvPoORd+G+p0NTiBt1EKQiQwbOwFDXdbU7buG+IoNXTnZD/4SFizcwGvg/K8e6Lo20060iuCdfoYokbWF9NqAGaf7CQ8wEriXSlZWTrd6VawQ2mdtjvmI640Ui1AMZ3GN1gBa/7Zyr3LOeLnmDRdw== 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(478600001)(8936002)(41300700001)(8676002)(316002)(6486002)(52116002)(1076003)(6506007)(7416002)(44832011)(186003)(6666004)(4326008)(66476007)(66556008)(66946007)(26005)(6512007)(2616005)(2906002)(4744005)(83380400001)(921005)(38100700002)(38350700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WE/iXoDg4A+YEavL7GoyUynxFwAjRFsvewZOydQpuPTgqDLs2A/gEnyg8eRSnLNLC9bewuC4zrhOk6gi0VVZ6YlhL7IJ9jO6jcE3kKuKMTP8RQpR43pBKmYXzSL8EItsxsJfIUzAUGrN5Mld8TDYqtC1U9UPI+QSnp0+tcmGHkpxVdoIbU9aexHaYz4GEEZLUyvkLoduqV3S9Ym+1FWxi3740sW8rJXujsROkoWiiFipFbxC0JWPdS2STlwgImpcCVFlwdhngJe0VowUdbNCv/PosjFAaxs/wOfHVB6wgTDUyN/Rzpdt0dX6UPiQ6skvvS+SLnryrmKlaxT0xzlTG2zTRwdSbkOetFtYtzxTHrHRMroJItu694pn+kPAgCDspd0GlbkdqnbsCOfinZ1K5YkZOjs09cp1Cb8iNv7uQ1q69FOAb1K2ZcqiLZVqR0hN+vn/r+qZtVZcyhVnEuhEF2Bp6ubDNazzDmYNFHRtqNUtasBarVY9F002u6UCLh3hlgHNv4B09UmtuGZgpk4xKLuWW2MRZlqDPG/6EUvbo7Gl1hJwPTBaJCyPrK5qCgonXFbDezUcffW1had28pgb+6NzW9F+TvWEV+ICh8YJZb9dL0mIzFCmV6K2tPVa9Tdqju82+3VjnKnb9h8GmAucW2GdjbSMqtSDWTj/NB113AN1UZH6yM9xQeIXTpnmtD9ZsOrPCf5CBproSlesLhjWmse0dxNPJAI/1ghxHN5zxmcI9/9OKaxYupJut4BwJjZJco8FmL4Udl5cQ0cr/9+B+QjHS8KNdgKkWcrteRJbhylQ2MxwwoWx230mwGc6AtqKkXSTtN3GcAnZIealIwSXrxnY2a2avRIUjppLMJSyQdzEj6Fd2mnsrDHxyOgOxPXc5sWjtc2cyYmM9VUMdM/N17uYX7cJRvW5xftGkNaCzEb+Pun7n76yCRMjR6F4CrAo41B5tINR2FBOzZUZpAhIHof0fuGr4DXiWltdE8gqXcpEWf/90+G+mGmcuhfba8ZrBPYHuMs4d9NvtSGKccVzkFrIXx//BSJMNo/+O2J+IER1oU1/qCwJb5ZFaAcdHswA9Y8XyjPPIWT2z8reVOd4wiNyxGol7yaxB/lg+lBloTJrpxI18MOhDSDVtAkA4GeNaOP7OISxrlGgiX0fnKGcuCoZO5Z9BYxy20fn9oj21a8hfknF9/IYHwYiPha7LQGJH4TuLtao4FdwY30Ogy37D78VrDiqw/8lkN2So3wWJkkZSnL4AvfzZI+wYPcD8OngqL1orOgfejg1qxT5n1oKxy0WGxqco+dlCVerqYbV4N++H6VE2IXkxqsDCqPGAWqDgGSYRMleDk/gkSxTYl/ilVaUX9ORiLHAK1pAuVRFtAvMyzShSFyoXmdCprOg28ok1Nz1dIKWsYZ4c++JRmOGPN1tz3olpEggKC5NQIRhpB22oSqE2fz9Zn+6zIFhoQJb1lE1MD2a8LLm04y/eSrxietDdiWBUnRYuNS9GLJzmjHka9Sse+lYpe86o1SSy0B7Y1Dd2fF44hRj9jRg3j1Igqb7XlVNx2FWYTm3TcmbO3Zj4XKphWgSSMavwU2zG7Yv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02b04227-439e-41c1-8758-08db6e67440b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8630.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 12:43:20.8382 (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: gHMXas5f0Su3Wa//pdlP4Yk578tFm+5S2T4rzmlSfGvUAXzjJG1JbpzbZmvZFzxZf2hJOZebcwmY7kV8zXPv6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_055743_041348_55FE3460 X-CRM114-Status: UNSURE ( 8.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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6992b7cc7095..21a7a5604436 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13536,6 +13536,15 @@ F: mm/ F: tools/mm/ F: tools/testing/selftests/mm/ +NXP Edgelock Enclave MU DRIVER +M: Pankaj Gupta +R: NXP Linux Team +L: linux-kernel@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/arm/freescale/fsl,ele_mu.yaml +F: drivers/firmware/imx/ele*.* +F: include/linux/firmware/imx/ele*.* + MEMORY TECHNOLOGY DEVICES (MTD) M: Miquel Raynal M: Richard Weinberger