2008-06-05 15:06:02 Wake On Lan Support
Patrick Roye (UNITED STATES)
Message: 56757
I am working on a project that requires wake-on-lan support on a BF537-stamp board. From reading through the forums and looking at the bfin_mac driver it seems that this functionality is not yet supported. If this is indeed the case, will this functionality be available in the driver anytime soon? Is there anything I could do to help provide this functionality? I have moderate experience writing kernel drivers, and I wouldn't mind taking a stab at it. Thanks.
QuoteReplyEditDelete
2008-06-05 15:36:27 Re: Wake On Lan Support
Mike Frysinger (UNITED STATES)
Message: 56760
adding WOL support should be pretty easy ... you just need to implement the get_wol/set_wol functions of the ethtool struct in bfin_mac.c. there is an open tracker item to finish implementing all the ethtool ops here:
but i dont believe there is a timeframe on it
QuoteReplyEditDelete
2008-06-05 19:48:26 Re: Wake On Lan Support
Patrick Roye (UNITED STATES)
Message: 56774
I tried a lot of things today, but I was never able to get anything to work. Right now I'm just trying to get the board to successfully wake up on receiving a magic packet, though I also attempted both wake on remote frame and global unicast. In my last attempt, I rewrote the bfin_mac_suspend() function as follows:
static int bfin_mac_suspend(struct platform_device *pdev, pm_message_t mesg)
{
unsigned int opmode;
// if (netif_running(net_dev))
// bfin_mac_close(net_dev);
opmode = bfin_read_EMAC_OPMODE();
opmode |= RE;
opmode &= (~TE);
bfin_write_EMAC_OPMODE(opmode);
bfin_write_EMAC_WKUP_CTL( MPKE );
return 0;
}
I had hoped that not closing the device on suspend might do the trick, but no such luck. Any suggestions?
Thanks.
QuoteReplyEditDelete
2008-06-05 22:43:02 Re: Wake On Lan Support
Mike Frysinger (UNITED STATES)
Message: 56778
if you dont enable the PHYWE bit in VR_CTL, then it really doesnt matter how the MAC is configured as it will be masked as a wake up source
QuoteReplyEditDelete
2008-06-06 12:04:13 Re: Wake On Lan Support
Patrick Roye (UNITED STATES)
Message: 56822
What I understand from the Hardware Reference Manual is that setting the PHYWE bit in VR_CTL is used for coming out of a hibernate. I'm trying to make WOL work from a sleep performed by "echo 'standby' > /sys/power/state". Regardless, I tried adding the following to the suspend function:
bfin_write_VR_CTL( bfin_read_VR_CTL() | PHYWE );
enable_irq_wake( IRQ_MAC_RX );
bfin_write_SIC_IWR( IWR_ENABLE_ALL );
Still no wake-ups on the processor though. Anything else I should try?
QuoteReplyEditDelete
2008-06-09 03:36:41 Re: Wake On Lan Support
Michael Hennerich (GERMANY)
Message: 56854
PHYWE is only used during transitions from hibernate state - similar to reset.
What is your default Power Saving Mode ?
[*] Power Management support
[ ] Legacy Power Management API (DEPRECATED)
[ ] Power Management Debug Support
[*] Suspend to RAM and standby
Default Power Saving Mode (Sleep) --->
In case you use Sleep Deeper - Ethernet may not work, because SCLK will be reduced to below 3 MHz. Minimum SCLK for Ethernet is 50MHz.
-Michael
QuoteReplyEditDelete
2008-06-09 04:23:07 Re: Wake On Lan Support
Michael Hennerich (GERMANY)
Message: 56859
enable_irq_wake( IRQ_MAC_RX ); ?!?
One more thing … The EMAC status end error interrupts come all in on IRQ_MAC_ERROR.
List of interrupts on IRQ_MAC_ERROR:
PHY INT DMAR1 OVERFLOW
MAC MGMT COUNTER (MMC)
STATION MGMT TRANSFER DONE
RX FRAME STATUS
TX FRAME STATUS
WAKEUP FRAME
TX DMA DIRECTION ERROR
RX DMA DIRECTION ERROR
EMAC_SYSTAT
So wake on IRQ_MAC_RX won’t work.
-Michael