This source file includes following definitions.
- imx_add_fec
1
2
3
4
5
6 #include <linux/dma-mapping.h>
7 #include <linux/sizes.h>
8
9 #include "../hardware.h"
10 #include "devices-common.h"
11
12 #define imx_fec_data_entry_single(soc, _devid) \
13 { \
14 .devid = _devid, \
15 .iobase = soc ## _FEC_BASE_ADDR, \
16 .irq = soc ## _INT_FEC, \
17 }
18
19 #ifdef CONFIG_SOC_IMX27
20 const struct imx_fec_data imx27_fec_data __initconst =
21 imx_fec_data_entry_single(MX27, "imx27-fec");
22 #endif
23
24 #ifdef CONFIG_SOC_IMX35
25
26 const struct imx_fec_data imx35_fec_data __initconst =
27 imx_fec_data_entry_single(MX35, "imx27-fec");
28 #endif
29
30 struct platform_device *__init imx_add_fec(
31 const struct imx_fec_data *data,
32 const struct fec_platform_data *pdata)
33 {
34 struct resource res[] = {
35 {
36 .start = data->iobase,
37 .end = data->iobase + SZ_4K - 1,
38 .flags = IORESOURCE_MEM,
39 }, {
40 .start = data->irq,
41 .end = data->irq,
42 .flags = IORESOURCE_IRQ,
43 },
44 };
45
46 return imx_add_platform_device_dmamask(data->devid, 0,
47 res, ARRAY_SIZE(res),
48 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
49 }