Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ramips] Add support for D-Link Dir 853 A1 #12053

Closed

Conversation

rikka0w0
Copy link
Contributor

@rikka0w0 rikka0w0 commented Feb 22, 2023

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 is "3.3V Input Output Gnd". Settings are 57600 8N1.

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.

Flash and test instructions:

  1. Open the case, and solder the 4-pin header near the WAN port.
  2. Connect it to a USB-UART TTL adapter, no need to connect VCC.
  3. Open a terminal emulator on your PC using 57600 baud, 8 data bits, no parity bit, one stop bit, and no flow control.
  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 configure a static IPv4 address: 192.168.0.101 (netmask 255.255.255.0) for your interface.
  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. To write OpenWrt to the device permantly, 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.
  • Not sure if update via the stock web interface works or not

Credits to Kar200 and Lucky1 who gave me plenty of help.

Prebuild firmwares:
dir-853-a1.zip

@github-actions github-actions bot added target/ramips pull request/issue for ramips target release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release labels Feb 22, 2023
@csharper2005
Copy link
Contributor

  1. First of all, you need to add device support to the master branch, not openwrt-22.03
  2. Your commit message is empty
  3. Check your commit titles naming convention
  4. Why do you need 2 commits? 1 should be enough :)

I would suggest to read these guides:

@rikka0w0
Copy link
Contributor Author

This PR has been reformatted:
#12087

@rikka0w0 rikka0w0 closed this Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/22.03 pull request/issue targeted (also) for OpenWrt 22.03 release target/ramips pull request/issue for ramips target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants