Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano
Date: Wed, 5 Feb 2025 11:43:22 -0500	[thread overview]
Message-ID: <Z6OVKqy+bRLNa4GY@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <6396921.lOV4Wx5bFT@steina-w>

On Wed, Feb 05, 2025 at 07:51:23AM +0100, Alexander Stein wrote:
> Am Freitag, 31. Januar 2025, 17:06:23 CET schrieb Frank Li:
> > On Fri, Jan 31, 2025 at 02:54:06PM +0100, Alexander Stein wrote:
> > > Hi,
> > >
> > > Am Donnerstag, 30. Januar 2025, 17:42:32 CET schrieb Frank Li:
> > > > On Thu, Jan 30, 2025 at 02:01:00PM +0100, Alexander Stein wrote:
> > > > > 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 <alexander.stein@ew.tq-group.com>
> > > > > ---
> > > > >  drivers/nvmem/Kconfig     |   3 ++
> > > > >  drivers/nvmem/imx-ocotp.c | 105 +++++++++++++++++++++++++++++++++++++-
> > > > >  2 files changed, 107 insertions(+), 1 deletion(-)
> > > > >
...
> > > multiples fuses for disables. This is an excerpt from imx8mp WIP
> > > > struct disable_fuse imx8mp_disable_fuse[] = {
> > > > 	[IMX8MP_OCOTP_CAN_DISABLE]		= { .fuse_addr = 16, .mask = BIT(28) },
> > > > 	[IMX8MP_OCOTP_CAN_FD_DISABLE]		= { .fuse_addr = 16, .mask = BIT(29) },
> > > > 	[IMX8MP_OCOTP_VPU_VC8000E_DISABLE]	= { .fuse_addr = 16, .mask = BIT(30) },
> > > > 	[IMX8MP_OCOTP_IMG_ISP1_DISABLE]		= { .fuse_addr = 20, .mask = BIT(0) },
> > > > 	[IMX8MP_OCOTP_IMG_ISP2_DISABLE]		= { .fuse_addr = 20, .mask = BIT(1) },
> > > > 	[IMX8MP_OCOTP_IMG_DEWARP_DISABLE]	= { .fuse_addr = 20, .mask = BIT(2) },
> > > > };
> > >
> > > Notice the fuse_addr of 16 and 20.
> >
> > Yes, I am not sure if it good idea to encode fuse_addr to IMX8MP_OCOTP_CAN_DISABLE
> >
> > like
> >
> > #define IMX8MP_OCOTP_CAN_DISABLE  16 << 16 | BIT(28)
> >
> > So dt-bindings/nvmem/fsl,imx8mn-ocotp.h can be moved to dts directory.
>
> Mh, I personally don't like encoding offsets into bits. How about using
> > '#access-controller-cells = <2>'
> and using the defines like this
> > #define IMX8MP_OCOTP_CAN_DISABLE  16 0x10000000

I think it is good. better told peng fan to align this!

Frank

>
> DT stays the same:
> > access-controllers = <&ocotp IMX8MP_OCOTP_CAN_DISABLE>;
>
> Note: It seems BIT(x) is not usable in DT.
>
> Best regards,
> Alexander
> --
> TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
> Amtsgericht München, HRB 105018
> Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
> http://www.tq-group.com/
>
>


  reply	other threads:[~2025-02-05 17:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 13:00 [PATCH 0/4] Make i.MX8M Nano OCOTP work as accessing controller Alexander Stein
2025-01-30 13:00 ` [PATCH 1/4] dt-bindings: nvmem: imx-ocotp: Add i.MX8M Nano access controller definitions Alexander Stein
2025-01-30 16:32   ` Frank Li
2025-01-30 18:47   ` Conor Dooley
2025-01-30 13:00 ` [PATCH 2/4] nvmem: imx-ocotp: Sort header alphabetically Alexander Stein
2025-01-30 16:33   ` Frank Li
2025-01-30 13:01 ` [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano Alexander Stein
2025-01-30 16:42   ` Frank Li
2025-01-31 13:54     ` Alexander Stein
2025-01-31 16:06       ` Frank Li
2025-02-05  6:51         ` Alexander Stein
2025-02-05 16:43           ` Frank Li [this message]
2025-02-05 17:02             ` Frank Li
2025-01-31  7:20   ` Krzysztof Kozlowski
2025-01-31 13:50     ` Alexander Stein
2025-01-31 14:07       ` Krzysztof Kozlowski
2025-01-30 13:01 ` [PATCH 4/4] arm64: dts: imx8mn: Add access-controller references Alexander Stein
2025-01-30 23:38 ` [PATCH 0/4] Make i.MX8M Nano OCOTP work as accessing controller Rob Herring (Arm)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z6OVKqy+bRLNa4GY@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox