9
0
Fork 0

net: fec: use standard phy type defines

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-03-07 22:33:08 +01:00
parent 31865e8a7f
commit e9e5919dd3
32 changed files with 33 additions and 71 deletions

View File

@ -81,7 +81,7 @@ struct imx_nand_platform_data nand_info = {
};
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 7,
};

View File

@ -47,7 +47,7 @@
#include <asm/barebox-arm-head.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
.phy_addr = 0,
};

View File

@ -47,7 +47,7 @@
#include <mach/devices-imx27.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 1,
};

View File

@ -52,7 +52,7 @@
#include <mach/devices-imx35.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 0,
};

View File

@ -39,7 +39,7 @@
#include <mach/devices-imx51.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
struct imx_nand_platform_data nand_info = {

View File

@ -104,7 +104,7 @@ struct imx_flash_header __flash_header_section flash_header = {
unsigned long __image_len_section barebox_len = DCD_BAREBOX_SIZE;
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
.phy_addr = 1,
};

View File

@ -172,7 +172,7 @@ static void __init mx28_evk_fec_reset(void)
/* PhyAD[0..2]=0, RMIISEL=1 */
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
.phy_addr = 0,
};

View File

@ -60,7 +60,7 @@
#define MX35PDK_BOARD_REV_2 1
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 0x1F,
};

View File

@ -43,7 +43,7 @@
#include <mach/imx-flash-header.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
static iomux_v3_cfg_t f3s_pads[] = {

View File

@ -47,7 +47,7 @@
#include <asm/mmu.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
};
static iomux_v3_cfg_t loco_pads[] = {

View File

@ -41,7 +41,7 @@
#include <asm/mmu.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
};
static iomux_v3_cfg_t smd_pads[] = {

View File

@ -122,7 +122,7 @@ static void mx6_rgmii_rework(struct phy_device *dev)
}
static struct fec_platform_data fec_info = {
.xcv_type = RGMII,
.xcv_type = PHY_INTERFACE_MODE_RGMII,
.phy_init = mx6_rgmii_rework,
.phy_addr = 0,
};

View File

@ -147,7 +147,7 @@ static void mx6_rgmii_rework(struct phy_device *dev)
}
static struct fec_platform_data fec_info = {
.xcv_type = RGMII,
.xcv_type = PHY_INTERFACE_MODE_RGMII,
.phy_init = mx6_rgmii_rework,
.phy_addr = 6,
};

View File

@ -159,7 +159,7 @@ static int ar8031_phy_fixup(struct phy_device *dev)
}
static struct fec_platform_data fec_info = {
.xcv_type = RGMII,
.xcv_type = PHY_INTERFACE_MODE_RGMII,
.phy_addr = 1,
};

View File

@ -43,7 +43,7 @@
#include <mach/devices-imx35.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
struct imx_nand_platform_data nand_info = {

View File

@ -51,7 +51,7 @@
#define BACKLIGHT_POWER_GPIO (GPIO_PORTE + 5)
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 31,
};

View File

@ -47,7 +47,7 @@
#include <asm/mmu.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
};
static iomux_v3_cfg_t vincell_pads[] = {

View File

@ -32,7 +32,7 @@
#include <mach/devices-imx27.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 1,
};

View File

@ -41,7 +41,7 @@
#include <asm/mmu.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
.phy_addr = 0x1f,
};

View File

@ -38,7 +38,7 @@ static struct mxs_mci_platform_data mci_pdata = {
/* PhyAD[0..2]=0, RMIISEL=1 */
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
.phy_addr = 0,
};

View File

@ -46,7 +46,7 @@
IOMUX_PAD(0x6c0, 0x2c0, 4, 0x098c, 1, 0)
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
struct imx_nand_platform_data nand_info = {

View File

@ -41,7 +41,7 @@
#include <asm/mmu.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
};
static iomux_v3_cfg_t tx53_pads[] = {

View File

@ -46,7 +46,7 @@
#include "pll.h"
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 1,
};

View File

@ -46,7 +46,7 @@
#include <mach/generic.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
struct imx_nand_platform_data nand_info = {

View File

@ -40,7 +40,7 @@
#include <mach/devices-imx27.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
.phy_addr = 1,
};

View File

@ -40,7 +40,7 @@
#include <mach/imx5.h>
static struct fec_platform_data fec_info = {
.xcv_type = RMII,
.xcv_type = PHY_INTERFACE_MODE_RMII,
};
static iomux_v3_cfg_t tqma53_pads[] = {

View File

@ -35,7 +35,7 @@
#include <fs.h>
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
.xcv_type = PHY_INTERFACE_MODE_MII,
};
static int devices_init (void)

View File

@ -307,7 +307,7 @@ static int fec_init(struct eth_device *dev)
writel(((fec_clk_get_rate(fec) >> 20) / 5) << 1,
fec->regs + FEC_MII_SPEED);
if (fec->xcv_type == RMII) {
if (fec->interface == PHY_INTERFACE_MODE_RMII) {
if (fec_is_imx28(fec) || fec_is_imx6(fec)) {
rcntl |= FEC_R_CNTRL_RMII_MODE | FEC_R_CNTRL_FCE |
FEC_R_CNTRL_NO_LGTH_CHECK;
@ -325,7 +325,7 @@ static int fec_init(struct eth_device *dev)
}
}
if (fec->xcv_type == RGMII)
if (fec->interface == PHY_INTERFACE_MODE_RGMII)
rcntl |= 1 << 6;
writel(rcntl, fec->regs + FEC_R_CNTRL);
@ -686,11 +686,11 @@ static int fec_probe(struct device_d *dev)
fec_alloc_receive_packets(fec, FEC_RBD_NUM, FEC_MAX_PKT_SIZE);
if (pdata) {
fec->xcv_type = pdata->xcv_type;
fec->interface = pdata->xcv_type;
fec->phy_init = pdata->phy_init;
fec->phy_addr = pdata->phy_addr;
} else {
fec->xcv_type = MII100;
fec->interface = PHY_INTERFACE_MODE_MII;
fec->phy_addr = -1;
}
@ -698,19 +698,6 @@ static int fec_probe(struct device_d *dev)
fec->miibus.read = fec_miibus_read;
fec->miibus.write = fec_miibus_write;
switch (fec->xcv_type) {
case RMII:
fec->interface = PHY_INTERFACE_MODE_RMII;
break;
case RGMII:
fec->interface = PHY_INTERFACE_MODE_RGMII;
break;
case MII10:
fec->phy_flags = PHYLIB_FORCE_10;
case MII100:
fec->interface = PHY_INTERFACE_MODE_MII;
break;
}
fec->miibus.priv = fec;
fec->miibus.parent = dev;

View File

@ -135,7 +135,6 @@ enum fec_type {
struct fec_priv {
struct eth_device edev;
void __iomem *regs;
xceiver_type xcv_type; /* transceiver type */
struct buffer_descriptor __iomem *rbd_base; /* RBD ring */
int rbd_index; /* next receive BD to read */
struct buffer_descriptor __iomem *tbd_base; /* TBD ring */

View File

@ -658,25 +658,12 @@ int mpc5xxx_fec_probe(struct device_d *dev)
fec->tbdBase = (FEC_TBD *)FEC_BD_BASE;
fec->rbdBase = (FEC_RBD *)(FEC_BD_BASE + FEC_TBD_NUM * sizeof(FEC_TBD));
fec->xcv_type = pdata->xcv_type;
fec->interface = pdata->xcv_type;
loadtask(0, 2);
fec->miibus.read = fec5xxx_miibus_read;
fec->miibus.write = fec5xxx_miibus_write;
switch (pdata->xcv_type) {
case RMII:
fec->interface = PHY_INTERFACE_MODE_RMII;
break;
case RGMII:
fec->interface = PHY_INTERFACE_MODE_RGMII;
break;
case MII10:
fec->phy_flags = PHYLIB_FORCE_10;
case MII100:
fec->interface = PHY_INTERFACE_MODE_MII;
break;
}
fec->miibus.priv = fec;
fec->miibus.parent = dev;

View File

@ -252,7 +252,6 @@ typedef struct {
typedef struct {
ethernet_regs *eth;
xceiver_type xcv_type; /* transceiver type */
FEC_RBD *rbdBase; /* RBD ring */
FEC_TBD *tbdBase; /* TBD ring */
uint16_t rbdIndex; /* next receive BD to read */

View File

@ -23,22 +23,12 @@
#include <linux/phy.h>
/*
* Supported phy types on this platform
*/
typedef enum {
MII10,
MII100,
RMII,
RGMII,
} xceiver_type;
/*
* Define the phy connected externally for FEC drivers
* (like MPC52xx and i.MX27)
*/
struct fec_platform_data {
xceiver_type xcv_type;
phy_interface_t xcv_type;
int phy_addr;
void (*phy_init)(struct phy_device *dev);
};