2019-06-04 16:11:33 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2010-10-06 18:00:18 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Pengutronix
|
|
|
|
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
|
|
|
|
*/
|
2011-06-16 19:01:34 +08:00
|
|
|
#include <linux/dma-mapping.h>
|
2019-05-15 06:46:51 +08:00
|
|
|
#include <linux/sizes.h>
|
2012-09-14 14:14:45 +08:00
|
|
|
|
|
|
|
#include "../hardware.h"
|
2012-09-13 15:51:15 +08:00
|
|
|
#include "devices-common.h"
|
2010-10-06 18:00:18 +08:00
|
|
|
|
2011-07-01 18:11:22 +08:00
|
|
|
#define imx_fec_data_entry_single(soc, _devid) \
|
2010-10-06 18:00:18 +08:00
|
|
|
{ \
|
2011-07-01 18:11:22 +08:00
|
|
|
.devid = _devid, \
|
2010-10-06 18:00:18 +08:00
|
|
|
.iobase = soc ## _FEC_BASE_ADDR, \
|
|
|
|
.irq = soc ## _INT_FEC, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_SOC_IMX27
|
|
|
|
const struct imx_fec_data imx27_fec_data __initconst =
|
2011-07-01 18:11:22 +08:00
|
|
|
imx_fec_data_entry_single(MX27, "imx27-fec");
|
2010-10-06 18:00:18 +08:00
|
|
|
#endif /* ifdef CONFIG_SOC_IMX27 */
|
|
|
|
|
2010-11-12 17:11:42 +08:00
|
|
|
#ifdef CONFIG_SOC_IMX35
|
2011-07-01 18:11:22 +08:00
|
|
|
/* i.mx35 has the i.mx27 type fec */
|
2010-10-06 18:00:18 +08:00
|
|
|
const struct imx_fec_data imx35_fec_data __initconst =
|
2011-07-01 18:11:22 +08:00
|
|
|
imx_fec_data_entry_single(MX35, "imx27-fec");
|
2010-10-06 18:00:18 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
struct platform_device *__init imx_add_fec(
|
|
|
|
const struct imx_fec_data *data,
|
|
|
|
const struct fec_platform_data *pdata)
|
|
|
|
{
|
|
|
|
struct resource res[] = {
|
|
|
|
{
|
|
|
|
.start = data->iobase,
|
2011-03-20 11:17:59 +08:00
|
|
|
.end = data->iobase + SZ_4K - 1,
|
2010-10-06 18:00:18 +08:00
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
}, {
|
|
|
|
.start = data->irq,
|
|
|
|
.end = data->irq,
|
|
|
|
.flags = IORESOURCE_IRQ,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-07-01 18:11:22 +08:00
|
|
|
return imx_add_platform_device_dmamask(data->devid, 0,
|
2010-10-06 18:00:18 +08:00
|
|
|
res, ARRAY_SIZE(res),
|
2011-01-19 18:37:10 +08:00
|
|
|
pdata, sizeof(*pdata), DMA_BIT_MASK(32));
|
2010-10-06 18:00:18 +08:00
|
|
|
}
|