]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - arch/arm/mach-imx/devices/platform-fec.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-jammy-kernel.git] / arch / arm / mach-imx / devices / platform-fec.c
CommitLineData
d2912cb1 1// SPDX-License-Identifier: GPL-2.0-only
6bd96f3c
UKK
2/*
3 * Copyright (C) 2010 Pengutronix
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
6bd96f3c 5 */
b7f080cf 6#include <linux/dma-mapping.h>
87dfb311 7#include <linux/sizes.h>
50f2de61
SG
8
9#include "../hardware.h"
e0557c0d 10#include "devices-common.h"
6bd96f3c 11
0ca1e290 12#define imx_fec_data_entry_single(soc, _devid) \
6bd96f3c 13 { \
0ca1e290 14 .devid = _devid, \
6bd96f3c
UKK
15 .iobase = soc ## _FEC_BASE_ADDR, \
16 .irq = soc ## _INT_FEC, \
17 }
18
6bd96f3c
UKK
19#ifdef CONFIG_SOC_IMX27
20const struct imx_fec_data imx27_fec_data __initconst =
0ca1e290 21 imx_fec_data_entry_single(MX27, "imx27-fec");
6bd96f3c
UKK
22#endif /* ifdef CONFIG_SOC_IMX27 */
23
a528bc87 24#ifdef CONFIG_SOC_IMX35
0ca1e290 25/* i.mx35 has the i.mx27 type fec */
6bd96f3c 26const struct imx_fec_data imx35_fec_data __initconst =
0ca1e290 27 imx_fec_data_entry_single(MX35, "imx27-fec");
6bd96f3c
UKK
28#endif
29
6bd96f3c
UKK
30struct 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,
5d187245 37 .end = data->iobase + SZ_4K - 1,
6bd96f3c
UKK
38 .flags = IORESOURCE_MEM,
39 }, {
40 .start = data->irq,
41 .end = data->irq,
42 .flags = IORESOURCE_IRQ,
43 },
44 };
45
0ca1e290 46 return imx_add_platform_device_dmamask(data->devid, 0,
6bd96f3c 47 res, ARRAY_SIZE(res),
78159566 48 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
6bd96f3c 49}