Commit f458ac47 authored by Linus Walleij's avatar Linus Walleij Committed by Jakub Kicinski
Browse files

ARM/net: ixp4xx: Pass ethernet physical base as resource



In order to probe this ethernet interface from the device tree
all physical MMIO regions must be passed as resources. Begin
this rewrite by first passing the port base address as a
resource for all platforms using this driver, remap it in
the driver and avoid using any reference of the statically
mapped virtual address in the driver.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3cb5b0ee
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -132,6 +132,22 @@ static struct platform_device fsg_leds = {
};

/* Built-in 10/100 Ethernet MAC interfaces */
static struct resource fsg_eth_npeb_resources[] = {
	{
		.start		= IXP4XX_EthB_BASE_PHYS,
		.end		= IXP4XX_EthB_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct resource fsg_eth_npec_resources[] = {
	{
		.start		= IXP4XX_EthC_BASE_PHYS,
		.end		= IXP4XX_EthC_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct eth_plat_info fsg_plat_eth[] = {
	{
		.phy		= 5,
@@ -151,12 +167,16 @@ static struct platform_device fsg_eth[] = {
		.dev = {
			.platform_data	= fsg_plat_eth,
		},
		.num_resources	= ARRAY_SIZE(fsg_eth_npeb_resources),
		.resource	= fsg_eth_npeb_resources,
	}, {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEC,
		.dev = {
			.platform_data	= fsg_plat_eth + 1,
		},
		.num_resources	= ARRAY_SIZE(fsg_eth_npec_resources),
		.resource	= fsg_eth_npec_resources,
	}
};

+20 −0
Original line number Diff line number Diff line
@@ -273,6 +273,22 @@ static struct platform_device device_uarts = {


/* Built-in 10/100 Ethernet MAC interfaces */
static struct resource eth_npeb_resources[] = {
	{
		.start		= IXP4XX_EthB_BASE_PHYS,
		.end		= IXP4XX_EthB_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct resource eth_npec_resources[] = {
	{
		.start		= IXP4XX_EthC_BASE_PHYS,
		.end		= IXP4XX_EthC_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct eth_plat_info eth_plat[] = {
	{
		.phy		= 0,
@@ -290,10 +306,14 @@ static struct platform_device device_eth_tab[] = {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEB,
		.dev.platform_data	= eth_plat,
		.num_resources		= ARRAY_SIZE(eth_npeb_resources),
		.resource		= eth_npeb_resources,
	}, {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEC,
		.dev.platform_data	= eth_plat + 1,
		.num_resources		= ARRAY_SIZE(eth_npec_resources),
		.resource		= eth_npec_resources,
	}
};

+20 −0
Original line number Diff line number Diff line
@@ -187,6 +187,22 @@ static struct platform_device ixdp425_uart = {
};

/* Built-in 10/100 Ethernet MAC interfaces */
static struct resource ixp425_npeb_resources[] = {
	{
		.start		= IXP4XX_EthB_BASE_PHYS,
		.end		= IXP4XX_EthB_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct resource ixp425_npec_resources[] = {
	{
		.start		= IXP4XX_EthC_BASE_PHYS,
		.end		= IXP4XX_EthC_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct eth_plat_info ixdp425_plat_eth[] = {
	{
		.phy		= 0,
@@ -204,10 +220,14 @@ static struct platform_device ixdp425_eth[] = {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEB,
		.dev.platform_data	= ixdp425_plat_eth,
		.num_resources		= ARRAY_SIZE(ixp425_npeb_resources),
		.resource		= ixp425_npeb_resources,
	}, {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEC,
		.dev.platform_data	= ixdp425_plat_eth + 1,
		.num_resources		= ARRAY_SIZE(ixp425_npec_resources),
		.resource		= ixp425_npec_resources,
	}
};

+10 −0
Original line number Diff line number Diff line
@@ -165,6 +165,14 @@ static struct platform_device nas100d_uart = {
};

/* Built-in 10/100 Ethernet MAC interfaces */
static struct resource nas100d_eth_resources[] = {
	{
		.start		= IXP4XX_EthB_BASE_PHYS,
		.end		= IXP4XX_EthB_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct eth_plat_info nas100d_plat_eth[] = {
	{
		.phy		= 0,
@@ -178,6 +186,8 @@ static struct platform_device nas100d_eth[] = {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEB,
		.dev.platform_data	= nas100d_plat_eth,
		.num_resources		= ARRAY_SIZE(nas100d_eth_resources),
		.resource		= nas100d_eth_resources,
	}
};

+10 −0
Original line number Diff line number Diff line
@@ -185,6 +185,14 @@ static struct platform_device nslu2_uart = {
};

/* Built-in 10/100 Ethernet MAC interfaces */
static struct resource nslu2_eth_resources[] = {
	{
		.start		= IXP4XX_EthB_BASE_PHYS,
		.end		= IXP4XX_EthB_BASE_PHYS + 0x0fff,
		.flags		= IORESOURCE_MEM,
	},
};

static struct eth_plat_info nslu2_plat_eth[] = {
	{
		.phy		= 1,
@@ -198,6 +206,8 @@ static struct platform_device nslu2_eth[] = {
		.name			= "ixp4xx_eth",
		.id			= IXP4XX_ETH_NPEB,
		.dev.platform_data	= nslu2_plat_eth,
		.num_resources		= ARRAY_SIZE(nslu2_eth_resources),
		.resource		= nslu2_eth_resources,
	}
};

Loading