2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
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.
9 #include <linux/dma-mapping.h>
10 #include <asm/sizes.h>
11 #include <mach/hardware.h>
12 #include <mach/devices-common.h>
14 #define imx_fec_data_entry_single(soc) \
16 .iobase = soc ## _FEC_BASE_ADDR, \
17 .irq = soc ## _INT_FEC, \
20 #ifdef CONFIG_SOC_IMX25
21 const struct imx_fec_data imx25_fec_data __initconst =
22 imx_fec_data_entry_single(MX25);
23 #endif /* ifdef CONFIG_SOC_IMX25 */
25 #ifdef CONFIG_SOC_IMX27
26 const struct imx_fec_data imx27_fec_data __initconst =
27 imx_fec_data_entry_single(MX27);
28 #endif /* ifdef CONFIG_SOC_IMX27 */
30 #ifdef CONFIG_SOC_IMX35
31 const struct imx_fec_data imx35_fec_data __initconst =
32 imx_fec_data_entry_single(MX35);
35 #ifdef CONFIG_SOC_IMX50
36 const struct imx_fec_data imx50_fec_data __initconst =
37 imx_fec_data_entry_single(MX50);
40 #ifdef CONFIG_SOC_IMX51
41 const struct imx_fec_data imx51_fec_data __initconst =
42 imx_fec_data_entry_single(MX51);
45 #ifdef CONFIG_SOC_IMX53
46 const struct imx_fec_data imx53_fec_data __initconst =
47 imx_fec_data_entry_single(MX53);
50 struct platform_device *__init imx_add_fec(
51 const struct imx_fec_data *data,
52 const struct fec_platform_data *pdata)
54 struct resource res[] = {
56 .start = data->iobase,
57 .end = data->iobase + SZ_4K - 1,
58 .flags = IORESOURCE_MEM,
62 .flags = IORESOURCE_IRQ,
66 return imx_add_platform_device_dmamask("fec", 0,
68 pdata, sizeof(*pdata), DMA_BIT_MASK(32));