Netgear R6350: max power for 5GHz lower after upgrading to 21.02 RC1

I just completed the test on my WAC124.

With my old patch (after replacing scpart-id by sercomm,scpart-id to make it compatible with the upstream driver), the partition table is correct (factory partition is where it should be).

Kernel log (factory partition with id 16)
[    0.982259] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[    0.994921] nand: Macronix MX30LF1G18AC
[    1.002542] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.017628] mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits
[    1.030685] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.045246] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.059801] Scanning device for bad blocks
[    2.401576] scpart: Valid 'SC PART MAP' (29 partitions) found at 0x100000
[    2.415242] 29 scpart partitions found on MTD device mt7621-nand
[    2.427204] Creating 29 MTD partitions on "mt7621-nand":
[    2.437792] 0x000000000000-0x000000100000 : "u-boot"
[    2.448827] 0x000000100000-0x000000200000 : "SC PART_MAP"
[    2.460936] 0x000000200000-0x000000600000 : "kernel"
[    2.471891] 0x000000600000-0x000002e00000 : "ubi"
[    2.482425] 0x000002e00000-0x000003000000 : "English UI"
[    2.494082] 0x000003000000-0x000003200000 : "ML1"
[    2.504473] 0x000003200000-0x000003400000 : "ML2"
[    2.514842] 0x000003400000-0x000003600000 : "ML3"
[    2.525224] 0x000003600000-0x000003800000 : "ML4"
[    2.535581] 0x000003800000-0x000003a00000 : "ML5"
[    2.546024] 0x000003a00000-0x000003c00000 : "ML6"
[    2.556384] 0x000003c00000-0x000003e00000 : "ML7"
[    2.566768] 0x000003e00000-0x000004000000 : "ML8"
[    2.577253] 0x000004000000-0x000004200000 : "ML9"
[    2.587678] 0x000004200000-0x000004400000 : "ML10"
[    2.598239] 0x000004400000-0x000004600000 : "ML11"
[    2.608809] 0x000004600000-0x000004800000 : "factory"
[    2.619950] 0x000004800000-0x000004a00000 : "SC Private Data"
[    2.632317] 0x000004a00000-0x000004c00000 : "POT"
[    2.642763] 0x000004c00000-0x000004e00000 : "Traffic Meter"
[    2.654859] 0x000004e00000-0x000005000000 : "SC PID"
[    2.665826] 0x000005000000-0x000005200000 : "SC Nvram"
[    2.677073] 0x000005200000-0x000005400000 : "Ralink Nvram"
[    2.689039] 0x000005400000-0x000005600000 : "reserved0"
[    2.700464] 0x000005600000-0x000005800000 : "reserved1"
[    2.711900] 0x000005800000-0x000005a00000 : "reserved2"
[    2.723388] 0x000005a00000-0x000005c00000 : "reserved3"
[    2.734870] 0x000005c00000-0x000005e00000 : "reserved4"
[    2.746427] 0x000005e00000-0x000007f80000 : "reserved5"

With your patch applied to mt7621_netgear_sercomm_chj.dtsi, the partition table is broken. In this case ML1 is used as factory partition (with the expected results). The two reserved partitions are also wrong (but of course that doesn't directly break anything as they aren't used).

Kernel log (factory partition with id 5)
[    0.982495] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
[    0.995149] nand: Macronix MX30LF1G18AC
[    1.002771] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.017854] mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits
[    1.030895] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.045456] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.060005] Scanning device for bad blocks
[    2.402340] scpart: Valid 'SC PART MAP' (29 partitions) found at 0x100000
[    2.415909] 7 scpart partitions found on MTD device mt7621-nand
[    2.427695] Creating 7 MTD partitions on "mt7621-nand":
[    2.438103] 0x000000000000-0x000000100000 : "u-boot"
[    2.449177] 0x000000100000-0x000000200000 : "SC PART_MAP"
[    2.461104] 0x000000200000-0x000000600000 : "kernel"
[    2.472036] 0x000000600000-0x000002e00000 : "ubi"
[    2.482492] 0x000002e00000-0x000003000000 : "reserved0"
[    2.493926] 0x000003000000-0x000003200000 : "factory"
[    2.504999] 0x000003200000-0x000003400000 : "reserved1"

@Borromini: If it actually works for you with a partition ID of 5 for the factory partition, could you check if the kernel log contains any scpart messages on your device?

Here's the kernel log from my 6350 flashed with the 6850 patch, if it helps?
and does your build work for the R6350?

Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.004198] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.016852] nand: Macronix MX30LF1G18AC
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.024494] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.039585] mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.052630] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.067188] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
Sun Jun  5 21:48:09 2022 kern.info kernel: [    1.081757] Scanning device for bad blocks
Sun Jun  5 21:48:09 2022 kern.warn kernel: [    1.362166] Bad eraseblock 216 at 0x000001b00000
Sun Jun  5 21:48:09 2022 kern.warn kernel: [    1.778105] Bad eraseblock 540 at 0x000004380000
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.394678] 7 fixed-partitions partitions found on MTD device mt7621-nand
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.408195] Creating 7 MTD partitions on "mt7621-nand":
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.418631] 0x000000000000-0x000000100000 : "u-boot"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.429554] 0x000000100000-0x000000200000 : "SC PART_MAP"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.441682] 0x000000200000-0x000000600000 : "kernel"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.452527] 0x000000600000-0x000002e00000 : "ubi"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.463047] 0x000002e00000-0x000004600000 : "reserved0"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.474491] 0x000004600000-0x000004800000 : "factory"
Sun Jun  5 21:48:09 2022 kern.notice kernel: [    2.485516] 0x000004800000-0x000008000000 : "reserved1"
Sun Jun  5 21:48:09 2022 kern.info kernel: [    2.540499] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module

OK. I checked your original patch again and it adds a bunch of other partitions whereas OpenWrt master now just expands that reserved0 partition to a total of 0x1800000 bytes. And those extra partitions in your DTSI patch make factory indeed have ID 16. I overlooked that the first time :see_no_evil:. After the factory partition, the master DTSI does the same again: it it allocates the remainder of the flash to reserved1, whereas your patch divides it into multiple partitions (to reflect OEM partitioning I suppose). I will adapt my patch.

Any idea why those reserved ranges are treated as one big partition in OpenWrt? I suppose because they're irrelevant to OpenWrt operation and only needed by the OEM firmware.

Edit: revised patch for both the BZV and CHJ platforms here.

@janh I will test again on my R6800 and report back, if you could test on your WAC124 and if it's looking good provide your Acked-by/Suggested-by/Tested-by/... - whatever feels appropriate to you.

@tsuda @jea101 @Jawadbz Since I'm at it anyway I will be whipping up images based on 22.03 HEAD. If you could test and report back for your specific device, that would be great and we can include your Tested-by in the final patch that gets sent in.

1 Like

Please find the 22.03 builds with the backported Sercomm parser and modified DTSIs here.

1 Like

Nice! Thanks a lot!!

Update: flashed and working well so far
Note to others who want to try: Luci is gone after upgrade, you need to reinstall it if you still have ssh root access and internet access.

1 Like

Thanks for testing. Sorry about that, thought stable releases had LuCI enabled automatically... Will check and re-upload.

@janh Don't have any bad blocks on my R6800, not sure if that means the Sercomm parser isn't kicking in... This is my dmesg excerpt:

[    1.069430] Scanning device for bad blocks
[    2.365479] 7 fixed-partitions partitions found on MTD device mt7621-nand
[    2.378997] Creating 7 MTD partitions on "mt7621-nand":
[    2.389416] 0x000000000000-0x000000100000 : "u-boot"
[    2.400215] 0x000000100000-0x000000200000 : "SC PART_MAP"
[    2.412173] 0x000000200000-0x000000600000 : "kernel"
[    2.423155] 0x000000600000-0x000002e00000 : "ubi"
[    2.433600] 0x000002e00000-0x000004600000 : "reserved0"
[    2.445080] 0x000004600000-0x000004800000 : "factory"
[    2.456112] 0x000004800000-0x000008000000 : "reserved1"

Edit: @tsuda Could you sysupgrade with the new build? Should have LuCI (SSL).

@Borromini - no worries I did use the sysupgrade img and lost luci, do you think it should not have lost it? Not big deal since I had root access and router was working fine. I just needed to install luci. thanks.

Here's my kernel log with bad blocks messages
[    0.994251] nand: Macronix MX30LF1G18AC
[    1.001875] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.016955] mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits
[    1.030008] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.044571] mt7621-nand 1e003000.nand: Using programmed access timing: 21005134
[    1.059138] Scanning device for bad blocks
[    1.339752] Bad eraseblock 216 at 0x000001b00000
[    1.756104] Bad eraseblock 540 at 0x000004380000
[    2.373233] 7 fixed-partitions partitions found on MTD device mt7621-nand
[    2.386766] Creating 7 MTD partitions on "mt7621-nand":
[    2.397183] 0x000000000000-0x000000100000 : "u-boot"
[    2.408106] 0x000000100000-0x000000200000 : "SC PART_MAP"
[    2.419865] 0x000000200000-0x000000600000 : "kernel"
[    2.430641] 0x000000600000-0x000002e00000 : "ubi"
[    2.441107] 0x000002e00000-0x000004600000 : "reserved0"
[    2.452669] 0x000004600000-0x000004800000 : "factory"
[    2.463712] 0x000004800000-0x000008000000 : "reserved1"
[    2.525602] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    2.541911] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21
[    2.559550] i2c /dev entries driver

@tsuda My question was if you could try with the new images I just uploaded. They should have LuCI.

@Borromini Sorry I missed the "new" as in a newer build. Flashed the latest 6850 sysupgrade, and luci is working now.

My device is a 6350 running with your 6850 build.

Thank you for spending the time to put this together!

1 Like

The reason my patch adds all the partitions is that the partition map parser also adjusts the size of the partitions. This means that combining multiple partitions isn't really possible anymore, as the result would just be a small partition with the offset and size of the one matching the specified scpart-id (you can see this in the kernel log I posted).

I don't think there is any other reason apart from them not being useful for OpenWrt. Although it may be possible to actually use them to enlarge the ubi partition using ubi-concat. Apparently, this has been done before and doesn't break sysupgrade. The factory image could be an issue though, and it would of course require lots of testing to make sure it really doesn't break anything.

My WAC124 also doesn't have any bad blocks either, and there kernel log still shows messages from the scpart driver. Looking at the driver code, there should always be some message, even if it doesn't find a partition table at all.

Are you sure that the driver is included in the image you tested? For 22.03, you also need to adjust the kernel config in addition to adding the driver patch (I tested using 22.03 myself).

Your builds don’t “fix” my bad 6350.

When I started the 6350 was running factory 1.1.0.88 (loaded using nmrpflash).
I first installed the 6350 factory build without luci with time 19:02.
I installed luci and luci-ssl.
When that didn’t help I tried a reset and reinstalled luci and luci-ssl.
Still no help.

I installed the sysuprade without luci and reinstalled luci and luci-ssl.
Still no help.

I installed the sysupgade with luci (time 22:28)
I saw the message

“the uploaded backup archive is not readable”

I then did a resset which should clean up the config.
Still no help.

Tested your build on my r6700v2. it flashed successfully but there seems to be no change. Max power still goes up to only 6dBm.

Thanks guys. Looks like the parser isn't enabled in the kernel like janh points out. Will let you know when I have new builds up.

New builds are up, parser is enabled now. Thanks @janh. Only thing that isn't clear to me is whether we can keep the current OpenWrt partitioning that merges all those OEM only partitions into reserved0 & reserved1?

Dmesg on my R6800:

[    1.061191] Scanning device for bad blocks
[    2.404052] scpart: Valid 'SC PART MAP' (29 partitions) found at 0x100000
[    2.417648] 7 scpart partitions found on MTD device mt7621-nand
[    2.429434] Creating 7 MTD partitions on "mt7621-nand":
[    2.439845] 0x000000000000-0x000000100000 : "u-boot"
[    2.450962] 0x000000100000-0x000000200000 : "SC PART_MAP"
[    2.462818] 0x000000200000-0x000000600000 : "kernel"
[    2.473635] 0x000000600000-0x000002e00000 : "ubi"
[    2.484255] 0x000002e00000-0x000003000000 : "reserved0"
[    2.495921] 0x000004600000-0x000004800000 : "factory"
[    2.507091] 0x000004800000-0x000004a00000 : "reserved1"

Just tried new build on my r6700v2 but no change for me.

Thanks. Let's wait for janh's feedback concerning the DTSI modifications.

@Borromini - Does this mean that it worked for my router because it moved the factory mtd away from the bad blocks?

Yes, very probably since it doesn't seem to do anything.

1 Like

Is there any need to reload the stock firmware before trying another build?

That should not be necessary.