The TEW-810DR shares a Cameo manufactured board, identical cpu, spi and ram chips, with the D-Link DIR-810L. I was using the D-Link as a template. Thanks to @123serge123 an issue with the LEDS has been addressed.
My builds have been unstable and I have identified a difference in the mtd partitions in the DIR-810L dts. The Trendnet Flash, on the hardware page, differs from the OEM bootlog 1.0 which differs from OEM bootlog 1.1. which differs from the D-Link
The DIR-810L Version ?
The hardware page Flash Layout for the TEW-810 is inconsistent with the Boot Logs
One complicating feature is the flash is really 16mb with ~1/2 used for an emergency rescue. If Trendnets emergency partition is different than D-Links could cause problems. Should the dts be modified to match OEM out of caution? I think I understand the # cat /proc/mtd output and the dts up to mtd 6 "Wolf_Config, but the size=00080000 in MyDlink and Jffs2 mean they are overlays? What happened to RootFS and where does the 'firmware' partition fit in?
These partitioning are the same. In case of dir-810l additional mtd10 partition ("Kernel_RootFS") overlap mtd8 and mtd9 ("Kernel" and "RootFS") to simplify firmware installation. So mtd10 is equivalent to openwrt "firmware" partition.
BTW, openwrt split "firmware" partition into "rootfs" and "rootfs_data" (skipping "kernel") dynamically at boot with special mtd-parser:
[ 0.830000] 8 ofpart partitions found on MTD device spi32766.0
[ 0.840000] Creating 8 MTD partitions on "spi32766.0":
[ 0.850000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.860000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.870000] 0x000000040000-0x000000050000 : "factory"
[ 0.880000] 0x000000050000-0x000000060000 : "factory5g"
[ 0.900000] 0x000000060000-0x000000070000 : "Wolf_Config"
[ 0.910000] 0x000000070000-0x0000000f0000 : "MyDlink"
[ 0.920000] 0x0000000e0000-0x000000160000 : "Jffs2"
[ 0.930000] 0x000000170000-0x000000800000 : "firmware"
[ 0.940000] 0x00000028003e-0x000000800000 : "rootfs"
[ 0.950000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.980000] mtd: device 8 (rootfs) set to be root filesystem
[ 0.990000] mtd: partition "rootfs_data" created automatically, ofs=0x4a0000, len=0x360000
[ 1.010000] 0x0000004a0000-0x000000800000 : "rootfs_data"
Then openwrt format "rootfs_data" into jffs2 filesystem and use it as R/W overlay.
is exactly 64Mbit = 8Mbytes.
It's possible that OEM partiotions "MyDLink" and "Jffs2" are used for recovery. So openwrt don't touch its and use only "firmware" (or "Kernel_RootFS") partition.
If the file system is OK, then I need to look further on why my build failed. One thing I'm considering is that I built in the master/snapshot code pull, in part because I hoped to submit. Would you recommend building in 19.07.1 for actual hardware testing. Then migrating the code to master for submitting?
But bootlog and board/chip inspection say than flash size is 8Mbytes. So I think that it's error at wikidev.wi-cat.ru. BTW DIR-810L at the same site have 8Mbytes flash too.
To submit patches you have to use current snapshot.
I use release 19.07.1 because all my boards already supported and in release 19.07.2 mtd-parser patch was committed. But it sometimes erase partitions. The patch was reverted (by this commit).
My build on git Master still results in a boot - kernel crash loop.
0.630194] NET: Registered protocol family 17
[ 0.638963] 8021q: 802.1Q VLAN Support v1.8
[ 0.647892] of_serial 10000c00.uartlite: could not find pctldev for node /pinctrl/uartlite, deferring probe
[ 0.668720] Warning: unable to open an initial console.
[ 0.679875] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.694676] Please append a correct "root=" boot option; here are the available partitions:
[ 0.711249] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.728508] Rebooting in 1 seconds..
There was a DIR-810 commit
6b7a525a725a78ff961d91a76e4ea9fbb7066178
That adjusted the mtd partition. The *dts you provided was based on pre-commit mtd partitions
and I'm still not sure the new layout is correct
Something wrong with spi-controller. Neither spi-controller nor mtd partitioning messages exist in log. One of possible reason is spi overclocking. In current source tree I see:
As I understand you don't try spi-max-frequency workaround?
My tests to increase frequency for the same chip mx25l64 failed at 25MHz.
The results was unstable flash readings.
Just test.
The router bricked in the usual fashion. I disassembled and flashed via an 8-pin clip. This time I could not do a serial tftp to install. There was no serial output and the power led did not progress to green in the usual fashion. I think the flash chip was wiggled one too many times with the clip.
I did order 5 flash chips, on a slow boat from China, that have yet to arrive. I plan to flash one of the new chips, remove the old chip and solder the new one in.
My remaining router is also a TEW-810, but I'm not flashing it until I'm confident it won't brick.
Thanks. Fortunately, Ebay covers fake items but I will have to jump through alot of hoops.
You are covered by the eBay Money Back Guarantee if you receive an item that is not as described in the listing.
If and when it arrives, I'll open it up and look at the chips. If they look valid, will look at the serial ttl bootlog and pull the *bin from the flash chip.
I was restoring my router by flashing back the factory image and using the factory U-boot to tftp flash the OpenWRT image. Can I directly flash the OpenWRT image?
Upload the U-Boot Image from another terminal via:
# cat u-boot.asc > /dev/ttyUSB0
Watch the loading progress via the console and wait a few minutes until it boots the U-Boot file.
Interrupt booting by pressing “t” key several times.
Disconnect the R225 pin from GND. Though you can keep it there until the flashing is done.
Flash Firmware
Now we need to upload the new firmware via tftp and erase the OEM firmware via the following commands:
tftp $(loadaddr) openwrt-18.06.1-lantiq-xrx200-tplink_tdw8980-squashfs-sysupgrade.bin
# Note: If you get timeouts (T) executing this command, you probably did not set up the networking/tftpd correctly or your ethernet cable is bad.
sf erase 0x20000 0x7a0000
sf write $(loadaddr) 0x20000 0x$(filesize)
reset
For this procedure you need prepare special flash dump. Cut 0x170000 bytes of orignal dump, append openwrt sysupgrade.bin image and if needed pad upto 8 Mbytes.