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

Thanks, but I cant find "boot" in kernel_menuconfig

BOOT OPTIONS >
      Support for the traditional ATAGS boot data passing [*]
      Supplement the appended DTB with traditional ATAG information [*]
              Kernel command line type > Extend with bootloader kernel arguments [*]

Thanks, but i cant find BOOT OPTIONS

Only

General setop
Machine selection
Openwrt specific image command line hack
Endianness selection (Big endian)
CPU selection
Kernel type
Bus options(PCI, PCMCIA, EISA, ISA, TC)
Power management options
CPU Power Management
Firmware Drivers
Virtualization
General architecture-dependent options
Enable loadable menu support
Enable the block layer
Executable file format
Networking support
Device Drivers
File systems
Security options
Cryptographic API
Library routines
Kernel hacking

I found the problem!

Turns out that I didnt enable seama firmware parser in the kernel,

go to kernek_menuconfig -> Memory Tree and Open Firmware support -> Openwrt specific MTD options-> select Seama firmware parser. And it boots!!!!

Thanks for your help!

But i have one more question.
The original firmware boots from 9f080040, but my openwrt build boots from 9f080000.
So I need to use bootm 9f080000 command to make openwrt boots.

Is there anyway I can make openwrt boots from 9f080040 also?

Thanks in advance

1 Like

target/linux/???

I based it on /target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts

because of this thread Support for DIR-842 rev: C1

1 Like

Will look into that.... jeff will probably help out if he drops by...

it is possible that you need to add some header magic when the buildroot generates the IMAGE... so your uboot actually copies to 0000 but the kernel itself starts at 0040.....

Boot your initramfs.... make full backups.... then hexdump -C | more your ( OEM ) kernel mtd part to see what the first 40 looks like.....

Be careful.... this is around the place where peeps start blasting critical data!

1 Like

Thanks very much for you help! Just another additional question , is

pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] 

normal? Because it seems like openwrt cant detect the wireless device

This is normal. It can be fixed by loading firmware.

Thanks, by loading firmware you mean loading wireless chip firmware?

You'll need to add your device to the 11-ath10k-caldata. It will load firmware from art to a file in /lib/firmware. Also mac should be patched,

Thanks, i added it but unfortunately

[   50.167509] ath10k 4.19 driver, optimized for CT firmware, probing pci device: 0x56.
[   50.177098] ath10k_pci 0000:00:00.0: enabling device (0000 -> 0002)
[   50.183862] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[   50.477587] firmware ath10k!fwcfg-pci-0000:00:00.0.txt: firmware_loading_store: map pages failed
[   50.666933] firmware ath10k!pre-cal-pci-0000:00:00.0.bin: firmware_loading_store: map pages failed
[   51.160531] firmware ath10k!QCA9888!hw2.0!ct-firmware-5.bin: firmware_loading_store: map pages failed
[   51.345585] firmware ath10k!QCA9888!hw2.0!ct-firmware-2.bin: firmware_loading_store: map pages failed
[   51.531209] firmware ath10k!QCA9888!hw2.0!firmware-6.bin: firmware_loading_store: map pages failed
[   51.720606] firmware ath10k!QCA9888!hw2.0!firmware-5.bin: firmware_loading_store: map pages failed
[   51.905955] firmware ath10k!QCA9888!hw2.0!firmware-4.bin: firmware_loading_store: map pages failed
[   52.095937] firmware ath10k!QCA9888!hw2.0!firmware-3.bin: firmware_loading_store: map pages failed
[   52.280802] firmware ath10k!QCA9888!hw2.0!firmware-2.bin: firmware_loading_store: map pages failed
[   52.290310] ath10k_pci 0000:00:00.0: Failed to find firmware-N.bin (N between 2 and 6) from ath10k/QCA9888/hw2.0: -11
[   52.301302] ath10k_pci 0000:00:00.0: could not fetch firmware files (-11)
[   52.308318] ath10k_pci 0000:00:00.0: could not probe fw (-11)
[   52.464835] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[   52.475487] ath9k 18100000.wmac: Falling back to syfs fallback for: ath9k-eeprom-ahb-18100000.wmac.bin
[   52.593507] firmware ath9k-eeprom-ahb-18100000.wmac.bin: firmware_loading_store: map pages failed
[   52.603378] ath: phy1: Unable to load EEPROM file ath9k-eeprom-ahb-18100000.wmac.bin
[   52.611441] ath9k 18100000.wmac: failed to initialize device
[   52.617352] ath9k: probe of 18100000.wmac failed with error -22

What exactly did you add there?

in 11-ath10k-caldata i added

....

ath10kcal_extract "art" 20480 2116
		ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0) -1)
		;;
	dlink,dir-859-a1|\
	dlink,dir-842-c2)
		ath10kcal_extract "art" 20480 2116
		ath10kcal_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
		;;
	elecom,wrc-1750ghbk2-i)
		ath10kcal_extract "art" 20480 2116

...

I added dlink,dir-842-c2) after dlink,dir-859-a1|
Thanks for your help!

I am not sure it is correct and why ath9k is there as well?

The switch chip is a QCA8337N, so the driver is ath9k

You need to check where caldata is really located, where mac addresses are located and set it up respectively. Not just copy lines from another device.

Oops, silly me, I forgot to include the firmware in make menuconfig

no wonder it cannot load....

I am sure the firmware is in /lib/firmware , but for some reason it cant load

[   48.918029] firmware ath10k!fwcfg-pci-0000:00:00.0.txt: firmware_loading_store: map pages failed
[   49.108017] firmware ath10k!pre-cal-pci-0000:00:00.0.bin: firmware_loading_store: map pages failed
[   49.601961] firmware ath10k!QCA9888!hw2.0!ct-firmware-5.bin: firmware_loading_store: map pages failed
[   49.786043] firmware ath10k!QCA9888!hw2.0!ct-firmware-2.bin: firmware_loading_store: map pages failed
[   49.970148] firmware ath10k!QCA9888!hw2.0!firmware-6.bin: firmware_loading_store: map pages failed
[   50.789565] ath10k_pci 0000:00:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
[   50.799136] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   50.819169] ath10k_pci 0000:00:00.0: firmware ver 10.4b-ct-9888-fW-012-e8020273 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 d41e2174
[   51.136959] ath10k_pci 0000:00:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0056,subsystem-vendor=0000,subsystem-device=0000 from ath10k/QCA9888/hw2.0/board-2.bin
[   51.246320] firmware ath10k!QCA9888!hw2.0!board.bin: firmware_loading_store: map pages failed
[   51.255340] ath10k_pci 0000:00:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9888/hw2.0
[   51.265073] ath10k_pci 0000:00:00.0: failed to fetch board file: -11
[   51.271860] ath10k_pci 0000:00:00.0: could not probe fw (-11)

Thanks

Is board-2.bin there?