1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

ramips: use resource to pass irq and base address to the ethernet driver

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18166 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2009-10-26 17:17:18 +00:00
parent 90e4aa2386
commit 487693fb19
3 changed files with 30 additions and 8 deletions

View File

@@ -189,10 +189,8 @@ struct ramips_tx_dma {
struct ramips_eth_platform_data
{
unsigned char mac[6];
unsigned int base_addr;
void (*reset_fe)(void);
int min_pkt_len;
int irq;
};
struct raeth_priv

View File

@@ -103,18 +103,30 @@ static void rt305x_fe_reset(void)
rt305x_sysc_wr(0, RAMIPS_FE_RESET);
}
static struct resource rt305x_eth_resources[] = {
{
.start = RT305X_FE_BASE,
.end = RT305X_FE_BASE + PAGE_SIZE - 1,
.flags = IORESOURCE_MEM,
}, {
.start = RT305X_CPU_IRQ_FE,
.end = RT305X_CPU_IRQ_FE,
.flags = IORESOURCE_IRQ,
},
};
static struct ramips_eth_platform_data ramips_eth_data = {
.mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.base_addr = RT305X_FE_BASE,
.irq = RT305X_CPU_IRQ_FE,
.reset_fe = rt305x_fe_reset,
.min_pkt_len = 64
};
static struct platform_device rt305x_eth_device = {
.name = "ramips_eth",
.name = "ramips_eth",
.resource = rt305x_eth_resources,
.num_resources = ARRAY_SIZE(rt305x_eth_resources),
.dev = {
.platform_data = (void *) &ramips_eth_data,
.platform_data = &ramips_eth_data,
}
};