TJA1101B driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TJA1101B driver

1,270 Views
Thinhnt7
Contributor I

Hello experts

I have a product board using TI processor with two Ethernet interface port are connected to two TJA1101B PHY.

1. The kernel_5.10 has already had the nxp-tja11xx.c driver supported TJA1101B. with two PHY device, I need to change the code as below, is it right?

static struct phy_driver tja11xx_driver[] = {
{
 PHY_ID_MATCH_MODEL(PHY_ID_TJA1101),
.name = "NXP TJA1101 Port1",
.features = PHY_BASIC_T1_FEATURES,
.probe = tja11xx_probe,
.soft_reset = tja11xx_soft_reset,
.config_aneg = tja11xx_config_aneg,
.config_init = tja11xx_config_init,
.read_status = tja11xx_read_status,
.get_sqi = tja11xx_get_sqi,
.get_sqi_max = tja11xx_get_sqi_max,
.suspend = genphy_suspend,
.resume = genphy_resume,
.set_loopback = genphy_loopback,
/* Statistics */
.get_sset_count = tja11xx_get_sset_count,
.get_strings = tja11xx_get_strings,
.get_stats = tja11xx_get_stats,
},
{
PHY_ID_MATCH_MODEL(PHY_ID_TJA1101),
.name = "NXP TJA1101 Port2",
.features = PHY_BASIC_T1_FEATURES,
.probe = tja11xx_probe,
.soft_reset = tja11xx_soft_reset,
.config_aneg = tja11xx_config_aneg,
.config_init = tja11xx_config_init,
.read_status = tja11xx_read_status,
.get_sqi = tja11xx_get_sqi,
.get_sqi_max = tja11xx_get_sqi_max,
.suspend = genphy_suspend,
.resume = genphy_resume,
.set_loopback = genphy_loopback,
/* Statistics */
.get_sset_count = tja11xx_get_sset_count,
.get_strings = tja11xx_get_strings,
.get_stats = tja11xx_get_stats,
},
}

2. With TJA1101B port1 MDIO address is 0x00, TJA1101B port2 MDIO address is 0x02

And I refer to the device tree inside the linux-imx in order to port it inside my kernel with contents of node as below

&ether_port1 {
	phy-mode = "rmii";
	phy-handle = <&ether_phy1>;
	interrupt-parent = <&main_gpio1>;
	interrupts = <22 IRQ_TYPE_LEVEL_LOW>;			/* V3 (GPIO1_22) interrupt */
	reset-gpios =  <&main_gpio1 21 GPIO_ACTIVE_LOW>;/* W2 (GPIO1_21) */
	reset-delay-us = <10>;							/* reset detection times: 5 - 20 uS */
	en-gpios = <&main_gpio1 20 GPIO_ACTIVE_LOW>;	/* Y2 (GPIO1_20) */
	en-delay-us = <10>;								/* detection time on pin EN */
};

&ether_port2 {
	phy-mode = "rmii";
	phy-handle = <&ether_phy2>;
	interrupt-parent = <&main_gpio0>;
	interrupts = <48 IRQ_TYPE_LEVEL_LOW	>;			/* V8 (GPIO0_48) interrupt */
	reset-gpios =  <&main_gpio0 47 GPIO_ACTIVE_LOW>;/* W8 (GPIO0_47) */
	reset-delay-us = <10>;							/* reset detection times: 5 - 20 uS */
	en-gpios = <&main_gpio0 46 GPIO_ACTIVE_LOW>;	/* U8 (GPIO0_46) */
	en-delay-us = <10>;								/* detection time on pin EN */
};

&ether_mdio {
	ether_phy1: ethernet-phy@0 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <0>;
		tja110x,refclk_in;
	};
	ether_phy2: ethernet-phy@2 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <2>;
		tja110x,refclk_in;
	};
};

 

could you recommend me about the solution of PHY-EN, PHY-RST, PHY-INT pin in the PHY driver?

Thanks

 

 

0 Kudos
Reply
0 Replies