Support for D-Link DIR-842 (Rev C2)

Thanks! So if I understand correctly, I I have the right file installed, I can get better signal / batter throughput?, but I only have a phone to test it, it the result accurate enough?

I tried append-uImage-fakehdr , it stuck at:

bootm 9f080040
## Booting image at 9f080040 ...
   Image Name:   OpenWrt fake multi
   Created:      2019-07-15  13:20:00 UTC
   Image Type:   MIPS Linux Multi-File Image (uncompressed)
   Data Size:    0 Bytes =  0 kB
   Load Address: 00000000
   Entry Point:  00000000
   Contents:
   Image 0: 1828716672 Bytes = 1744 MB
   Image 1:  6596696 Bytes =  6.3 MB
   Verifying Checksum at 0x9f080080 ...OK

I also modified the script to set custom load address and entry point, no luck

## Booting image at 9f080040 ...
   Image Name:   OpenWrt fake multi
   Created:      2019-07-15  13:20:00 UTC
   Image Type:   MIPS Linux Multi-File Image (uncompressed)
   Data Size:    0 Bytes =  0 kB
   Load Address: 9f080000
   Entry Point:  9f080000
   Contents:
   Image 0: 1828716672 Bytes = 1744 MB
   Image 1:  6596696 Bytes =  6.3 MB
   Verifying Checksum at 0x9f080080 ...OK

Fixed it!

Didnt realize that there is uImage lzma function built in.....
I should read the script more carefully next time......

## Booting image at 9f080040 ...
   Image Name:   MIPS OpenWrt Linux-4.14.132
   Created:      2019-07-15  13:20:00 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1699803 Bytes =  1.6 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f080080 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...


3 Likes

Hi, now I am trying to get the USB working, I installed

kmod-phy-ath79-usb 
kmod-usb-core 
kmod-usb-ehci
kmod-usb2

I can see that the USB core initializing during boot.

root@OpenWrt:~# dmesg | grep usb
[    3.819823] usbcore: registered new interface driver usbfs
[    3.825618] usbcore: registered new interface driver hub
[    3.831214] usbcore: registered new device driver usb

But when I plug any usb device into the port, the device gets power but nothing appears on dmesg . Any chance that the USB has a on-off switch controlled by GPIO?

lsusb returns unable to initialize libusb: -99
I see no usb controller present in lspci

1 Like

What kind of devices are you trying. You need more modules for e.g. disk drives, modems, etc.

I am plugging in a USB harddrive, but I think the problem I am facing is the USB controller not detected by openwrt
unable to initialize libusb: -99

1 Like

There is no lsusb by default in Openwrt. For USB harddrives you need a lot more modules.

Install usbutils for lsusb

2 Likes

Your log showed that the USB driver is registered but the device is not initialized. Did you define USB in dts?
I've no experience in ath79 but I have the same router model.

You can probably refer this dts for USB definition:

2 Likes

https://openwrt.org/docs/guide-user/storage/usb-drives

1 Like

defining usb in dts file fixed it, thanks!

3 Likes

The problem is that you never published your dts file. Maybe it's time for PR? Some other fixes may appear.

Or at least a branch on your GitHub or other site. PRs can be pretty brutal on unreviewed code.

I think everything is 99% OK now. PRs are well reviewed now.

Sure, I am putting it on github, I am not very familiar with git so please give me 30 minutes to do it, thanks!

git push github-remote-name local-branch-name:remote-branch-name

is helpful. At least for me, not calling the branch master is helpful.

Here is it:

gpio-export is deprecated -- what are you trying to accomplish here?

	gpio-export {
		compatible = "gpio-export";
		#size-cells = <0>;

 		gpio_switch_reset {
			gpio-export,name = "dir-842-c2:reset:switch";
			gpio-export,output = <1>;
			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
		};
	};
};

gpio-hog is a supported choice for pulling a "random" line up or down at kernel start.

This is the code I copied from dir-859 dts file

I think this is to make the reset key work so I leave it in, unfortunately I dont know what it does also...

Running sysupgrade after factory is wrong. If it is required, then your factory image is wrong.

1 Like

Check behavior with it removed. If still required, change to gpio-hog.