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

Commit a0a08fdc authored by Hartley Sweeten's avatar Hartley Sweeten Committed by Russell King
Browse files

[ARM] 5273/2: ep93xx: move ethernet support into core.c



All EP93xx based systems can support Ethernet. This patch moves
the platform_device setup from the various board support files
into the core support file. The Ethernet driver data still remains
in the individual platform setup files to allow specific platform
configuration.

This also adds Ethernet support to the edb9302, edb9312, and
edb9315 platforms.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 92e88aa7
Loading
Loading
Loading
Loading
+1 −25
Original line number Diff line number Diff line
@@ -47,36 +47,12 @@ static struct ep93xx_eth_data adssphere_eth_data = {
	.phy_id		= 1,
};

static struct resource adssphere_eth_resource[] = {
	{
		.start	= EP93XX_ETHERNET_PHYS_BASE,
		.end	= EP93XX_ETHERNET_PHYS_BASE + 0xffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.start	= IRQ_EP93XX_ETHERNET,
		.end	= IRQ_EP93XX_ETHERNET,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device adssphere_eth_device = {
	.name		= "ep93xx-eth",
	.id		= -1,
	.dev		= {
		.platform_data	= &adssphere_eth_data,
	},
	.num_resources	= 2,
	.resource	= adssphere_eth_resource,
};

static void __init adssphere_init_machine(void)
{
	ep93xx_init_devices();
	platform_device_register(&adssphere_flash);

	memcpy(adssphere_eth_data.dev_addr,
		(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
	platform_device_register(&adssphere_eth_device);
	ep93xx_register_eth(&adssphere_eth_data, 1);
}

MACHINE_START(ADSSPHERE, "ADS Sphere board")
+35 −0
Original line number Diff line number Diff line
@@ -461,6 +461,41 @@ static struct platform_device ep93xx_ohci_device = {
	.resource	= ep93xx_ohci_resources,
};

static struct ep93xx_eth_data ep93xx_eth_data;

static struct resource ep93xx_eth_resource[] = {
	{
		.start	= EP93XX_ETHERNET_PHYS_BASE,
		.end	= EP93XX_ETHERNET_PHYS_BASE + 0xffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.start	= IRQ_EP93XX_ETHERNET,
		.end	= IRQ_EP93XX_ETHERNET,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device ep93xx_eth_device = {
	.name		= "ep93xx-eth",
	.id		= -1,
	.dev		= {
		.platform_data	= &ep93xx_eth_data,
	},
	.num_resources	= ARRAY_SIZE(ep93xx_eth_resource),
	.resource	= ep93xx_eth_resource,
};

void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
{
	if (copy_addr) {
		memcpy(data->dev_addr,
			(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
	}

	ep93xx_eth_data = *data;
	platform_device_register(&ep93xx_eth_device);
}

extern void ep93xx_gpio_init(void);

void __init ep93xx_init_devices(void)
+6 −0
Original line number Diff line number Diff line
@@ -43,10 +43,16 @@ static struct platform_device edb9302_flash = {
	.resource	= &edb9302_flash_resource,
};

static struct ep93xx_eth_data edb9302_eth_data = {
	.phy_id		= 1,
};

static void __init edb9302_init_machine(void)
{
	ep93xx_init_devices();
	platform_device_register(&edb9302_flash);

	ep93xx_register_eth(&edb9302_eth_data, 1);
}

MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
+1 −25
Original line number Diff line number Diff line
@@ -47,36 +47,12 @@ static struct ep93xx_eth_data edb9302a_eth_data = {
	.phy_id			= 1,
};

static struct resource edb9302a_eth_resource[] = {
	{
		.start	= EP93XX_ETHERNET_PHYS_BASE,
		.end	= EP93XX_ETHERNET_PHYS_BASE + 0xffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.start	= IRQ_EP93XX_ETHERNET,
		.end	= IRQ_EP93XX_ETHERNET,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device edb9302a_eth_device = {
	.name		= "ep93xx-eth",
	.id		= -1,
	.dev		= {
		.platform_data	= &edb9302a_eth_data,
	},
	.num_resources	= 2,
	.resource	= edb9302a_eth_resource,
};

static void __init edb9302a_init_machine(void)
{
	ep93xx_init_devices();
	platform_device_register(&edb9302a_flash);

	memcpy(edb9302a_eth_data.dev_addr,
		(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
	platform_device_register(&edb9302a_eth_device);
	ep93xx_register_eth(&edb9302a_eth_data, 1);
}

MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
+1 −25
Original line number Diff line number Diff line
@@ -47,36 +47,12 @@ static struct ep93xx_eth_data edb9307_eth_data = {
	.phy_id			= 1,
};

static struct resource edb9307_eth_resource[] = {
	{
		.start	= EP93XX_ETHERNET_PHYS_BASE,
		.end	= EP93XX_ETHERNET_PHYS_BASE + 0xffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.start	= IRQ_EP93XX_ETHERNET,
		.end	= IRQ_EP93XX_ETHERNET,
		.flags	= IORESOURCE_IRQ,
	}
};

static struct platform_device edb9307_eth_device = {
	.name		= "ep93xx-eth",
	.id		= -1,
	.dev		= {
		.platform_data	= &edb9307_eth_data,
	},
	.num_resources	= 2,
	.resource	= edb9307_eth_resource,
};

static void __init edb9307_init_machine(void)
{
	ep93xx_init_devices();
	platform_device_register(&edb9307_flash);

	memcpy(edb9307_eth_data.dev_addr,
		(void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
	platform_device_register(&edb9307_eth_device);
	ep93xx_register_eth(&edb9307_eth_data, 1);
}

MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
Loading