Add linux-next specific files for 20110831
[linux-2.6/next.git] / arch / arm / mach-mxs / devices / platform-fec.c
blobae96a4fd8f14f3da31da730f1f36be3aa2af80b4
1 /*
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.
8 */
9 #include <linux/dma-mapping.h>
10 #include <asm/sizes.h>
11 #include <mach/mx28.h>
12 #include <mach/devices-common.h>
14 #define mxs_fec_data_entry_single(soc, _id) \
15 { \
16 .id = _id, \
17 .iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \
18 .irq = soc ## _INT_ENET_MAC ## _id, \
21 #define mxs_fec_data_entry(soc, _id) \
22 [_id] = mxs_fec_data_entry_single(soc, _id)
24 #ifdef CONFIG_SOC_IMX28
25 const struct mxs_fec_data mx28_fec_data[] __initconst = {
26 #define mx28_fec_data_entry(_id) \
27 mxs_fec_data_entry(MX28, _id)
28 mx28_fec_data_entry(0),
29 mx28_fec_data_entry(1),
31 #endif
33 struct platform_device *__init mxs_add_fec(
34 const struct mxs_fec_data *data,
35 const struct fec_platform_data *pdata)
37 struct resource res[] = {
39 .start = data->iobase,
40 .end = data->iobase + SZ_16K - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
49 return mxs_add_platform_device_dmamask("imx28-fec", data->id,
50 res, ARRAY_SIZE(res), pdata, sizeof(*pdata),
51 DMA_BIT_MASK(32));