Found some more time to dig this device back out, rebuilt the image from staging-nbd
and looked at the images generated... Turns out, the factory image can actually be flashed via recovery bootloader, and depending on the current active partition, this will be written either to the correct (first) or wrong (second) partition. This can only be observed on the serial console: When the bootloader writes the image to 0x02C80000 (firmware2)
, there will be a bootloop caused by kernel panic, since rootfs (ubi
) could not be mounted, which is declared in dts
to be located within the first firmware partition at 0x00180000
.
Curiously, the factory image does even not use the same FIT header (0xD00DFEED
) as the d-link image, but just a regular 0x27051956
header, which is also still understood by uboot.
So basically, without opening the case, it currently just needs multiple flashing attempts of the factory image via the bootloader recovery Web UI, until it happens to be written to the correct partition. After that, I have not yet observed any regression, i.e. bootloader switching back to the other partition after some failed boot etc.
But in the long term, we should find a solution for dual boot, since this seems to apply to the vast majority of mt7621 devices with NAND these days. I thought about placing an OKLI loader etc. to the second partition, just to make sure the bootloader would not accidentally try to boot the wrong image (which might even be the factory one) after an unexpected reboot / power loss during boot / etc.
But the OEM Web updater obviously just writes to one partition, so we couldn't write that loader during the initial flashign procedure. Thus, upon first boot, there should be a script detecting the position in flash, where the image was written, and then place an OKLI loader etc. to the other partition? Or copy itself to the first partition first - this way we could leave the loader as a gap, and reuse the remaining flash area of the second firmware partition by utilizing mtd-concat
.
In any case, the wifi of the two MT7915 was not yet working when trying to configure from LuCI, though it should be considered that mt76
is under heavy development regarding these chips, and updating the driver to the latest trunk might already solve it.