* [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply
2024-09-30 9:22 [PATCH v2 0/3] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
@ 2024-09-30 9:22 ` Peng Fan (OSS)
2024-09-30 9:18 ` Miquel Raynal
2024-09-30 9:22 ` [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
2024-09-30 9:22 ` [PATCH v2 3/3] arm64: dts: imx93-11x11-evk: add overlays for flexspi flash Peng Fan (OSS)
2 siblings, 1 reply; 12+ messages in thread
From: Peng Fan (OSS) @ 2024-09-30 9:22 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Introduce optional vcc-supply property, SPI NOR flashes needs power supply
to work properly. The power supply maybe software controlable per board
design.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
index 6e3afb42926e..bab0617a51d5 100644
--- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
+++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
@@ -96,6 +96,10 @@ properties:
If "broken-flash-reset" is present then having this property does not
make any difference.
+ vcc-supply:
+ description:
+ Supply for the spi nor power.
+
spi-cpol: true
spi-cpha: true
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply
2024-09-30 9:22 ` [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
@ 2024-09-30 9:18 ` Miquel Raynal
2024-10-06 0:39 ` Peng Fan
0 siblings, 1 reply; 12+ messages in thread
From: Miquel Raynal @ 2024-09-30 9:18 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Richard Weinberger,
Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Marco Felsch, linux-mtd, devicetree, linux-kernel,
imx, linux-arm-kernel, Peng Fan
Hi,
peng.fan@oss.nxp.com wrote on Mon, 30 Sep 2024 17:22:24 +0800:
> From: Peng Fan <peng.fan@nxp.com>
>
> Introduce optional vcc-supply property, SPI NOR flashes needs power supply
> to work properly. The power supply maybe software controlable per board
> design.
>
> Acked-by: Rob Herring (Arm) <robh@kernel.org>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> index 6e3afb42926e..bab0617a51d5 100644
> --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> @@ -96,6 +96,10 @@ properties:
> If "broken-flash-reset" is present then having this property does not
> make any difference.
>
> + vcc-supply:
> + description:
> + Supply for the spi nor power.
SPI NOR?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply
2024-09-30 9:18 ` Miquel Raynal
@ 2024-10-06 0:39 ` Peng Fan
0 siblings, 0 replies; 12+ messages in thread
From: Peng Fan @ 2024-10-06 0:39 UTC (permalink / raw)
To: Miquel Raynal, Peng Fan (OSS), Tudor Ambarus
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Richard Weinberger,
Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Marco Felsch, linux-mtd@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Hi Tudor, Miquel
> Subject: Re: [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add
> optional vcc-supply
>
> Hi,
>
> peng.fan@oss.nxp.com wrote on Mon, 30 Sep 2024 17:22:24 +0800:
>
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Introduce optional vcc-supply property, SPI NOR flashes needs power
> > supply to work properly. The power supply maybe software
> controlable
> > per board design.
> >
> > Acked-by: Rob Herring (Arm) <robh@kernel.org>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> > Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml | 4
> ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-
> nor.yaml
> > b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> > index 6e3afb42926e..bab0617a51d5 100644
> > --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> > +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
> > @@ -96,6 +96,10 @@ properties:
> > If "broken-flash-reset" is present then having this property does
> not
> > make any difference.
> >
> > + vcc-supply:
> > + description:
> > + Supply for the spi nor power.
>
> SPI NOR?
Since this is a minor typo, do you expect me to send v3 or you could
help update when applying the patch?
Thanks,
Peng.
>
> Thanks,
> Miquèl
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:22 [PATCH v2 0/3] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
2024-09-30 9:22 ` [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
@ 2024-09-30 9:22 ` Peng Fan (OSS)
2024-09-30 9:19 ` Miquel Raynal
2024-09-30 9:21 ` Marc Kleine-Budde
2024-09-30 9:22 ` [PATCH v2 3/3] arm64: dts: imx93-11x11-evk: add overlays for flexspi flash Peng Fan (OSS)
2 siblings, 2 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2024-09-30 9:22 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
From: Peng Fan <peng.fan@nxp.com>
SPI NOR flashes needs power supply to work properly. The power supply
maybe software controllable per board design. So add the support
for an vcc-supply regulator.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/mtd/spi-nor/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 9d6e85bf227b..5249c8b13916 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -17,6 +17,7 @@
#include <linux/mtd/spi-nor.h>
#include <linux/mutex.h>
#include <linux/of_platform.h>
+#include <linux/regulator/consumer.h>
#include <linux/sched/task_stack.h>
#include <linux/sizes.h>
#include <linux/slab.h>
@@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
if (!nor->bouncebuf)
return -ENOMEM;
+ ret = devm_regulator_get_enable(dev, "vcc");
+ if (ret)
+ return ret;
+
ret = spi_nor_hw_reset(nor);
if (ret)
return ret;
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:22 ` [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
@ 2024-09-30 9:19 ` Miquel Raynal
2024-09-30 9:36 ` Marco Felsch
2024-09-30 9:21 ` Marc Kleine-Budde
1 sibling, 1 reply; 12+ messages in thread
From: Miquel Raynal @ 2024-09-30 9:19 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Richard Weinberger,
Vignesh Raghavendra, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Marco Felsch, linux-mtd, devicetree, linux-kernel,
imx, linux-arm-kernel, Peng Fan
Hi,
peng.fan@oss.nxp.com wrote on Mon, 30 Sep 2024 17:22:25 +0800:
> From: Peng Fan <peng.fan@nxp.com>
>
> SPI NOR flashes needs power supply to work properly. The power supply
> maybe software controllable per board design. So add the support
> for an vcc-supply regulator.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/mtd/spi-nor/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 9d6e85bf227b..5249c8b13916 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -17,6 +17,7 @@
> #include <linux/mtd/spi-nor.h>
> #include <linux/mutex.h>
> #include <linux/of_platform.h>
> +#include <linux/regulator/consumer.h>
> #include <linux/sched/task_stack.h>
> #include <linux/sizes.h>
> #include <linux/slab.h>
> @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> if (!nor->bouncebuf)
> return -ENOMEM;
>
> + ret = devm_regulator_get_enable(dev, "vcc");
_optional ?
> + if (ret)
> + return ret;
> +
> ret = spi_nor_hw_reset(nor);
> if (ret)
> return ret;
>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:19 ` Miquel Raynal
@ 2024-09-30 9:36 ` Marco Felsch
0 siblings, 0 replies; 12+ messages in thread
From: Marco Felsch @ 2024-09-30 9:36 UTC (permalink / raw)
To: Miquel Raynal
Cc: Peng Fan (OSS), Tudor Ambarus, Pratyush Yadav, Michael Walle,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, linux-mtd, devicetree,
linux-kernel, imx, linux-arm-kernel, Peng Fan
Hi Miquel,
On 24-09-30, Miquel Raynal wrote:
> Hi,
>
> peng.fan@oss.nxp.com wrote on Mon, 30 Sep 2024 17:22:25 +0800:
>
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SPI NOR flashes needs power supply to work properly. The power supply
> > maybe software controllable per board design. So add the support
> > for an vcc-supply regulator.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> > drivers/mtd/spi-nor/core.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> > index 9d6e85bf227b..5249c8b13916 100644
> > --- a/drivers/mtd/spi-nor/core.c
> > +++ b/drivers/mtd/spi-nor/core.c
> > @@ -17,6 +17,7 @@
> > #include <linux/mtd/spi-nor.h>
> > #include <linux/mutex.h>
> > #include <linux/of_platform.h>
> > +#include <linux/regulator/consumer.h>
> > #include <linux/sched/task_stack.h>
> > #include <linux/sizes.h>
> > #include <linux/slab.h>
> > @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> > if (!nor->bouncebuf)
> > return -ENOMEM;
> >
> > + ret = devm_regulator_get_enable(dev, "vcc");
>
> _optional ?
The regulator optional API is different compared to other optional APIs.
If we would use optional here, we would need to check the returned error
code. On the other hand if the non optional API is used and the
regualtor is missing, a dummy regualtor is returned (as pointed out by
Marc).
Please see the _optional API doc to see more information about the
_optional usage.
Regards,
Marco
> > + if (ret)
> > + return ret;
> > +
> > ret = spi_nor_hw_reset(nor);
> > if (ret)
> > return ret;
> >
>
>
> Thanks,
> Miquèl
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:22 ` [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
2024-09-30 9:19 ` Miquel Raynal
@ 2024-09-30 9:21 ` Marc Kleine-Budde
2024-09-30 9:25 ` Marc Kleine-Budde
1 sibling, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2024-09-30 9:21 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch, devicetree,
Peng Fan, imx, linux-kernel, linux-mtd, linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
On 30.09.2024 17:22:25, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> SPI NOR flashes needs power supply to work properly. The power supply
> maybe software controllable per board design. So add the support
> for an vcc-supply regulator.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/mtd/spi-nor/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 9d6e85bf227b..5249c8b13916 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -17,6 +17,7 @@
> #include <linux/mtd/spi-nor.h>
> #include <linux/mutex.h>
> #include <linux/of_platform.h>
> +#include <linux/regulator/consumer.h>
> #include <linux/sched/task_stack.h>
> #include <linux/sizes.h>
> #include <linux/slab.h>
> @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> if (!nor->bouncebuf)
> return -ENOMEM;
>
> + ret = devm_regulator_get_enable(dev, "vcc");
> + if (ret)
> + return ret;
> +
What happens if the SPI-NOR doesn't have a "vcc" regulator?
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:21 ` Marc Kleine-Budde
@ 2024-09-30 9:25 ` Marc Kleine-Budde
2024-10-07 7:50 ` Michael Walle
0 siblings, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2024-09-30 9:25 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: Rob Herring, Conor Dooley, Fabio Estevam, Michael Walle,
Vignesh Raghavendra, devicetree, imx, Richard Weinberger,
Sascha Hauer, Marco Felsch, linux-kernel, Tudor Ambarus,
linux-mtd, linux-arm-kernel, Pengutronix Kernel Team,
Miquel Raynal, Krzysztof Kozlowski, Shawn Guo, Peng Fan,
Pratyush Yadav
[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]
On 30.09.2024 11:21:27, Marc Kleine-Budde wrote:
> On 30.09.2024 17:22:25, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SPI NOR flashes needs power supply to work properly. The power supply
> > maybe software controllable per board design. So add the support
> > for an vcc-supply regulator.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> > drivers/mtd/spi-nor/core.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> > index 9d6e85bf227b..5249c8b13916 100644
> > --- a/drivers/mtd/spi-nor/core.c
> > +++ b/drivers/mtd/spi-nor/core.c
> > @@ -17,6 +17,7 @@
> > #include <linux/mtd/spi-nor.h>
> > #include <linux/mutex.h>
> > #include <linux/of_platform.h>
> > +#include <linux/regulator/consumer.h>
> > #include <linux/sched/task_stack.h>
> > #include <linux/sizes.h>
> > #include <linux/slab.h>
> > @@ -3462,6 +3463,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name,
> > if (!nor->bouncebuf)
> > return -ENOMEM;
> >
> > + ret = devm_regulator_get_enable(dev, "vcc");
> > + if (ret)
> > + return ret;
> > +
>
> What happens if the SPI-NOR doesn't have a "vcc" regulator?
...the SPI-NOR will use the dummy regulator.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-09-30 9:25 ` Marc Kleine-Budde
@ 2024-10-07 7:50 ` Michael Walle
2024-10-29 9:50 ` Tudor Ambarus
0 siblings, 1 reply; 12+ messages in thread
From: Michael Walle @ 2024-10-07 7:50 UTC (permalink / raw)
To: Marc Kleine-Budde, Peng Fan (OSS)
Cc: Rob Herring, Conor Dooley, Fabio Estevam, Vignesh Raghavendra,
devicetree, imx, Richard Weinberger, Sascha Hauer, Marco Felsch,
linux-kernel, Tudor Ambarus, linux-mtd, linux-arm-kernel,
Pengutronix Kernel Team, Miquel Raynal, Krzysztof Kozlowski,
Shawn Guo, Peng Fan, Pratyush Yadav
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
Hi,
> > > + ret = devm_regulator_get_enable(dev, "vcc");
> > > + if (ret)
> > > + return ret;
> > > +
> >
> > What happens if the SPI-NOR doesn't have a "vcc" regulator?
>
> ...the SPI-NOR will use the dummy regulator.
Which then prints a warning "using dummy regulator". Is that the
usual way to go?
I mean the regulator is actually mandatory because it is the main
voltage rail for the flash. To get rid of the warning one can add a
fixed-regulator (which is correct anyway). But OTOH, the device tree
lists it as optional (marking it as required isn't an option either
because virtually all device trees won't have that property).
-michael
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator
2024-10-07 7:50 ` Michael Walle
@ 2024-10-29 9:50 ` Tudor Ambarus
0 siblings, 0 replies; 12+ messages in thread
From: Tudor Ambarus @ 2024-10-29 9:50 UTC (permalink / raw)
To: Michael Walle, Marc Kleine-Budde, Peng Fan (OSS)
Cc: Rob Herring, Conor Dooley, Fabio Estevam, Vignesh Raghavendra,
devicetree, imx, Richard Weinberger, Sascha Hauer, Marco Felsch,
linux-kernel, linux-mtd, linux-arm-kernel,
Pengutronix Kernel Team, Miquel Raynal, Krzysztof Kozlowski,
Shawn Guo, Peng Fan, Pratyush Yadav
On 10/7/24 8:50 AM, Michael Walle wrote:
> Hi,
>
>>>> + ret = devm_regulator_get_enable(dev, "vcc");
>>>> + if (ret)
>>>> + return ret;
>>>> +
>>>
>>> What happens if the SPI-NOR doesn't have a "vcc" regulator?
>>
>> ...the SPI-NOR will use the dummy regulator.
>
> Which then prints a warning "using dummy regulator". Is that the
> usual way to go?
> I mean the regulator is actually mandatory because it is the main
> voltage rail for the flash. To get rid of the warning one can add a
> fixed-regulator (which is correct anyway). But OTOH, the device tree
I think it's fine to have the warning. It will help people write a
better device tree.
> lists it as optional (marking it as required isn't an option either
> because virtually all device trees won't have that property).
>
> -michael
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 3/3] arm64: dts: imx93-11x11-evk: add overlays for flexspi flash
2024-09-30 9:22 [PATCH v2 0/3] spi-nor: add optional vcc-supply and enable it for i.MX93 Peng Fan (OSS)
2024-09-30 9:22 ` [PATCH v2 1/3] dt-bindings: mtd: jedec,spi-nor: add optional vcc-supply Peng Fan (OSS)
2024-09-30 9:22 ` [PATCH v2 2/3] mtd: spi-nor: support vcc-supply regulator Peng Fan (OSS)
@ 2024-09-30 9:22 ` Peng Fan (OSS)
2 siblings, 0 replies; 12+ messages in thread
From: Peng Fan (OSS) @ 2024-09-30 9:22 UTC (permalink / raw)
To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Marco Felsch
Cc: linux-mtd, devicetree, linux-kernel, imx, linux-arm-kernel,
Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Add overlays for the flexspi flash connected using M.2 interface.
The M.2 interface could be connected with M.2 flash card.
The M.2 interface needs PCIE power to work properly, the flash card
needs 1.8V voltage to work properly.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
arch/arm64/boot/dts/freescale/Makefile | 3 ++
.../dts/freescale/imx93-11x11-evk-flexspi-m2.dtso | 59 ++++++++++++++++++++++
arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts | 10 ++++
3 files changed, 72 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index 9d3df8b218a2..8f82aae85fe0 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -241,6 +241,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qxp-tqma8xqp-mba8xx.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-9x9-qsb.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-11x11-evk.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx93-11x11-evk-flexspi-m2.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-14x14-evk.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-kontron-bl-osm-s.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-phyboard-segin.dtb
@@ -249,6 +250,8 @@ dtb-$(CONFIG_ARCH_MXC) += imx93-tqma9352-mba93xxla.dtb
dtb-$(CONFIG_ARCH_MXC) += imx93-var-som-symphony.dtb
dtb-$(CONFIG_ARCH_MXC) += imx95-19x19-evk.dtb
+imx93-11x11-evk-flexspi-m2-dtbs := imx93-11x11-evk.dtb imx93-11x11-evk-flexspi-m2.dtbo
+
imx8mm-venice-gw72xx-0x-imx219-dtbs := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-imx219.dtbo
imx8mm-venice-gw72xx-0x-rpidsi-dtbs := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-rpidsi.dtbo
imx8mm-venice-gw72xx-0x-rs232-rts-dtbs := imx8mm-venice-gw72xx-0x.dtb imx8mm-venice-gw72xx-0x-rs232-rts.dtbo
diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk-flexspi-m2.dtso b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-flexspi-m2.dtso
new file mode 100644
index 000000000000..f307789546a2
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-flexspi-m2.dtso
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2024 NXP
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "imx93-pinfunc.h"
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+ reg_spinor_vcc: regulator-spinor {
+ compatible = "regulator-fixed";
+ regulator-name = "SPINOR";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <®_m2_pwr>;
+ gpio = <&pcal6524 20 GPIO_ACTIVE_HIGH>;
+ startup-delay-us = <2000>;
+ enable-active-high;
+ };
+};
+
+&usdhc3 {
+ status = "disabled";
+};
+
+&flexspi1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_flexspi1>;
+ status = "okay";
+
+ mt25qu512abb8e12: flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ vcc-supply = <®_spinor_vcc>;
+ reset-gpios = <&pcal6524 12 GPIO_ACTIVE_LOW>;
+ spi-max-frequency = <133000000>;
+ spi-tx-bus-width = <4>;
+ spi-rx-bus-width = <4>;
+ };
+};
+
+&iomuxc {
+ pinctrl_flexspi1: flexspi1grp {
+ fsl,pins = <
+ MX93_PAD_SD3_CLK__FLEXSPI1_A_SCLK 0x3fe
+ MX93_PAD_SD3_CMD__FLEXSPI1_A_SS0_B 0x3fe
+ MX93_PAD_SD3_DATA0__FLEXSPI1_A_DATA00 0x3fe
+ MX93_PAD_SD3_DATA1__FLEXSPI1_A_DATA01 0x3fe
+ MX93_PAD_SD3_DATA2__FLEXSPI1_A_DATA02 0x3fe
+ MX93_PAD_SD3_DATA3__FLEXSPI1_A_DATA03 0x3fe
+ >;
+ };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
index 8d036b3962e9..2eefa65fbfa8 100644
--- a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
@@ -78,6 +78,16 @@ reg_vref_1v8: regulator-adc-vref {
regulator-max-microvolt = <1800000>;
};
+ reg_m2_pwr: regulator-m2-pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "M.2-power";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&pcal6524 13 GPIO_ACTIVE_HIGH>;
+ startup-delay-us = <2000>;
+ enable-active-high;
+ };
+
reg_usdhc2_vmmc: regulator-usdhc2 {
compatible = "regulator-fixed";
pinctrl-names = "default";
--
2.37.1
^ permalink raw reply related [flat|nested] 12+ messages in thread