immortalwrt/target/linux
Hang Zhou e451957166 ramips: add support for D-Link Dir-853 A1
Specifications:
* SoC: MT7621AT
* RAM: 256MB (NT5CC64M16GP-DI)
* Flash: 16MB NOR SPI flash (GD25Q127CSIG, using GD25Q128C driver)
* WiFi: MT7615DN (2.4GHz+5Ghz) with DBDC
* Ethernet: 4x1000M LAN, 1x 1000M WAN
* LEDs: Power Blue+Orange,Wan Blue+Orange,WPS Blue,"2.4G"Blue, "5G" Blue,
  USB Blue
* Buttons: Reset,WPS, Wifi
* Serial interface: on board but not populated, pinout (from the DC jack
side to the WAN port side) is "3.3V Input Output Gnd". Baud rate is 57600,
settings are 8 data bits, no parity bit, one stop bit, and no flow control.

Stock flash layout:
```
GD25Q128C(c8 40180000) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K)
.numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x000000000000-0x000001000000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "Config2"
0x000000060000-0x000000fb0000 : "Kernel"
0x000000fb0000-0x000001000000 : "Private"
```
The kernel partition will be replaced with the OpenWrt image, the other
partitions are left untouched.

"Config2" seems to be the config storage used by the stock firmware.

"Private" is a 320kB empty JFFS2 partition that comes with the stock
firmware. One can get a larger space for OpenWrt by merging it with
"Kernel".

OpenWrt flash layout:
```
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000060000 : "config2_stock"
0x000000060000-0x000000fb0000 : "firmware"
0x000000fb0000-0x000001000000 : "private_stock"
```

The OpenWrt image must have 96 bytes of padding in the header.

MAC addresses on OEM firmware:
|      		| location on the flash 	| notes    	|
|------		|-----------------------	|----------	|
| lan (eth2) 	| factory + 0xe000      	| on label 	|
| wan (eth3) 	| factory + 0xe006      	|          	|
| 2.4g (rax0) 	| not on flash          	| lan + 1  	|
| 5g (ra0) 	| not on flash          	| lan + 2  	|

Mac addresses of the 2.4g and 5g interface are stored as ASCII strings in
the u-boot-env partition, but they are not used. OpenWrt calculates
Wifi Mac addresses based on the LAN Mac.

Flash and test instructions:
Flash the encrypted image (available in the OpenWrt forum) through the
stock D-Dink web interface.

1. Open the case, and solder the 4-pin header near the WAN port.
2. Connect it to a USB-UART TTL (3.3V) adapter, no need to connect VCC.
3. Open a terminal emulator (e.g. `screen /dev/ttyUSB0` on linux) with
the settings mentioned above.
4. Setup a TFTP server on your PC that can serve
`xxx-ramips-mt7621-dlink_dir-853-a1-initramfs-kernel.bin`.
5. Connect any LAN port to your PC and set a static IPv4 address to
192.168.0.101 (netmask 255.255.255.0).
6. Power on the device and keeps pressing 1 until you see the prompt.
7. Use default IP addresses and enter the file name accordingly, then hit
enter.
8. Wait until it boots to OpenWrt, the default IP address is 192.168.1.1,
you need to change your PC network adapter to use DHCP in order to access
LUCI.
9. So far, the OpenWrt runs in RAM and the flash contents are not touched.
You can try OpenWrt without having to overwrite the stock firmware, a
reboot clears all changes.
10. Optionally, backup the stock firmware (the "firmware" partition) in
Luci.
11. To permantly install OpenWrt to the device , click
on "System -> Backup/Flash Firmware" in Luci and flash
`xxx-ramips-mt7621-dlink_dir-853-a1-squashfs-sysupgrade.bin`

Known problems:
* WLAN0 defaults to 5G after a fresh installation, to enable 2.4G network,
you need to config it manually in LUCI.

* If you see jffs2 related warnings/errors after updating from the stock
web interface, you need to do a reset in LUCI. The error will be gone after
a cold reboot.

Signed-off-by: Hang Zhou <929513338qq@gmail.com>
2023-03-04 13:23:18 +01:00
..
airoha airoha: disable swconfig 2022-11-27 13:18:29 +01:00
apm821xx treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
archs38 treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
armvirt kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
at91 treewide: strip useless default n Kconfig lines 2023-02-03 12:50:15 +01:00
ath25 treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
ath79 kernel: bump 5.15 to 5.15.95 2023-02-28 04:38:13 -05:00
bcm27xx kernel: bump 5.15 to 5.15.98 2023-03-04 13:06:28 +01:00
bcm47xx kernel: bump 5.15 to 5.15.96 2023-02-28 04:38:13 -05:00
bcm53xx bcm53xx: Add D-Link DWL-8610AP board settings 2023-02-26 22:22:48 +01:00
bcm63xx bcm63xx: loader-lzma: drop unused RAMSIZE parameter 2023-03-02 20:37:56 +01:00
bcm4908 kernel: bump 5.15 to 5.15.96 2023-02-28 04:38:13 -05:00
bmips bmips: loader-lzma: drop unused RAMSIZE parameter 2023-03-02 20:37:56 +01:00
gemini gemini: add generic subtarget 2022-12-23 19:44:20 +01:00
generic generic: MIPS: Add barriers between dcache & icache flushes 2023-03-04 13:09:30 +01:00
imx cypress-nvram: consolidate NVRAM packages 2022-11-16 20:14:13 +01:00
ipq40xx ipq40xx: Linksys MR8300: fix the USB port power 2023-02-25 20:33:40 +01:00
ipq806x ipq806x: chromium: Enable kmod-ramoops by default 2023-02-18 19:58:22 +01:00
ipq807x ipq807x: don't generate factory.ubi for Buffalo WXR-5950AX12 2023-03-04 13:12:40 +01:00
kirkwood treewide: remove label = "cpu" from DSA dt-binding 2023-02-26 22:22:48 +01:00
lantiq treewide: remove label = "cpu" from DSA dt-binding 2023-02-26 22:22:48 +01:00
layerscape kernel: bump 5.15 to 5.15.96 2023-02-28 04:38:13 -05:00
malta treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
mediatek linux-firmware: add mt7986 offload firmware 2023-03-02 11:25:17 +01:00
mpc85xx mpc85xx: p2020: enable CONFIG_MAX63XX_WATCHDOG 2023-03-04 12:54:38 +01:00
mvebu kernel: bump 5.15 to 5.15.96 2023-02-28 04:38:13 -05:00
mxs mxs: switch default kernel to 5.15 2023-01-30 11:13:14 +01:00
octeon kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic config 2022-10-21 13:47:01 +02:00
octeontx octeontx: add f2fs and ext4 support 2023-02-26 22:22:48 +01:00
omap treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
oxnas treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
pistachio pistachio: Cleanup kernel configuration 2023-01-28 19:58:20 +01:00
qoriq treewide: remove label = "cpu" from DSA dt-binding 2023-02-26 22:22:48 +01:00
ramips ramips: add support for D-Link Dir-853 A1 2023-03-04 13:23:18 +01:00
realtek kernel: bump 5.15 to 5.15.96 2023-02-28 04:38:13 -05:00
rockchip treewide: update NVMEM symbols 2023-01-07 01:30:31 +01:00
sunxi sunxi: enable CONFIG_NVMEM_SYSFS 2023-02-26 22:22:48 +01:00
tegra treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
uml treewide: replace wpad-basic-wolfssl default 2023-02-04 02:35:03 +01:00
x86 kernel: bump 5.15 to 5.15.95 2023-02-28 04:38:13 -05:00
zynq zynq: remove kconfig for 5.10 2023-01-30 18:01:14 +08:00
Makefile