All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Unune <npcomplete13@gmail.com>
Cc: devicetree@vger.kernel.org, florian.fainelli@broadcom.com,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	linux-kernel@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-arm-kernel@lists.infradead.org,
	"Vivek Unune" <npcomplete13@gmail.com>
Subject: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
Date: Sun,  1 Nov 2020 15:08:03 -0500	[thread overview]
Message-ID: <20201101200804.2460-1-npcomplete13@gmail.com> (raw)
In-Reply-To: <e64d76cc-90bb-5b54-04de-fde21542e4fe@gmail.com>

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Vivek Unune <npcomplete13@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: florian.fainelli@broadcom.com,
	"Vivek Unune" <npcomplete13@gmail.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	"Rob Herring" <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions
Date: Sun,  1 Nov 2020 15:08:03 -0500	[thread overview]
Message-ID: <20201101200804.2460-1-npcomplete13@gmail.com> (raw)
In-Reply-To: <e64d76cc-90bb-5b54-04de-fde21542e4fe@gmail.com>

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


  parent reply	other threads:[~2020-11-01 20:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 13:13 [PATCH] ARM: dts: BCM5301X: Linksys EA9500 add fixed partitions Vivek Unune
2020-10-26 13:13 ` Vivek Unune
2020-10-26 13:30 ` Florian Fainelli
2020-10-26 13:30   ` Florian Fainelli
2020-10-26 15:39   ` Vivek Unune
2020-10-26 15:39     ` Vivek Unune
2020-11-01 20:08   ` Vivek Unune [this message]
2020-11-01 20:08     ` [PATCH v2] " Vivek Unune
2020-11-04  3:41     ` Florian Fainelli
2020-11-04  3:41       ` Florian Fainelli
2020-11-04 12:54       ` Vivek Unune
2020-11-04 12:54         ` Vivek Unune
2020-11-09 17:28     ` Rafał Miłecki
2020-11-09 17:28       ` Rafał Miłecki
2020-11-09 17:58       ` Vivek Unune
2020-11-09 17:58         ` Vivek Unune

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201101200804.2460-1-npcomplete13@gmail.com \
    --to=npcomplete13@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.