Carambola2 with mv88e6352 via mdio-gpio on device tree

The link status looks okay, port 0 is connected to eth0 and port 2 is connected to mv88e6352 switch, but port 2 does not receive anything from the switch.
Run ethtool -S eth0, to dump the CPU port status.

1 Like
root@OpenWrt:/# ethtool -S eth0
NIC statistics:
     Tx/Rx 64 Byte: 24
     Tx/Rx 65-127 Byte: 8
     Tx/Rx 128-255 Byte: 11
     Tx/Rx 256-511 Byte: 1
     Tx/Rx 512-1023 Byte: 0
     Tx/Rx 1024-1518 Byte: 0
     Tx/Rx 1519-1522 Byte VLAN: 0
     Rx Byte: 0
     Rx Packet: 0
     Rx FCS Error: 0
     Rx Multicast Packet: 0
     Rx Broadcast Packet: 0
     Rx Control Frame Packet: 0
     Rx Pause Frame Packet: 0
     Rx Unknown OPCode Packet: 0
     Rx Alignment Error: 0
     Rx Frame Length Error: 0
     Rx Code Error: 0
     Rx Carrier Sense Error: 0
     Rx Undersize Packet: 0
     Rx Oversize Packet: 0
     Rx Fragments: 0
     Rx Jabber: 0
     Rx Dropped Packet: 0
     Tx Byte: 4552
     Tx Packet: 44
     Tx Multicast Packet: 19
     Tx Broadcast Packet: 25
     Tx Pause Control Frame: 0
     Tx Deferral Packet: 0
     Tx Excessive Deferral Packet: 0
     Tx Single Collision Packet: 0
     Tx Multiple Collision: 0
     Tx Late Collision Packet: 0
     Tx Excessive Collision Packet: 0
     Tx Total Collision: 0
     Tx Pause Frames Honored: 1803
     Tx Drop Frame: 0
     Tx Jabber Frame: 0
     Tx FCS Error: 0
     Tx Control Frame: 0
     Tx Oversize Frame: 0
     Tx Undersize Frame: 0
     Tx Fragment: 0
     p01_in_good_octets: 0
     p01_in_bad_octets: 0
     p01_in_unicast: 0
     p01_in_broadcasts: 0
     p01_in_multicasts: 0
     p01_in_pause: 0
     p01_in_undersize: 0
     p01_in_fragments: 0
     p01_in_oversize: 0
     p01_in_jabber: 0
     p01_in_rx_error: 0
     p01_in_fcs_error: 0
     p01_out_octets: 67733
     p01_out_unicast: 0
     p01_out_broadcasts: 61
     p01_out_multicasts: 213
     p01_out_pause: 0
     p01_excessive: 0
     p01_collisions: 0
     p01_deferred: 0
     p01_single: 0
     p01_multiple: 0
     p01_out_fcs_error: 0
     p01_late: 0
     p01_hist_64bytes: 0
     p01_hist_65_127bytes: 154
     p01_hist_128_255bytes: 56
     p01_hist_256_511bytes: 8
     p01_hist_512_1023bytes: 56
     p01_hist_1024_max_bytes: 0
     p01_sw_in_discards: 0
     p01_sw_in_filtered: 0
     p01_sw_out_filtered: 0
     p01_atu_member_violation: 0
     p01_atu_miss_violation: 0
     p01_atu_full_violation: 0
     p01_vtu_member_violation: 0
     p01_vtu_miss_violation: 0

Hmm.. Same at the 88e6352 side, no ingress packets at p01.
Do you use fixed-link on port 1 or let it auto-negotiate?

Don't have any fixed-link in this version.

Installed the latest stable version of OpenWrt on the Carambola2 to check if the traffic between the carambola2 and the switch would work without switch configuration. And it does. I looked into swconfig and asking myself where the MAC Adress from Port 2 comes from?

OpenWrt without mv88e6xxx driver

root@OpenWrt:/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 500
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_table: address resolution table
Port 0: MAC c4:93:00:20:bd:a3
Port 2: MAC 08:be:ac:20:c5:c2

Port 0:
        mib: MIB counters
RxGoodByte  : 132198 (129.0 KiB)
TxByte      : 134781 (131.6 KiB)

        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: No MIB data
        pvid: 1
        link: port:1 link:down
Port 2:
        mib: MIB counters
RxGoodByte  : 134781 (131.6 KiB)
TxByte      : 132198 (129.0 KiB)

        pvid: 1
        link: port:2 link:up speed:100baseT full-duplex auto
Port 3:
        mib: No MIB data
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: No MIB data
        pvid: 1
        link: port:4 link:down
VLAN 1:
        vid: 1
        ports: 0 1 2 3 4

OpenWrt with mv88e6xxx driver

root@OpenWrt:/# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 500
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_table: address resolution table
Port 0: MAC c4:93:00:20:bd:a3

Port 0:
        mib: MIB counters
RxGoodByte  : 8852 (8.6 KiB)
TxByte      : 0

        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: No MIB data
        pvid: 1
        link: port:1 link:down
Port 2:
        mib: MIB counters
RxGoodByte  : 0
TxByte      : 8852 (8.6 KiB)

        pvid: 1
        link: port:2 link:up speed:100baseT full-duplex auto
Port 3:
        mib: No MIB data
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: No MIB data
        pvid: 1
        link: port:4 link:down
VLAN 1:
        vid: 1
        ports: 0 1 2 3 4

A few weeks ago i was able to solve the problem. It was important to switch to the master branch and use the 5.10 kernel. The configuration of the internal switch of the Carambola2 can remain completely unchanged. The devices have been rigorously tested and are working properly. Here is the final device tree and kernel config. Thanks to @LGA1150 for the quick answers and for pushing me in the right direction.

Devicetree

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "ar9331.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	model = "8devices Carambola2";
	compatible = "8dev,carambola2", "qca,ar9331";

	aliases {
		mdio-gpio0 = &mdio_gpio;
		label-mac-device = &wmac;
	};

	mdio_gpio: mdio-gpio {
		compatible = "virtual,mdio-gpio";
		gpios = <&gpio 19 GPIO_ACTIVE_HIGH>,
			<&gpio 21 GPIO_ACTIVE_HIGH>;

		#address-cells = <1>;
		#size-cells = <0>;

		switch2@20 {
			compatible = "marvell,mv88e6085";
			reg = <0>;
			dsa,member = <0 0>;

			ports {
				#address-cells = <1>;
				#size-cells = <0>;

				port@1 {
					reg = <1>;
					label = "cpu";
					ethernet = <&eth1>;
					fixed-link {
						speed = <100>;
						full-duplex;
					};
				};

				port@3 {
					reg = <3>;
					label = "lan1";
				};

				port@4 {
					reg = <4>;
					label = "lan2";
				};

				port@5 {
					reg = <5>;
					phy-mode = "rgmii-id";
					label = "pof2";
					fixed-link {
						speed = <1000>;
						full-duplex;
					};
				};

				port@6 {
					reg = <6>;
					phy-mode = "rgmii-id";
					label = "pof1";
					fixed-link {
						speed = <1000>;
						full-duplex;
					};
				};
			};
		};
  };

	leds {
		compatible = "gpio-leds";

		wlan {
			label = "green:wlan";
			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
		};

		eth0 {
			label = "orange:eth0";
			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
		};

		eth1 {
			label = "orange:eth1";
			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
		};
	};

	keys {
		compatible = "gpio-keys";

		wps {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
		};
	};
};

&ref {
	clock-frequency = <40000000>;
};

&usb {
	dr_mode = "host";
	status = "okay";
};

&usb_phy {
	status = "okay";
};

&spi {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		spi-max-frequency = <50000000>;
		reg = <0>;

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

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

			partition@40000 {
				label = "u-boot-env";
				reg = <0x040000 0x010000>;
				read-only;
			};

			partition@50000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x50000 0xfa0000>;
			};

			art: partition@ff0000 {
				label = "art";
				reg = <0xff0000 0x010000>;
				read-only;
			};
		};
	};
};

&mdio0 {
	status = "okay";
};

&eth0 {
	status = "okay";
	nvmem-cells = <&macaddr_art_0>;
	nvmem-cell-names = "mac-address";

	gmac-config {
		device = <&gmac>;

		switch-phy-addr-swap = <1>;
		switch-phy-swap = <1>;
	};
};

&eth1 {
	status = "okay";
	nvmem-cells = <&macaddr_art_6>;
	nvmem-cell-names = "mac-address";
};

&wmac {
	status = "okay";
	mtd-cal-data = <&art 0x1000>;
};

&art {
	compatible = "nvmem-cells";
	#address-cells = <1>;
	#size-cells = <1>;

	macaddr_art_0: macaddr@0 {
		reg = <0x0 0x6>;
	};

	macaddr_art_6: macaddr@6 {
		reg = <0x6 0x6>;
	};
};

Network config

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

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'pof1'
	list ports 'pof2'
	option igmp_snooping '1'
	option stp '1'

config interface 'lan'
	option proto 'dhcp'
	option device 'br-lan'

Kernel config

CONFIG_AG71XX=y
# CONFIG_AG71XX_DEBUG is not set
CONFIG_AG71XX_DEBUG_FS=y
CONFIG_AR8216_PHY=y
CONFIG_AR8216_PHY_LEDS=y
CONFIG_ARCH_32BIT_OFF_T=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_MMAP_RND_BITS_MAX=15
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_AT803X_PHY=y
CONFIG_ATH79=y
CONFIG_ATH79_WDT=y
CONFIG_BLK_MQ_PCI=y
CONFIG_CEVT_R4K=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
CONFIG_CMDLINE_BOOL=y
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_COMMON_CLK=y
# CONFIG_COMMON_CLK_BOSTON is not set
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CPU_BIG_ENDIAN=y
CONFIG_CPU_GENERIC_DUMP_TLB=y
CONFIG_CPU_HAS_DIEI=y
CONFIG_CPU_HAS_PREFETCH=y
CONFIG_CPU_HAS_RIXI=y
CONFIG_CPU_HAS_SYNC=y
CONFIG_CPU_MIPS32=y
CONFIG_CPU_MIPS32_R2=y
CONFIG_CPU_MIPSR2=y
CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
CONFIG_CPU_R4K_CACHE_TLB=y
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
CONFIG_CPU_SUPPORTS_HIGHMEM=y
CONFIG_CPU_SUPPORTS_MSA=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CSRC_R4K=y
CONFIG_DMA_NONCOHERENT=y
CONFIG_DTC=y
CONFIG_EARLY_PRINTK=y
CONFIG_FIXED_PHY=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_CPU_AUTOPROBE=y
CONFIG_GENERIC_GETTIMEOFDAY=y
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_LIB_ASHLDI3=y
CONFIG_GENERIC_LIB_ASHRDI3=y
CONFIG_GENERIC_LIB_CMPDI2=y
CONFIG_GENERIC_LIB_LSHRDI3=y
CONFIG_GENERIC_LIB_UCMPDI2=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PHY=y
CONFIG_GENERIC_PINCONF=y
CONFIG_GENERIC_PINCTRL_GROUPS=y
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GPIOLIB=y
CONFIG_GPIOLIB_IRQCHIP=y
CONFIG_GPIO_74X164=y
CONFIG_GPIO_ATH79=y
CONFIG_GPIO_GENERIC=y
# CONFIG_GPIO_LATCH is not set
CONFIG_GRO_CELLS=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HARDWARE_WATCHPOINTS=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
CONFIG_HWMON=y
CONFIG_HZ_PERIODIC=y
CONFIG_I2C=y
CONFIG_I2C_ALGOBIT=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_IMAGE_CMDLINE_HACK=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_MIPS_CPU=y
CONFIG_IRQ_WORK=y
CONFIG_LEDS_GPIO=y
# CONFIG_LEDS_RESET is not set
CONFIG_LIBFDT=y
CONFIG_LLD_VERSION=0
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_MARVELL_PHY=y
CONFIG_MDIO_BITBANG=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MDIO_GPIO=y
CONFIG_MEMFD_CREATE=y
# CONFIG_MFD_RB4XX_CPLD is not set
CONFIG_MFD_SYSCON=y
CONFIG_MIGRATION=y
CONFIG_MIPS=y
CONFIG_MIPS_ASID_BITS=8
CONFIG_MIPS_ASID_SHIFT=0
CONFIG_MIPS_CBPF_JIT=y
CONFIG_MIPS_CLOCK_VSYSCALL=y
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set
CONFIG_MIPS_CMDLINE_FROM_DTB=y
# CONFIG_MIPS_ELF_APPENDED_DTB is not set
CONFIG_MIPS_L1_CACHE_SHIFT=5
CONFIG_MIPS_LD_CAN_LINK_VDSO=y
# CONFIG_MIPS_NO_APPENDED_DTB is not set
CONFIG_MIPS_RAW_APPENDED_DTB=y
CONFIG_MIPS_SPRAM=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_CFI_I2 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
CONFIG_MTD_PARSER_CYBERTAN=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_SPLIT_ELF_FW=y
CONFIG_MTD_SPLIT_LZMA_FW=y
CONFIG_MTD_SPLIT_SEAMA_FW=y
CONFIG_MTD_SPLIT_TPLINK_FW=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_MTD_SPLIT_WRGG_FW=y
CONFIG_MTD_VIRT_CONCAT=y
CONFIG_MVMDIO=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NET_DEVLINK=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
CONFIG_NET_DSA_TAG_DSA=y
CONFIG_NET_DSA_TAG_EDSA=y
CONFIG_NET_SWITCHDEV=y
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
CONFIG_NVMEM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_OF_NET=y
CONFIG_PCI=y
CONFIG_PCI_AR71XX=y
CONFIG_PCI_AR724X=y
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DRIVERS_LEGACY=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_PHYLIB=y
CONFIG_PHYLINK=y
# CONFIG_PHY_AR7100_USB is not set
# CONFIG_PHY_AR7200_USB is not set
# CONFIG_PHY_ATH79_USB is not set
CONFIG_PINCTRL=y
CONFIG_RATIONAL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGULATOR=y
CONFIG_RESET_ATH79=y
CONFIG_RESET_CONTROLLER=y
CONFIG_SERIAL_8250_NR_UARTS=1
CONFIG_SERIAL_8250_RUNTIME_UARTS=1
CONFIG_SERIAL_AR933X=y
CONFIG_SERIAL_AR933X_CONSOLE=y
CONFIG_SERIAL_AR933X_NR_UARTS=2
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SPI=y
CONFIG_SPI_AR934X=y
CONFIG_SPI_ATH79=y
CONFIG_SPI_BITBANG=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
# CONFIG_SPI_RB4XX is not set
CONFIG_SRCU=y
CONFIG_SWCONFIG=y
CONFIG_SWCONFIG_LEDS=y
CONFIG_SWPHY=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_SYS_HAS_CPU_MIPS32_R2=y
CONFIG_SYS_HAS_EARLY_PRINTK=y
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
CONFIG_SYS_SUPPORTS_MIPS16=y
CONFIG_SYS_SUPPORTS_ZBOOT=y
CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
CONFIG_TARGET_ISA_REV=2
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TINY_SRCU=y
CONFIG_USB_SUPPORT=y
CONFIG_USE_OF=y

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.