diff mbox series

ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions

Message ID 20201026131351.258296-1-npcomplete13@gmail.com (mailing list archive)
State Superseded, archived
Headers show
Series ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions | expand

Commit Message

Vivek Unune Oct. 26, 2020, 1:13 p.m. UTC
This router has dual paritions to store trx firmware image and
dual partitions for nvram. The second one in each of these cases acts
as a backup store.

When tested with OpenWrt, the default partition parser causes two issues:

1. It labels both nvram partitions as nvram. In factory, second one is
labeled devinfo.
2. It parses second trx image and tries to create second 'linux' partition
and fails with - cannot create duplicate 'linux' partition. I've set this
partition to read-only for now

The following patch works around both of these issues.

Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
---
 .../boot/dts/bcm47094-linksys-panamera.dts    | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)

Comments

Florian Fainelli Oct. 26, 2020, 1:30 p.m. UTC | #1
On 10/26/2020 6:13 AM, Vivek Unune wrote:
> This router has dual paritions to store trx firmware image and
> dual partitions for nvram. The second one in each of these cases acts
> as a backup store.
> 
> When tested with OpenWrt, the default partition parser causes two issues:
> 
> 1. It labels both nvram partitions as nvram. In factory, second one is
> labeled devinfo.
> 2. It parses second trx image and tries to create second 'linux' partition
> and fails with - cannot create duplicate 'linux' partition. I've set this
> partition to read-only for now
> 
> The following patch works around both of these issues.
> 
> Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
> ---
>   .../boot/dts/bcm47094-linksys-panamera.dts    | 41 +++++++++++++++++++
>   1 file changed, 41 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> index 5d5930edfb9d..13da16c5de68 100644
> --- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> +++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> @@ -292,3 +292,44 @@ fixed-link {
>   &usb3_phy {
>   	status = "okay";
>   };
> +
> +&nandcs {
> +	partitions {
> +		compatible = "fixed-partitions";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		partition@0 {
> +			label = "boot";
> +			reg = <0x0000000 0x0080000>;
> +			read-only;
> +		};
> +
> +		partition@80000 {
> +			label = "nvram";
> +			reg = <0x080000 0x0100000>;
> +		};
> +
> +		partition@180000{
> +			label = "devinfo";
> +			reg = <0x0180000 0x080000>;
> +		};
> +
> +		partition@200000 {
> +			label = "firmware";
> +			reg = <0x0200000 0x01D00000>;
> +			compatible = "brcm,trx";
> +		};
> +
> +		partition@1F00000 {
> +			label = "failsafe";
> +			reg = <0x01F00000 0x01D00000>;
> +			read-only;
> +		};
> +
> +		partition@0x5200000 {

You would need to remove the 0x from the hex number here.

> +			label = "brcmnand";

Not sure how useful naming this partition brcmnand is, can we find a 
better name for it?
Vivek Unune Oct. 26, 2020, 3:39 p.m. UTC | #2
On Mon, Oct 26, 2020 at 06:30:53AM -0700, Florian Fainelli wrote:
> 
> 
> On 10/26/2020 6:13 AM, Vivek Unune wrote:
> > This router has dual paritions to store trx firmware image and
> > dual partitions for nvram. The second one in each of these cases acts
> > as a backup store.
> > 
> > When tested with OpenWrt, the default partition parser causes two issues:
> > 
> > 1. It labels both nvram partitions as nvram. In factory, second one is
> > labeled devinfo.
> > 2. It parses second trx image and tries to create second 'linux' partition
> > and fails with - cannot create duplicate 'linux' partition. I've set this
> > partition to read-only for now
> > 
> > The following patch works around both of these issues.
> > 
> > Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
> > ---
> >   .../boot/dts/bcm47094-linksys-panamera.dts    | 41 +++++++++++++++++++
> >   1 file changed, 41 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> > index 5d5930edfb9d..13da16c5de68 100644
> > --- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> > +++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
> > @@ -292,3 +292,44 @@ fixed-link {
> >   &usb3_phy {
> >   	status = "okay";
> >   };
> > +
> > +&nandcs {
> > +	partitions {
> > +		compatible = "fixed-partitions";
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +
> > +		partition@0 {
> > +			label = "boot";
> > +			reg = <0x0000000 0x0080000>;
> > +			read-only;
> > +		};
> > +
> > +		partition@80000 {
> > +			label = "nvram";
> > +			reg = <0x080000 0x0100000>;
> > +		};
> > +
> > +		partition@180000{
> > +			label = "devinfo";
> > +			reg = <0x0180000 0x080000>;
> > +		};
> > +
> > +		partition@200000 {
> > +			label = "firmware";
> > +			reg = <0x0200000 0x01D00000>;
> > +			compatible = "brcm,trx";
> > +		};
> > +
> > +		partition@1F00000 {
> > +			label = "failsafe";
> > +			reg = <0x01F00000 0x01D00000>;
> > +			read-only;
> > +		};
> > +
> > +		partition@0x5200000 {
> 
> You would need to remove the 0x from the hex number here.

Sure, I'll fix this in next version

> 
> > +			label = "brcmnand";
> 
> Not sure how useful naming this partition brcmnand is, can we find a better
> name for it?

I'll be more than happy to rename this that makes sense. Factory uses this
name as well. This is used as a general persistent storage for system cofigs.
Could we name it System?

Thanks,

Vivek
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
index 5d5930edfb9d..13da16c5de68 100644
--- a/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
+++ b/arch/arm/boot/dts/bcm47094-linksys-panamera.dts
@@ -292,3 +292,44 @@  fixed-link {
 &usb3_phy {
 	status = "okay";
 };
+
+&nandcs {
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			label = "boot";
+			reg = <0x0000000 0x0080000>;
+			read-only;
+		};
+
+		partition@80000 {
+			label = "nvram";
+			reg = <0x080000 0x0100000>;
+		};
+
+		partition@180000{
+			label = "devinfo";
+			reg = <0x0180000 0x080000>;
+		};
+
+		partition@200000 {
+			label = "firmware";
+			reg = <0x0200000 0x01D00000>;
+			compatible = "brcm,trx";
+		};
+
+		partition@1F00000 {
+			label = "failsafe";
+			reg = <0x01F00000 0x01D00000>;
+			read-only;
+		};
+
+		partition@0x5200000 {
+			label = "brcmnand";
+			reg = <0x05200000 0x02E00000>;
+		};
+	};
+};