Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 Pengutronix |
| 3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it under |
| 6 | * the terms of the GNU General Public License version 2 as published by the |
| 7 | * Free Software Foundation. |
| 8 | */ |
| 9 | #include <asm/sizes.h> |
| 10 | #include <mach/hardware.h> |
| 11 | #include <mach/devices-common.h> |
| 12 | |
| 13 | #define imx_fec_data_entry_single(soc) \ |
| 14 | { \ |
| 15 | .iobase = soc ## _FEC_BASE_ADDR, \ |
| 16 | .irq = soc ## _INT_FEC, \ |
| 17 | } |
| 18 | |
Uwe Kleine-König | 972cc48 | 2010-11-11 18:35:01 +0100 | [diff] [blame] | 19 | #ifdef CONFIG_SOC_IMX25 |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 20 | const struct imx_fec_data imx25_fec_data __initconst = |
| 21 | imx_fec_data_entry_single(MX25); |
Uwe Kleine-König | 972cc48 | 2010-11-11 18:35:01 +0100 | [diff] [blame] | 22 | #endif /* ifdef CONFIG_SOC_IMX25 */ |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 23 | |
| 24 | #ifdef CONFIG_SOC_IMX27 |
| 25 | const struct imx_fec_data imx27_fec_data __initconst = |
| 26 | imx_fec_data_entry_single(MX27); |
| 27 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
| 28 | |
Uwe Kleine-König | a528bc8 | 2010-11-12 10:11:42 +0100 | [diff] [blame] | 29 | #ifdef CONFIG_SOC_IMX35 |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 30 | const struct imx_fec_data imx35_fec_data __initconst = |
| 31 | imx_fec_data_entry_single(MX35); |
| 32 | #endif |
| 33 | |
Richard Zhao | 82c520d | 2011-01-14 17:48:03 +0800 | [diff] [blame^] | 34 | #ifdef CONFIG_SOC_IMX50 |
| 35 | const struct imx_fec_data imx50_fec_data __initconst = |
| 36 | imx_fec_data_entry_single(MX50); |
| 37 | #endif |
| 38 | |
Fabio Estevam | d94ed12 | 2010-11-26 12:25:58 -0200 | [diff] [blame] | 39 | #ifdef CONFIG_SOC_IMX51 |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 40 | const struct imx_fec_data imx51_fec_data __initconst = |
| 41 | imx_fec_data_entry_single(MX51); |
| 42 | #endif |
| 43 | |
Yong Shen | 6390476 | 2011-01-07 12:25:32 +0800 | [diff] [blame] | 44 | #ifdef CONFIG_SOC_IMX53 |
| 45 | const struct imx_fec_data imx53_fec_data __initconst = |
| 46 | imx_fec_data_entry_single(MX53); |
| 47 | #endif |
| 48 | |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 49 | struct platform_device *__init imx_add_fec( |
| 50 | const struct imx_fec_data *data, |
| 51 | const struct fec_platform_data *pdata) |
| 52 | { |
| 53 | struct resource res[] = { |
| 54 | { |
| 55 | .start = data->iobase, |
| 56 | .end = data->iobase + SZ_4K, |
| 57 | .flags = IORESOURCE_MEM, |
| 58 | }, { |
| 59 | .start = data->irq, |
| 60 | .end = data->irq, |
| 61 | .flags = IORESOURCE_IRQ, |
| 62 | }, |
| 63 | }; |
| 64 | |
| 65 | return imx_add_platform_device("fec", 0 /* -1? */, |
| 66 | res, ARRAY_SIZE(res), |
| 67 | pdata, sizeof(*pdata)); |
| 68 | } |