net: fec: set GPR bit on suspend by DT configuration.
authorMartin Fuzzey <martin.fuzzey@flowbird.group>
Thu, 2 Apr 2020 13:51:27 +0000 (15:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Apr 2020 01:23:37 +0000 (18:23 -0700)
commitda722186f6549d752ea5b5fbc18111833c81a133
tree89bab2944dc6d1767466f03c7e9d15e7a76f8ee8
parent045065f06f938d3171b3ffacb34453421a32c1e3
net: fec: set GPR bit on suspend by DT configuration.

On some SoCs, such as the i.MX6, it is necessary to set a bit
in the SoC level GPR register before suspending for wake on lan
to work.

The fec platform callback sleep_mode_enable was intended to allow this
but the platform implementation was NAK'd back in 2015 [1]

This means that, currently, wake on lan is broken on mainline for
the i.MX6 at least.

So implement the required bit setting in the fec driver by itself
by adding a new optional DT property indicating the GPR register
and adding the offset and bit information to the driver.

[1] https://www.spinics.net/lists/netdev/msg310922.html

Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c