1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6 #include <linux/dma-mapping.h>
7 #include <linux/sizes.h>
9 #include "../hardware.h"
10 #include "devices-common.h"
12 #define imx_fec_data_entry_single(soc, _devid) \
15 .iobase = soc ## _FEC_BASE_ADDR, \
16 .irq = soc ## _INT_FEC, \
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 /* ifdef CONFIG_SOC_IMX27 */
24 #ifdef CONFIG_SOC_IMX35
25 /* i.mx35 has the i.mx27 type fec */
26 const struct imx_fec_data imx35_fec_data __initconst
=
27 imx_fec_data_entry_single(MX35
, "imx27-fec");
30 struct platform_device
*__init
imx_add_fec(
31 const struct imx_fec_data
*data
,
32 const struct fec_platform_data
*pdata
)
34 struct resource res
[] = {
36 .start
= data
->iobase
,
37 .end
= data
->iobase
+ SZ_4K
- 1,
38 .flags
= IORESOURCE_MEM
,
42 .flags
= IORESOURCE_IRQ
,
46 return imx_add_platform_device_dmamask(data
->devid
, 0,
48 pdata
, sizeof(*pdata
), DMA_BIT_MASK(32));