mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility
@ 2021-05-03 12:25 Yunus Bas
  2021-05-03 12:38 ` Ahmad Fatoum
  0 siblings, 1 reply; 5+ messages in thread
From: Yunus Bas @ 2021-05-03 12:25 UTC (permalink / raw)
  To: barebox

The kernel NVMEM-subsystem prevents the usage of duplicate partition names.
Change the SPI-NOR partition names to be compatible with the kernel
driver.

Commit 72ba815bf6fe ("ARM: dts: phycore-imx6: change mtd-partition names for
compatibility with kernel") applies the change for phyCORE SOMs. The
same applies for phyFLEX-modules.

Signed-off-by: Yunus Bas <y.bas@phytec.de>
---
 arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
index e1aa3183b..6df8d247b 100644
--- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
+++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
@@ -21,7 +21,7 @@
 
 		environment-spinor {
 			compatible = "barebox,environment";
-			device-path = &som_flash, "partname:barebox-environment";
+			device-path = &som_flash, "partname:nor.barebox-environment";
 			status = "disabled";
 		};
 
@@ -54,28 +54,29 @@
 /delete-node/ &{/memory@10000000};
 
 &som_flash {
+
 	partitions {
 		compatible = "fixed-partitions";
 		#address-cells = <1>;
 		#size-cells = <1>;
 
 		partition@0 {
-			label = "barebox";
+			label = "nor.barebox";
 			reg = <0x0 0x100000>;
 		};
 
 		partition@100000 {
-			label = "barebox-environment";
+			label = "nor.barebox-environment";
 			reg = <0x100000 0x20000>;
 		};
 
 		partition@120000 {
-			label = "oftree";
+			label = "nor.oftree";
 			reg = <0x120000 0x20000>;
 		};
 
 		partition@140000 {
-			label = "kernel";
+			label = "nor.kernel";
 			reg = <0x140000 0x0>;
 		};
 	};
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility
  2021-05-03 12:25 [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility Yunus Bas
@ 2021-05-03 12:38 ` Ahmad Fatoum
  2021-05-03 14:38   ` Yunus Bas
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2021-05-03 12:38 UTC (permalink / raw)
  To: Yunus Bas, barebox

Hello Yunus,

On 03.05.21 14:25, Yunus Bas wrote:
> The kernel NVMEM-subsystem prevents the usage of duplicate partition names.
> Change the SPI-NOR partition names to be compatible with the kernel
> driver.

I don't mind the change, but I can't follow the reasoning.
These are MTD partitions, so they shouldn't have been registered with the NVMEM
framework in the first place?

Cheers,
Ahmad

> 
> Commit 72ba815bf6fe ("ARM: dts: phycore-imx6: change mtd-partition names for
> compatibility with kernel") applies the change for phyCORE SOMs. The
> same applies for phyFLEX-modules.
> 
> Signed-off-by: Yunus Bas <y.bas@phytec.de>
> ---
>  arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> index e1aa3183b..6df8d247b 100644
> --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> @@ -21,7 +21,7 @@
>  
>  		environment-spinor {
>  			compatible = "barebox,environment";
> -			device-path = &som_flash, "partname:barebox-environment";
> +			device-path = &som_flash, "partname:nor.barebox-environment";
>  			status = "disabled";
>  		};
>  
> @@ -54,28 +54,29 @@
>  /delete-node/ &{/memory@10000000};
>  
>  &som_flash {
> +
>  	partitions {
>  		compatible = "fixed-partitions";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  
>  		partition@0 {
> -			label = "barebox";
> +			label = "nor.barebox";
>  			reg = <0x0 0x100000>;
>  		};
>  
>  		partition@100000 {
> -			label = "barebox-environment";
> +			label = "nor.barebox-environment";
>  			reg = <0x100000 0x20000>;
>  		};
>  
>  		partition@120000 {
> -			label = "oftree";
> +			label = "nor.oftree";
>  			reg = <0x120000 0x20000>;
>  		};
>  
>  		partition@140000 {
> -			label = "kernel";
> +			label = "nor.kernel";
>  			reg = <0x140000 0x0>;
>  		};
>  	};
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility
  2021-05-03 12:38 ` Ahmad Fatoum
@ 2021-05-03 14:38   ` Yunus Bas
  2021-05-03 18:36     ` Ahmad Fatoum
  0 siblings, 1 reply; 5+ messages in thread
From: Yunus Bas @ 2021-05-03 14:38 UTC (permalink / raw)
  To: barebox, a.fatoum

Hi Ahmad,

The main purpose behind adding MTD-partitions as NVMEM-devices was to
have a fast and uncomplicated access on partitions with sensitive data,
especially on embedded systems. I think, there is a reasoning for it,
but nevertheless, the original kernel patch is from 2018.

To say the truth, there is already an upstream fix for the name-
clashing, which registers the NVMEM devices with the unique device
names, instead of the MTD-names. I had two options here, one was to
revert the first patch with the change for phyCore, the other was to
follow up with the phyFLEX-module. I've chosen the latter one, since I
felt it has more readability.

Regards,
Yunus

Am Montag, dem 03.05.2021 um 14:38 +0200 schrieb Ahmad Fatoum:
> Hello Yunus,
> 
> On 03.05.21 14:25, Yunus Bas wrote:
> > The kernel NVMEM-subsystem prevents the usage of duplicate
> > partition names.
> > Change the SPI-NOR partition names to be compatible with the kernel
> > driver.
> 
> I don't mind the change, but I can't follow the reasoning.
> These are MTD partitions, so they shouldn't have been registered with
> the NVMEM
> framework in the first place?
> 
> Cheers,
> Ahmad
> 
> > 
> > Commit 72ba815bf6fe ("ARM: dts: phycore-imx6: change mtd-partition
> > names for
> > compatibility with kernel") applies the change for phyCORE SOMs.
> > The
> > same applies for phyFLEX-modules.
> > 
> > Signed-off-by: Yunus Bas <y.bas@phytec.de>
> > ---
> >  arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > index e1aa3183b..6df8d247b 100644
> > --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > @@ -21,7 +21,7 @@
> >  
> >                 environment-spinor {
> >                         compatible = "barebox,environment";
> > -                       device-path = &som_flash,
> > "partname:barebox-environment";
> > +                       device-path = &som_flash,
> > "partname:nor.barebox-environment";
> >                         status = "disabled";
> >                 };
> >  
> > @@ -54,28 +54,29 @@
> >  /delete-node/ &{/memory@10000000};
> >  
> >  &som_flash {
> > +
> >         partitions {
> >                 compatible = "fixed-partitions";
> >                 #address-cells = <1>;
> >                 #size-cells = <1>;
> >  
> >                 partition@0 {
> > -                       label = "barebox";
> > +                       label = "nor.barebox";
> >                         reg = <0x0 0x100000>;
> >                 };
> >  
> >                 partition@100000 {
> > -                       label = "barebox-environment";
> > +                       label = "nor.barebox-environment";
> >                         reg = <0x100000 0x20000>;
> >                 };
> >  
> >                 partition@120000 {
> > -                       label = "oftree";
> > +                       label = "nor.oftree";
> >                         reg = <0x120000 0x20000>;
> >                 };
> >  
> >                 partition@140000 {
> > -                       label = "kernel";
> > +                       label = "nor.kernel";
> >                         reg = <0x140000 0x0>;
> >                 };
> >         };
> > 
> 

-- 
Mit freundlichen Grüßen
Yunus Bas

-Software Engineer-
PHYTEC Messtechnik GmbH
Robert-Koch-Str. 39
55129 Mainz
Germany
Tel.: +49 (0)6131 9221- 466
Web: www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz | St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility
  2021-05-03 14:38   ` Yunus Bas
@ 2021-05-03 18:36     ` Ahmad Fatoum
  2021-05-03 21:50       ` Yunus Bas
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2021-05-03 18:36 UTC (permalink / raw)
  To: Yunus Bas, barebox

Hello Yunus,

On 03.05.21 16:38, Yunus Bas wrote:
> Hi Ahmad,
> 
> The main purpose behind adding MTD-partitions as NVMEM-devices was to
> have a fast and uncomplicated access on partitions with sensitive data,
> especially on embedded systems. I think, there is a reasoning for it,
> but nevertheless, the original kernel patch is from 2018.

So it's a patch you carry with you and not Linux-upstream functionality?

> To say the truth, there is already an upstream fix for the name-
> clashing, which registers the NVMEM devices with the unique device
> names, instead of the MTD-names. I had two options here, one was to
> revert the first patch with the change for phyCore, the other was to
> follow up with the phyFLEX-module. I've chosen the latter one, since I
> felt it has more readability.

Thanks for the clarification,
Ahmad

> 
> Regards,
> Yunus
> 
> Am Montag, dem 03.05.2021 um 14:38 +0200 schrieb Ahmad Fatoum:
>> Hello Yunus,
>>
>> On 03.05.21 14:25, Yunus Bas wrote:
>>> The kernel NVMEM-subsystem prevents the usage of duplicate
>>> partition names.
>>> Change the SPI-NOR partition names to be compatible with the kernel
>>> driver.
>>
>> I don't mind the change, but I can't follow the reasoning.
>> These are MTD partitions, so they shouldn't have been registered with
>> the NVMEM
>> framework in the first place?
>>
>> Cheers,
>> Ahmad
>>
>>>
>>> Commit 72ba815bf6fe ("ARM: dts: phycore-imx6: change mtd-partition
>>> names for
>>> compatibility with kernel") applies the change for phyCORE SOMs.
>>> The
>>> same applies for phyFLEX-modules.
>>>
>>> Signed-off-by: Yunus Bas <y.bas@phytec.de>
>>> ---
>>>  arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 11 ++++++-----
>>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
>>> b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
>>> index e1aa3183b..6df8d247b 100644
>>> --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
>>> +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
>>> @@ -21,7 +21,7 @@
>>>  
>>>                 environment-spinor {
>>>                         compatible = "barebox,environment";
>>> -                       device-path = &som_flash,
>>> "partname:barebox-environment";
>>> +                       device-path = &som_flash,
>>> "partname:nor.barebox-environment";
>>>                         status = "disabled";
>>>                 };
>>>  
>>> @@ -54,28 +54,29 @@
>>>  /delete-node/ &{/memory@10000000};
>>>  
>>>  &som_flash {
>>> +
>>>         partitions {
>>>                 compatible = "fixed-partitions";
>>>                 #address-cells = <1>;
>>>                 #size-cells = <1>;
>>>  
>>>                 partition@0 {
>>> -                       label = "barebox";
>>> +                       label = "nor.barebox";
>>>                         reg = <0x0 0x100000>;
>>>                 };
>>>  
>>>                 partition@100000 {
>>> -                       label = "barebox-environment";
>>> +                       label = "nor.barebox-environment";
>>>                         reg = <0x100000 0x20000>;
>>>                 };
>>>  
>>>                 partition@120000 {
>>> -                       label = "oftree";
>>> +                       label = "nor.oftree";
>>>                         reg = <0x120000 0x20000>;
>>>                 };
>>>  
>>>                 partition@140000 {
>>> -                       label = "kernel";
>>> +                       label = "nor.kernel";
>>>                         reg = <0x140000 0x0>;
>>>                 };
>>>         };
>>>
>>
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility
  2021-05-03 18:36     ` Ahmad Fatoum
@ 2021-05-03 21:50       ` Yunus Bas
  0 siblings, 0 replies; 5+ messages in thread
From: Yunus Bas @ 2021-05-03 21:50 UTC (permalink / raw)
  To: barebox, a.fatoum

Hello Ahmad,

Am Montag, dem 03.05.2021 um 20:36 +0200 schrieb Ahmad Fatoum:
> Hello Yunus,
> 
> On 03.05.21 16:38, Yunus Bas wrote:
> > Hi Ahmad,
> > 
> > The main purpose behind adding MTD-partitions as NVMEM-devices was
> > to
> > have a fast and uncomplicated access on partitions with sensitive
> > data,
> > especially on embedded systems. I think, there is a reasoning for
> > it,
> > but nevertheless, the original kernel patch is from 2018.
> 
> So it's a patch you carry with you and not Linux-upstream
> functionality?

Registering MTD-partitions as NVMEM devices is Linux-upstream. We just
need to adapt the partition names in barebox.

> 
> > To say the truth, there is already an upstream fix for the name-
> > clashing, which registers the NVMEM devices with the unique device
> > names, instead of the MTD-names. I had two options here, one was to
> > revert the first patch with the change for phyCore, the other was
> > to
> > follow up with the phyFLEX-module. I've chosen the latter one,
> > since I
> > felt it has more readability.
> 
> Thanks for the clarification,
> Ahmad
> 

Maybe it is better to drop this and revert the change on phyCore
instead. Prepending the device before the partition would only apply to
the NOR flash. Also, this solution doesn't work out in case there are
two flash memories of the same kind, e.g. two NOR flashes.

Please drop this patch.

Regards,
Yunus

> > 
> > Regards,
> > Yunus
> > 
> > Am Montag, dem 03.05.2021 um 14:38 +0200 schrieb Ahmad Fatoum:
> > > Hello Yunus,
> > > 
> > > On 03.05.21 14:25, Yunus Bas wrote:
> > > > The kernel NVMEM-subsystem prevents the usage of duplicate
> > > > partition names.
> > > > Change the SPI-NOR partition names to be compatible with the
> > > > kernel
> > > > driver.
> > > 
> > > I don't mind the change, but I can't follow the reasoning.
> > > These are MTD partitions, so they shouldn't have been registered
> > > with
> > > the NVMEM
> > > framework in the first place?
> > > 
> > > Cheers,
> > > Ahmad
> > > 
> > > > 
> > > > Commit 72ba815bf6fe ("ARM: dts: phycore-imx6: change mtd-
> > > > partition
> > > > names for
> > > > compatibility with kernel") applies the change for phyCORE
> > > > SOMs.
> > > > The
> > > > same applies for phyFLEX-modules.
> > > > 
> > > > Signed-off-by: Yunus Bas <y.bas@phytec.de>
> > > > ---
> > > >  arch/arm/dts/imx6qdl-phytec-pfla02.dtsi | 11 ++++++-----
> > > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > > > b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > > > index e1aa3183b..6df8d247b 100644
> > > > --- a/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > > > +++ b/arch/arm/dts/imx6qdl-phytec-pfla02.dtsi
> > > > @@ -21,7 +21,7 @@
> > > >  
> > > >                 environment-spinor {
> > > >                         compatible = "barebox,environment";
> > > > -                       device-path = &som_flash,
> > > > "partname:barebox-environment";
> > > > +                       device-path = &som_flash,
> > > > "partname:nor.barebox-environment";
> > > >                         status = "disabled";
> > > >                 };
> > > >  
> > > > @@ -54,28 +54,29 @@
> > > >  /delete-node/ &{/memory@10000000};
> > > >  
> > > >  &som_flash {
> > > > +
> > > >         partitions {
> > > >                 compatible = "fixed-partitions";
> > > >                 #address-cells = <1>;
> > > >                 #size-cells = <1>;
> > > >  
> > > >                 partition@0 {
> > > > -                       label = "barebox";
> > > > +                       label = "nor.barebox";
> > > >                         reg = <0x0 0x100000>;
> > > >                 };
> > > >  
> > > >                 partition@100000 {
> > > > -                       label = "barebox-environment";
> > > > +                       label = "nor.barebox-environment";
> > > >                         reg = <0x100000 0x20000>;
> > > >                 };
> > > >  
> > > >                 partition@120000 {
> > > > -                       label = "oftree";
> > > > +                       label = "nor.oftree";
> > > >                         reg = <0x120000 0x20000>;
> > > >                 };
> > > >  
> > > >                 partition@140000 {
> > > > -                       label = "kernel";
> > > > +                       label = "nor.kernel";
> > > >                         reg = <0x140000 0x0>;
> > > >                 };
> > > >         };
> > > > 
> > > 
> > 
> 

-- 
Mit freundlichen Grüßen
Yunus Bas

-Software Engineer-
PHYTEC Messtechnik GmbH
Robert-Koch-Str. 39
55129 Mainz
Germany
Tel.: +49 (0)6131 9221- 466
Web: www.phytec.de

Sie finden uns auch auf: Facebook, LinkedIn, Xing, YouTube

PHYTEC Messtechnik GmbH | Robert-Koch-Str. 39 | 55129 Mainz, Germany
Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber |
Handelsregister Mainz HRB 4656 | Finanzamt Mainz | St.Nr. 266500608, DE
149059855
This E-Mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this E-Mail in error)
please notify the sender immediately and destroy this E-Mail. Any
unauthorized copying, disclosure or distribution of the material in
this E-Mail is strictly forbidden.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-03 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 12:25 [PATCH] ARM: dts: imx6qdl: pfla02: Update spi-nor naming for kernel compatibility Yunus Bas
2021-05-03 12:38 ` Ahmad Fatoum
2021-05-03 14:38   ` Yunus Bas
2021-05-03 18:36     ` Ahmad Fatoum
2021-05-03 21:50       ` Yunus Bas

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git