From patchwork Tue Dec 17 08:43:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13911399 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 5BBA6E7716A for ; Tue, 17 Dec 2024 08:48: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: Content-Transfer-Encoding:Content-Type:Message-Id:Date:Subject:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=qQk5B3qgmwvPgezO5g9YOx8GgZGniQwM4ZQE3x9P1Uc=; b=wAXCdBOSaClqkKhYy7tCDQir3W +JkV3cjncWY28JoOHUuK3ZcQeX7kP/TRtQgCHOuZbHIgF3OE9ydifjFf44zT97x6zBVgGPeL17Evz 8xj6/Fa/poqpBDmus0fUWq24OAURcRJaRZ1eYqa0VJX8fWXbqjyG++/FP7OamTcYncEFCA4qiOSzh Xt/x60+KEQINyOZPQaGMPdw3xn/TVAC6cVyC3QaqY+vmLW7ItyMg85wwBRLp0lmEUawpM5GiXk9cd n1B03fJR/YzHybc1qZSSVxhLOIniTiILfbe46jA+5jv+GfU/rSsz4YCcGVZlRX9AqOhuC5lX3mpLs cJpSWA7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNTFu-0000000ClU3-3BjM; Tue, 17 Dec 2024 08:48:38 +0000 Received: from mail-db8eur05on2062d.outbound.protection.outlook.com ([2a01:111:f403:2614::62d] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNTBb-0000000CkJ7-1aoK for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2024 08:44:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d1Wz6OPFBbc1unRqA2iGoEkO9a4wvlQ55F5JJilakdyBG/jSGGa6KNh91Sdqi5w9ipHRLS9fWXXIjH9EIvlSzyfuJkygjQhyf3bouur590/CyQNe6MBs5XgtV7UphulQFFa1Vhm6hJFon46dI8R8o63yVNNUmLcZNxAzM59qeX6ii13jZZfp7fsCGZS0A8OL3p4rCk23sbefWqEPdQYFcaO2Hz0PXgmMg+Bl3kX8lFYWhmeuoH4+LMtYraEyGV+peyXTEMcu031qX1HG5QE/kKCZEqysjIzzQmyLM7qR59UVU2eI7gPCFu0ORGRordRkfKijzRyXSSf+M/G2wys5Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qQk5B3qgmwvPgezO5g9YOx8GgZGniQwM4ZQE3x9P1Uc=; b=viSr9cJUJ4itdwFddXjnH+MQAk7B/+Tq1okTfxxdKzN2jHmv2u/do/syTMYDexK2+FNZxQiWx9DSJHKjCrfHp1/DprZ05UbiTqJsDBwGfCZuplvKrFBLpFmhPGI/m7QPbSATWfxhqsFXxKR8slyGqO3WAvrjBl6b+4KSr9GoAS9IchURPa5aHMEkK7QHCsxBN5wu6bMZ1e0R71S1kUGWnnG92KZSdV8PZLPh3NG2iYETD28JkZn0pmX69myXxP7s5EFgV3QhOfOIwJ/XyGNCD2CcOFLhNKoIpjZmCpL0n1D+au+/GqZ9N7a2f3kLcT5MCbTXFDpRn1Lo1PRM3hcAIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qQk5B3qgmwvPgezO5g9YOx8GgZGniQwM4ZQE3x9P1Uc=; b=BgJzU8W+VHU1cNbuNG5m0LKBl4A8hjuc76CaITZTxGmuo+t+oRmNqUAekR+Ygm441F2wueCZ5phf0EGOIbyrVxlCpEFL3tWFRPk2/P+yaXmNGXuWOZYZce7VM95pE7dH28Mr4dDInwX04QbiZTQw5B6TDDKktKTVb74rt6Re11aJ43Y2OIKS+LVE6X46CmKoCWX3sYEQp9feJ4HyCgAEdNeTVdavSR+ydAciYqErPuaDfKVlKgq19vp7blF7iXXO9dvzCagiw6HEEPIspOon/RnBY8VuEBgWsTbEhLscdZLg3VQkXsbeBTPshTkuMUwvPRFnNg5XuyLXj2r4oNBeJA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) by DU4PR04MB11054.eurprd04.prod.outlook.com (2603:10a6:10:581::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Tue, 17 Dec 2024 08:44:06 +0000 Received: from PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630]) by PAXPR04MB8459.eurprd04.prod.outlook.com ([fe80::165a:30a2:5835:9630%5]) with mapi id 15.20.8272.005; Tue, 17 Dec 2024 08:44:05 +0000 From: "Peng Fan (OSS)" Subject: [PATCH v2 0/2] Make i.MX9 OCOTP work as accessing controller Date: Tue, 17 Dec 2024 16:43:35 +0800 Message-Id: <20241217-imx-ocotp-v2-0-3faa6cbff41b@nxp.com> X-B4-Tracking: v=1; b=H4sIALc5YWcC/23MQQ7CIBCF4as0sxbDIJrqqvcwXQCCnUWBQEMwD XcXu3b5v7x8O2SbyGZ4DDskWyhT8D3EaQCzKP+2jF69QXAhUaBgtFYWTNgiM9q6C5coubtC/8d kHdXDes69F8pbSJ+DLvhb/ykFGWd4H7Xmyo03xSdf49mEFebW2hds1M0VoAAAAA== X-Change-ID: 20241212-imx-ocotp-cbef304140f5 To: Srinivas Kandagatla , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Frank Li X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734425027; l=1840; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=xOeObexZiq2L0BioifYbNzNyx8BBXR1C21SApHfttWM=; b=jrfUuin5rfBkfCKGiVomkLZdJ8mcgMKFDewcelV9SH66BmA0SUHQQ6aFZTBnIag8/Z/v07/NH 038BcsTV6lxDsPExq/MQlBHuW2uPmsPw3m+Pde0KvGsZp6chnUI09PG X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SG2PR02CA0101.apcprd02.prod.outlook.com (2603:1096:4:92::17) To PAXPR04MB8459.eurprd04.prod.outlook.com (2603:10a6:102:1da::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8459:EE_|DU4PR04MB11054:EE_ X-MS-Office365-Filtering-Correlation-Id: 90a50ae8-6c93-4112-2ee5-08dd1e76f6f4 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?ByHbOxSID4Eps8iXWyJjuOJryXhsw/n?= =?utf-8?q?07HXIBxBVVmYXsSlaYExF89vn+GdcgmWksm/PtF5rAPt2l0Yq/0FP1ZvXK561PCn6?= =?utf-8?q?AQWwn/5oIc9dHgOi79/a0TxVDRlvpqqyPOerw4z0fCL6e7cOqH4kFikYt952/SMb5?= =?utf-8?q?hmwmNZbj0G+rTXCvFKcBK2Upb+SB2h28xiNDuYAie84ggFGfOMU8dKHq341kVjG5W?= =?utf-8?q?32Sqee9L4L8pF0SMCIDVsnP/u4ALFPRQYjS7hC/zfnQ3e3V1R3wCG7cKNTnEUgZRJ?= =?utf-8?q?9Ye+b5/xWbRZpZqP2vL7+7OczBmDbIT56co0IMy8MC4DP2aNglhKAwIJY0/TMam3e?= =?utf-8?q?7ZzIo27V6+rVy8KYIVTC86qBKh+s01BDuYrRM9Wt5fz4tKERXRAS+XMiWZoCvLg27?= =?utf-8?q?1LTRCWfOIUsu+mtkP5aKluCa2juKqJGFZxd8dvxbpCpsrbcWWP+6EVGyVW5JZT2kh?= =?utf-8?q?oGUyAFn1nfumuSxD2Uya9tV45Mw29ZzxF0PM3WbM6sR56hlIPiB5akpLFfiS07n/o?= =?utf-8?q?gpnCSnZ+a00fQF0ngSGWGMpn762q8MPbRutp49N13v6NHFJYV/SQgcq3A/obtenhj?= =?utf-8?q?KMJWiMJLHBApopWtj0ow6ZskDE58cZtjmwvnuORvRIN62vn4hixwlfK919sh1lN07?= =?utf-8?q?dUG9HWZzlHiyBYnCDBMljLPCZxrDvMGaSFc7YNmOS+PjUNH5g2LNJgH7TdEwCcVtX?= =?utf-8?q?pf9DrVx1FU7web5dOEDyNnWaw8kz6yRNvqmY4hmdP8NIBU8nRCEpZCJrOsTRi5Zp9?= =?utf-8?q?zHz2JG7RfXWxGqqDguCzhWnNiHRVTcaQHoZDKehGPvcMEkW1wkXYvrpFYF2LGFuhw?= =?utf-8?q?/+tgmaRMxVewtupSoUhQpyBcOe+LbVJJbJ7Dc5z6oEUO+RReJ3VvCB1BCvwG5od0e?= =?utf-8?q?iUi4bYaVlfol8posQrzTsD5f2GIOC9FNYAH+zGtl9jRhqDRlxkaAyCgLLFNaeSlqs?= =?utf-8?q?Zp1H3AhntW97qrs3UE/u8kvgSHydTU7C3b2UASC1CKTXp0wEVv1N7S7gjWrhp4tkT?= =?utf-8?q?uL5BgbWnHN3pAYDQZO9pUhA0KcbDhpR105D0CfFIV2GqzZuxP0mQAWfJkFgYxk+uV?= =?utf-8?q?bYNskO1FDY6zwIWr6rbcH/hhdgq5YlQG+jJ7e1a91kXc/JDvTYikjbS1CPeQwT/FB?= =?utf-8?q?x70wLkIzz2yLngS6I4GLFcGknTCNZjqNIWZI7PM/+HsRV/IVmr+OqC5FRPQft7Uh1?= =?utf-8?q?NkDYh7DOOSLZxU6lUL+z0QTxH2a4PIPiSfX2cz2yHvyh558fR9Lz3UnWyoefkLK2q?= =?utf-8?q?bNtQ2xSOay70UuRz2v5/s27wmbYEbHULnTyyPiWT3LPz4xBO9OS68psqJ8GvjVtwa?= =?utf-8?q?jtO7hZAF9AhCw9Z5J13+fzoZF3hCF3HnLphLbeqKx+84PP/epG9PpCAXYfS3tS27E?= =?utf-8?q?oGL8WlwYz1r?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8459.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(52116014)(38350700014);DIR:OUT;SFP:1101; X-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i14wE+kYx7lqdNyrsXaXgLKG?= =?utf-8?q?3cd1AlJQ9rKL/o3zrVcsYInLL9yHa2rg3PqxEMSmJKqN/1Bu59z7n2M3xyFAHMCzi?= =?utf-8?q?rdoIi73sD79RAzgL/C+guLEC2egdavAbb/5NsxLJUGcSfqkLbvdrrHnbYXrRt8rnF?= =?utf-8?q?pIh0jsHqgMWXZmIoQOsSanv+HUKxcwKYlTJ6dQ/pB8wRqs0M50JlrXKOfplYlSwXx?= =?utf-8?q?mD0r0EXTh9ZBqC/cWeBi7CdgG3+JTodZ7/7vKj9iD03AhXjz3Yppq+xq0ho+zyN7G?= =?utf-8?q?9hZ4rhZeRC4UeMFKecnt5ehAuiTo3JVu6cFhnDPppaiQA+Xpb6RCo0Mp6//aSxaws?= =?utf-8?q?CDT2od9HQizwpaEGGX1Ri26lLKdvzXEMUZYWDk0RST6qi2kGTJ6BcRG8h+GDFD1AW?= =?utf-8?q?dId0lnG8xG5CUeN3B5uC16a8QQ25ZtVknP3wjwnNwA9/PYnXoALz/0DImUn9aABF0?= =?utf-8?q?6+YGIbRogiW9iFyO2ZjNHp0JY6dHwShqZjQrGFb+2zWFnF4h+WXgO6XubhYvYrJ8U?= =?utf-8?q?eUaT/vvf6TXCKteCtqdtoHUyNPDspupUiWqR5VfZWAdIFLocNpVq2VB4ZQ+mhPax7?= =?utf-8?q?CchRyPoBblPAh5JAIcpmNXrnaOOsjqRkiOo8D2lUPPYcE6n7TOcZsGWt7u1uWNmkZ?= =?utf-8?q?58oudmNQO8NBt3NbWDRyVUVAfOmnohGOfgOioxH0k1p+QuCj8hF0hrCAIqpVDGVst?= =?utf-8?q?Jvg0wox6h5Ix?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90a50ae8-6c93-4112-2ee5-08dd1e76f6f4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8459.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 08:44:05.6173 (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: 6jo/GYhYAJqM5YHuD6j/6cEgcZZ+AjxIwZLBFzW/EOztRzNZgPE0XSby87ywS4yx+QiLXb8uPclf3algoYZGNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB11054 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_004411_422844_A41F3320 X-CRM114-Status: GOOD ( 11.35 ) 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 Previously there was discussion on using "feature-controller" or adding a specific node to group the fuse information for U-Boot to parse and update node. But rejected by DT maintainer(Rob). Since the STM32 engineers added access controller concept and landed the support in Linux Kernel, reuse the concept for i.MX. i.MX OCOTP eFuse has some bits to indicate a specific periphral or function is avaiable for current chip, for example i.MX93 has variants that not have NPU. So introduce '#access-controller-cells' for OCOTP, and add "#access-controllers = <&ocotp [gate_index]>" for periphrals that needs accessing control checking. In OCOTP driver, the nodes under "/" will be iterated, and checked if property "#access-controllers" exsits. If not allow access, detach the node. In the end, cpu nodes should still be handled by bootloader. And I may also update i.MX8M to use same method to support variants if this patchset is good. Signed-off-by: Peng Fan --- Changes in v2: - Add R-b for patch 1 - Use '/' root node instead of '/soc' or '/soc@0' for patch 2 - Link to v1: https://lore.kernel.org/r/20241212-imx-ocotp-v1-0-198bb0af86a0@nxp.com --- Peng Fan (2): dt-bindings: nvmem: imx-ocotp: Introduce #access-controller-cells nvmem: imx-ocotp-ele: Support accessing controller for i.MX9 .../devicetree/bindings/nvmem/imx-ocotp.yaml | 5 + drivers/nvmem/imx-ocotp-ele.c | 184 ++++++++++++++++++++- include/dt-bindings/nvmem/fsl,imx93-ocotp.h | 24 +++ include/dt-bindings/nvmem/fsl,imx95-ocotp.h | 43 +++++ 4 files changed, 255 insertions(+), 1 deletion(-) --- base-commit: d49bc7ced87506bedbcce1ca7782ff942b309f2d change-id: 20241212-imx-ocotp-cbef304140f5 Best regards,