mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] ARM: dts: imx6qdl-nitrogen6x: Add SPI NOR partitions
@ 2017-11-27 13:31 Otavio Salvador
  2017-11-27 16:17 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Otavio Salvador @ 2017-11-27 13:31 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Gary Bisson, Otavio Salvador, Fabio Estevam, devicetree,
	Sascha Hauer, linux-kernel, Rob Herring, Mark Rutland,
	Russell King, Shawn Guo

This adds the partitions definition for the SPI NOR to provide
backward compatibility with the documented[1] layout used with
Boundary Devices BSP.

1. https://boundarydevices.com/boot-flash-access-linux/

It exports to Linux:

 mtd0: bootloader
 mtd1: env
 mtd2: splash

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---

Changes in v3:
 - use lock instead of read-only (Gary Bisson)

Changes in v2:
 - rework labels (Fabio Estevam)
 - add read-only flags (Fabio Estevam)

 arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
index 4bdf29169d2a..f855d802533e 100644
--- a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
@@ -276,6 +276,26 @@
 		compatible = "sst,sst25vf016b", "jedec,spi-nor";
 		spi-max-frequency = <20000000>;
 		reg = <0>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "bootloader";
+			reg = <0x0 0xc0000>;
+			lock;
+		};
+
+		partition@c0000 {
+			label = "env";
+			reg = <0xc0000 0x2000>;
+			lock;
+		};
+
+		partition@c2000 {
+			label = "splash";
+			reg = <0xc2000 0x13e000>;
+			lock;
+		};
 	};
 };
 
-- 
2.15.0

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

* Re: [PATCH v3] ARM: dts: imx6qdl-nitrogen6x: Add SPI NOR partitions
  2017-11-27 13:31 [PATCH v3] ARM: dts: imx6qdl-nitrogen6x: Add SPI NOR partitions Otavio Salvador
@ 2017-11-27 16:17 ` Fabio Estevam
  2017-11-28 17:37   ` Otavio Salvador
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2017-11-27 16:17 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: linux-arm-kernel, Mark Rutland, devicetree, linux-kernel,
	Russell King, Gary Bisson, Rob Herring, Sascha Hauer,
	Fabio Estevam, Shawn Guo

On Mon, Nov 27, 2017 at 11:31 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> This adds the partitions definition for the SPI NOR to provide
> backward compatibility with the documented[1] layout used with
> Boundary Devices BSP.
>
> 1. https://boundarydevices.com/boot-flash-access-linux/
>
> It exports to Linux:
>
>  mtd0: bootloader
>  mtd1: env
>  mtd2: splash
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

Has this been tested? I mean, have you tested the locking mechanism is
really working in this SPI NOR flash?

As far as I can see the SPI locking mechanism does not need device
tree properties.

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

* Re: [PATCH v3] ARM: dts: imx6qdl-nitrogen6x: Add SPI NOR partitions
  2017-11-27 16:17 ` Fabio Estevam
@ 2017-11-28 17:37   ` Otavio Salvador
  0 siblings, 0 replies; 3+ messages in thread
From: Otavio Salvador @ 2017-11-28 17:37 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Otavio Salvador, Mark Rutland, devicetree, linux-kernel,
	Russell King, Gary Bisson, Rob Herring, Sascha Hauer,
	Fabio Estevam, Shawn Guo, linux-arm-kernel

Hello Fabio,

On Mon, Nov 27, 2017 at 2:17 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Nov 27, 2017 at 11:31 AM, Otavio Salvador
> <otavio@ossystems.com.br> wrote:
>> This adds the partitions definition for the SPI NOR to provide
>> backward compatibility with the documented[1] layout used with
>> Boundary Devices BSP.
>>
>> 1. https://boundarydevices.com/boot-flash-access-linux/
>>
>> It exports to Linux:
>>
>>  mtd0: bootloader
>>  mtd1: env
>>  mtd2: splash
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>
> Has this been tested? I mean, have you tested the locking mechanism is
> really working in this SPI NOR flash?

Yes, we tested it here using Linux 4.14 but didn't notice this SPI NOR
does not support the lock.

> As far as I can see the SPI locking mechanism does not need device
> tree properties.

Humm it is confusing, at least for me that am not used to the this. In
any case, I think for now it is better to include the partitions
without read-only and lock as it is convenient to have access to it
from Linux so we adhere the same partition layout used in Boundary's
Linux fork.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

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

end of thread, other threads:[~2017-11-28 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 13:31 [PATCH v3] ARM: dts: imx6qdl-nitrogen6x: Add SPI NOR partitions Otavio Salvador
2017-11-27 16:17 ` Fabio Estevam
2017-11-28 17:37   ` Otavio Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®