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

/dts-v1/;

#include "ipq6000-link.dtsi"

/ {
	model = "Link NN6000 v1";
	compatible = "link,nn6000-v1", "qcom,ipq6018";

	aliases {
		ethernet1 = &dp2;
		ethernet2 = &dp3;
		ethernet3 = &dp4;
	};
};

&mdio {
	status = "okay";

	pinctrl-0 = <&mdio_pins>;
	pinctrl-names = "default";
	reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;

	ethernet-phy-package@0 {
		compatible = "qcom,qca8075-package";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0>;

		qca8075_1: ethernet-phy@1 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <1>;
		};

		qca8075_2: ethernet-phy@2 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <2>;
		};

		qca8075_3: ethernet-phy@3 {
			compatible = "ethernet-phy-ieee802.3-c22";
			reg = <3>;
		};
	};
};

&switch {
	status = "okay";

	switch_lan_bmp = <(ESS_PORT3 | ESS_PORT4)>;
	switch_wan_bmp = <ESS_PORT2>;
	switch_mac_mode = <MAC_MODE_PSGMII>;

	qcom,port_phyinfo {
		port@2 {
			port_id = <2>;
			phy_address = <1>;
		};

		port@3 {
			port_id = <3>;
			phy_address = <2>;
		};

		port@4 {
			port_id = <4>;
			phy_address = <3>;
		};
	};
};

&dp2 {
	status = "okay";
	phy-handle = <&qca8075_1>;
	label = "wan";
};

&dp3 {
	status = "okay";
	phy-handle = <&qca8075_2>;
	label = "lan1";
};

&dp4 {
	status = "okay";
	phy-handle = <&qca8075_3>;
	label = "lan2";
};
