diff mbox series

[v2,4/5] arm64: dts: librem5: protect some partitions of the nor-flash

Message ID 20210217111944.1416-5-martin.kepplinger@puri.sm (mailing list archive)
State New, archived
Headers show
Series arm64: dts: librem5 phone and devkit dts and config updates | expand

Commit Message

Martin Kepplinger Feb. 17, 2021, 11:19 a.m. UTC
From: Angus Ainslie <angus@akkea.ca>

These sections should be read only as they contain important data.

Signed-off-by: Angus Ainslie <angus@akkea.ca>
Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
---
 .../arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Krzysztof Kozlowski Feb. 17, 2021, 11:52 a.m. UTC | #1
On Wed, Feb 17, 2021 at 12:19:43PM +0100, Martin Kepplinger wrote:
> From: Angus Ainslie <angus@akkea.ca>
> 
> These sections should be read only as they contain important data.
> 
> Signed-off-by: Angus Ainslie <angus@akkea.ca>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> ---
>  .../arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
> index c2bbbdeb93e3..3c0462f81b3a 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
> @@ -258,6 +258,22 @@
>  		compatible = "jedec,spi-nor";
>  		reg = <0>;
>  		spi-max-frequency = <1000000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;

Still a line break here is needed.

> +		partition@0 {
> +			label = "protected0";
> +			reg = <0x00000000 0x00030000>;
> +			read-only;
> +		};
> +		partition@30000 {
> +			label = "protected1";
> +			reg = <0x00030000 0x00010000>;

Drop the leading 0 in address and size. I saw some DTS using it but it's
not the common format. All nodes don't lead with 0 so why partitions are
different?

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
index c2bbbdeb93e3..3c0462f81b3a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
@@ -258,6 +258,22 @@ 
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <1000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "protected0";
+			reg = <0x00000000 0x00030000>;
+			read-only;
+		};
+		partition@30000 {
+			label = "protected1";
+			reg = <0x00030000 0x00010000>;
+			read-only;
+		};
+		partition@40000 {
+			label = "rw";
+			reg = <0x00040000 0x001C0000>;
+		};
 	};
 };