Skip to content

ath79: add support for D-Link DIR-842 C2#2259

Closed
programmingisart wants to merge 1 commit intoopenwrt:masterfrom
programmingisart:master
Closed

ath79: add support for D-Link DIR-842 C2#2259
programmingisart wants to merge 1 commit intoopenwrt:masterfrom
programmingisart:master

Conversation

@programmingisart
Copy link
Copy Markdown
Contributor

Hardware spec of DIR-842 C2:
SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
Switch: QCA8337N
WiFi 5.8GHz: QCA9888
WiFi 2.4Ghz: QCA9563
USB: 2.0

Flash instructions:

  1. Upgrade the factory.bin through the factory web interface or the u-boot
    failsafe interface.
    The firmware will boot up correctly for the first time.
    Do not power off the device after OpenWrt has booted. Otherwise the u-boot
    will enter failsafe mode as the checksum of the firmware has been changed.
  2. Upgrade the sysupgrade.bin in OpenWrt.
    After upgrading completes the u-boot won't complain about the firmware
    checksum and it's OK to use now.
  3. If you powered off the device before upgrading the sysupgrade.bin, just
    upgrade the factory.bin through the u-boot failsafe interface and then goto
    step 2.

Signed-off-by: Jackson Lim [email protected]

@programmingisart
Copy link
Copy Markdown
Contributor Author

The mac address printed on the label is used by LAN
eth0.1

@hanipouspilot
Copy link
Copy Markdown
Contributor

The printed on label mac normally is used on wan, unless many macs are printed.

@programmingisart
Copy link
Copy Markdown
Contributor Author

The printed on label mac normally is used on wan, unless many macs are printed.

But in the devconf partition, the mac printed on label is lan mac also.

@hanipouspilot
Copy link
Copy Markdown
Contributor

The main idea with macs is to keep stock firmware behavior. So after you flash Openwrt, macs stay the same.

@hanipouspilot
Copy link
Copy Markdown
Contributor

In many cases you can find 1 or 2 macs in flash partitions. But you need to Ethernet and two wireless macs that are produced by incrementing the "base" macs some ways. There are functions in user space scripts for that.

@programmingisart
Copy link
Copy Markdown
Contributor Author

programmingisart commented Jul 19, 2019

In many cases you can find 1 or 2 macs in flash partitions. But you need to Ethernet and two wireless macs that are produced by incrementing the "base" macs some ways. There are functions in user space scripts for that.

The devconf partition already has something like: lanmac=XX:XX:XX:XX:XX:XX,wanmac=YY:YY:YY:YY:YY:YY

So I think the mac printed on label is intended to be lanmac by d-link?
I will flash back to the stock firmware to confirm the macs are the same after flashing openwrt

@programmingisart
Copy link
Copy Markdown
Contributor Author

@blocktrron
I changed most of the things you suggested, thanks!

@programmingisart
Copy link
Copy Markdown
Contributor Author

Tested & working
LEDs
LAN/WAN ports
MAC address (same as defined in factory devconf partition)
USB port
5G wifi
2.4G wifi
Reset Button

Copy link
Copy Markdown
Member

@blocktrron blocktrron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully, the last iteration.

Thanks for you work 👍

Hardware spec of DIR-842 C2:
SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
Switch: QCA8337N
WiFi 5.8GHz: QCA9888
WiFi 2.4Ghz: QCA9563
USB: 2.0

Flash instructions:

1. Upgrade the factory.bin through the factory web interface or the u-boot
   failsafe interface.
   The firmware will boot up correctly for the first time.
   Do not power off the device after OpenWrt has booted. Otherwise the u-boot
   will enter failsafe mode as the checksum of the firmware has been changed.
2. Upgrade the sysupgrade.bin in OpenWrt.
   After upgrading completes the u-boot won't complain about the firmware
   checksum and it's OK to use now.
3. If you powered off the device before upgrading the sysupgrade.bin, just
   upgrade the factory.bin through the u-boot failsafe interface and then goto
   step 2.

Signed-off-by: Jackson Lim <[email protected]>
@programmingisart
Copy link
Copy Markdown
Contributor Author

All done, thanks!

@adschm
Copy link
Copy Markdown
Member

adschm commented Jul 22, 2019

@hanipouspilot @jackcolentern

You were disagreeing on the label MAC. Is it lan (eth0.1) or wan (eth0.2)?

@programmingisart
Copy link
Copy Markdown
Contributor Author

@adrianschmutzler It is used by eth0.1 (lan)

@programmingisart
Copy link
Copy Markdown
Contributor Author

I can confirm the LAN and WAN addresses are set exactly the same as the factory D-link firmware

@dedeckeh dedeckeh added the target/ath79 pull request/issue for ath79 target label Jul 22, 2019
@blocktrron
Copy link
Copy Markdown
Member

LGTM.

However, i would be interested where (Country) you bought this device, as i was only able to find Information about rev. C1 & C3 here (and both lack an USB port).

@hanipouspilot
Copy link
Copy Markdown
Contributor

BTW, this PR is tested and confirmed to work fine on C1 as well

Maybe it makes sense to support both devices by making a common dtsi and removing USB from C1?

@blocktrron
Copy link
Copy Markdown
Member

@jackcolentern But the device is explictly labled as C2?

Otherwise, I like the idea of @hanipouspilot but if this is not something you would like to do I'm fine going without C1 support here.

So add insult to injury, there seems to be a rev. C3 already.

@hanipouspilot
Copy link
Copy Markdown
Contributor

hanipouspilot commented Jul 22, 2019

So add insult to injury, there seems to be a rev. C3 already.

If we have the dtsi for dir-842, someone who has C3 can easily test and add it later.

@programmingisart
Copy link
Copy Markdown
Contributor Author

@blocktrron
Yes, it write "H/W Ver.: C2" on the label, it shows C2 in the original firmware as well.

How about we use this PR first, and I will try to get a C3 and find out what hardware it uses, if possible I will make a PR supporting C1 C2 C3 in one go in the future (no promise though).

@blocktrron
Copy link
Copy Markdown
Member

@blocktrron blocktrron closed this Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/ath79 pull request/issue for ath79 target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants