Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02460d08 authored by Sonic Zhang's avatar Sonic Zhang Committed by Mike Frysinger
Browse files

netdev: bfin_mac: push settings to platform resources



Move all the pin settings out of the Kconfig and into the platform
resources (MII vs RMII).  This clean up also lets us push out the
phy settings so that board porters may control the layout.

Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 229aebb8
Loading
Loading
Loading
Loading
+43 −1
Original line number Original line Diff line number Diff line
@@ -87,13 +87,55 @@ static struct platform_device rtc_device = {
#endif
#endif


#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#include <linux/bfin_mac.h>
static const unsigned short bfin_mac_peripherals[] = {
	P_MII0_ETxD0,
	P_MII0_ETxD1,
	P_MII0_ETxEN,
	P_MII0_ERxD0,
	P_MII0_ERxD1,
	P_MII0_TxCLK,
	P_MII0_PHYINT,
	P_MII0_CRS,
	P_MII0_MDC,
	P_MII0_MDIO,
	0
};

static struct bfin_phydev_platform_data bfin_phydev_data[] = {
	{
		.addr = 1,
		.irq = IRQ_MAC_PHYINT,
	},
	{
		.addr = 2,
		.irq = IRQ_MAC_PHYINT,
	},
	{
		.addr = 3,
		.irq = IRQ_MAC_PHYINT,
	},
};

static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
	.phydev_number = 3,
	.phydev_data = bfin_phydev_data,
	.phy_mode = PHY_INTERFACE_MODE_MII,
	.mac_peripherals = bfin_mac_peripherals,
};

static struct platform_device bfin_mii_bus = {
static struct platform_device bfin_mii_bus = {
	.name = "bfin_mii_bus",
	.name = "bfin_mii_bus",
	.dev = {
		.platform_data = &bfin_mii_bus_data,
	}
};
};


static struct platform_device bfin_mac_device = {
static struct platform_device bfin_mac_device = {
	.name = "bfin_mac",
	.name = "bfin_mac",
	.dev.platform_data = &bfin_mii_bus,
	.dev = {
		.platform_data = &bfin_mii_bus,
	}
};
};


#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
+23 −1
Original line number Original line Diff line number Diff line
@@ -81,13 +81,35 @@ static struct platform_device rtc_device = {
#endif
#endif


#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#include <linux/bfin_mac.h>
static const unsigned short bfin_mac_peripherals[] = P_MII0;

static struct bfin_phydev_platform_data bfin_phydev_data[] = {
	{
		.addr = 1,
		.irq = IRQ_MAC_PHYINT,
	},
};

static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
	.phydev_number = 1,
	.phydev_data = bfin_phydev_data,
	.phy_mode = PHY_INTERFACE_MODE_MII,
	.mac_peripherals = bfin_mac_peripherals,
};

static struct platform_device bfin_mii_bus = {
static struct platform_device bfin_mii_bus = {
	.name = "bfin_mii_bus",
	.name = "bfin_mii_bus",
	.dev = {
		.platform_data = &bfin_mii_bus_data,
	}
};
};


static struct platform_device bfin_mac_device = {
static struct platform_device bfin_mac_device = {
	.name = "bfin_mac",
	.name = "bfin_mac",
	.dev.platform_data = &bfin_mii_bus,
	.dev = {
		.platform_data = &bfin_mii_bus,
	}
};
};
#endif
#endif


+23 −1
Original line number Original line Diff line number Diff line
@@ -273,13 +273,35 @@ static struct platform_device dm9000_device = {
#endif
#endif


#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#include <linux/bfin_mac.h>
static const unsigned short bfin_mac_peripherals[] = P_RMII0;

static struct bfin_phydev_platform_data bfin_phydev_data[] = {
	{
		.addr = 1,
		.irq = IRQ_MAC_PHYINT,
	},
};

static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
	.phydev_number = 1,
	.phydev_data = bfin_phydev_data,
	.phy_mode = PHY_INTERFACE_MODE_RMII,
	.mac_peripherals = bfin_mac_peripherals,
};

static struct platform_device bfin_mii_bus = {
static struct platform_device bfin_mii_bus = {
	.name = "bfin_mii_bus",
	.name = "bfin_mii_bus",
	.dev = {
		.platform_data = &bfin_mii_bus_data,
	}
};
};


static struct platform_device bfin_mac_device = {
static struct platform_device bfin_mac_device = {
	.name = "bfin_mac",
	.name = "bfin_mac",
	.dev.platform_data = &bfin_mii_bus,
	.dev = {
		.platform_data = &bfin_mii_bus,
	}
};
};
#endif
#endif


+23 −1
Original line number Original line Diff line number Diff line
@@ -193,13 +193,35 @@ static struct platform_device rtc_device = {




#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#include <linux/bfin_mac.h>
static const unsigned short bfin_mac_peripherals[] = P_RMII0;

static struct bfin_phydev_platform_data bfin_phydev_data[] = {
	{
		.addr = 1,
		.irq = IRQ_MAC_PHYINT,
	},
};

static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
	.phydev_number = 1,
	.phydev_data = bfin_phydev_data,
	.phy_mode = PHY_INTERFACE_MODE_RMII,
	.mac_peripherals = bfin_mac_peripherals,
};

static struct platform_device bfin_mii_bus = {
static struct platform_device bfin_mii_bus = {
	.name = "bfin_mii_bus",
	.name = "bfin_mii_bus",
	.dev = {
		.platform_data = &bfin_mii_bus_data,
	}
};
};


static struct platform_device bfin_mac_device = {
static struct platform_device bfin_mac_device = {
	.name = "bfin_mac",
	.name = "bfin_mac",
	.dev.platform_data = &bfin_mii_bus,
	.dev = {
		.platform_data = &bfin_mii_bus,
	}
};
};
#endif
#endif


+23 −1
Original line number Original line Diff line number Diff line
@@ -366,13 +366,35 @@ static struct platform_device dm9000_device = {
#endif
#endif


#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
#include <linux/bfin_mac.h>
static const unsigned short bfin_mac_peripherals[] = P_RMII0;

static struct bfin_phydev_platform_data bfin_phydev_data[] = {
	{
		.addr = 1,
		.irq = IRQ_MAC_PHYINT,
	},
};

static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
	.phydev_number = 1,
	.phydev_data = bfin_phydev_data,
	.phy_mode = PHY_INTERFACE_MODE_RMII,
	.mac_peripherals = bfin_mac_peripherals,
};

static struct platform_device bfin_mii_bus = {
static struct platform_device bfin_mii_bus = {
	.name = "bfin_mii_bus",
	.name = "bfin_mii_bus",
	.dev = {
		.platform_data = &bfin_mii_bus_data,
	}
};
};


static struct platform_device bfin_mac_device = {
static struct platform_device bfin_mac_device = {
	.name = "bfin_mac",
	.name = "bfin_mac",
	.dev.platform_data = &bfin_mii_bus,
	.dev = {
		.platform_data = &bfin_mii_bus,
	}
};
};
#endif
#endif


Loading