Porting guide ar71xx to ath79?

yes, but here you don't have so much vlans defined in swconfig, what's your /etc/config/network under ath and ar, could you save the ar config and paste it on ath config ?

Yes, it seems strange that the ath79 profile have so many vlans already configured, the both swconfig dev switch0 show output that I put before, were from a clean factory reset ar71xx and ath79 images, give me a couple of minutes to try what you suggest and get the new info @lucize.

Here is the ar71xx network config

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd84:4961:0b54::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 9t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 9t'

And here is the ath79 network config

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fda1:ee88:6930::/48'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '1 2 3 4 9t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 9t'

The copy of the network config of the ar71xx over the ath79 image not fix the wan port :thinking:

maybe the reset is not needed, try without reset options in switch and eth0 or see if cpu_port = <9>; added to the switch helps
based on match file the realtek,extif0 = <1 0 1 1 1 1 1 1 2>; should be ok

these are the meaning

	cfg->txdelay = be32_to_cpup(prop++);
	cfg->rxdelay = be32_to_cpup(prop++);
	cfg->mode = be32_to_cpup(prop++);
	cfg->ability.force_mode = be32_to_cpup(prop++);
	cfg->ability.txpause = be32_to_cpup(prop++);
	cfg->ability.rxpause = be32_to_cpup(prop++);
	cfg->ability.link = be32_to_cpup(prop++);
	cfg->ability.duplex = be32_to_cpup(prop++);
	cfg->ability.speed = be32_to_cpup(prop++);

from match:

        .mode = RTL8367_EXTIF_MODE_RGMII,
        .txdelay = 1,
        .rxdelay = 0,
        .ability = {
                .force_mode = 1,
                .txpause = 1,
                .rxpause = 1,
                .link = 1,
                .duplex = 1,
                .speed = RTL8367_PORT_SPEED_1000,
        },

maybe also adding rgmii to mdio or changing phy to 4 (don't think it helps)

                cpu_port = <9>;

                mdio-bus {
                        status = "okay";

                        phy0: ethernet-phy@4 {
                                reg = <4>;
                                phy-mode = "rgmii";

                        };
                };
        };

@robimarko
On an unrelated side-note:
Ubiquiti provided me with the GPL-Archive of the uap-ac-pro (=> all qca956x aps)
So yeah asking them seems to work now ( compliance@ubnt.com )

2 Likes

@MartB Awesome,will contact them on that email as it loks like their support has no idea what to do.

Mr @lucize Removing in the ath79 dts the reset options from

rtl8367

   resets = <&rst 8>;
   reset-names = "switch";

&eth0

   resets = <&rst 9>;
   reset-names = "mac";

Do the trick, wan port is now working :grin:,. here is the output from the swconfig dev switch0 show on the ath79

Global attributes:
	enable_vlan: 1
	enable_vlan4k: 0
	max_length: 1
Port 0:
	mib: Port 0 MIB counters
IfInOctets                          : 1996131
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 1513
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 2128716
EtherStatsUnderSizePkts             : 22
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 69
EtherStatsPkts65to127Octets         : 1108
EtherStatsPkts128to255Octets        : 93
EtherStatsPkts256to511Octets        : 217
EtherStatsPkts512to1023Octets       : 39
EtherStatsPkts1024to1518Octets      : 1309
EtherStatsMulticastPkts             : 188
EtherStatsBroadcastPkts             : 98
IfOutOctets                         : 132585
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 83
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 1058
IfOutMulticastPkts                  : 22
IfOutBroadcastPkts                  : 2
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 2
	link: port:0 link:up speed:100baseT full-duplex txflow rxflow auto
Port 1:
	mib: Port 1 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:1 link:down
Port 2:
	mib: Port 2 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:2 link:down
Port 3:
	mib: Port 3 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:3 link:down
Port 4:
	mib: Port 4 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:4 link:down
Port 5:
	mib: Port 5 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:5 link:down
Port 6:
	mib: Port 6 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:6 link:down
Port 7:
	mib: Port 7 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:7 link:down
Port 8:
	mib: Port 8 MIB counters
IfInOctets                          : 0
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 0
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 0
EtherStatsUnderSizePkts             : 0
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 0
EtherStatsPkts65to127Octets         : 0
EtherStatsPkts128to255Octets        : 0
EtherStatsPkts256to511Octets        : 0
EtherStatsPkts512to1023Octets       : 0
EtherStatsPkts1024to1518Octets      : 0
EtherStatsMulticastPkts             : 0
EtherStatsBroadcastPkts             : 0
IfOutOctets                         : 0
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 0
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 0
IfOutUcastPkts                      : 0
IfOutMulticastPkts                  : 0
IfOutBroadcastPkts                  : 0
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:8 link:down
Port 9:
	mib: Port 9 MIB counters
IfInOctets                          : 157839
Dot3StatsFCSErrors                  : 0
Dot3StatsSymbolErrors               : 0
Dot3InPauseFrames                   : 0
Dot3ControlInUnknownOpcodes         : 0
EtherStatsFragments                 : 0
EtherStatsJabbers                   : 0
IfInUcastPkts                       : 1064
EtherStatsDropEvents                : 0
EtherStatsOctets                    : 2161550
EtherStatsUnderSizePkts             : 29
EtherOversizeStats                  : 0
EtherStatsPkts64Octets              : 69
EtherStatsPkts65to127Octets         : 1148
EtherStatsPkts128to255Octets        : 172
EtherStatsPkts256to511Octets        : 221
EtherStatsPkts512to1023Octets       : 40
EtherStatsPkts1024to1518Octets      : 1309
EtherStatsMulticastPkts             : 301
EtherStatsBroadcastPkts             : 106
IfOutOctets                         : 2003785
Dot3StatsSingleCollisionFrames      : 0
Dot3StatMultipleCollisionFrames     : 0
Dot3sDeferredTransmissions          : 10
Dot3StatsLateCollisions             : 0
EtherStatsCollisions                : 0
Dot3StatsExcessiveCollisions        : 0
Dot3OutPauseFrames                  : 0
Dot1dBasePortDelayExceededDiscards  : 0
Dot1dTpPortInDiscards               : 121
IfOutUcastPkts                      : 1521
IfOutMulticastPkts                  : 166
IfOutBroadcastPkts                  : 96
OutOampduPkts                       : 0
InOampduPkts                        : 0
PktgenPkts                          : 0

	pvid: 1
	link: port:9 link:up speed:1000baseT full-duplex txflow rxflow 
VLAN 1:
	info: VLAN 1: Ports: '12349t', members=021e, untag=001e, fid=0
	fid: 0
	ports: 1 2 3 4 9t 
VLAN 2:
	info: VLAN 2: Ports: '09t', members=0201, untag=0001, fid=0
	fid: 0
	ports: 0 9t 

Seems that now all the hardware is now working on this device, there are still some minor details, decide what will happen with the wifi leds, and other issue that happen with the sysupgrade procedure, making sysupgrade from ar71xx ath79 (without preserving config) works fine, but sysupgrade between ath79 to ath79 complains about the image don't contain a supported format.

Do you need specific info from this device or that i do some specific test on this device now that all the hardware seems to be working?

glad that works!
try the PR, should have sysupgrade fixed, about the wlan switch maybe I'll think of something

Ok, let me check the sysupgrade procedure.

Alfter a little review of the new openwrt pull request, it seems that is missing, in the 10-ath9k-eeprom file

"tplink,tl-wr2543-v1")
	ath9k_eeprom_extract "art" 4096 2048

Good news to hear that the devices is waiting for approval :smiley:.

And what is this?

Hello.
Me need num-cs more than one.
Also need CS as gpio.
Seems it not realized, log:

...
[    0.401473] ath79-spi 1f000000.spi: cs1 >= max 1
[    0.406219] spi_master spi0: spi_device register error /ahb/spi@1f000000/sdcard@0
[    0.413758] spi_master spi0: Failed to create SPI device for /ahb/spi@1f000000/sdcard@0
[    0.424300] m25p80 spi0.0: en25f32 (4096 Kbytes)
[    0.429070] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.435484] Creating 3 MTD partitions on "spi0.0":
...

Part pf config:

&spi {
	status = "okay";
	num-cs = <2>;

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <0>;
		...
		...
		...
	sdcard@0 {
		compatible = "mmc-spi-slot";
		reg = <1>;
		spi-max-frequency = <25000000>;
		voltage-ranges = <3200 3400>;
	};

@Deoptim Have you tried to set additional gpios?

An example:

num-cs = <2>;
cs-gpios = <0>, <&gpio 0 GPIO_ACTIVE_HIGH/GPIO_ACTIVE_LOW>;

The first is "0" because this is the hw-cs...

Edited: Take a look into kernel source: Documentation/devicetree/bindings/spi/spi-bus.txt

If cs-gpios is used the number of chip selects will be increased automatically
with max(cs-gpios > hw cs).
2 Likes

:astonished:

Maybe I was not clear explainin what i did before when we tried the correction on the ath9 eeprom helper, the change that i did that ends working was...

Changin this....

"tplink,tl-wdr3600"|\
	"tplink,tl-wdr4300")
		ath9k_eeprom_extract "art" 20480 1088
		;;
	"tplink,tl-wr740n-v2"|\
	"tplink,tl-wr2543-v1"|\
		ath9k_eeprom_extract "art" 20480 1088
	"ubnt,unifi")
		ath9k_eeprom_extract "art" 4096 2048
		;;
	*)
		ath9k_eeprom_die "board $board is not supported yet"
;;

To this

"tplink,tl-wdr3600"|\
	"tplink,tl-wdr4300")
		ath9k_eeprom_extract "art" 20480 1088
		;;
	"tplink,tl-wr740n-v2"|\
	"tplink,tl-wr2543-v1")
		ath9k_eeprom_extract "art" 4096 2048
	"ubnt,unifi")
		ath9k_eeprom_extract "art" 4096 2048
		;;
	*)
		ath9k_eeprom_die "board $board is not supported yet"
;;

I put that with the output of the working helper dmesg mentioned it in my previous post, but maybe was not clear, sorry if this caused confusion.

the first time it was setup for ath9k_eeprom_extract "art" 20480 1088 not ath9k_eeprom_extract "art" 4096 2048
review the discussion
and the second example should not be good..

@lucize, yes , I was correcting my post, but you notice it before I put the correct info

this

 	"tplink,tl-wr740n-v2"|\
	"tplink,tl-wr2543-v1"|\
 	"ubnt,unifi")
 		ath9k_eeprom_extract "art" 4096 2048
 		;;

is better than

and it's missing a ;; in the between of the case

Ok, let me try your pull request, and I've report back, sorry if I've caused confusion.

@juppin Thank so much, now it showed up))

root@OpenWrt:~# cat /sys/bus/spi/devices/spi0.
spi0.0/  spi0.1/
root@OpenWrt:~# cat /sys/bus/spi/devices/spi0.1/
modalias     of_node/     statistics/  subsystem/   uevent
root@OpenWrt:~# cat /sys/bus/spi/devices/spi0.1/modalias 
spi:mmc-spi-slot
root@OpenWrt:~# 

SPI part of dts config:

&spi {
	status = "okay";
	num-cs = <2>;
	// First value is default pin for flash, second value
	// (via comma) the GPIO number for sdcard. But we used
	// gpio 2 and it equivalent of internal CS0 line. And
	// we use it because we use common bus SPI0.0 for two
	// devices (default Low polarity chip-select, custom
	// High polarity chip-select).
	// In its core, this is a dummy, because internal CS0 line
	// is locked by HW and SPI driver, and we can not use it at all.
	// We use this to simply switch SPI bus to another device.
	cs-gpios = <0>, <&gpio 2 GPIO_ACTIVE_HIGH>;

	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <25000000>;

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

			uboot: partition@0 {
				reg = <0x0 0x20000>;
				label = "u-boot";
				read-only;
			};

			firmware: partition@20000 {
				reg = <0x20000 0x3d0000>;
				label = "firmware";
			};

			art: partition@3f0000 {
				reg = <0x3f0000 0x10000>;
				label = "art";
				read-only;
			};
		};
	};

	sdcard@0 {
		compatible = "mmc-spi-slot";
		reg = <1>;
		spi-max-frequency = <25000000>;
		voltage-ranges = <3200 3400>;
	};
};
1 Like

Is this for a hw mod or has the device a mmc slot by default?
Which device is it?

Is this for a hw mod or has the device a mmc slot by default?
Yes, its for hardware mod.

Which device is it?
tl-mr3420-v1 with usb support.

I have some questions about porting this device on ath79:

I used default configuration from ar7240_tl-wr740n-v2.dts for (eth0 eth1 mdio0).
But it works only with this configuration of switch0:

	"tplink,tl-mr3420-v1")
		ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
		ucidef_add_switch "switch0" \
			"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"

Where mdio0 is used(4.14 log):

[    0.485863] libphy: Fixed MDIO Bus: probed
[    1.455188] libphy: mdio: probed
[    1.460663] mdio-bus.0: Found an AR7240/AR9330 built-in switch
[    1.507974] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:04 [uid=004dd041, driver=Generic PHY]
[    1.518168] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    2.146606] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    2.156585] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII

Original configuration (ar71xx):

		ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
		ucidef_add_switch "switch0" \
			"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"

Where it use mdio1(4.9 log):

[    0.975162] libphy: Fixed MDIO Bus: probed
[    0.996875] libphy: ag71xx_mdio: probed
[    1.624838] ag71xx-mdio.1: Found an AR7240/AR9330 built-in switch
[    1.676918] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.305044] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[    2.315288] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII

How can I swap eth0 <=> eth1?
As I understand it is necessary to use mdio1...