diff mbox series

[v1] ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors

Message ID 20211201125703.52935-1-chunkeey@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v1] ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors | expand

Commit Message

Christian Lamparter Dec. 1, 2021, 12:57 p.m. UTC
Steven Maddox reported in the OpenWrt bugzilla, that his
RaidSonic IB-NAS4220-B was no longer booting with the new
OpenWrt 21.02 (uses linux 5.10's device-tree). However, it was
working with the previous OpenWrt 19.07 series (uses 4.14).

|[    5.548038] No RedBoot partition table detected in 30000000.flash
|[    5.618553] Searching for RedBoot partition table in 30000000.flash at offset 0x0
|[    5.739093] No RedBoot partition table detected in 30000000.flash
|...
|[    7.039504] Waiting for root device /dev/mtdblock3...

The provided bootlog shows that the RedBoot partition parser was
looking for the partition table "at offset 0x0". Which is strange
since the comment in the device-tree says it should be at 0xfe0000.

Further digging on the internet led to a review site that took
some useful PCB pictures of their review unit back in February 2009.
Their picture shows a Spansion S29GL128N11TFI01 flash chip.

From Spansion's Datasheet:
"S29GL128N: One hundred twenty-eight 64 Kword (128 Kbyte) sectors"
Steven also provided a "cat /sys/class/mtd/mtd0/erasesize" from his
unit: "131072".

With the 128 KiB Sector/Erasesize in mind. This patch changes the
fis-index-block property to (0xfe0000 / 0x20000) = 0x7f.

Fixes: b5a923f8c739 ("ARM: dts: gemini: Switch to redboot partition parsing")
Bugzilla: https://bugs.openwrt.org/index.php?do=details&task_id=4137
Reported-by: Steven Maddox <s.maddox@lantizia.me.uk>
Tested-by: Steven Maddox <s.maddox@lantizia.me.uk>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
 arch/arm/boot/dts/gemini-nas4220b.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Dec. 6, 2021, 12:44 a.m. UTC | #1
On Wed, Dec 1, 2021 at 1:57 PM Christian Lamparter <chunkeey@gmail.com> wrote:

> Steven Maddox reported in the OpenWrt bugzilla, that his
> RaidSonic IB-NAS4220-B was no longer booting with the new
> OpenWrt 21.02 (uses linux 5.10's device-tree). However, it was
> working with the previous OpenWrt 19.07 series (uses 4.14).
>
> |[    5.548038] No RedBoot partition table detected in 30000000.flash
> |[    5.618553] Searching for RedBoot partition table in 30000000.flash at offset 0x0
> |[    5.739093] No RedBoot partition table detected in 30000000.flash
> |...
> |[    7.039504] Waiting for root device /dev/mtdblock3...
>
> The provided bootlog shows that the RedBoot partition parser was
> looking for the partition table "at offset 0x0". Which is strange
> since the comment in the device-tree says it should be at 0xfe0000.
>
> Further digging on the internet led to a review site that took
> some useful PCB pictures of their review unit back in February 2009.
> Their picture shows a Spansion S29GL128N11TFI01 flash chip.
>
> From Spansion's Datasheet:
> "S29GL128N: One hundred twenty-eight 64 Kword (128 Kbyte) sectors"
> Steven also provided a "cat /sys/class/mtd/mtd0/erasesize" from his
> unit: "131072".
>
> With the 128 KiB Sector/Erasesize in mind. This patch changes the
> fis-index-block property to (0xfe0000 / 0x20000) = 0x7f.
>
> Fixes: b5a923f8c739 ("ARM: dts: gemini: Switch to redboot partition parsing")
> Bugzilla: https://bugs.openwrt.org/index.php?do=details&task_id=4137
> Reported-by: Steven Maddox <s.maddox@lantizia.me.uk>
> Tested-by: Steven Maddox <s.maddox@lantizia.me.uk>
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>

Thanks a lot Christian excellent rootcausing!

I have relayed this patch directly to the SoC tree for fixes.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/gemini-nas4220b.dts b/arch/arm/boot/dts/gemini-nas4220b.dts
index 13112a8a5dd8..6544c730340f 100644
--- a/arch/arm/boot/dts/gemini-nas4220b.dts
+++ b/arch/arm/boot/dts/gemini-nas4220b.dts
@@ -84,7 +84,7 @@  flash@30000000 {
 			partitions {
 				compatible = "redboot-fis";
 				/* Eraseblock at 0xfe0000 */
-				fis-index-block = <0x1fc>;
+				fis-index-block = <0x7f>;
 			};
 		};