* [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
@ 2020-10-26 13:13 Vivek Unune
2020-10-26 13:30 ` Florian Fainelli
0 siblings, 1 reply; 8+ messages in thread
From: Vivek Unune @ 2020-10-26 13:13 UTC (permalink / raw)
Cc: Vivek Unune, Hauke Mehrtens, Rafał Miłecki,
bcm-kernel-feedback-list, Rob Herring, linux-arm-kernel,
devicetree, linux-kernel
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 {
+ label = "brcmnand";
+ reg = <0x05200000 0x02E00000>;
+ };
+ };
+};
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-10-26 13:13 [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions Vivek Unune
@ 2020-10-26 13:30 ` Florian Fainelli
2020-10-26 15:39 ` Vivek Unune
2020-11-01 20:08 ` [PATCH v2] " Vivek Unune
0 siblings, 2 replies; 8+ messages in thread
From: Florian Fainelli @ 2020-10-26 13:30 UTC (permalink / raw)
To: Vivek Unune
Cc: devicetree, Hauke Mehrtens, Rafał Miłecki,
linux-kernel, Rob Herring, bcm-kernel-feedback-list,
linux-arm-kernel
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?
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-10-26 13:30 ` Florian Fainelli
@ 2020-10-26 15:39 ` Vivek Unune
2020-11-01 20:08 ` [PATCH v2] " Vivek Unune
1 sibling, 0 replies; 8+ messages in thread
From: Vivek Unune @ 2020-10-26 15:39 UTC (permalink / raw)
To: Florian Fainelli
Cc: devicetree, Hauke Mehrtens, Rafał Miłecki,
linux-kernel, Rob Herring, bcm-kernel-feedback-list,
linux-arm-kernel
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-10-26 13:30 ` Florian Fainelli
2020-10-26 15:39 ` Vivek Unune
@ 2020-11-01 20:08 ` Vivek Unune
2020-11-04 3:41 ` Florian Fainelli
2020-11-09 17:28 ` Rafał Miłecki
1 sibling, 2 replies; 8+ messages in thread
From: Vivek Unune @ 2020-11-01 20:08 UTC (permalink / raw)
Cc: florian.fainelli, Vivek Unune, Hauke Mehrtens,
Rafał Miłecki, bcm-kernel-feedback-list, Rob Herring,
linux-arm-kernel, devicetree, linux-kernel
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
The following patch works around both of these issues.
Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
---
V2:
- Removed 0x before partition offset
- Renamed brcmnand to system
---
.../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@5200000 {
+ label = "system";
+ reg = <0x05200000 0x02E00000>;
+ };
+ };
+};
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-11-01 20:08 ` [PATCH v2] " Vivek Unune
@ 2020-11-04 3:41 ` Florian Fainelli
2020-11-04 12:54 ` Vivek Unune
2020-11-09 17:28 ` Rafał Miłecki
1 sibling, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2020-11-04 3:41 UTC (permalink / raw)
To: bcm-kernel-feedback-list, Vivek Unune
Cc: florian.fainelli, Hauke Mehrtens, Rafał Miłecki,
Rob Herring, linux-arm-kernel, devicetree, linux-kernel
On Sun, 1 Nov 2020 15:08:03 -0500, Vivek Unune <npcomplete13@gmail.com> 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
>
> The following patch works around both of these issues.
>
> Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
> ---
Applied to devicetree/next, thanks!
--
Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-11-04 3:41 ` Florian Fainelli
@ 2020-11-04 12:54 ` Vivek Unune
0 siblings, 0 replies; 8+ messages in thread
From: Vivek Unune @ 2020-11-04 12:54 UTC (permalink / raw)
To: Florian Fainelli
Cc: bcm-kernel-feedback-list, florian.fainelli, Hauke Mehrtens,
Rafał Miłecki, Rob Herring, linux-arm-kernel,
devicetree, linux-kernel
On Tue, Nov 03, 2020 at 07:41:59PM -0800, Florian Fainelli wrote:
> On Sun, 1 Nov 2020 15:08:03 -0500, Vivek Unune <npcomplete13@gmail.com> 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
> >
> > The following patch works around both of these issues.
> >
> > Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
> > ---
>
> Applied to devicetree/next, thanks!
> --
> Florian
Thanks Florian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-11-01 20:08 ` [PATCH v2] " Vivek Unune
2020-11-04 3:41 ` Florian Fainelli
@ 2020-11-09 17:28 ` Rafał Miłecki
2020-11-09 17:58 ` Vivek Unune
1 sibling, 1 reply; 8+ messages in thread
From: Rafał Miłecki @ 2020-11-09 17:28 UTC (permalink / raw)
To: Vivek Unune
Cc: florian.fainelli, Hauke Mehrtens, bcm-kernel-feedback-list,
Rob Herring, linux-arm-kernel, devicetree, linux-kernel
On 01.11.2020 21:08, 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.
I'm quite sure CFE is supposed to flash new firmware to the backup
partition and then mark it as main one. The old firmware partition becomes a
new backup then.
That means you need to check which partition bootloader used to handle
partitioning properly.
> + partition@200000 {
> + label = "firmware";
> + reg = <0x0200000 0x01D00000>;
> + compatible = "brcm,trx";
> + };
> +
> + partition@1F00000 {
> + label = "failsafe";
> + reg = <0x01F00000 0x01D00000>;
> + read-only;
> + };
Here you assume CFE always boots from the first firmware partition.
Unless EA9500 CFE does sth stupid it seems like a 50% - 50% guess.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
2020-11-09 17:28 ` Rafał Miłecki
@ 2020-11-09 17:58 ` Vivek Unune
0 siblings, 0 replies; 8+ messages in thread
From: Vivek Unune @ 2020-11-09 17:58 UTC (permalink / raw)
To: Rafał Miłecki
Cc: florian.fainelli, Hauke Mehrtens, bcm-kernel-feedback-list,
Rob Herring, linux-arm-kernel, devicetree, linux-kernel
On Mon, Nov 09, 2020 at 06:28:38PM +0100, Rafał Miłecki wrote:
> On 01.11.2020 21:08, 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.
>
> I'm quite sure CFE is supposed to flash new firmware to the backup
> partition and then mark it as main one. The old firmware partition becomes a
> new backup then.
>
> That means you need to check which partition bootloader used to handle
> partitioning properly.
>
>
> > + partition@200000 {
> > + label = "firmware";
> > + reg = <0x0200000 0x01D00000>;
> > + compatible = "brcm,trx";
> > + };
> > +
> > + partition@1F00000 {
> > + label = "failsafe";
> > + reg = <0x01F00000 0x01D00000>;
> > + read-only;
> > + };
>
> Here you assume CFE always boots from the first firmware partition.
>
> Unless EA9500 CFE does sth stupid it seems like a 50% - 50% guess.
Hi Rafał,
Indeed, my assumption is to only boot using first partition.
If we ever want to support true dual partitions in future, we need to:
1. Read the boot flag 'bootpartition' and skip the backup partition parsing
2. Updagrading firmware will write to backup partition and flip the bootpartition
Thanks,
Vivek
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-11-09 17:58 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 13:13 [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions Vivek Unune
2020-10-26 13:30 ` Florian Fainelli
2020-10-26 15:39 ` Vivek Unune
2020-11-01 20:08 ` [PATCH v2] " Vivek Unune
2020-11-04 3:41 ` Florian Fainelli
2020-11-04 12:54 ` Vivek Unune
2020-11-09 17:28 ` Rafał Miłecki
2020-11-09 17:58 ` Vivek Unune
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).