aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/nxp/lpc_eth.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-08-09 16:40:33 +0200
committerArnd Bergmann <arnd@arndb.de>2019-08-15 21:33:52 +0200
commitecca1a6277aac10e40e4baba28adb893899b24b3 (patch)
treec36f914a8560d30ef2a188896b74429edac697aa /drivers/net/ethernet/nxp/lpc_eth.c
parentnet: lpc-enet: factor out iram access (diff)
downloadlinux-dev-ecca1a6277aac10e40e4baba28adb893899b24b3.tar.xz
linux-dev-ecca1a6277aac10e40e4baba28adb893899b24b3.zip
net: lpc-enet: move phy setup into platform code
Setting the phy mode requires touching a platform specific register, which prevents us from building the driver without its header files. Move it into a separate function in arch/arm/mach/lpc32xx to hide the core registers from the network driver. Link: https://lore.kernel.org/r/20190809144043.476786-8-arnd@arndb.de Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/net/ethernet/nxp/lpc_eth.c')
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index bcdd0adcfb0c..0893b77c385d 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -20,9 +20,6 @@
#include <linux/spinlock.h>
#include <linux/soc/nxp/lpc32xx-misc.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
#define MODNAME "lpc-eth"
#define DRV_VERSION "1.00"
@@ -1237,16 +1234,9 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
dma_addr_t dma_handle;
struct resource *res;
int irq, ret;
- u32 tmp;
/* Setup network interface for RMII or MII mode */
- tmp = __raw_readl(LPC32XX_CLKPWR_MACCLK_CTRL);
- tmp &= ~LPC32XX_CLKPWR_MACCTRL_PINS_MSK;
- if (lpc_phy_interface_mode(dev) == PHY_INTERFACE_MODE_MII)
- tmp |= LPC32XX_CLKPWR_MACCTRL_USE_MII_PINS;
- else
- tmp |= LPC32XX_CLKPWR_MACCTRL_USE_RMII_PINS;
- __raw_writel(tmp, LPC32XX_CLKPWR_MACCLK_CTRL);
+ lpc32xx_set_phy_interface_mode(lpc_phy_interface_mode(dev));
/* Get platform resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);