D-Link DIR-1260 Support

Thanks for the tip! I do have the A1 version.

I took a look at the boot log and compared to the dts for the DIR-xx60 and it looks like it lines up but perhaps you could assist me in confirming or denying my assumption that some of the 'interspersed' partitions that the uboot log mentions (rootfs in particular as well as the All entry that exist in the middle of other partitions) won't disrupt the actual operation if not explicitly mentioned in the dts?

Unless I am looking in the wrong place?

I'll see if I can't figure out how to give the initramfs w/ RAM only via uBoot a shot.

Thanks again!

The logs I'm seeing in case its helpful in to anyone in the future:


[    2.524000] Creating 10 MTD partitions on "MT7621-NAND":
[    2.536000] 0x000000000000-0x000007f80000 : "ALL"
[    2.576000] 0x000000000000-0x000000080000 : "Bootloader"
[    2.588000] 0x000000080000-0x000000100000 : "Config"
[    2.600000] 0x000000100000-0x000000140000 : "Factory"
[    2.612000] 0x000000140000-0x000000180000 : "Config2"
[    2.624000] 0x000000180000-0x000002980000 : "firmware"
[    2.648000] 0x00000045fb99-0x000002980000 : "rootfs"
[    2.656000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    2.704000] mtd: partition "rootfs_data" created automatically, ofs=0xee0000, len=0x1aa0000
[    2.720000] 0x000000ee0000-0x000002980000 : "rootfs_data"
[    2.740000] 0x000002980000-0x000004980000 : "Private"
[    2.756000] 0x000004980000-0x000007180000 : "firmware2"
[    2.780000] 0x000007180000-0x000007780000 : "mydlink"
[    2.792000] 0x000007780000-0x000008080000 : "Reserved"
[    2.800000] mtd: partition "Reserved" extends beyond the end of device "MT7621-NAND" -- size truncated to 0x800000

And relevant DIR-xx60 dts snippet

&nand {
	status = "okay";

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

		partition@0 {
			label = "Bootloader";
			reg = <0x0 0x80000>;
			read-only;
		};

		partition@80000 {
			label = "config";
			reg = <0x80000 0x80000>;
			read-only;
		};

		factory: partition@100000 {
			label = "factory";
			reg = <0x100000 0x40000>;
			read-only;
		};

		partition@140000 {
			label = "config2";
			reg = <0x140000 0x40000>;
			read-only;
		};

		partition@180000 {
			label = "firmware";
			compatible = "sge,uimage";
			reg = <0x180000 0x2800000>;
		};

		partition@2980000 {
			label = "private";
			reg = <0x2980000 0x2000000>;
			read-only;
		};

		partition@4980000 {
			label = "firmware2";
			compatible = "sge,uimage";
			reg = <0x4980000 0x2800000>;
		};

		partition@7180000 {
			label = "mydlink";
			reg = <0x7180000 0x600000>;
			read-only;
		};

		partition@7780000 {
			label = "reserved";
			reg = <0x7780000 0x880000>;
			read-only;
		};
	};
};

Thanks! I'm going to take some time to figure out how to run that. Is there anything in particular that you know would be exceptionally helpful from the fw dump once I get it downloaded?

look's the same
you should be able via the serial console in uboot
to run the initramfs image in ram for say DIR-1960-A1 via tftp
this should run and allow you to save all the MTD's
and the current unencrypted firmware
this image should mostly work as a test
but you will then have to sort out the led's & button assignments
and make a DTS with the DIR-1260's ID etc

Edit 2: I'm a big dumb dumb - ignore all below. I was loading to the wrong address (needed 0x84000000) and it all worked. Thanks again for the help.

Edit: I'm going to edit this because I almost immediately after posting spotted an error in the logs after the bootm command (sorry):

Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

If it is clear that I did something wrong in my steps below I'd appreciate any additional guidance to get me back on path, otherwise I'll be googling my way through that error above.

Original:

Thanks for the help with this, could you assist me a little further in understanding what I should be expecting or seeing happen with the initramfs:

Here is what I have been doing:

  1. I built openwrt-ramips-mt7621-dlink_dir-1960-a1-initramfs-kernel.bin and put it on the tftp server plugged into the router.
  2. Boot into u boot
  3. set serverip 192.168.0.10
  4. tftpboot 0x8000 openwrt-ramips-mt7621-dlink_dir-1960-a1-initramfs-kernel.bin
  5. (console outputs)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##############################################################
done
Bytes transferred = 5637201 (560451 hex)
LoadAddr=8000 NetBootFileXferSize= 00560451
  1. bootm 0x8000

From this point it boots up and runs completely as it normally does. The serial console gives me the same prompt / login as before (dlinkrouter77 login:, i.e) and the usual D-Link web interface is accessible through the previously configured SSID

My question then is: is this considered a successful test and I properly loaded that initramfs and now just need to figure out the GPIO led/button situation?

Or was I supposed to see some different behavior and I have made some errors in my execution?

Thanks a million for everything so far, this has been very helpful (and fun).

you could have just used the normal per compiled initramfs image btw

it should have booted the openwrt image
and you should have been able to login to
i would have expected it to run or crash
maybe it's crashing & then booting as normal

maybe try the initramfs image from 21.02.3
https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/openwrt-21.02.3-ramips-mt7621-dlink_dir-1960-a1-initramfs-kernel.bin

Thanks Lucky! It is working now booted into the 1960 initramfs.

from there save all you MTD'S
System > Backup / Flah Firmware > Save mtdblock contents

you should have a backup of the OEM firmware unencrypted in one of the files
you can now see what works & not
radio's may just work
led's and buttons are usually mapped different tho
but you could start to make it's own firmware

Is that from a web interface or is that a console command I can run?

I am able to ping to the 192.168.1.1 from a device connected to one of the ethernet ports, and through the serial interface I can get wan connection from the router (e.g. I can ping google.com).

Not able to load 192.168.1.1 in a browser window though might not have remembered to build with that package

you do need luci to do that just use linked file above

Thanks for the help! Everything is going well so far.

The radios work when I manually select the wireless driver kernel modules in menuconfig. When it comes to adding support files for this device, will I only need to update the mt7621.mk file with those modules for the device to be properly supported with regards to the radios?

e.g.

  DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware \
  uboot-envtools kmod-mt7603 kmod-mt7663u kmod-mt7663-firmware-ap

Many thanks

this is an old "maybe out of date "example of what you will need to do
should start you off anyway

1 Like

Looks like I've got about everything working - the only thing left that is giving me grief is the LED for the 5GHz radio... it seems that both radios have the led wired direct to them and should be accessible through the firmware but I can only get the 2.4G led to cooperate.

2.4G radio chipset is MT7603 while 5G is MT7613. I thought maybe it was the driver/firmware though I've tried both kmod-m7633u & s to no avail. I can't seem to flip it on manually by running the script from the wiki to run over all the gpio pins either.

I can set mt76-phy0 manually through Luci but m76-phy1 doesn't trigger.

MT7613 could be working after adding these 2 packages: kmod-mt7615, kmod-mt7663-firmware-ap

If you can't find and led for 5G, maybe patch like this https://github.com/openwrt/mt76/pull/651/commits/cdff2574bb9b184442f5b20b9b14e59197f5e2ce could be solution.

1 Like

it sounds good you got most of it going
it maybe the MT7613 still needs work
you could ask over here

I think lukasz92 may have it there

1 Like

Thanks! The radio is working fine with those packages.

The LED appears to be a muxed pin that is controlled in some firmware specific to the device. I'd probably have to track down the address of the register used in this hardware configuration and update that patch to this device, if I'm understanding that correctly

1 Like

this was the chat from when they got added to the 7615's

1 Like

This thread hasn't bee updated for quite some time, I just wanted how's the progress?

I'm willing to continue development of openwrt for this model, and I'd really appreciate if you guys could pass over the current progress on GitHub.

HI SGproo
everything I have is out there
but i don't have this model myself so not much I can do
I imagine it's ll the same as the to others just ID change & new led mapping