Carambola2 with mv88e6352 via mdio-gpio on device tree

Hello,
I have a 8devices Carambola2 connected to mv88e6352 switch. The mv88e6352 is configurable with a MDIO bus. On the Carambola2 MDC is connected to GPIO 19 and MDIO is connected to GPIO 21. The goal is that the mv88e6352 can be set via DSA. I'm trying to create a hardware description using the devicetree. Unfortunately I have never made such a change to the devicetree. I assume that I have to use mdio-gpio. When I have defined a new MDIO bus i can attach the switch driver to this bus. So far all attempts were unsuccessful and during the build there was a syntax error in the devicetree. I checked the Linux documentation of the devicetree bindings to find a starting point.

mdio-gpio
mv88e6352

This is the first attempt on changing the carambola2 dts.

// 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 {
		label-mac-device = &wmac;
		mdio-gpio0 = &mdio1
	};

	mdio1: mdio {
      	compatible = "virtual,mdio-gpio";
      	#address-cells = <1>;
      	#size-cells = <0>;
      	gpios = <&gpio 19>,
              	<&gpio 21>;
      	ethphy0: ethernet-phy@0 {
        	reg = <0>;
      	};
    };

	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 = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		};
	};
};

&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";
	mtd-mac-address = <&art 0x0>;

	gmac-config {
		device = <&gmac>;

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

&eth1 {
	status = "okay";
	mtd-mac-address = <&art 0x6>;
};

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

A little bit of guidance and suggestions would be great to make further progress. I hope that the ideas lead into the right directions and that that is not to much to ask for.

1 Like

Missing a colon after mdio-gpio0 = &mdio1

1 Like

Thank your for that fast reply. I added the colon and after some try and error i now have this dts.

// 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 {
		label-mac-device = &wmac;
		mdio-gpio0 = &mdio2;
	};

	mdio2: mdio {
      	compatible = "virtual,mdio-gpio";
      	#address-cells = <1>;
      	#size-cells = <0>;
      	gpios = <&gpio 19>,
              	<&gpio 21>;
    };

	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 = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		};
	};
};

&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";
};

&mdio2 {
	status = "okay";
};

&eth0 {
	status = "okay";
	mtd-mac-address = <&art 0x0>;

	gmac-config {
		device = <&gmac>;

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

&eth1 {
	status = "okay";
	mtd-mac-address = <&art 0x6>;
};

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

And this is the current bootlog

[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is 8devices Carambola2
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 57160K/65536K available (4938K kernel code, 188K rwdata, 1136K rodata, 1216K init, 196K bss, 8376K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] random: get_random_bytes called from start_kernel+0x358/0x54c with crng_init=0
[    0.000000] CPU clock: 400.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000012] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007908] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.092687] pid_max: default: 32768 minimum: 301
[    0.097550] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.104615] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.118649] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.127099] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.133976] pinctrl core: initialized pinctrl subsystem
[    0.140536] NET: Registered protocol family 16
[    0.185932] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.199427] clocksource: Switched to clocksource MIPS
[    0.204888] NET: Registered protocol family 2
[    0.208058] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.215999] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.223462] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.231020] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.238023] TCP: Hash tables configured (established 1024 bind 1024)
[    0.244584] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.250944] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.258268] NET: Registered protocol family 1
[    0.262237] PCI: CLS 0 bytes, default 32
[    0.271513] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.287667] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.292122] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.322722] pinctrl-single 18040028.pinmux: 64 pins, size 8
[    0.328271] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.334488] 18020000.uart: ttyATH0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a AR933X UART
[    0.342882] printk: console [ttyATH0] enabled
[    0.351068] printk: bootconsole [early0] disabled
[    0.380094] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.383499] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.389803] Creating 4 MTD partitions on "spi0.0":
[    0.394576] 0x000000000000-0x000000040000 : "u-boot"
[    0.401015] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.406199] 0x000000050000-0x000000ff0000 : "firmware"
[    0.415122] 2 uimage-fw partitions found on MTD device firmware
[    0.419666] Creating 2 MTD partitions on "firmware":
[    0.424550] 0x000000000000-0x000000200000 : "kernel"
[    0.430896] 0x000000200000-0x000000fa0000 : "rootfs"
[    0.435734] mtd: device 4 (rootfs) set to be root filesystem
[    0.442650] 1 squashfs-split partitions found on MTD device rootfs
[    0.447394] 0x0000004c0000-0x000000fa0000 : "rootfs_data"
[    0.454295] 0x000000ff0000-0x000001000000 : "art"
[    0.460306] OF: /mdio: could not find phandle
[    0.463237] mdio-gpio: probe of mdio failed with error -22
[    0.470571] libphy: Fixed MDIO Bus: probed
[    0.841618] libphy: ag71xx_mdio: probed
[    0.844111] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.529938] libphy: ag71xx_mdio: probed
[    1.533323] libphy: ar8xxx-mdio: probed
[    1.539283] switch0: Atheros AR724X/AR933X built-in rev. 2 switch registered on mdio.1
[    1.585640] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.594198] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.599654] i2c /dev entries driver
[    1.605910] NET: Registered protocol family 10
[    1.616162] Segment Routing with IPv6
[    1.618545] NET: Registered protocol family 17
[    1.623010] 8021q: 802.1Q VLAN Support v1.8
[    1.971083] ag71xx 19000000.eth: connected to PHY at mdio.1:1f:04 [uid=004dd041, driver=Generic PHY]
[    1.980257] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    1.993007] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.008046] Freeing unused kernel memory: 1216K
[    2.011160] This architecture does not have kernel memory protection.
[    2.017538] Run /sbin/init as init process
[    2.559438] random: fast init done
[    2.781686] init: Console is alive
[    2.783979] init: - watchdog -
[    4.188836] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.469213] usbcore: registered new interface driver usbfs
[    4.473431] usbcore: registered new interface driver hub
[    4.478641] usbcore: registered new device driver usb
[    4.498926] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.516635] chipidea-usb2 1b000000.usb: 1b000000.usb supply vbus not found, using dummy regulator
[    4.527221] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    4.530771] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    4.559439] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    4.564650] hub 1-0:1.0: USB hub found
[    4.567641] hub 1-0:1.0: 1 port detected
[    4.573484] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.581762] init: - preinit -
[    5.109390] usb 1-1: new full-speed USB device number 2 using ci_hdrc
[    5.541674] usb 1-1: device descriptor read/64, error -71
[    5.969510] usb 1-1: device descriptor read/64, error -71
[    5.981770] random: jshn: uninitialized urandom read (4 bytes read)
[    6.189018] random: jshn: uninitialized urandom read (4 bytes read)
[    6.239579] usb 1-1: new full-speed USB device number 3 using ci_hdrc
[    6.287976] random: jshn: uninitialized urandom read (4 bytes read)
[    6.489523] usb 1-1: device descriptor read/64, error -71
[    6.667982] eth0: link up (1000Mbps/Full duplex)
[    6.673256] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.859454] usb 1-1: device descriptor read/64, error -71
[    6.979497] usb usb1-port1: attempt power cycle
[    7.449448] usb 1-1: new full-speed USB device number 4 using ci_hdrc
[    7.949452] usb 1-1: device not accepting address 4, error -71
[    8.099454] usb 1-1: new full-speed USB device number 5 using ci_hdrc
[    8.600368] usb 1-1: device not accepting address 5, error -71
[    8.604824] usb usb1-port1: unable to enumerate USB device
[   10.974532] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[   10.980458] jffs2_build_filesystem(): unlocking the mtd device... 
[   10.980535] done.
[   10.988366] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   45.315664] done.
[   45.324566] jffs2: notice: (546) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   45.340948] mount_root: overlay filesystem has not been fully initialized yet
[   45.349631] mount_root: switching to jffs2 overlay
[   45.356355] overlayfs: upper fs does not support tmpfile.
[   46.270062] urandom-seed: Seed file not found (/etc/urandom.seed)
[   46.541706] eth0: link down
[   46.562315] procd: - early -
[   46.563884] procd: - watchdog -
[   47.155895] procd: - watchdog -
[   47.158159] procd: - ubus -
[   47.207444] urandom_read: 4 callbacks suppressed
[   47.207456] random: ubusd: uninitialized urandom read (4 bytes read)
[   47.220393] random: ubusd: uninitialized urandom read (4 bytes read)
[   47.226001] random: ubusd: uninitialized urandom read (4 bytes read)
[   47.236005] procd: - init -
[   48.625595] kmodloader: loading kernel modules from /etc/modules.d/*
[   49.296212] Loading modules backported from Linux version v5.10.42-0-g65859eca4dff
[   49.302426] Backport generated by backports.git v5.10.42-1-0-gbee5c545
[   49.392995] xt_time: kernel timezone is -0000
[   49.581373] urngd: v1.0.2 started.
[   49.613704] PPP generic driver version 2.4.2
[   49.631346] NET: Registered protocol family 24
[   49.803923] ath: EEPROM regdomain sanitized
[   49.803940] ath: EEPROM regdomain: 0x64
[   49.803945] ath: EEPROM indicates we should expect a direct regpair map
[   49.803975] ath: Country alpha2 being used: 00
[   49.803980] ath: Regpair used: 0x64
[   49.817548] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   49.820846] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   49.930104] kmodloader: done loading kernel modules from /etc/modules.d/*
[   50.447259] random: crng init done
[   70.835034] eth0: link up (1000Mbps/Full duplex)
[   70.839191] br-lan: port 1(eth0) entered blocking state
[   70.843537] br-lan: port 1(eth0) entered disabled state
[   70.849113] device eth0 entered promiscuous mode
[   70.880631] br-lan: port 1(eth0) entered blocking state
[   70.884410] br-lan: port 1(eth0) entered forwarding state
[   71.859580] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

I think the next step would be to add the description for the switch to the carambola2 dts. Or is there anything else I have to think about?

The devicetree has been changed so that the first switch description is included.

// 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 {
		label-mac-device = &wmac;
		mdio-gpio0 = &mdio2;
	};

	mdio2: mdio {
  	compatible = "virtual,mdio-gpio";
  	#address-cells = <1>;
  	#size-cells = <0>;
  	gpios = <&gpio 19>,
          	<&gpio 21>;

		switch0: switch0@0 {
			compatible = "marvell,mv88e6xxx-mdio-external";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;

			dsa,member = <0 0>;

			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					label = "lan0";
				};

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

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

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

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

				port@5 {
					reg = <5>;
					label = "lan5";
				};
			};
		};
  };

	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 = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		};
	};
};

&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";
	mtd-mac-address = <&art 0x0>;

	gmac-config {
		device = <&gmac>;

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

&eth1 {
	status = "okay";
	mtd-mac-address = <&art 0x6>;
};

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

Unfortunately, the bootlog still looks like this.

[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is 8devices Carambola2
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56964K/65536K available (5091K kernel code, 190K rwdata, 1184K rodata, 1204K init, 196K bss, 8572K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] random: get_random_bytes called from start_kernel+0x358/0x54c with crng_init=0
[    0.000000] CPU clock: 400.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000012] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007905] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.092696] pid_max: default: 32768 minimum: 301
[    0.097560] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.104626] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.118963] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.127418] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.134293] pinctrl core: initialized pinctrl subsystem
[    0.140863] NET: Registered protocol family 16
[    0.187642] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.201252] clocksource: Switched to clocksource MIPS
[    0.206677] NET: Registered protocol family 2
[    0.209853] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.217778] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.225248] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.232804] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.239811] TCP: Hash tables configured (established 1024 bind 1024)
[    0.246384] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.252728] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.260041] NET: Registered protocol family 1
[    0.264025] PCI: CLS 0 bytes, default 32
[    0.273394] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.289749] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.294204] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.325147] pinctrl-single 18040028.pinmux: 64 pins, size 8
[    0.330707] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.336912] 18020000.uart: ttyATH0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a AR933X UART
[    0.345309] printk: console [ttyATH0] enabled
[    0.353497] printk: bootconsole [early0] disabled
[    0.381680] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.385079] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.391385] Creating 4 MTD partitions on "spi0.0":
[    0.396139] 0x000000000000-0x000000040000 : "u-boot"
[    0.402595] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.407793] 0x000000050000-0x000000ff0000 : "firmware"
[    0.416780] 2 uimage-fw partitions found on MTD device firmware
[    0.421329] Creating 2 MTD partitions on "firmware":
[    0.426205] 0x000000000000-0x000000210000 : "kernel"
[    0.432541] 0x000000210000-0x000000fa0000 : "rootfs"
[    0.437382] mtd: device 4 (rootfs) set to be root filesystem
[    0.444390] 1 squashfs-split partitions found on MTD device rootfs
[    0.449153] 0x0000004d0000-0x000000fa0000 : "rootfs_data"
[    0.456044] 0x000000ff0000-0x000001000000 : "art"
[    0.462029] OF: /mdio: could not find phandle
[    0.464965] mdio-gpio: probe of mdio failed with error -22
[    0.472303] libphy: Fixed MDIO Bus: probed
[    0.843454] libphy: ag71xx_mdio: probed
[    0.845948] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.531764] libphy: ag71xx_mdio: probed
[    1.535161] libphy: ar8xxx-mdio: probed
[    1.541128] switch0: Atheros AR724X/AR933X built-in rev. 2 switch registered on mdio.1
[    1.587447] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.596018] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.601684] i2c /dev entries driver
[    1.607730] NET: Registered protocol family 10
[    1.618327] Segment Routing with IPv6
[    1.620694] NET: Registered protocol family 17
[    1.625485] 8021q: 802.1Q VLAN Support v1.8
[    1.972913] ag71xx 19000000.eth: connected to PHY at mdio.1:1f:04 [uid=004dd041, driver=Generic PHY]
[    1.982094] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    1.994781] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.009722] Freeing unused kernel memory: 1204K
[    2.012834] This architecture does not have kernel memory protection.
[    2.019215] Run /sbin/init as init process
[    2.561265] random: fast init done
[    2.783801] init: Console is alive
[    2.786093] init: - watchdog -
[    4.192274] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.472216] usbcore: registered new interface driver usbfs
[    4.476366] usbcore: registered new interface driver hub
[    4.481724] usbcore: registered new device driver usb
[    4.502621] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.519807] chipidea-usb2 1b000000.usb: 1b000000.usb supply vbus not found, using dummy regulator
[    4.530421] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    4.533959] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    4.571266] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    4.576496] hub 1-0:1.0: USB hub found
[    4.579461] hub 1-0:1.0: 1 port detected
[    4.585225] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.601730] init: - preinit -
[    5.130736] usb 1-1: new full-speed USB device number 2 using ci_hdrc
[    5.562554] usb 1-1: device descriptor read/64, error -71
[    5.990919] usb 1-1: device descriptor read/64, error -71
[    6.003406] random: jshn: uninitialized urandom read (4 bytes read)
[    6.210982] random: jshn: uninitialized urandom read (4 bytes read)
[    6.261405] usb 1-1: new full-speed USB device number 3 using ci_hdrc
[    6.309983] random: jshn: uninitialized urandom read (4 bytes read)
[    6.511353] usb 1-1: device descriptor read/64, error -71
[    6.690087] eth0: link up (1000Mbps/Full duplex)
[    6.695309] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.881275] usb 1-1: device descriptor read/64, error -71
[    7.001315] usb usb1-port1: attempt power cycle
[    7.471284] usb 1-1: new full-speed USB device number 4 using ci_hdrc
[    7.971287] usb 1-1: device not accepting address 4, error -71
[    8.121278] usb 1-1: new full-speed USB device number 5 using ci_hdrc
[    8.622165] usb 1-1: device not accepting address 5, error -71
[    8.626596] usb usb1-port1: unable to enumerate USB device
[   10.978459] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   10.990011] urandom-seed: Seed file not found (/etc/urandom.seed)
[   11.261522] eth0: link down
[   11.282013] procd: - early -
[   11.283585] procd: - watchdog -
[   11.963172] procd: - watchdog -
[   12.121639] procd: - ubus -
[   12.290355] urandom_read: 4 callbacks suppressed
[   12.290367] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.349770] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.355431] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.365500] procd: - init -
[   13.782876] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.435853] Loading modules backported from Linux version v5.10.42-0-g65859eca4dff
[   14.442057] Backport generated by backports.git v5.10.42-1-0-gbee5c545
[   14.538893] xt_time: kernel timezone is -0000
[   14.695966] urngd: v1.0.2 started.
[   14.770095] PPP generic driver version 2.4.2
[   14.783273] NET: Registered protocol family 24
[   14.965761] ath: EEPROM regdomain sanitized
[   14.965779] ath: EEPROM regdomain: 0x64
[   14.965784] ath: EEPROM indicates we should expect a direct regpair map
[   14.965813] ath: Country alpha2 being used: 00
[   14.965818] ath: Regpair used: 0x64
[   14.979394] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   14.982696] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   15.091934] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.376721] random: crng init done
[   69.701466] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   69.706965] jffs2_build_filesystem(): unlocking the mtd device... 
[   69.706996] done.
[   69.714962] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   77.917059] eth0: link up (1000Mbps/Full duplex)
[   77.932824] br-lan: port 1(eth0) entered blocking state
[   77.936605] br-lan: port 1(eth0) entered disabled state
[   77.942432] device eth0 entered promiscuous mode
[   77.988395] br-lan: port 1(eth0) entered blocking state
[   77.992257] br-lan: port 1(eth0) entered forwarding state
[   78.981570] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  114.309455] done.
[  114.309975] jffs2: notice: (1611) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  114.489669] overlayfs: upper fs does not support tmpfile.

What could be the mistake? What could be tried next?

1 Like

You used the wrong compatible, it should be the switch model, not an external MDIO.
Also you forgot to specify the CPU port.

1 Like

Thank you for your answer and sorry for the late reply. We had a few problems due to flooding in our region. I changed the devicetree to this.

// 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 {
		label-mac-device = &wmac;
		mdio-gpio0 = <&mdio2>;
	};

	mdio2: mdio {
  	compatible = "virtual,mdio-gpio";
  	#address-cells = <1>;
  	#size-cells = <0>;
  	gpios = <&gpio 19>,
          	<&gpio 21>;

		switch0: switch0@0 {
			compatible = "marvell,mv88e6085";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;

			dsa,member = <0 0>;

			ports {
				#address-cells = <1>;
				#size-cells = <0>;
				port@0 {
					reg = <0>;
					label = "lan0";
				};

				port@1 {
					reg = <1>;
					label = "cpu";
				};

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

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

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

				port@5 {
					reg = <5>;
					label = "lan5";
				};
			};
		};
  };

	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 = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		};
	};
};

&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";
	mtd-mac-address = <&art 0x0>;

	gmac-config {
		device = <&gmac>;

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

&eth1 {
	status = "okay";
	mtd-mac-address = <&art 0x6>;
};

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

The bootlog looks like this.

[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is 8devices Carambola2
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56964K/65536K available (5091K kernel code, 190K rwdata, 1184K rodata, 1204K init, 196K bss, 8572K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] random: get_random_bytes called from start_kernel+0x358/0x54c with crng_init=0
[    0.000000] CPU clock: 400.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000012] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007905] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.092687] pid_max: default: 32768 minimum: 301
[    0.097552] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.104618] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.118960] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.127408] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.134284] pinctrl core: initialized pinctrl subsystem
[    0.140856] NET: Registered protocol family 16
[    0.187674] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.201270] clocksource: Switched to clocksource MIPS
[    0.206710] NET: Registered protocol family 2
[    0.209874] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.217804] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.225274] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.232830] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.239837] TCP: Hash tables configured (established 1024 bind 1024)
[    0.246410] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.252754] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.260069] NET: Registered protocol family 1
[    0.264052] PCI: CLS 0 bytes, default 32
[    0.273423] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.289764] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.294213] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.325139] pinctrl-single 18040028.pinmux: 64 pins, size 8
[    0.330695] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.336904] 18020000.uart: ttyATH0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a AR933X UART
[    0.345301] printk: console [ttyATH0] enabled
[    0.345301] printk: console [ttyATH0] enabled
[    0.353488] printk: bootconsole [early0] disabled
[    0.353488] printk: bootconsole [early0] disabled
[    0.381599] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.385002] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.391307] Creating 4 MTD partitions on "spi0.0":
[    0.396062] 0x000000000000-0x000000040000 : "u-boot"
[    0.402528] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.407728] 0x000000050000-0x000000ff0000 : "firmware"
[    0.416713] 2 uimage-fw partitions found on MTD device firmware
[    0.421177] Creating 2 MTD partitions on "firmware":
[    0.426220] 0x000000000000-0x000000210000 : "kernel"
[    0.432474] 0x000000210000-0x000000fa0000 : "rootfs"
[    0.437318] mtd: device 4 (rootfs) set to be root filesystem
[    0.444305] 1 squashfs-split partitions found on MTD device rootfs
[    0.449066] 0x0000004d0000-0x000000fa0000 : "rootfs_data"
[    0.455961] 0x000000ff0000-0x000001000000 : "art"
[    0.461937] OF: /mdio: could not find phandle
[    0.464869] mdio-gpio: probe of mdio failed with error -22
[    0.472220] libphy: Fixed MDIO Bus: probed
[    0.843476] libphy: ag71xx_mdio: probed
[    0.845965] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.531779] libphy: ag71xx_mdio: probed
[    1.535170] libphy: ar8xxx-mdio: probed
[    1.541137] switch0: Atheros AR724X/AR933X built-in rev. 2 switch registered on mdio.1
[    1.587461] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.596068] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.601661] i2c /dev entries driver
[    1.607716] NET: Registered protocol family 10
[    1.618284] Segment Routing with IPv6
[    1.620655] NET: Registered protocol family 17
[    1.625444] 8021q: 802.1Q VLAN Support v1.8
[    1.972927] ag71xx 19000000.eth: connected to PHY at mdio.1:1f:04 [uid=004dd041, driver=Generic PHY]
[    1.982108] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    1.994789] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.009729] Freeing unused kernel memory: 1204K
[    2.012833] This architecture does not have kernel memory protection.
[    2.019215] Run /sbin/init as init process
[    2.561282] random: fast init done
[    2.783279] init: Console is alive
[    2.785573] init: - watchdog -
[    4.191902] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.470607] usbcore: registered new interface driver usbfs
[    4.474825] usbcore: registered new interface driver hub
[    4.480087] usbcore: registered new device driver usb
[    4.500399] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.517843] chipidea-usb2 1b000000.usb: 1b000000.usb supply vbus not found, using dummy regulator
[    4.528450] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    4.531982] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    4.561284] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    4.566476] hub 1-0:1.0: USB hub found
[    4.569483] hub 1-0:1.0: 1 port detected
[    4.575319] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.583609] init: - preinit -
[    5.196774] usb 1-1: new full-speed USB device number 2 using ci_hdrc
[    5.546039] usb 1-1: device descriptor read/64, error -71
[    5.974812] usb 1-1: device descriptor read/64, error -71
[    5.987137] random: jshn: uninitialized urandom read (4 bytes read)
[    6.196010] random: jshn: uninitialized urandom read (4 bytes read)
[    6.241391] usb 1-1: new full-speed USB device number 3 using ci_hdrc
[    6.295197] random: jshn: uninitialized urandom read (4 bytes read)
[    6.491368] usb 1-1: device descriptor read/64, error -71
[    6.676126] eth0: link up (1000Mbps/Full duplex)
[    6.679342] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    6.861294] usb 1-1: device descriptor read/64, error -71
[    6.981318] usb usb1-port1: attempt power cycle
[    7.451280] usb 1-1: new full-speed USB device number 4 using ci_hdrc
[    7.951297] usb 1-1: device not accepting address 4, error -71
[    8.101284] usb 1-1: new full-speed USB device number 5 using ci_hdrc
[    8.602210] usb 1-1: device not accepting address 5, error -71
[    8.606661] usb usb1-port1: unable to enumerate USB device
[   10.965384] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   10.976885] urandom-seed: Seed file not found (/etc/urandom.seed)
[   11.248477] eth0: link down
[   11.268940] procd: - early -
[   11.270514] procd: - watchdog -
[   11.950171] procd: - watchdog -
[   12.108683] procd: - ubus -
[   12.277392] urandom_read: 4 callbacks suppressed
[   12.277404] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.336940] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.342602] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.352634] procd: - init -
Please press Enter to activate this console.
[   13.754217] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.429325] Loading modules backported from Linux version v5.10.42-0-g65859eca4dff
[   14.435529] Backport generated by backports.git v5.10.42-1-0-gbee5c545
[   14.524777] xt_time: kernel timezone is -0000
[   14.663191] urngd: v1.0.2 started.
[   14.742705] PPP generic driver version 2.4.2
[   14.753318] NET: Registered protocol family 24
[   14.942734] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   15.051953] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.343942] random: crng init done
[   47.551489] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   47.556982] jffs2_build_filesystem(): unlocking the mtd device...
[   47.557013] done.
[   47.564981] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   55.924365] eth0: link up (1000Mbps/Full duplex)
[   55.941643] br-lan: port 1(eth0) entered blocking state
[   55.945415] br-lan: port 1(eth0) entered disabled state
[   55.951129] device eth0 entered promiscuous mode
[   55.998958] br-lan: port 1(eth0) entered blocking state
[   56.002813] br-lan: port 1(eth0) entered forwarding state
[   56.981878] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   92.066736] done.
[   92.067249] jffs2: notice: (1598) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   92.248139] overlayfs: upper fs does not support tmpfile.

Is the specification of the CPU Port enough or should there be more details?

You haven't enabled the mv88e6xxx DSA driver in make kernel_menuconfig, have you?
And the CPU port configuration is not correct:

				port@1 {
					reg = <1>;
					label = "cpu";
				};

Please take a look at Linksys WRT1900AC v1's dts:
Are you sure that port 1 is the CPU port?

1 Like

My kernel_menuconfig is changed to this.

diff --git a/target/linux/ath79/config-5.4 b/target/linux/ath79/config-5.4
index e37b728554..754c23ace0 100644
--- a/target/linux/ath79/config-5.4
+++ b/target/linux/ath79/config-5.4
@@ -5,24 +5,10 @@ CONFIG_AR8216_PHY=y
 CONFIG_AR8216_PHY_LEDS=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y
-CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
-CONFIG_ARCH_HAS_DMA_WRITE_COMBINE=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_RESET_CONTROLLER=y
-CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
-CONFIG_ARCH_HAS_UNCACHED_SEGMENT=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_MMAP_RND_BITS_MAX=15
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_MEMREMAP_PROT=y
-CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
-CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_AT803X_PHY=y
 CONFIG_ATH79=y
 CONFIG_ATH79_WDT=y
@@ -50,18 +36,15 @@ CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_CPU_SUPPORTS_MSA=y
+CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CSRC_R4K=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
-CONFIG_EFI_EARLYCON=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
-CONFIG_FONT_8x16=y
-CONFIG_FONT_AUTOSELECT=y
-CONFIG_FONT_SUPPORT=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_CLOCKEVENTS=y
@@ -91,47 +74,12 @@ 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_HAVE_ARCH_COMPILER_H=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ASM_MODVERSIONS=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FAST_GUP=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_VDSO=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IOREMAP_PROT=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KVM=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_IMAGE_CMDLINE_HACK=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -144,6 +92,7 @@ CONFIG_LEDS_GPIO=y
 # CONFIG_LEDS_RESET is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
+CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BITBANG=y
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
@@ -155,6 +104,7 @@ 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
@@ -173,7 +123,6 @@ CONFIG_MTD_CFI_GEOMETRY=y
 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_NAND_RB91X is not set
 CONFIG_MTD_PARSER_CYBERTAN=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPI_NOR=y
@@ -184,8 +133,16 @@ 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
@@ -206,6 +163,7 @@ 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

I changed the CPU Port to this.

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

The Bootlog still looks the same.

On the Carambola2 module the pins 12 - 15
ETH0 RXP
ETH0 RXM
ETH0 TXP
ETH0 TXM
are connected to the Marvell pins 9 - 12
P1_MDP_2
P1_MDN_2
P1_MDP_3
P1_MDN_3

1 Like

Wait a minute..

AR9331 does not provide any external MII's, so are you connecting two PHY ports?

Remove the mdio-gpio0 = <&mdio2>;, it is useless and causes the could not find phandle error.

The connection between the Carambola2 and the mv88e6352.

There is nothing more between these two.

I will remove the alias from the devicetree.

AR9331 has only FE ports, so you should remove the unsupported fixed-link, and it should auto-negotiate.
Your diagram is wrong -- You don't connect eth0 directly to 88e6352, instead you connect one of the PHY ports of the internal switch to it.
Also, I'm not sure if a PHY port of 88e6352 can be set up as the CPU port, so you'd better ask the driver's maintainers.

Many thanks for your help so far. I will try to find out if a PHY port could be used as cpu port. I will share the results here.

So, I got an answer to the question.

Is it possible to use a PHY port (port1) as a cpu port with the
mv88e6xxx driver?

The Answer is:

Yes. There are a few boards in mainline that does this. The original assumption was that the switch PHY defaults to auto-neg, and so gets link as soon as the SoC PHY is configured up. No PHY driver controls the switch PHY. This works for the older mv88e6xxx devices, like the 6352.

I changed the devicetree to this.

// 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>;

		switch@1 {
			compatible = "marvell,mv88e6085";
			reg = <0>;
			dsa,member = <0 0>;

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

				port@0 {
					reg = <0>;
					label = "lan0";
				};

				port@1 {
					reg = <1>;
					label = "cpu";
					ethernet = <&eth0>;
				};

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

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

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

	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 = "wps";
			linux,code = <KEY_WPS_BUTTON>;
			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
		};
	};
};

&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";
	mtd-mac-address = <&art 0x0>;

	gmac-config {
		device = <&gmac>;

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

&eth1 {
	status = "okay";
	mtd-mac-address = <&art 0x6>;
};

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

Bootlog:

[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is 8devices Carambola2
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56964K/65536K available (5087K kernel code, 193K rwdata, 1180K rodata, 1212K init, 196K bss, 8572K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x520 with crng_init=0
[    0.000000] CPU clock: 400.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000013] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007893] Calibrating delay loop... 265.98 BogoMIPS (lpj=531968)
[    0.048607] pid_max: default: 32768 minimum: 301
[    0.053473] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.060531] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.074763] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.083128] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.090020] pinctrl core: initialized pinctrl subsystem
[    0.096528] NET: Registered protocol family 16
[    0.142211] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.155396] clocksource: Switched to clocksource MIPS
[    0.160872] NET: Registered protocol family 2
[    0.165027] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.172235] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.179788] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.186813] TCP: Hash tables configured (established 1024 bind 1024)
[    0.193366] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.199719] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.207025] NET: Registered protocol family 1
[    0.211002] PCI: CLS 0 bytes, default 32
[    0.220376] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.236615] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.241059] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.271711] pinctrl-single 18040028.pinmux: 64 pins, size 8
[    0.277268] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.283493] 18020000.uart: ttyATH0 at MMIO 0x18020000 (irq = 9, base_baud = 2500000) is a AR933X UART
[    0.292073] printk: console [ttyATH0] enabled
[    0.300061] printk: bootconsole [early0] disabled
[    0.327776] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.331176] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.337482] Creating 4 MTD partitions on "spi0.0":
[    0.342254] 0x000000000000-0x000000040000 : "u-boot"
[    0.348691] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.354007] 0x000000050000-0x000000ff0000 : "firmware"
[    0.362875] 2 uimage-fw partitions found on MTD device firmware
[    0.367430] Creating 2 MTD partitions on "firmware":
[    0.372317] 0x000000000000-0x000000210000 : "kernel"
[    0.378605] 0x000000210000-0x000000fa0000 : "rootfs"
[    0.383705] mtd: device 4 (rootfs) set to be root filesystem
[    0.390385] 1 squashfs-split partitions found on MTD device rootfs
[    0.395220] 0x0000004c0000-0x000000fa0000 : "rootfs_data"
[    0.401979] 0x000000ff0000-0x000001000000 : "art"
[    0.408255] libphy: GPIO Bitbanged MDIO: probed
[    0.413506] libphy: Fixed MDIO Bus: probed
[    0.420599] mv88e6085 gpio-0:00: switch 0x3520 detected: Marvell 88E6352, revision 1
[    0.627134] libphy: mv88e6xxx SMI: probed
[    0.883384] random: fast init done
[    0.953589] libphy: ag71xx_mdio: probed
[    0.956179] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.595893] libphy: ag71xx_mdio: probed
[    1.599262] libphy: ar8xxx-mdio: probed
[    1.605418] switch0: Atheros AR724X/AR933X built-in rev. 2 switch registered on mdio.1
[    1.645589] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.654151] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.659776] i2c /dev entries driver
[    1.665874] NET: Registered protocol family 10
[    1.676339] Segment Routing with IPv6
[    1.678711] NET: Registered protocol family 17
[    1.683633] 8021q: 802.1Q VLAN Support v1.8
[    1.689368] mv88e6085 gpio-0:00: switch 0x3520 detected: Marvell 88E6352, revision 1
[    1.877661] libphy: mv88e6xxx SMI: probed
[    2.205024] ag71xx 19000000.eth: connected to PHY at mdio.1:1f:04 [uid=004dd041, driver=Generic PHY]
[    2.214126] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    2.219290] mv88e6085 gpio-0:00: switch 0x3520 detected: Marvell 88E6352, revision 1
[    2.400623] libphy: mv88e6xxx SMI: probed
[    2.679660] mv88e6085 gpio-0:00 lan0 (uninitialized): PHY [mv88e6xxx-2:00] driver [Marvell 88E1540]
[    2.698447] mv88e6085 gpio-0:00 lan2 (uninitialized): PHY [mv88e6xxx-2:02] driver [Marvell 88E1540]
[    2.711375] mv88e6085 gpio-0:00 lan3 (uninitialized): PHY [mv88e6xxx-2:03] driver [Marvell 88E1540]
[    2.729265] mv88e6085 gpio-0:00 lan4 (uninitialized): PHY [mv88e6xxx-2:04] driver [Marvell 88E1540]
[    2.741964] DSA: tree 0 setup
[    2.751229] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    2.766394] Freeing unused kernel memory: 1212K
[    2.769502] This architecture does not have kernel memory protection.
[    2.775896] Run /sbin/init as init process
[    3.545724] init: Console is alive
[    3.548196] init: - watchdog -
[    4.945745] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.173449] usbcore: registered new interface driver usbfs
[    5.177677] usbcore: registered new interface driver hub
[    5.182947] usbcore: registered new device driver usb
[    5.202693] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.220181] chipidea-usb2 1b000000.usb: 1b000000.usb supply vbus not found, using dummy regulator
[    5.230799] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    5.234333] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    5.255748] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    5.261004] hub 1-0:1.0: USB hub found
[    5.264119] hub 1-0:1.0: 1 port detected
[    5.269649] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.286151] init: - preinit -
[    5.869482] usb 1-1: new full-speed USB device number 2 using ci_hdrc
[    6.322134] usb 1-1: device descriptor read/64, error -71
[    6.719460] usb 1-1: device descriptor read/64, error -71
[    6.852308] random: jshn: uninitialized urandom read (4 bytes read)
[    7.019503] usb 1-1: new full-speed USB device number 3 using ci_hdrc
[    7.317020] random: jshn: uninitialized urandom read (4 bytes read)
[    7.399461] usb 1-1: device descriptor read/64, error -71
[    7.415018] random: jshn: uninitialized urandom read (4 bytes read)
[    7.735463] usb 1-1: device descriptor read/64, error -71
[    7.794769] eth0: link up (1000Mbps/Full duplex)
[    7.803669] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    7.847598] usb usb1-port1: attempt power cycle
[    8.503410] usb 1-1: new full-speed USB device number 4 using ci_hdrc
[    8.987418] usb 1-1: device not accepting address 4, error -71
[    9.119402] usb 1-1: new full-speed USB device number 5 using ci_hdrc
[    9.603708] usb 1-1: device not accepting address 5, error -71
[    9.608161] usb usb1-port1: unable to enumerate USB device
[   12.200781] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   12.212578] urandom-seed: Seed file not found (/etc/urandom.seed)
[   12.465293] eth0: link down
[   12.486258] procd: - early -
[   12.487943] procd: - watchdog -
[   13.173167] procd: - watchdog -
[   13.332687] procd: - ubus -
[   13.480857] urandom_read: 4 callbacks suppressed
[   13.480869] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.541322] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.547372] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.557164] procd: - init -
[   15.063996] kmodloader: loading kernel modules from /etc/modules.d/*
[   15.435450] Loading modules backported from Linux version v5.10.16-0-gde53befa79cf
[   15.441604] Backport generated by backports.git v5.10.16-1-0-g21d2a1d2
[   15.526867] xt_time: kernel timezone is -0000
[   15.730907] PPP generic driver version 2.4.2
[   15.744837] NET: Registered protocol family 24
[   15.915959] ath: EEPROM regdomain sanitized
[   15.915977] ath: EEPROM regdomain: 0x64
[   15.915982] ath: EEPROM indicates we should expect a direct regpair map
[   15.916010] ath: Country alpha2 being used: 00
[   15.916015] ath: Regpair used: 0x64
[   15.929619] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   15.932941] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   16.055713] urngd: v1.0.2 started.
[   16.064969] kmodloader: done loading kernel modules from /etc/modules.d/*
[   16.624120] random: crng init done
[   79.107606] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   79.127553] jffs2_build_filesystem(): unlocking the mtd device...
[   79.127625] done.
[   79.134264] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   86.146136] eth0: link up (1000Mbps/Full duplex)
[   86.165028] br-lan: port 1(eth0) entered blocking state
[   86.168893] br-lan: port 1(eth0) entered disabled state
[   86.174553] device eth0 entered promiscuous mode
[   86.222124] br-lan: port 1(eth0) entered blocking state
[   86.225944] br-lan: port 1(eth0) entered forwarding state
[   87.167455] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  122.488044] done.
[  122.488563] jffs2: notice: (1686) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  122.670852] overlayfs: upper fs does not support tmpfile.

ip link:

root@OpenWrt:/# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1508 qdisc fq_codel state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
4: lan0@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
5: lan2@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
6: lan3@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
7: lan4@eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
8: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a4 brd ff:ff:ff:ff:ff:ff
9: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff

The driver is probing now. So got a step further.
Now i'm curious about these lines.

[    2.679660] mv88e6085 gpio-0:00 lan0 (uninitialized): PHY [mv88e6xxx-2:00] driver [Marvell 88E1540]
[    2.698447] mv88e6085 gpio-0:00 lan2 (uninitialized): PHY [mv88e6xxx-2:02] driver [Marvell 88E1540]
[    2.711375] mv88e6085 gpio-0:00 lan3 (uninitialized): PHY [mv88e6xxx-2:03] driver [Marvell 88E1540]
[    2.729265] mv88e6085 gpio-0:00 lan4 (uninitialized): PHY [mv88e6xxx-2:04] driver [Marvell 88E1540]

Already tried with a fixed link speed but with the same result.

1 Like

The uninitialized part is normal.
The next part is configure the ar9331 switch ports to untagged.

1 Like

I changed the /etc/config/network to this.

cat /etc/config/network

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 'fd8b:803d:7610::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0 eth1 lan0 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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 5'

Do I achieve that all ports are untagged with this or is there a better method?
I got these messages from the ports.

[   35.004650] eth0: link up (1000Mbps/Full duplex)
[   35.008816] br-lan: port 1(eth0) entered blocking state
[   35.013119] br-lan: port 1(eth0) entered disabled state
[   35.018776] device eth0 entered promiscuous mode
[   35.047672] br-lan: port 1(eth0) entered blocking state
[   35.051492] br-lan: port 1(eth0) entered forwarding state
[   35.149523] mv88e6085 gpio-0:00 lan0: configuring for phy/gmii link mode
[   35.187275] 8021q: adding VLAN 0 to HW filter on device lan0
[   35.211352] br-lan: port 2(lan0) entered blocking state
[   35.215205] br-lan: port 2(lan0) entered disabled state
[   35.261910] device lan0 entered promiscuous mode
[   35.265141] device eth1 entered promiscuous mode
[   35.374076] mv88e6085 gpio-0:00 lan2: configuring for phy/gmii link mode
[   35.380068] 8021q: adding VLAN 0 to HW filter on device lan2
[   35.398960] br-lan: port 3(lan2) entered blocking state
[   35.402817] br-lan: port 3(lan2) entered disabled state
[   35.426484] device lan2 entered promiscuous mode
[   35.436912] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   35.475249] mv88e6085 gpio-0:00 lan3: configuring for phy/gmii link mode
[   35.487841] 8021q: adding VLAN 0 to HW filter on device lan3
[   35.500941] br-lan: port 4(lan3) entered blocking state
[   35.504798] br-lan: port 4(lan3) entered disabled state
[   35.533078] device lan3 entered promiscuous mode
[   35.543461] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   35.587784] mv88e6085 gpio-0:00 lan4: configuring for phy/gmii link mode
[   35.600128] 8021q: adding VLAN 0 to HW filter on device lan4
[   35.610561] br-lan: port 5(lan4) entered blocking state
[   35.614417] br-lan: port 5(lan4) entered disabled state
[   35.642393] device lan4 entered promiscuous mode
[   35.652799] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   36.031555] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   38.818159] mv88e6085 gpio-0:00 lan4: Link is Up - 1Gbps/Full - flow control rx/tx
[   38.824361] br-lan: port 5(lan4) entered blocking state
[   38.829528] br-lan: port 5(lan4) entered forwarding state

Right now i am not able to ping the carambola2 from the network or ping from the carambola2 in the network.

Replace ethernet eth0 with eth1 in your dts.
Also do not bridge DSA master ports (eth0/1) to br-lan.

I replaced eth0 with eth1 and changed /etc/config/network to this.

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 'fd1d:e623:4070::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'lan0 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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 5'

Messages

[   34.759169] eth0: link up (1000Mbps/Full duplex)
[   34.765145] mv88e6085 gpio-0:00 lan0: configuring for phy/gmii link mode
[   34.779912] 8021q: adding VLAN 0 to HW filter on device lan0
[   34.784995] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   34.799094] br-lan: port 1(lan0) entered blocking state
[   34.802948] br-lan: port 1(lan0) entered disabled state
[   34.825702] device lan0 entered promiscuous mode
[   34.828934] device eth0 entered promiscuous mode
[   35.002030] mv88e6085 gpio-0:00 lan2: configuring for phy/gmii link mode
[   35.019923] 8021q: adding VLAN 0 to HW filter on device lan2
[   35.030538] br-lan: port 2(lan2) entered blocking state
[   35.034401] br-lan: port 2(lan2) entered disabled state
[   35.057375] device lan2 entered promiscuous mode
[   35.067776] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   35.108017] mv88e6085 gpio-0:00 lan3: configuring for phy/gmii link mode
[   35.122364] 8021q: adding VLAN 0 to HW filter on device lan3
[   35.132707] br-lan: port 3(lan3) entered blocking state
[   35.136573] br-lan: port 3(lan3) entered disabled state
[   35.160565] device lan3 entered promiscuous mode
[   35.170915] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   35.215998] mv88e6085 gpio-0:00 lan4: configuring for phy/gmii link mode
[   35.230356] 8021q: adding VLAN 0 to HW filter on device lan4
[   35.240334] br-lan: port 4(lan4) entered blocking state
[   35.244187] br-lan: port 4(lan4) entered disabled state
[   35.268667] device lan4 entered promiscuous mode
[   35.279016] mv88e6085 gpio-0:00: p1: already a member of VLAN 1
[   36.869911] mv88e6085 gpio-0:00 lan3: Link is Up - 100Mbps/Full - flow control rx/tx
[   36.895570] br-lan: port 3(lan3) entered blocking state
[   36.899352] br-lan: port 3(lan3) entered forwarding state
[   36.944191] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   38.462172] mv88e6085 gpio-0:00 lan4: Link is Up - 1Gbps/Full - flow control rx/tx
[   38.468377] br-lan: port 4(lan4) entered blocking state
[   38.473548] br-lan: port 4(lan4) entered forwarding state

ip link show

root@OpenWrt:/# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc fq_codel state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
3: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
4: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
5: lan3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
6: lan4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff
7: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a2 brd ff:ff:ff:ff:ff:ff
8: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether c4:93:00:20:bd:a4 brd ff:ff:ff:ff:ff:ff
9: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c4:93:00:20:bd:a3 brd ff:ff:ff:ff:ff:ff

ifconfig

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::c693:ff:fe20:bda3/64 Scope:Link
          inet6 addr: fd1d:e623:4070::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2306 (2.2 KiB)

eth0      Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          inet6 addr: fe80::c693:ff:fe20:bda3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1508  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:7044 (6.8 KiB)
          Interrupt:5

lan0      Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan2      Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:2306 (2.2 KiB)

lan4      Link encap:Ethernet  HWaddr C4:93:00:20:BD:A3
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1102 (1.0 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:387 errors:0 dropped:0 overruns:0 frame:0
          TX packets:387 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30288 (29.5 KiB)  TX bytes:30288 (29.5 KiB)

Not able to ping from and to the carambola2.

I think port 0 is missing in the VLAN ports

Thank you. I changed /etc/config/network to this.

root@OpenWrt:/# cat /etc/config/network

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 'fd1d:e623:4070::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1 lan0 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

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

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

And now i see the VLAN in swconfig

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:a2

Port 0:
        mib: MIB counters
RxGoodByte  : 7362 (7.1 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      : 7362 (7.1 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

But i am still not able to ping the carambola2 module.

1 Like