]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: Properly handle phylink on at91rm9200
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 19 Feb 2020 14:15:51 +0000 (15:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 23:00:31 +0000 (15:00 -0800)
commit454e955d4c11f7c185d5b40f52d0524f49e88915
tree8a5c0f13e8ac268fbcc653cee874e91d95da2b50
parente2d53f2eb69792d676a815acac2a14f8404203ca
net: macb: Properly handle phylink on at91rm9200

at91ether_init was handling the phy mode and speed but since the switch to
phylink, the NCFGR register got overwritten by macb_mac_config(). The issue
is that the RM9200_RMII bit and the MACB_CLK_DIV32 field are cleared
but never restored as they conflict with the PAE, GBE and PCSSEL bits.

Add new capability to differentiate between EMAC and the other versions of
the IP and use it to set and avoid clearing the relevant bits.

Also, this fixes a NULL pointer dereference in macb_mac_link_up as the EMAC
doesn't use any rings/bufffers/queues.

Fixes: 46e1536937ee ("net: macb: convert to phylink")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c