CPSW - acontis/atemsys GitHub Wiki

am335x-icev2

Both ports used by EcMaster

Additionally remove the davinci_mdio node, and add a replacement to the slave sub nodes.


ethernet@4a100000 {
	compatible = "atemsys";
	atemsys-Ident = "CPSW";

	ti,hwmods = "cpgmac0";
	clocks = <0x3d 0x3e>;
	clock-names = "fck\0cpts";
	cpdma_channels = <0x08>;
	ale_entries = <0x400>;
	bd_ram_size = <0x2000>;
	mac_control = <0x20>;
	slaves = <0x02>;
	active_slave = <0x00>;
	cpts_clock_mult = <0x80000000>;
	cpts_clock_shift = <0x1d>;
	reg = <0x4a100000 0x800 0x4a101200 0x100>;
	#address-cells = <0x01>;
	#size-cells = <0x01>;
	interrupts = <0x28 0x29 0x2a 0x2b>;
	ranges;
	syscon = <0x05>;
	status = "okay";
	pinctrl-names = "default\0sleep";
	pinctrl-0 = <0x3f>;
	pinctrl-1 = <0x40>;
	dual_emac;

	slave@4a100200 {
		compatible = "atemsys";
		atemsys-Ident = "CPSW";
		atemsys-Instance = <0x1>;
		atemsys-phy-reset-gpios = <0x43 0x05 0x01>;
		atemsys-phy-reset-duration = <0x02>;

		mac-address = [00 00 00 00 00 00];
		phy-handle = <0x44>;
		phy-mode = "rmii";
		dual_emac_res_vlan = <0x01>;
		
		mdio@4a100200 {
			#address-cells = <0x01>;
			#size-cells = <0x00>;

			ethernet-phy@1 {
				reg = <0x01>;
				phandle = <0x44>;
			};
		};
	};

	slave@4a100300 {
		compatible = "atemsys";
		atemsys-Ident = "CPSW";
		atemsys-Instance = <0x2>;
		mac-address = [00 00 00 00 00 00];
		phy-handle = <0x45>;
		phy-mode = "rmii";
		dual_emac_res_vlan = <0x02>;
		
		mdio@4a100300 {
			#address-cells = <0x01>;
			#size-cells = <0x00>;
			ethernet-phy@3 {
				reg = <0x03>;
				phandle = <0x45>;
			};
		};
	};

};

first port used by EcMaster, second port used by patched Linux driver

Just change the slave sub node you want to use. The CPSW Linux driver will start the atemsys driver for the node recursively.


ethernet@4a100000 {
	compatible = "ti,am335x-cpsw\0ti,cpsw";
	ti,hwmods = "cpgmac0";
	clocks = <0x3d 0x3e>;
	clock-names = "fck\0cpts";
	cpdma_channels = <0x08>;
	ale_entries = <0x400>;
	bd_ram_size = <0x2000>;
	mac_control = <0x20>;
	slaves = <0x02>;
	active_slave = <0x00>;
	cpts_clock_mult = <0x80000000>;
	cpts_clock_shift = <0x1d>;
	reg = <0x4a100000 0x800 0x4a101200 0x100>;
	#address-cells = <0x01>;
	#size-cells = <0x01>;
	interrupts = <0x28 0x29 0x2a 0x2b>;
	ranges;
	syscon = <0x05>;
	status = "okay";
	pinctrl-names = "default\0sleep";
	pinctrl-0 = <0x3f>;
	pinctrl-1 = <0x40>;
	dual_emac;

	mdio@4a101000 {
		compatible = "ti,cpsw-mdio\0ti,davinci_mdio";
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		ti,hwmods = "davinci_mdio";
		bus_freq = <0xf4240>;
		reg = <0x4a101000 0x100>;
		status = "okay";
		pinctrl-names = "default\0sleep";
		pinctrl-0 = <0x41>;
		pinctrl-1 = <0x42>;
		reset-gpios = <0x43 0x05 0x01>;
		reset-delay-us = <0x02>;

		ethernet-phy@1 {
			reg = <0x01>;
			phandle = <0x44>;
		};

		ethernet-phy@3 {
			reg = <0x03>;
			phandle = <0x45>;
		};
	};

	slave@4a100200 {
		compatible = "atemsys";
		atemsys-Ident = "CPSW";
		atemsys-Instance = <0x1>;
		mac-address = [00 00 00 00 00 00];
		phy-handle = <0x44>;
		phy-mode = "rmii";
		dual_emac_res_vlan = <0x01>;
	};

	slave@4a100300 {
		mac-address = [00 00 00 00 00 00];
		phy-handle = <0x45>;
		phy-mode = "rmii";
		dual_emac_res_vlan = <0x02>;
	};

	cpsw-phy-sel@44e10650 {
		compatible = "ti,am3352-cpsw-phy-sel";
		reg = <0x44e10650 0x04>;
		reg-names = "gmii-sel";
		rmii-clock-ext;
	};
};

⚠️ **GitHub.com Fallback** ⚠️