avila: add model detection, refresh patches. Kaloz: thank you for the review, comment...
[openwrt/openwrt.git] / target / linux / ixp4xx / patches-2.6.24 / 296-avila_mac_plat_info.patch
1 Index: linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
2 ===================================================================
3 --- linux-2.6.24.2.orig/arch/arm/mach-ixp4xx/avila-setup.c
4 +++ linux-2.6.24.2/arch/arm/mach-ixp4xx/avila-setup.c
5 @@ -132,12 +132,42 @@ static struct platform_device avila_pata
6 .resource = avila_pata_resources,
7 };
8
9 +/* Built-in 10/100 Ethernet MAC interfaces */
10 +static struct eth_plat_info avila_plat_eth[] = {
11 + {
12 + .phy = 0,
13 + .rxq = 3,
14 + .txreadyq = 20,
15 + }, {
16 + .phy = 1,
17 + .rxq = 4,
18 + .txreadyq = 21,
19 + }
20 +};
21 +
22 +static struct platform_device avila_eth[] = {
23 + {
24 + .name = "ixp4xx_eth",
25 + .id = IXP4XX_ETH_NPEB,
26 + .dev.platform_data = avila_plat_eth,
27 + }, {
28 + .name = "ixp4xx_eth",
29 + .id = IXP4XX_ETH_NPEC,
30 + .dev.platform_data = avila_plat_eth + 1,
31 + }
32 +};
33 +
34 static struct platform_device *avila_devices[] __initdata = {
35 &avila_i2c_gpio,
36 &avila_flash,
37 &avila_uart
38 };
39
40 +static struct platform_device *avila_eth_devices[] = {
41 + &avila_eth[0],
42 + &avila_eth[1]
43 +};
44 +
45 static void __init avila_init(void)
46 {
47 ixp4xx_sys_init();
48 @@ -159,6 +189,7 @@ static void __init avila_init(void)
49
50 platform_device_register(&avila_pata);
51
52 + platform_add_devices(avila_eth_devices, ARRAY_SIZE(avila_eth_devices));
53 }
54
55 MACHINE_START(AVILA, "Gateworks Avila Network Platform")