openwrt/target/linux
INAGAKI Hiroshi f7f9e6bd20 ramips: use parser_trx for Buffalo WCR-1166DS
Buffalo WCR-1166DS uses trx-fomatted firmware and the custom magic
number (0x5C436F74, "\Cot") is required for OpenWrt installation from
OEM WebUI.
But the current mtdsplit_trx doesn't support the custom magic number and
fail to parse and split to kernel and rootfs when the factory image is
flashed. Then, the kernel fails to mount rootfs automatically and panics.

Before the commit fddc78bc11, mtdsplit_trx
was patched in ramips target and the device-specific magic number was
supported only for WCR-1166DS[1].
But the patch was not inherited to the later version of the kernel and
deleted by the above commit, then, the custom magic number support was
broken.

[1]: 05d6e92594/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch (L27)

log (factory image):

[    1.165312] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.195782] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.205353] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.217938] Creating 7 MTD partitions on "spi0.0":
[    1.227436] 0x000000000000-0x000000030000 : "u-boot"
[    1.238427] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.250123] 0x000000040000-0x000000050000 : "factory"
[    1.261306] 0x000000050000-0x000000810000 : "firmware"
[    1.282051] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.293594] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.304719] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.452424] /dev/root: Can't open blockdev
[    1.460619] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    1.475434] Please append a correct "root=" boot option; here are the available partitions:
[    1.491986] 1f00             192 mtdblock0
[    1.491989]  (driver?)
[    1.504938] 1f01              64 mtdblock1
[    1.504941]  (driver?)
[    1.517885] 1f02              64 mtdblock2
[    1.517888]  (driver?)
[    1.530831] 1f03            7936 mtdblock3
[    1.530834]  (driver?)
[    1.543777] 1f04            7936 mtdblock4
[    1.543781]  (driver?)
[    1.556724] 1f05              64 mtdblock5
[    1.556727]  (driver?)
[    1.569672] 1f06              64 mtdblock6
[    1.569675]  (driver?)
[    1.582617] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    1.598976] Rebooting in 1 seconds..

This patch fixes this issue by using parser_trx with specifying custom
magic number in dts instead of mtdsplit_trx.

log (fixed factory image):

[    1.202044] spi-mt7621 10000b00.spi: sys_freq: 193333333
[    1.225369] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.235015] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.247603] Creating 7 MTD partitions on "spi0.0":
[    1.257106] 0x000000000000-0x000000030000 : "u-boot"
[    1.269447] 0x000000030000-0x000000040000 : "u-boot-env"
[    1.281192] 0x000000040000-0x000000050000 : "factory"
[    1.294208] 0x000000050000-0x000000810000 : "firmware"
[    1.305774] 2 trx partitions found on MTD device firmware
[    1.316540] Creating 2 MTD partitions on "firmware":
[    1.326399] 0x00000000001c-0x000000214754 : "linux"
[    1.336063] mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only
[    1.357070] 0x000000214754-0x0000007c0000 : "rootfs"
[    1.366994] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    1.386368] mtd: device 5 (rootfs) set to be root filesystem
[    1.398700] 1 squashfs-split partitions found on MTD device rootfs
[    1.411027] 0x000000520000-0x0000007c0000 : "rootfs_data"
[    1.422841] 0x000000810000-0x000000fd0000 : "firmware2"
[    1.436282] 0x000000fd0000-0x000000fe0000 : "glbcfg"
[    1.447408] 0x000000fe0000-0x000000ff0000 : "board_data"
...
[    1.611216] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2022-03-06 20:40:35 +01:00
..
apm821xx apm821xx: WNDR4700: use upstream tc654 cooling devices 2022-02-19 19:34:18 +01:00
archs38 kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs 2022-03-01 22:57:40 +00:00
armvirt kernel: 5.10: consolidate mac80211 crypto options 2021-12-17 16:16:34 +01:00
at91 kernel: bump 5.10 to 5.10.103 2022-03-05 21:05:45 +01:00
ath25 ath25: drop Linux 5.4 support 2022-02-17 11:08:58 +01:00
ath79 kernel: bump 5.10 to 5.10.103 2022-03-05 21:05:45 +01:00
bcm27xx kernel: bump 5.10 to 5.10.103 2022-03-05 21:05:45 +01:00
bcm47xx bcm47xx: switch to kernel 5.10 2021-11-08 15:56:39 +01:00
bcm53xx kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
bcm63xx bcm63xx: switch to Kernel 5.10 2022-02-27 14:41:28 +01:00
bcm4908 kernel: bump 5.10 to 5.10.103 2022-03-05 21:05:45 +01:00
bmips kernel: 5.10: consolidate mac80211 crypto options 2021-12-17 16:16:34 +01:00
gemini kernel: bump 5.10 to 5.10.94 2022-02-01 23:34:07 +00:00
generic kernel: backport patch to allow using parser_trx from ramips 2022-03-06 20:40:35 +01:00
imx imx: bump SDMA firmware to v3.6 2022-01-13 09:33:29 +01:00
ipq40xx kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
ipq806x kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
kirkwood target/linux: replace egrep with grep -E 2022-02-07 00:03:27 +01:00
lantiq kernel: bump 5.10 to 5.10.101 2022-03-01 21:38:36 +01:00
layerscape kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs 2022-03-01 22:57:40 +00:00
malta kernel: 5.10: consolidate mac80211 crypto options 2021-12-17 16:16:34 +01:00
mediatek kernel: move parser_trx patches of custom magic to generic 2022-03-06 20:40:07 +01:00
mpc85xx mpc85xx: HiveAP-330: add tmp125 temperature sensor 2022-02-25 17:54:56 +01:00
mvebu kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
mxs kernel: 5.10: consolidate mac80211 crypto options 2021-12-17 16:16:34 +01:00
octeon octeon: switch to Kernel 5.10 2022-02-11 14:24:01 +01:00
octeontx octeontx: switch to 5.10 Kernel 2022-02-05 14:39:20 +01:00
omap omap: make use of 'rootfs-part' feature 2022-01-23 19:48:20 +00:00
oxnas kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs 2022-03-01 22:57:40 +00:00
pistachio kernel: bump 5.10 to 5.10.95 2022-02-01 23:34:07 +00:00
qoriq qoriq: Expand generic subtarget description 2022-01-05 10:54:59 +02:00
ramips ramips: use parser_trx for Buffalo WCR-1166DS 2022-03-06 20:40:35 +01:00
realtek kernel: bump 5.10 to 5.10.102 2022-03-01 21:38:36 +01:00
rockchip kernel: 5.10: remove CONFIG_DEVTMPFS{,_MOUNT} from kconfigs 2022-03-01 22:57:40 +00:00
sunxi kernel: bump 5.10 to 5.10.101 2022-03-01 21:38:36 +01:00
tegra kernel: 5.10: consolidate mac80211 crypto options 2021-12-17 16:16:34 +01:00
uml uml: make use of 'rootfs-part' feature 2022-01-23 19:48:31 +00:00
x86 kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
zynq kernel: 5.10: allocate last level PTEs in high memory 2022-03-01 22:57:34 +00:00
Makefile target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00