SJA1105 configuration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SJA1105 configuration

3,146 次查看
amol_kulkarni1
Contributor II

I have attached our hardware design of how iMX8 is connected to SJA1105 and then to KSZ8873 and TJA1101.

 

1. CPU port from iMX8 to SJA is connected on port0 

2. KSZ8873 which is MAC+PHY that is it also behaves like switch connected to port4

2. TJA1101 BroadR phy connected to port2

Issue

Unable to ping the device 

I think I got the SJA1105 driver up it is verifying the device ID.

KSZ and TJA device ID's are also successfully verified 

below is my dts configuration 

 

SJA1105 Configuration

&ecspi1 {
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; /* Check this pin if required as we are using SS0 for chip select */
status = "okay";
##address-cells = <1>
#size-cells = <0>;

switch: sja1105@1 {
reg = <0x0>;
#address-cells = <1>;
#size-cells = <0>;
compatible = "nxp,sja1105q";
spi-max-frequency = <4000000>;
spi-cpha;
fsl,spi-cs-sck-delay = <1000>;
fsl,spi-sck-cs-delay = <1000>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
label = "swp0";
ethernet = <&fec>;
phy-mode = "rmii";
reg = <0>;
fixed-link {
speed = <100>;
full-duplex;
};
};
port@1 {
label = "swp1";
fixed-link = <0 1 100 0 0>;
phy-mode = "mii";
reg = <1>;
};
port@2 {
label = "swp2";
phy-handle = <&fec_phy1>;
phy-mode = "mii";
reg = <2>;
};
port@3 {
label = "swp3";
fixed-link = <0 1 100 0 0>;
phy-mode = "mii";
reg = <3>;
};
port@4 {
label = "swp4";
//phy-handle = <&fec_phy2>;
phy-mode = "mii";
reg = <4>;
fixed-link {
speed = <100>;
full-duplex;
};
};
};
};
};

FEC Configuration 

&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec>;
phy-mode = "rmii";
phy-reset-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
phy-reset-post-delay = <100>;
fsl,magic-packet;
status = "okay";

fixed-link {
speed = <100>;
full-duplex;
};

mdio {
compatible = "snps,dwmac-mdio";
#address-cells = <1>;
#size-cells = <0>;

fec_phy1: fec-phy@0 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0>;
eee-broken-1000t;
tja110x,refclk_in;
};
};

};

 

Issue

Unable to ping the device 

I think I got the SJA1105 driver up it is verifying the device ID.

KSZ and TJA device ID's are also successfully verified 

ip link output
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 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 mq state UP mode DEFAULT group default qlen 1000
link/ether d2:38:41:00:11:65 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 1e:29:0c:9a:d7:58 brd ff:ff:ff:ff:ff:ff
4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can
5: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
link/can
6: swp1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether d2:38:41:00:11:65 brd ff:ff:ff:ff:ff:ff
7: swp2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether d2:38:41:00:11:65 brd ff:ff:ff:ff:ff:ff
8: swp3@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether d2:38:41:00:11:65 brd ff:ff:ff:ff:ff:ff
9: swp4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether d2:38:41:00:11:65 brd ff:ff:ff:ff:ff:ff

ip route output

192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.30
192.168.0.0/24 dev swp4 proto kernel scope link src 192.168.0.20

I dont know what am i missing but unable to ping our HW.

0 项奖励
回复
3 回复数

3,089 次查看
amol_kulkarni1
Contributor II

I have made some more changes as below.

  1. We have RMII interface between iMX8 and SJA1105.
  2. We don't have the oscillator connected to ref clock so we have to generate the ref clock.
  3. Found that SJA1105 in PHY can't provide the clock to imx8.
  4. so now generated the clock of 50 MHZ from imx8 SJA1105.

 

After making these changes now I see ARP packets are going to connected device in my case I have connected PC at KSZ8873.

I check in Wireshark and found the ARP packets are reaching PC and PC is responding back with MAC address.

But looks like these packets are dropped below are ethtool outputs

 

root@imx8-ccomgx2-base:~# ethtool -S eth0 | grep -v ': 0'

NIC statistics:

   mmc_tx_octetcount_gb: 2224

   mmc_tx_framecount_gb: 26

   mmc_tx_broadcastframe_g: 1

   mmc_tx_multicastframe_g: 16

   mmc_tx_64_octets_gb: 2

   mmc_tx_65_to_127_octets_gb: 24

   mmc_tx_unicast_gb: 9

   mmc_tx_multicast_gb: 16

   mmc_tx_broadcast_gb: 1

   mmc_tx_octetcount_g: 2224

   mmc_tx_framecount_g: 26

   mmc_rx_framecount_gb: 4117

   mmc_rx_octetcount_gb: 459131

   mmc_rx_octetcount_g: 459131

   mmc_rx_broadcastframe_g: 4086

   mmc_rx_multicastframe_g: 21

   mmc_rx_64_octets_gb: 3339

   mmc_rx_65_to_127_octets_gb: 92

   mmc_rx_128_to_255_octets_gb: 5

   mmc_rx_256_to_511_octets_gb: 681

   mmc_rx_unicast_g: 10

   mmc_rx_ipc_intr_mask: 1073692671

   mmc_rx_ipv4_gd: 777

   mmc_rx_ipv4_gd_octets: 231359

   mmc_rx_ipv6_gd_octets: 72

   mmc_rx_ipv6_gd: 1

   mmc_rx_udp_gd: 769

   mmc_rx_icmp_gd: 9

   mmc_rx_udp_gd_octets: 215307

   mmc_rx_icmp_gd_octets: 544

   threshold: 1

   tx_pkt_n: 26

   rx_pkt_n: 4117

   normal_irq_n: 4100

   rx_normal_irq_n: 4099

   napi_poll: 8224

   tx_normal_irq_n: 4100

   tx_clean: 4125

   tx_set_ic_bit: 1

   ip_csum_bypassed: 3339

   ipv4_pkt_rcvd: 777

   ipv6_pkt_rcvd: 1

   no_ptp_rx_msg_type_ext: 4117

 

root@imx8-ccomgx2-base:~# ethtool -S swp4 | grep -v ': 0'

NIC statistics:

   tx_packets: 3301

   tx_bytes: 139186

   n_rxfrm: 2973

   n_rxbyte: 312110

   n_txfrm: 3904

   n_txbyte: 420158

   n_egr_disabled: 5

   qlevel_hwm_0: 1

root@imx8-ccomgx2-base:~# 

 

Questions

 

  1. When I load the SJA1105 driver I see the following message, based on below message I understand that swp2 and swp4 are not initialized. Why am I getting this error?

[ 103.534901] sja1105 spi1.0 swp4 (uninitialized PHY [30be0000.ethernet-1:01] driver [Micrel KSZ8873MLL Switch]

[ 103.560539] sja1105 spi1.0 swp4 (uninitialized phy: setting supported 00,00000000,0000024a advertising 00,00000000,0000024a

 

[ 102.452530] sja1105 spi1.0 swp2 (uninitialized PHY [30be0000.ethernet-1:00] driver [NXP TJA1101]

[ 102.477021] sja1105 spi1.0 swp2 (uninitialized phy: setting supported 00,00000000,0000024a advertising 00,00000000,00000000

 

  1. is the SJA1105 driver provided is compatible with imx8mp?
  2. Do I need to worry about the VLAN id here?

 

How am I testing

ifconfig eth0 up (Not assigning the IP address, just making interface up )

ifconfig swp4 192.168.1.20 up (This port is were KSZ8873 phy is connected)

ping 192.168.1.103 (PC IP address)

0 项奖励
回复

3,044 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

Hi Amol,

Hope you are doing well.

Apologies for delay in response.

Kindly delete the FEC node from FEC configurations and update the device tree as per below link:

https://www.kernel.org/doc/Documentation/devicetree/bindings/net/dsa/sja1105.txt

Thanks & Regards,

Ritesh M Patel

0 项奖励
回复

3,113 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

@amol_kulkarni1,

Hope you are doing well.

Apologies for delay in response.

Could you please try doing loopback and share the logs?

Thanks & Regards,

Ritesh M Patel

0 项奖励
回复