From patchwork Thu Jan 30 13:00:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13954543 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 C51C3C0218A for ; Thu, 30 Jan 2025 13:04:05 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xq5ntvdixTiMxw1S/ZM1ceyovGwDVcIx7hfQrpd8SjY=; b=R0qHSDdcWGCc5UIQJ4bQUWpYYx egPYTw82dQmOZfqYM0OlQGEbJUqYE4xApH518hImYXnyzBQ+aFmuwXMtFChaJm97yNvPpzhJju89q clFaGwCSVu6UkM649LXN4Pj/EZX60PCFiYPsMDzjCUVjwBlgEqvBk8Q30vDagzsVxF7jM2+KCztBQ fqz0j/3S4eSXRpVUvN7utXgywtVD2hp43tOCavCM8NHkyyPhIKh7Xq3XaUMtEFjFWHylSSTe/8ZWq jAp5A84CQFi39ldLLDQPPlZwcec/vCWAmw1wZ9scG5w2KD+jJgd8thO9X6kioTUnuT3SWIyPvONHh 3sjvvgIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdUD3-00000008oSZ-10a7; Thu, 30 Jan 2025 13:03:53 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdUAU-00000008o2H-1lma for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2025 13:01:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1738242074; x=1769778074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xq5ntvdixTiMxw1S/ZM1ceyovGwDVcIx7hfQrpd8SjY=; b=Y2LkQmdGaNrplHQX9ALcSaq9RzFjyomXHXXFKvGwPp6HHkdAyWw+XFh0 0wMzvCDr01WEu5caLGoJw/qqKhmI6dOP8ee/ngiVXXJkZeuVKbQrIf9CK NhCZZ9Gn6aNwfUGcAoTmJbGK3ykk+9+d0OtMIadAR69qmch0UMSA1xlV9 rLAqb3HOWHHnvjZks2ktGfD12BCUGXeHRbso3kkvVI9ktkCBC8+MTwAdE Yxh5YUlR9y3N732X/5lLkYY4BSIDDVMzW+nb744gWewHvLqYcKWK/V/42 qW+5VYHEluRgIdHMrtlVcRgNhfI5WtJHd/83gHBMCJhF4KeLMy3+KI2cO g==; X-CSE-ConnectionGUID: Xpw1lbTSSA+LmV+tlAdbqA== X-CSE-MsgGUID: Jg7Qd6jUTN2CIa1azzepQA== X-IronPort-AV: E=Sophos;i="6.13,245,1732575600"; d="scan'208";a="41374598" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 30 Jan 2025 14:01:13 +0100 X-CheckPoint: {679B7819-39-31397509-E321C4C4} X-MAIL-CPID: 9BA95ED871756AC7173E720217D157CF_0 X-Control-Analysis: str=0001.0A682F21.679B781A.0002,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 141261675B4; Thu, 30 Jan 2025 14:01:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1738242069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xq5ntvdixTiMxw1S/ZM1ceyovGwDVcIx7hfQrpd8SjY=; b=UR1yUV+70I+An2YmuusWORYL4BjlpiS/BTwBrJNm/+PFoMO9bDCS9TKCI2EMrLOBBHNhFo rYWa1E/gvtMOEcDdLpSaRWOYZwM2gpm+fM/q0bR98mVFPmf4bGKRZMBH7hoJhZdLPslodI SOOt31ld5pQa1rTVVysSFN3s99mD75x6zn9TE4eX8Q+UFisk/bE8oX6grAgpo26rttsikU RJ1Ly+346pXDyUqVWjBG2EcX2mrIv2NBBK7XrqM0HCy79RrMMTGKRsj1cIwqMrf+8zCQBc +8IL7ffBGiKcmRznMDIejAMqPvt/8r3VMM/27R3lpvmKlIAXl9CGmMnKBSjMsw== From: Alexander Stein To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Srinivas Kandagatla Cc: Alexander Stein , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] dt-bindings: nvmem: imx-ocotp: Add i.MX8M Nano access controller definitions Date: Thu, 30 Jan 2025 14:00:58 +0100 Message-Id: <20250130130101.1040824-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> References: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250130_050114_763957_396237EF X-CRM114-Status: GOOD ( 11.20 ) 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 These are the definition for the bindings of imx-ocotp for disabling fuses. Signed-off-by: Alexander Stein Reviewed-by: Frank Li Acked-by: Conor Dooley --- include/dt-bindings/nvmem/fsl,imx8mn-ocotp.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 include/dt-bindings/nvmem/fsl,imx8mn-ocotp.h diff --git a/include/dt-bindings/nvmem/fsl,imx8mn-ocotp.h b/include/dt-bindings/nvmem/fsl,imx8mn-ocotp.h new file mode 100644 index 0000000000000..6e554edefd488 --- /dev/null +++ b/include/dt-bindings/nvmem/fsl,imx8mn-ocotp.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ + +#ifndef _DT_BINDINGS_NVMEM_IMX8MN_OCOTP_H +#define _DT_BINDINGS_NVMEM_IMX8MN_OCOTP_H + +#define IMX8MN_OCOTP_M7_DISABLE 0 +#define IMX8MN_OCOTP_M7_MPU_DISABLE 1 +#define IMX8MN_OCOTP_M7_FPU_DISABLE 2 +#define IMX8MN_OCOTP_USB_OTG1_DISABLE 3 +#define IMX8MN_OCOTP_GPU3D_DISABLE 4 +#define IMX8MN_OCOTP_MIPI_DSI_DISABLE 5 +#define IMX8MN_OCOTP_ENET_DISABLE 6 +#define IMX8MN_OCOTP_MIPI_CSI_DISABLE 7 +#define IMX8MN_OCOTP_ASRC_DISABLE 8 + +#endif From patchwork Thu Jan 30 13:00:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13954544 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 C2A4DC0218A for ; Thu, 30 Jan 2025 13:05:29 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1qhRbu605zRQmNnQr5f4yNDwmxxb+PPe4g8I5X68vQg=; b=VJeXlfFRFO02WIjo7y8yyFlXGc po/Vd3jlzeuN4DHv8HrDi7ej5ogoIsJvYO7JYsLRoX7UudKcn0anNG48LX6tmSYPt2FiYph0bqeUT CfmKdD1uJBpq5DxkL8gNSB5k60obVHf0NjSZtxWTEzyVTNHc9L0GDkVKHdL74UiqRuIQ6+TR0Gehj LXhjUfojesPABn4xwrJ5cpN8RMTw4HAJ6G0X3Oj508JUQLmlaNsO2tBZqOU5FbrbGfmf6QJfGs4rE HqTYmHTeSNY/1653b3LXVBQMEAOZi6Go7MPtBtA/ZEIBivdvLWarP3mpbpNJUlmrzbEuvL0Svi/gj 1HWIdnPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdUER-00000008oct-081V; Thu, 30 Jan 2025 13:05:19 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdUAZ-00000008o2H-2DWW for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2025 13:01:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1738242079; x=1769778079; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1qhRbu605zRQmNnQr5f4yNDwmxxb+PPe4g8I5X68vQg=; b=NwZqyzSyMM5eX49ivPuxL0TBvqONqLK0euqFjwCn1U/VhurJCAGtAJVQ kYXPxyGodWZfcbL7sLo44MxjQVjJ0NDOehQcZsqrLibWq7k6AhTplIJ5F URXE5Hwl13jmwQYM/+eAYRvqI8tYI17m3ANj6DecrW7moFvi0yCr4oUgS Aj9Hxzd5FgUzos8OEceFRlgoo9adbC323Lh3y+tBS4rXMH0DrA9w33tHb 7AIHrk1lpYdQa1GyLekmCIFkeo0U+mmJ3zHjI7jb4j2gYjmxOiUTw0bNE uv9Nb/nOFkjTjMluhs6a8QxYt6L2B5ABpVTTof1zoqlpwrTRDO4308w24 Q==; X-CSE-ConnectionGUID: JJtIfw3ORCuByqg3pGf1Qg== X-CSE-MsgGUID: 4kNxiujQRCCAMM/dMkGYkA== X-IronPort-AV: E=Sophos;i="6.13,245,1732575600"; d="scan'208";a="41374603" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 30 Jan 2025 14:01:18 +0100 X-CheckPoint: {679B781E-55-1CE016C0-E589DA3E} X-MAIL-CPID: 98CB8C2355A9D21FC1577AA8A1651977_1 X-Control-Analysis: str=0001.0A682F1E.679B781F.0017,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 239971675B4; Thu, 30 Jan 2025 14:01:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1738242074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1qhRbu605zRQmNnQr5f4yNDwmxxb+PPe4g8I5X68vQg=; b=P9QJefT0IPrYF3Smx7qjegIOujC1UdIQEbRkT1xuE8bxTOBvLsqHGEeFdzscAwcDJ+gPGb KhIWzDI0KjaHF5c5j839jT73xUxiBsm02iB7yk8iUQ9MZ5WkNsGpPW8z3ES3OlYLCJxkuW HXffa0F/I1ilKFp1Re9HSa9rEi7YpsFIxQuUPcW97pguod14f+wOP212efR6FeMjeBD753 TXnXa2unORAgGjIoydKlpc9jGkc7Jr5HImyeJvGzIBtFaT0i8t9E+/HjJ12qYjMkDUKAX8 wFITMOScrgV+WjGgf6CdSduR2v1THwCDpXYoVWmol7A+MM0toQlPZuLP4xZkdw== From: Alexander Stein To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Srinivas Kandagatla Cc: Alexander Stein , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] nvmem: imx-ocotp: Sort header alphabetically Date: Thu, 30 Jan 2025 14:00:59 +0100 Message-Id: <20250130130101.1040824-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> References: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250130_050119_869327_7659D8A3 X-CRM114-Status: GOOD ( 11.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 Move linux/delay.h to the right position. Signed-off-by: Alexander Stein Reviewed-by: Frank Li --- drivers/nvmem/imx-ocotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 79dd4fda03295..c5086a16450ac 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -15,6 +15,7 @@ */ #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #define IMX_OCOTP_OFFSET_B0W0 0x400 /* Offset from base address of the * OTP Bank0 Word0 From patchwork Thu Jan 30 13:01:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13954545 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 A8FA5C0218A for ; Thu, 30 Jan 2025 13:06:50 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LyKkikvY80+GKiSyONnc9vcmv/5ZXa6vRuWd2+cvLNU=; b=tkXsSTdQdegWBjnCSMtGA+b1Eb fEb5wAX4JMfSlXxaK8nVxraQQKf8tN6Am0mkGxAIKH5oEj5nDqGAaoSfmHZNb6X70R43ek1SFAtoT Hyy9dBjmAa4AEtZwTvFWrZbkAq1TWTVWNZZzHBTCNkHGmQI9h0psTQAfTQLKEVlJsqvq28/SB4+9b hhaMn1RyHwguLkDM0I1UG4RqhyqVZ7jx6rFcaLTvxrlVAgxAcCwYJFRcHpNboUl/R7BL/6QePvMUw fNdYIZzxXXoaJRUv5lAW5JGnnQoqmZY3hq+KBWxeu+bZS1eCWT4lsRvy/iAnICsZif56IkRz6VmH/ ZLj0BlJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdUFh-00000008om8-2ieT; Thu, 30 Jan 2025 13:06:37 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdUAe-00000008o2H-4Avy for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2025 13:01:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1738242085; x=1769778085; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LyKkikvY80+GKiSyONnc9vcmv/5ZXa6vRuWd2+cvLNU=; b=ejBcVXmgYgriV21V5MYGG5GF14Tpvc4sM8E32JQ/tKsBn0UEPdA8tW/B MMEp2eavvqg7BwGLMg7wsdkI5ksA3sPx22cq4ciIDuaKwDyZJsPdIKjv2 uF0722xgKnnJEBkKwo7yD2xfxIkiIjArT/xKmxX1R29sNvYBXYECJSugw yYvwgTUr5fm8diebbZms9P48+kKWkmtIksVc0Lh5XOmqcZbDSEu+Mf40K Co0FivOuIdjYwnotMZTrcHBmNFktjyvZ/fVuG+pn2cQoza7SFAXZAAVjs r9oU/d86HRCxytoH1OZnQlpZexYNlTwlLvruqGfAUkvVNxkgD3rwhe937 A==; X-CSE-ConnectionGUID: yIqcFOdySnOPsjZWKtoG3g== X-CSE-MsgGUID: HrRJxZPMRCew96JoOAIhlg== X-IronPort-AV: E=Sophos;i="6.13,245,1732575600"; d="scan'208";a="41374617" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 30 Jan 2025 14:01:24 +0100 X-CheckPoint: {679B7824-E-1D00F64B-E6C57517} X-MAIL-CPID: 2551D003E15F2F7538C09A8A99662D09_3 X-Control-Analysis: str=0001.0A682F1E.679B7824.0080,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8600B1675B4; Thu, 30 Jan 2025 14:01:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1738242079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LyKkikvY80+GKiSyONnc9vcmv/5ZXa6vRuWd2+cvLNU=; b=E30/0s4co8oDMYj/gRd7177975fwdVx6WXD8jH+PJbApatPtxR0HyvIeQDaWKD+GDqiJFN pV6yr57uFgQpI9iknuLeDx2W1gF8Or+CQu6t8c9iU+2Q0KNmyoNhbI6iwXYr1jxfTTb3cu DAnhuMtVO46porBxvwv1k8RN3zRRKp9Sph6uhjA6uYWTvIgx5HpV+22lroeyAVrOsOoC9j 2mEx7cWgKxv5ID7BJGIIRenf5dEMfrg0IERVqiia5WuNiUu9mjd8SvmiioWWauA1GZd5yB IfL5wnscsJIxuFRhnlPFfn5Ok8lb2benuljhQsurlELexW5JSYAs3K+3Q/pP5Q== From: Alexander Stein To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Srinivas Kandagatla Cc: Alexander Stein , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano Date: Thu, 30 Jan 2025 14:01:00 +0100 Message-Id: <20250130130101.1040824-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> References: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250130_050125_346924_D5B2EDFC X-CRM114-Status: GOOD ( 22.67 ) 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 i.MX8M OCOTP supports a specific peripheral or function being fused which means disabled, so - Introduce disable_fuse for a list of possible fused peripherals. - Iterate all nodes to check accessing permission. If not allowed to be accessed, detach the node Signed-off-by: Alexander Stein Reviewed-by: Frank Li --- drivers/nvmem/Kconfig | 3 ++ drivers/nvmem/imx-ocotp.c | 105 +++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index 8671b7c974b93..ba5c928cab520 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -84,6 +84,9 @@ config NVMEM_IMX_OCOTP This driver can also be built as a module. If so, the module will be called nvmem-imx-ocotp. + If built as modules, any other driver relying on this working + as access controller also needs to be a module as well. + config NVMEM_IMX_OCOTP_ELE tristate "i.MX On-Chip OTP Controller support" depends on ARCH_MXC || COMPILE_TEST diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index c5086a16450ac..e3ea026a37d0d 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -23,6 +23,7 @@ #include #include #include +#include #define IMX_OCOTP_OFFSET_B0W0 0x400 /* Offset from base address of the * OTP Bank0 Word0 @@ -91,11 +92,20 @@ struct ocotp_ctrl_reg { u32 bm_rel_shadows; }; +#define OCOTP_MAX_NUM_GATE_WORDS 4 + +struct disable_fuse { + u32 fuse_addr; + u32 mask; +}; + struct ocotp_params { unsigned int nregs; unsigned int bank_address_words; void (*set_timing)(struct ocotp_priv *priv); struct ocotp_ctrl_reg ctrl; + u32 num_disables; + struct disable_fuse *disables; }; static int imx_ocotp_wait_for_busy(struct ocotp_priv *priv, u32 flags) @@ -552,11 +562,25 @@ static const struct ocotp_params imx8mm_params = { .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, }; +struct disable_fuse imx8mn_disable_fuse[] = { + [IMX8MN_OCOTP_M7_DISABLE] = { .fuse_addr = 20, .mask = BIT(8) }, + [IMX8MN_OCOTP_M7_MPU_DISABLE] = { .fuse_addr = 20, .mask = BIT(9) }, + [IMX8MN_OCOTP_M7_FPU_DISABLE] = { .fuse_addr = 20, .mask = BIT(10) }, + [IMX8MN_OCOTP_USB_OTG1_DISABLE] = { .fuse_addr = 20, .mask = BIT(11) }, + [IMX8MN_OCOTP_GPU3D_DISABLE] = { .fuse_addr = 20, .mask = BIT(24) }, + [IMX8MN_OCOTP_MIPI_DSI_DISABLE] = { .fuse_addr = 20, .mask = BIT(28) }, + [IMX8MN_OCOTP_ENET_DISABLE] = { .fuse_addr = 20, .mask = BIT(29) }, + [IMX8MN_OCOTP_MIPI_CSI_DISABLE] = { .fuse_addr = 20, .mask = BIT(30) }, + [IMX8MN_OCOTP_ASRC_DISABLE] = { .fuse_addr = 20, .mask = BIT(31) }, +}; + static const struct ocotp_params imx8mn_params = { .nregs = 256, .bank_address_words = 0, .set_timing = imx_ocotp_set_imx6_timing, .ctrl = IMX_OCOTP_BM_CTRL_DEFAULT, + .num_disables = ARRAY_SIZE(imx8mn_disable_fuse), + .disables = imx8mn_disable_fuse, }; static const struct ocotp_params imx8mp_params = { @@ -589,6 +613,81 @@ static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem, cell->read_post_process = imx_ocotp_cell_pp; } +static int imx_ocotp_check_access(struct ocotp_priv *priv, u32 id) +{ + u32 addr, mask, ret, val; + + if (id >= priv->params->num_disables) { + dev_err(priv->dev, "Index %d too large\n", id); + return -EACCES; + } + + addr = priv->params->disables[id].fuse_addr; + mask = priv->params->disables[id].mask; + + ret = imx_ocotp_read(priv, addr, &val, sizeof(val)); + if (ret) + return ret; + + dev_dbg(priv->dev, "id:%d addr:%#x mask:0x%08x\n", id, addr, mask); + /* true means disabled */ + if (val & mask) + return -EACCES; + + return 0; +} + +static int imx_ocotp_grant_access(struct ocotp_priv *priv, struct device_node *parent) +{ + struct device *dev = priv->dev; + + for_each_available_child_of_node_scoped(parent, child) { + struct of_phandle_args args; + u32 id, idx = 0; + + while (!of_parse_phandle_with_args(child, "access-controllers", + "#access-controller-cells", + idx++, &args)) { + of_node_put(args.np); + if (args.np != dev->of_node) + continue; + + /* Only support one cell */ + if (args.args_count != 1) { + dev_err(dev, "wrong args count\n"); + continue; + } + + id = args.args[0]; + + dev_dbg(dev, "Checking node: %pOF disable ID: %d\n", child, id); + + if (imx_ocotp_check_access(priv, id)) { + of_detach_node(child); + dev_info(dev, "%pOF: disabled by fuse, device driver will not be probed\n", + child); + } + } + + imx_ocotp_grant_access(priv, child); + } + + return 0; +} + +static int imx_ocotp_access_control(struct ocotp_priv *priv) +{ + struct device_node *root __free(device_node) = of_find_node_by_path("/"); + + if (!priv->params->disables) + return 0; + + if (WARN_ON(!root)) + return -EINVAL; + + return imx_ocotp_grant_access(priv, root); +} + static int imx_ocotp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -622,9 +721,13 @@ static int imx_ocotp_probe(struct platform_device *pdev) imx_ocotp_clr_err_if_set(priv); clk_disable_unprepare(priv->clk); + platform_set_drvdata(pdev, priv); + nvmem = devm_nvmem_register(dev, &imx_ocotp_nvmem_config); + if (IS_ERR(nvmem)) + return PTR_ERR(nvmem); - return PTR_ERR_OR_ZERO(nvmem); + return imx_ocotp_access_control(priv); } static struct platform_driver imx_ocotp_driver = { From patchwork Thu Jan 30 13:01:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13954546 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 B5397C0218A for ; Thu, 30 Jan 2025 13:08:09 +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:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XlXAWMI0jccQM6/g/C8LaMfR+EC5iEa5X2zR+R/BcUg=; b=zazq0keEBCtZvia93UyHkwW4nB qj/zh6xqNe3DMH8XQMwY7XjsvSG5rU9QexwBWA+9gVTF/ppdm++crpqzy432i4h/Oo2QRoth/3BUX Vu/EnSK3xT3MpFehikwD4JNHPG7sriU99aVLS0cQeTsQkKoKNhGWxmyJrTZ529kSdm+50fo+z85ho Mmpsn2/OD3rq3LdRr2DvmLk+l6RCClzLSAPqpXRr0BkX/AW70Voi7g5mnNEzlM1l1IvR4X4B05uJy 5587tlseR50aXExerXUWK7e8Pm6mNM+mHV3IkOmp3SIgkvwr9C2tmuy0hslWFuo7UNLN29A3Rgp9P fyBTVyww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdUGy-00000008osL-1R8Y; Thu, 30 Jan 2025 13:07:56 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdUAk-00000008o2H-0igM for linux-arm-kernel@lists.infradead.org; Thu, 30 Jan 2025 13:01:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1738242090; x=1769778090; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XlXAWMI0jccQM6/g/C8LaMfR+EC5iEa5X2zR+R/BcUg=; b=K95XFuhpyzuY4ePqJHnsArTnKDwM305YyOyqhh6sZkJG7ThXHfL48Fqs YCGd8IcvtGlneoe4nSUMUehg7uiKe/iR+CgUwgmSLjgOSYXGOpDaN1UQL q+jY2bmEwS++BnPwFYi0OxUDtxd4WqfbARNZEDEds+X7sydxIIsHGaZ7/ N9b2pxFDIXf3lrfFEOMXNQadV1LazWMo5izjnZXUD3qYCIJUfWvsVfuig oHUNMNqAa8lCIrnjDG87ICqe4nT8LEj8adfVrLLDOsgzi1sGtVN7zjGd2 3LftbTxco+iReSkT9OhNI4vc62x9tJ7fH70m1hBPY1I3iQc8emhg5BY3i g==; X-CSE-ConnectionGUID: tVv2S7LDQKaRqxAvRIMJ7A== X-CSE-MsgGUID: ucsh4h+SRWOeH0M15uviNQ== X-IronPort-AV: E=Sophos;i="6.13,245,1732575600"; d="scan'208";a="41374630" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 30 Jan 2025 14:01:29 +0100 X-CheckPoint: {679B7829-1B-3C670366-E45AD810} X-MAIL-CPID: AD046D59AB2B64B0B01BA9A3A0E2865C_4 X-Control-Analysis: str=0001.0A682F1E.679B7829.0086,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BF14016A8C6; Thu, 30 Jan 2025 14:01:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1738242085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlXAWMI0jccQM6/g/C8LaMfR+EC5iEa5X2zR+R/BcUg=; b=Dp8aGpHnOwlDVpj+8nvp6MWlvkBPp+0y3Gh66FW2SuYuXbC4FX+Jar2TCn59V0XhDRA2Dh sbgvY/4L+z2s5c2q9RvwmO9bXqVQfxWvXzotg5AL6Tb+GTmevpPCrVTn7ASOg+U+pQTZ4U F3rt6JjghVsCtnjl1h37mSW+IKcXNkn5/wmXceFeeEdhWWke2oDjUqP2gm9enXUyT+TbAU hgezjjEVJljmYtPsFRAdeXX0wKF/n5T84IGO8/mo390SPZiXv5HB9Dz3M1w9B3W/QYhmhY uixvtci4mKBRqKyB1rM2u1MEYpiAgKPBo+1BktjFLsFjypl4MFIFi8y5Y+hqeg== From: Alexander Stein To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Srinivas Kandagatla Cc: Alexander Stein , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] arm64: dts: imx8mn: Add access-controller references Date: Thu, 30 Jan 2025 14:01:01 +0100 Message-Id: <20250130130101.1040824-5-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> References: <20250130130101.1040824-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250130_050130_508199_3888E6BC X-CRM114-Status: GOOD ( 11.30 ) 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 Mark ocotp as a access-controller and add references on peripherals which can be disabled (fused). Signed-off-by: Alexander Stein --- arch/arm64/boot/dts/freescale/imx8mn.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi index a5f9cfb46e5dd..b023724679b80 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "imx8mn-pinfunc.h" @@ -431,6 +432,7 @@ easrc: easrc@300c0000 { firmware-name = "imx/easrc/easrc-imx8mn.bin"; fsl,asrc-rate = <8000>; fsl,asrc-format = <2>; + access-controllers = <&ocotp IMX8MN_OCOTP_ASRC_DISABLE>; status = "disabled"; }; }; @@ -571,6 +573,7 @@ ocotp: efuse@30350000 { clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>; #address-cells = <1>; #size-cells = <1>; + #access-controller-cells = <1>; /* * The register address below maps to the MX8M @@ -1053,6 +1056,7 @@ fec1: ethernet@30be0000 { nvmem-cells = <&fec_mac_address>; nvmem-cell-names = "mac-address"; fsl,stop-mode = <&gpr 0x10 3>; + access-controllers = <&ocotp IMX8MN_OCOTP_ENET_DISABLE>; status = "disabled"; }; @@ -1091,6 +1095,7 @@ mipi_dsi: dsi@32e10000 { clock-names = "bus_clk", "sclk_mipi"; interrupts = ; power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_MIPI_DSI>; + access-controllers = <&ocotp IMX8MN_OCOTP_MIPI_DSI_DISABLE>; status = "disabled"; ports { @@ -1195,6 +1200,7 @@ mipi_csi: mipi-csi@32e30000 { <&clk IMX8MN_CLK_DISP_AXI_ROOT>; clock-names = "pclk", "wrap", "phy", "axi"; power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_MIPI_CSI>; + access-controllers = <&ocotp IMX8MN_OCOTP_MIPI_CSI_DISABLE>; status = "disabled"; ports { @@ -1225,6 +1231,7 @@ usbotg1: usb@32e40000 { phys = <&usbphynop1>; fsl,usbmisc = <&usbmisc1 0>; power-domains = <&pgc_hsiomix>; + access-controllers = <&ocotp IMX8MN_OCOTP_USB_OTG1_DISABLE>; status = "disabled"; }; @@ -1288,6 +1295,7 @@ gpu: gpu@38000000 { <400000000>, <1200000000>; power-domains = <&pgc_gpumix>; + access-controllers = <&ocotp IMX8MN_OCOTP_GPU3D_DISABLE>; }; gic: interrupt-controller@38800000 {