Porting guide ar71xx to ath79?

made it work with swapped interfaces but with forced links on wan and with that the led is always on..

regarding wmac tried the ahb patches from https://patchwork.kernel.org/project/LKML/list/?submitter=81271 on wireless-compat but no success, no device detected, maybe something is still missing or I didn't used it right in dts, mabye pcie0 needs not to be defined ?

sadly, with luci

[mktplinkfw] rootfs offset aligned to 0x1415632
[mktplinkfw] *** error: images are too big by 15211 bytes
[mktplinkfw] rootfs offset aligned to 0x1415632
[mktplinkfw] *** error: images are too big by 15211 bytes

Your wifi compatible property is broken...
"ca,qca9530-wmac" instead of "qca,qca9530-wmac"
Probably this would solve detection....

pci isn´t used for soc internal wireless and should not interfere with...

wifi node should be named as wmac but shouldn´t be important

has also noticed that kernel 4.14 is much bigger than 4.9 on my wr841v8... but for my 841´s i had bought some spi flash chips long time ago...

Yes, I didn't see it because of my eyes, but still maybe something else I'm missing

edit:
adding 1024 to squashfs solved the space problem

What patches you have exactly applied for wmac dt support?
Probably blogic would have a much clearer view on what is needed and for me i will wait for his announced support for wmac in the future...

I like your enthusiasm on porting to ath79 :slight_smile:

the latest series 1to7 but without the 6 and 7, they need some adjustments and I was caught on wired part, I also saw that some external resets are already present in the driver and no nvmem patches, but that one should give error on loading the firmware

yeah.. I'm just in a moment with very much free time

1 Like

AHB was missing in the backports for ath79
config-$(CONFIG_TARGET_ath79) += ATH9K_AHB

but that led to a data bus error followed by a panic :slight_smile:

Where did you put that line?

FYI, lots of ath79 were committed a few hours ago.
https://git.openwrt.org/?p=openwrt/openwrt.git;a=shortlog;h=75ed56a08a4ce978323259a59a8f45ceed511584

in package/kernel/mac80211/Makefile

yes those where needed for image generation, but they are not complete CONFIG_MTD_SPLIT_TPLINK_FW=y is also needed to kernel and I my case the images are generating sizes beyond flash size without warnings so they need more work

Thank you.
However I added

  • that line after config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB
  • the seven patches (I edited one of them otherwise it didn't apply)
  • the wifi part inside qca9557.dtsi and inside my dts file

These are my edited files... correct me if I am wrong:
qca9557.dtsi

			wifi: wifi@18100000 {
				compatible = "qca,qca9550-wmac";
				reg = <0x18100000 0x20000>; 

				//interrupt-parent = <&cpuintc>;
				//interrupts = <2>;
				interrupt-parent = <&intc2>;
				interrupts = <1>;

				clock-names = "ref";
				clocks = <&extosc>;

//				nvmem-cell-names = "eeprom", "address";
//				nvmem-cells = <&wmac_eeprom>, <&wmac_address>;

				//resets = <&rst 22>;
			};

I got the "reg" values from arch/mips/include/asm/mach-ath79/ar71xx_regs.h

#define AR71XX_APB_BASE		0x18000000
#define QCA955X_WMAC_BASE	(AR71XX_APB_BASE + 0x00100000)
#define QCA955X_WMAC_SIZE	0x20000

I got the "interrupt-parent" and "interrupt" inside the same qca9557.dtsi

intc2: interrupt-controller@2 {
	compatible = "qcom,qca9556-intc";

	interrupts = <2>;

	interrupt-controller;
	#interrupt-cells = <1>;

	qcom,pending-bits = <0x1f0>,	/* pcie rc1 */
						<0xf>;	/* wmac */
};

I commented the "resets" because I found a lot of reset bit inside the QCA9558 datasheet (page 217), but anything about WMAC or WIFI...

Finally inside my qca9558_wlr8100.dts

&wifi {
	status = "okay";
};

But i don't see anything different in the dmesg and I don't know what to do now...

did you verify that ahb.o exists in the backports build folder ?
at least it doesn't crash on you

There is reset register for the WLAN MAC on page 335 of the QCA9558 datasheet.

Yes I have "ahb.o" inside: \build_dir\target-mips_24kc_musl\linux-ath79_generic\backports-2017-11-01\drivers\net\wireless\ath\ath9k

I don't know how to "read" that page... For example in qca9557.dtsi there is this part:

&mdio1 {
	resets = <&rst 23>;
	reset-names = "mdio";
};

and in page 217 the 23rd bit is RESET_GE1_MDIO... but in page 335 there are just offsets

Well it looks like another reset controller is needed as the reset bit for the wlan mac is in completely different register and location.

Unless wifi is tied to the GE1 MDIO

In this case I can't help... it goes beyond my skills... I am still in the state: copy-paste-try :sweat_smile:

In this moment I have mdio1 for wan port of the switch:

&mdio1 {
        status = "okay";
		
        phy1: ethernet-phy@1 {
			reg = <1>;
			phy-mode = "sgmii";
        };
};

Can 2 interfaces be tied to the same MDIO?

I think you don't have to link it to any mdio for it to be detected

started work on 1043nd-v1 and I have a strange thing, the kernel loader will not start every time, most of the time will not work, luckily initramfs is working and can be tested but for the moment I have this

[    0.647786] Realtek RTL8366S ethernet switch driver version 0.2.2
[    0.654065] rtl8366s rtl8366s: using GPIO pins 18 (SDA) and 19 (SCK)
[    0.660568] rtl8366s rtl8366s: unknown chip id (0000)
[    0.665650] rtl8366s rtl8366s: chip detection failed, err=-19
[    0.672123] libphy: Fixed MDIO Bus: probed

and with pcie will stall at

[    0.152840] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.159282]  MEM 0x0000000010000000..0x0000000013ffffff
[    0.164545]   IO 0x0000000000000000..0x0000000000000000

edit:
used rtl8366s instead of rtl8366rb:
ar71xx

[    0.660932] Realtek RTL8366RB ethernet switch driver version 0.2.4
[    0.768849] rtl8366rb rtl8366rb: using GPIO pins 18 (SDA) and 19 (SCK)
[    0.775564] rtl8366rb rtl8366rb: RTL5937 ver. 3 chip found
[    0.985292] libphy: rtl8366rb: probed

I'll upload the dts changes

1 Like

Preliminary support for TP-Link WDR3600 / WDR4300: https://github.com/openwrt/openwrt/pull/964

i have uploaded a precompiled image for wdr3600 and wdr4300 at my pr on github.

all except wireless 2.4g is working...

if interrested please test an left feedback on this pr.

1 Like

@numero53 Is your tree with ath9k ahb patches public?
I would like to try it since I am porting ath79 to Carambola2