Path: blob/master/arch/arm/mach-mxs/devices/platform-fec.c
10819 views
/*1* Copyright (C) 2010 Pengutronix2* Uwe Kleine-Koenig <[email protected]>3*4* This program is free software; you can redistribute it and/or modify it under5* the terms of the GNU General Public License version 2 as published by the6* Free Software Foundation.7*/8#include <asm/sizes.h>9#include <mach/mx28.h>10#include <mach/devices-common.h>1112#define mxs_fec_data_entry_single(soc, _id) \13{ \14.id = _id, \15.iobase = soc ## _ENET_MAC ## _id ## _BASE_ADDR, \16.irq = soc ## _INT_ENET_MAC ## _id, \17}1819#define mxs_fec_data_entry(soc, _id) \20[_id] = mxs_fec_data_entry_single(soc, _id)2122#ifdef CONFIG_SOC_IMX2823const struct mxs_fec_data mx28_fec_data[] __initconst = {24#define mx28_fec_data_entry(_id) \25mxs_fec_data_entry(MX28, _id)26mx28_fec_data_entry(0),27mx28_fec_data_entry(1),28};29#endif3031struct platform_device *__init mxs_add_fec(32const struct mxs_fec_data *data,33const struct fec_platform_data *pdata)34{35struct resource res[] = {36{37.start = data->iobase,38.end = data->iobase + SZ_16K - 1,39.flags = IORESOURCE_MEM,40}, {41.start = data->irq,42.end = data->irq,43.flags = IORESOURCE_IRQ,44},45};4647return mxs_add_platform_device_dmamask("imx28-fec", data->id,48res, ARRAY_SIZE(res), pdata, sizeof(*pdata),49DMA_BIT_MASK(32));50}515253