Changes

Jump to: navigation, search

DESK-MX8M-L/Peripherals/Ethernet

6,499 bytes added, 14:24, 29 December 2021
Created page with "<section begin=History/> {| style="border-collapse:collapse; " !colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History |- !style="border-le..."
<section begin=History/>
{| style="border-collapse:collapse; "
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
|-
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|1.0.0
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Jan 2022
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M release
|-
|}
<section end=History/>
<section begin=Body/>

==Peripheral Ethernet ==

The ethernet interface is made available through the i.MX6 '''fec''' interface which should be initialized on the device tree.

=== Device tree configuration ===
Here below an example of device tree configuration used on standard DAVE's kit for the ORCA SOM:

From <code>imx8mp-mito8mplus-cb1001.dts </code>:

<pre>
&fec {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_fec>;
phy-mode = "rgmii-id";
phy-handle = <&ethphy1>;
fsl,magic-packet;
status = "okay";

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

ethphy1: ethernet-phy@8 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <8>;
eee-broken-1000t;
eee-broken-100tx;
};
};
};
</pre>


From <code>imx8mp-mito8mplus.dtsi </code>:

<pre>
&eqos {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_eqos>;
phy-mode = "rgmii-id";
phy-handle = <&ethphy0>;
status = "okay";

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

ethphy0: ethernet-phy@7 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <7>;
eee-broken-1000t;
eee-broken-100tx;
};
};
};
...
...

&iomuxc {
...
...
pinctrl_eqos: eqosgrp {
fsl,pins = <
MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC 0x3
MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO 0x3
MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0 0x91
MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1 0x91
MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2 0x91
MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3 0x91
MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK 0x91
MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x91
MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0 0x1f
MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1 0x1f
MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2 0x1f
MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3 0x1f
MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x1f
MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK 0x1f
MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x19
>;
};

pinctrl_fec: fecgrp {
fsl,pins = <
MX8MP_IOMUXC_SAI1_RXD2__ENET1_MDC 0x3
MX8MP_IOMUXC_SAI1_RXD3__ENET1_MDIO 0x3
MX8MP_IOMUXC_SAI1_RXD4__ENET1_RGMII_RD0 0x91
MX8MP_IOMUXC_SAI1_RXD5__ENET1_RGMII_RD1 0x91
MX8MP_IOMUXC_SAI1_RXD6__ENET1_RGMII_RD2 0x91
MX8MP_IOMUXC_SAI1_RXD7__ENET1_RGMII_RD3 0x91
MX8MP_IOMUXC_SAI1_TXC__ENET1_RGMII_RXC 0x91
MX8MP_IOMUXC_SAI1_TXFS__ENET1_RGMII_RX_CTL 0x91
MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0 0x1f
MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1 0x1f
MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2 0x1f
MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3 0x1f
MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL 0x1f
MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC 0x1f
MX8MP_IOMUXC_SAI1_RXD0__GPIO4_IO02 0x19
>;
};
...
...
};
</pre>

===Accessing the peripheral===
ORCA SOM provides the network interface mapped as <code>eth0</code> and <code>eth1</code>.

====Linux messages at boot time====

* <code>eth0</code>
<pre class="workstation-terminal">
...
...
[ 2.253084] fec 30be0000.ethernet eth0: registered PHC device 0
...
[ 6.211939] Generic PHY 30be0000.ethernet-1:08: attached PHY driver [Generic PHY] (mii_bus:phy_addr=30be0000.ethernet-1:08, irq=POLL)
</pre>

* <code>eth1</code>
<pre class="workstation-terminal">
[ 6.139981] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:07] driver [Microchip KSZ9131 Gigabit PHY]
[ 6.162868] imx-dwmac 30bf0000.ethernet eth1: No Safety Features support found
[ 6.170459] imx-dwmac 30bf0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[ 6.181622] imx-dwmac 30bf0000.ethernet eth1: registered PTP clock
[ 6.187870] imx-dwmac 30bf0000.ethernet eth1: configuring for phy/rgmii-id link mode
</pre>

Cable connection:

<pre class="workstation-terminal">
...
...
[ 8.277607] fec 30be0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 8.285568] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
</pre>

==== Check the interface with ifconfig ====

<pre class="workstation-terminal">
root@desk-mx8mp:~# ifconfig eth0
eth0 Link encap:Ethernet HWaddr f2:b3:2f:ee:0c:69
inet6 addr: fe80::f0b3:2fff:feee:c69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16657 errors:0 dropped:0 overruns:0 frame:0
TX packets:109 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1806277 (1.7 MiB) TX bytes:19191 (18.7 KiB)

root@desk-mx8mp:~# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 2e:89:64:91:78:a6
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)
Interrupt:45

root@desk-mx8mp:~#
</pre>

==== Test with [https://iperf.fr/ iperf3] ====

<pre class="workstation-terminal">
root@desk-mx8mp:~# iperf3 -t 5 -c 192.168.0.125
Connecting to host 192.168.0.125, port 5201

root@desk-mx8mp:~#
</pre>

<section end=Body/>

----

[[Category:ORCA]]
8,286
edits

Navigation menu