Message ID | efe912ca-9c98-b3c2-e96c-47b8811e8626@gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Series | ath79 porting of NEtgear R6100 | expand |
On 2021-08-16 17:24, Enrico Mioso wrote: > Hello all!! > > It's me, again trying to port a device to ath79. And guess where I am > stuck ... in the Ethernet part and switch configuration. :) > > The device runs ar71xx, I have the io package installed. > > I can get replies from the device, but ping doesn't see them (only > tcpdump), which means something in the timing or data is wrong. > > The system is otherwise able to boot. > Can you help, maybe poiting me where I can look? > At the moment I have no UART access to the system, so I was trying to > debug things in ar71xx and take inspiration looking at the DTS files > around. > My guess is that you forgot the switch config, or DSA support. Look at similar devices. I guess you need some trial and error. Otherwise, DSA support. Look at other ath79 DSA porting efforts: https://github.com/openwrt/openwrt/pull/4036 I see eth0 and eth1 in the bootlog, so that's a good thing.
Hello all!! Well, sorry, I've been unclear about the fact that this dmesg comes from ar71x. Thanks Paul for the the hints. I tried looking at similar devices, like the hiveap-121, but s far I had no luck. And so decided it would be best to follow a more "technical" pproach. Trials and errors worked well in other cases but I guess this time they may not. Side note: recovery ath79 image is accepted via tftp. On Mon, 16 Aug 2021, Paul D wrote: > Date: Mon, 16 Aug 2021 23:16:54 > From: Paul D <newtwen@gmail.com> > To: openwrt-devel@lists.openwrt.org > Subject: Re: ath79 porting of NEtgear R6100 > > > > On 2021-08-16 17:24, Enrico Mioso wrote: >> Hello all!! >> >> It's me, again trying to port a device to ath79. And guess where I am stuck >> ... in the Ethernet part and switch configuration. :) >> >> The device runs ar71xx, I have the io package installed. >> >> I can get replies from the device, but ping doesn't see them (only >> tcpdump), which means something in the timing or data is wrong. >> >> The system is otherwise able to boot. >> Can you help, maybe poiting me where I can look? >> At the moment I have no UART access to the system, so I was trying to debug >> things in ar71xx and take inspiration looking at the DTS files around. >> > > My guess is that you forgot the switch config, or DSA support. > > Look at similar devices. I guess you need some trial and error. > > > Otherwise, DSA support. Look at other ath79 DSA porting efforts: > > https://github.com/openwrt/openwrt/pull/4036 > > > I see eth0 and eth1 in the bootlog, so that's a good thing. > > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel >
In my (admittedly limited) experience, there are sometimes multiple ways of accessing the same hardware. So while what you have works, it might need refinement, or changing completely. It might require reading data-sheets of the chips your board has. e.g. https://datasheetspdf.com/pdf-file/825113/Atheros/AR9344/1 In the first few pages, I see that accessing ethX is done via: MII, RMII, RGMII. Page 61 has a nice overview. So you may need to stare and compare with existing devices to see how they did it. Not everything will make sense... On 2021-08-17 08:47, Enrico Mioso wrote: > Hello all!! > > Well, sorry, I've been unclear about the fact that this dmesg comes from > ar71x. > > Thanks Paul for the the hints. I tried looking at similar devices, like > the hiveap-121, but s far I had no luck. And so decided it would be best > to follow a more "technical" pproach. > Trials and errors worked well in other cases but I guess this time they > may not. > > Side note: recovery ath79 image is accepted via tftp. > > > > On Mon, 16 Aug 2021, Paul D wrote: > >> Date: Mon, 16 Aug 2021 23:16:54 >> From: Paul D <newtwen@gmail.com> >> To: openwrt-devel@lists.openwrt.org >> Subject: Re: ath79 porting of NEtgear R6100 >> >> >> >> On 2021-08-16 17:24, Enrico Mioso wrote: >>> Hello all!! >>> >>> It's me, again trying to port a device to ath79. And guess where I am >>> stuck ... in the Ethernet part and switch configuration. :) >>> >>> The device runs ar71xx, I have the io package installed. >>> >>> I can get replies from the device, but ping doesn't see them (only >>> tcpdump), which means something in the timing or data is wrong. >>> >>> The system is otherwise able to boot. >>> Can you help, maybe poiting me where I can look? >>> At the moment I have no UART access to the system, so I was trying to >>> debug things in ar71xx and take inspiration looking at the DTS files >>> around. >>> >> >> My guess is that you forgot the switch config, or DSA support. >> >> Look at similar devices. I guess you need some trial and error. >> >> >> Otherwise, DSA support. Look at other ath79 DSA porting efforts: >> >> https://github.com/openwrt/openwrt/pull/4036 >> >> >> I see eth0 and eth1 in the bootlog, so that's a good thing. >> >> _______________________________________________ >> openwrt-devel mailing list >> openwrt-devel@lists.openwrt.org >> https://lists.openwrt.org/mailman/listinfo/openwrt-devel >>
diff --git a/target/linux/ath79/dts/ar9344_netgear_r6100.dts b/target/linux/ath79/dts/ar9344_netgear_r6100.dts new file mode 100644 index 0000000000..15164d991a --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_r6100.dts @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: GPL-2.0-only + +// Open questions: +// I see clock-frequency = <40000000>; in the &ref node. +// Where does the code use it? Function ar934x_clocks_init in arch/mips/ath79/clock.c seems to be able to read this information via ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP) + +#include "ar9344.dtsi" + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + phy-mode = "rgmii"; + pll-data = <0x06000000 0x00000101 0x00001616>; + + //mac addr??//mac addr incr/decr? +}; + +ð1 { + //mac addr? + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +&nand { + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "caldata"; + reg = <0x20000 0x40000>; + read-only; + }; + + partition@60000 { + label = "caldata-backup"; + reg = <0x60000 0x40000>; + read-only; + }; + + partition@a0000 { + label = "config"; + reg = <0xa0000 0x80000>; + read-only; + }; + + partition@120000 { + label = "pot"; + reg = <0x120000 0x80000>; + read-only; + }; + + partition@1a0000 { + label = "kernel"; + reg = <0x1a0000 0x200000>; + }; + + partition@3a0000 { + label = "ubi"; + reg = <0x3a0000 0x7760000>; + }; + + firmware@1a0000 { + label = "firmware"; + reg = <0x1a0000 0x1900000>; + }; + }; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 20cb2f60fa..a3a738b2b1 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -170,6 +170,16 @@ define Device/netgear_ath79_nand UBINIZE_OPTS := -E 5 endef +define Device/netgear_r6100 + SOC := ar9344 + DEVICE_MODEL := R6100 + UIMAGE_MAGIC := 0x36303030 + NETGEAR_BOARD_ID := R6100 + NETGEAR_HW_ID := 29764434+0+128+128+2x2+2x2 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_r6100 + define Device/netgear_wndr3700-v4 SOC := ar9344 DEVICE_MODEL := WNDR3700 diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 7402fc067a..d3fa6132e6 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -32,6 +32,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; + netgear,r6100) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" + ;; zyxel,nbg6716) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index cac955905a..f7809c045d 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -28,6 +28,7 @@ case "$FIRMWARE" in "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in netgear,wndr3700-v4|\ + netgear,r6100|\ netgear,wndr4300|\ netgear,wndr4300sw|\ netgear,wndr4300tn|\ diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index f8cc8f1a2b..d448686bc0 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -18,6 +18,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1) ;; + netgear,r6100) + ath10kcal_extract "caldata" 0x5000 0x844 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2) + ;; zyxel,nbg6716) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1)