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 Xiaomi Mi Router 3G support #1299

Closed
wants to merge 1 commit into from

Conversation

dissent1
Copy link
Contributor

This commit adds support for Xiaomi Mi WiFi Router 3G.

Short specification:

  • MT7621AT + MT7603EN + 7612EN
  • 256MB DDR3 RAM
  • 128MB NAND flash
  • 1+2 x 1000M Ethernet
  • 1x USB 3.0 port
  • reset button
  • yellow, blue, red leds

Installation through telnet/ssh:

  • copy lede-ramips-mt7621-mir3g-squashfs-kernel1.bin and lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin to usb disk or wget it from LEDE download site to /tmp
  • switch to /extdisks/sda1/ (if copied to USB drive) or to /tmp if wgetted from LEDE download site
  • run: mtd write lede-ramips-mt7621-mir3g-squashfs-kernel1.bin kernel1
  • run: mtd write lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin rootfs0
  • run: mtd erase kernel0
  • run: reboot

Originally stock firmware has following partitions:

  • ...
  • kernel0 (primary kernel image)
  • kernel1 (secondary kernel image, used by u-boot in failsafe routine)
  • rootfs0 (primary rootfs)
  • rootfs1 (secondary rootfs in case primary fails)
  • overlay (used as ubi overlay)

This commit squashes rootfs0, rootfs1 and overlay partitions into 1, so it can be used by LEDE fully for package installation, resulting in 117,5MiB.

This device lacks hw watchdog, so adding softdog instead (stock does the same).

@robimarko
Copy link
Contributor

This looks really similar to Xiaomi Mi router R3
https://wiki.openwrt.org/toh/xiaomi/mir3
If it is similar support for R3 also would be great

@dissent1
Copy link
Contributor Author

@robimarko actually these devices are pretty different, The twin brother to mi3 is https://wiki.openwrt.org/toh/xiaomi/mini

@robimarko
Copy link
Contributor

@dissent1 Yeah, I was pretty tired and did not check before writing.
Only difference between mini and R3 is that R3 has 128MB of NAND flash instead of 16MB

@robimarko
Copy link
Contributor

@dissent1 I am looking into your PR and I am wondering what did you do to kernel0 partition.
In DTS there is comment that you deleted kernel0 partition and renamed it to kernel_erase but it looks like you did not erase the whole partition since the original kernel0 partition ends in 0x600000 and you have deleted it until 0x400000

@dissent1
Copy link
Contributor Author

As ppl keep worrying, I'll put the answer here as well:
In DTS I've just renamed kernel0 into kernel_erase for others to remind that it should be erased with 'mtd erase kernel0' while on stock firmware.
0x400000 is the size of the partition, not an end address

@das1969
Copy link

das1969 commented Aug 19, 2017

May I ask how you got telnet/ssh access? Is this through UART?

This commit adds support for Xiaomi Mi WiFi Router 3G.

Short specification:
 - MT7621AT + MT7603EN + 7612EN
 - 256MB DDR3 RAM
 - 128MB NAND flash
 - 1+2 x 1000M Ethernet
 - 1x USB 3.0 port
 - reset button
 - yellow, blue, red leds

Installation through telnet/ssh:
- copy lede-ramips-mt7621-mir3g-squashfs-kernel1.bin and
lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin to usb disk or wget it
from LEDE download site to /tmp
- switch to /extdisks/sda1/ (if copied to USB drive) or to /tmp if
wgetted from LEDE download site
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-kernel1.bin kernel1
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin rootfs0
- run: mtd erase kernel0
- run: reboot

Originally stock firmware has following partitions:
 - ...
 - kernel0 (primary kernel image)
 - kernel1 (secondary kernel image, used by u-boot in failsafe routine)
 - rootfs0 (primary rootfs)
 - rootfs1 (secondary rootfs in case primary fails)
 - overlay (used as ubi overlay)

This commit squashes rootfs0, rootfs1 and overlay partitions into 1, so
it can be used by LEDE fully for package installation, resulting in 117,5MiB.

This device lacks hw watchdog, so adding softdog instead (stock does the same).

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
@dissent1
Copy link
Contributor Author

dissent1 commented Aug 19, 2017

Changed wifi nodes - added specific vendor,device ids instead of plain pci device.
dissent1@4094632

May I ask how you got telnet/ssh access? Is this through UART?

Yes, ath this moment using UART only, but dev firmware that grants ssh access should be out soon.

@pepe2k pepe2k added the ramips label Aug 20, 2017
@blogic
Copy link
Contributor

blogic commented Aug 23, 2017

merged, Thanks !

@blogic blogic closed this Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants