Background
Wake-on-LAN ( WoL) is an Ethernet computer networking standard that allows a computer to be turned on or awakened from sleep mode by a network message.
The message is usually sent to the target computer by a program executed on a device connected to the same local area network.
Ethernet connections, including home and work networks, wireless data networks, and the Internet itself, are based on frames sent between computers.
WoL is implemented using a specially designed frame called a magic packet, which is sent to all computers in a network, among them the computer to be awakened. The magic packet contains the MAC address of the destination computer. This is an identifying number, built into each network interface controller (NIC)/Ethernet Controller, that enables the NIC/EnetController to be uniquely recognized and addressed on a network
What is a WOL Magic packet?
The magic packet is a frame that is most often sent as a broadcast and that contains anywhere within its payload 6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal), followed by sixteen repetitions of the target computer's 48-bit MAC address, for a total of 102 bytes.
it is typically sent as a UDP datagram to port 0 (reserved port number), 7 (Echo Protocol) or 9 (Discard Protocol) or directly over Ethernet using EtherType 0x0842
Configure iMX93EVK to wake up on an Ethernet Wake On LAN Magic Packet
Pre-requisite:-
Install 'Wake on LAN' utility on windows from the Microsoft Store.
This utility uses Port 7 to send magic packet as a broadcast to the devices on the network.
Step-1 Make the dts change to enable wake-up functionality on eth1
In the following dts:-
arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
You would see the node entry for the corresponding ethernet, eth1 as eqos.
Add fsl,magic-packet; to the node
After building the changes, boot with the imx93evk image.
Step-2 Enable wake on LAN
By default in linux user-space the wake-on-lan is disabled, to enable the wake-on-lan run:
ethtool -s eth1 wol g
Now you are all set to wake up imx93evk via Ethernet WOL packet.
Put the iMX93 to deep sleep via 'echo mem > /sys/power/state'
Step-3 Send WOL magic packet via Wake On LAN windows utility to wake up iMX93EVK
Make sure the devices are connected to the same local network like imx93evk and laptop connected to the same L2 switch.
Add your imx93evk device to Wake on LAN software, you have to give iMX93EVK's MAC address of the ethernet that the RJ45 cable is connected to[you can get this from 'ifconfig -a' output].
After adding the device, it will look something like below:-
Right-click on the 'imx' device which is registered on Wake on LAN UI and click on 'Send WOL(magic packet)'.
The moment you do that the WOL packet is sent to your iMX from your Laptop/PC on the same network and the iMX is woken up from deep sleep.
Hope you found it helpful. Please drop in any questions/comments just in case.