Support for DIR-842 rev: C1

I'd say it's close to 90% compatible with this device.

cat ./target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts | grep -A11 partition

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "bootloader";
				reg = <0x000000 0x40000>;
				read-only;
			};

			partition@40000 {
				label = "bdcfg";
				reg = <0x040000 0x10000>;
				read-only;
			};

			partition@50000 {
				label = "devdata";
				reg = <0x050000 0x10000>;
				read-only;
			};

			partition@60000 {
				label = "devconf";
				reg = <0x060000 0x10000>;
				read-only;
			};

			partition@70000 {
				compatible = "seama";
				label = "firmware";
				reg = <0x070000 0xf80000>;
			};

			art: partition@ff0000 {
				label = "art";
				reg = <0xff0000 0x010000>;
				read-only;
			};


cat ./target/linux/ath79/image/generic.mk | grep -A7 dir-859-a1 | head -n 9

define Device/dlink_dir-859-a1
  $(Device/seama)
  ATH_SOC := qca9563
  DEVICE_TITLE := D-LINK DIR-859 A1
  IMAGE_SIZE := 15872k
  DEVICE_PACKAGES :=  kmod-usb-core kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct
--
  SUPPORTED_DEVICES += dir-859-a1
endef

TEST being the operable word.... Without an initramfs recipe and / or a way to boot from tftp / usb .... Physical access and someone who knows seama / dlink firmware idiosyncrasies would be advisable.

Glad to hear this, but if I understood right: testing is not done by "cooking" bin's and flashing them in emergency/recovery mode (which accepts "any" firmware)? There shouldn't be a need for tftp.

Look, dir-859 works flashing openwrt in emergency mode straight away: D-Link DIR-859 A3 AC1750 works with DIR-869 A1 image

Essentially what else would we need?

Sorry if I appear too simple, but: take openwrt from dir-859 (edit: 869 also similar, all revisions?), put qca9888 driver and the hw addresses found in bootlog. And done. It should just work, isn't it?

When modifying hardware, routers, computer systems. It's prudent to base actions on could. Not should.

One "should" ask oneself;

  1. What do I need to do ( we have now pretty much cleared that up... barring some seama / boot trick schemantics )

  2. How am I going to do it. You've addressed the software creation side of this.... Can you go into more detail on applying test firmware.

  3. What can go wrong, and what am I going to do if/when it does. What are your plans?

This is where my limited knowledge and availability of tools ends. Advanced software and hardware is something that I won't be able to help with. I can learn and acquire them, but it takes time and money.

However I am perfectly willing to:

  1. Try and find someone to do a hexdump on the memory, in the process desoldering it and destroying the router.
  2. Mail it in Europe (or even somewhere else not too far away from Romania) via post service, it's dirt cheap.
  3. Risk bricking the device with even the most poorly built firmware, with the poorest of boot tricks stuck-together.

:slight_smile:

I was kind of hoping you'd say that......

Hi all,

I try to flash the router using this fw via recovery mode
https://downloads.openwrt.org/snapshots/targets/ath79/generic/openwrt-ath79-generic-dlink_dir-859-a1-squashfs-factory.bin

not working, the router stuck in recovery mode.
I need to reflash it again using dlink fw

Regards
Ari

Some relevant info in this thread... Please don't spam it with C1 stuff. Anyone with the skills may be interested in perusing or testing the PR.

The C2 support has been merged into master. That image should work on C1 as well.
If someone is ready to test, it is quite easy to add official C1 support.

Pull request to support C1 is here:

C2 image works perfectly on C1

2 Likes

Why don't you disable USBfor c1 in dts?

Mainly because the USB on C1 can be modded with some soldering skills. So people wont have to recompile the image if they have a modded C1, they just have to install kmod-usb2

1 Like

This is not the way it is normally done. Those who can solder USB can also build an image with modified dts.
Otherwise I don't see a reason of having a separate image for c1. We could have one for both c1 and c2 since the only diff is the USB.

1 Like

Also soldering people can simply install C2 image.

Today I got my hands on a C3 (or maybe C3EU). I created Support for D-Link DIR842 (Rev C3) - Maybe EU version? for the discussion.

Has anyone actually confirmed that GPIO 15 is correct for the power / status LED ?
I'm just wondering why it's constantly on during boot, rather than showing the typical OpenWRT flash pattern to allow for entering failsafe mode.

Also I noticed that 2.4 GHz wifi will use the label mac in OpenWRT (i.e. the same as for LAN), rather than the WAN mac as the stock firmware would do. Is this intended behaviour so that wifi would use the same MAC as LAN?

1 Like

Is anyone willing to share a backup of an ART partition for the C1 with me? Mine doesn't seem to have any ath10k data.

your device seems to have art partition stored in another partition.

It seems like we have two kinds of dir-842, they store art in different partition

I think I answered my own question in this thread: Support for D-Link DIR842 (Rev C3) - #77 by augs

The version I have seems to load boarddata from the firmware image provided by dlink, not from the art partition. I've got mine mostly working by commenting out the caldata_extract line for this model in /etc/hotplug.d/firmware/11-ath10k-caldata and copying boardData_2_0_QCA9888_5G_Y9582.bin from the vendor firmware to /lib/firmware/ath10k/pre-cal-pci-0000:00:00.0.bin

I spent about 20 minutes reverse engineering qca_ol.ko, but didn't make it far enough to understand what the offset in the structure was for the ID it was mapping in ol_ath_softc_net80211 (this changes based on various compile time flags). Someone who is more familiar with qsdk could probably figure out the image selection fairly quickly.

I'm also not sure what the stance is from openwrt of including boarddata from the vendor directly in the openwrt source tree and what the copyright implications are.

Do you have a ttl adapter to do a cat /proc/mtd ?

I am interested in what the partition layout are, it seems like the partition layout is different

If I understand correctly boardData_2_0_QCA9888_5G_Y9582.bin is different from the calibration data.

boardData_2_0_QCA9888_5G_Y9582.bin is a board file while the data in art partition is the calibration data.

I suspect that the DIR842 you got stores the calibration file in other location (or the partition layout is different)