summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-02-20 18:08:05 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-02-20 18:25:16 +0100
commit370f550107b57f02c7cb5cdbdf8b6c0872de0acd (patch)
treef7e8f344b6fb1cc8a4ceab2bc7989cab293a5c3c
parent5392235bddf419390817092c00fe8fb8d388a0c7 (diff)
downloadbarebox-370f550107b57f02c7cb5cdbdf8b6c0872de0acd.tar.gz
barebox-370f550107b57f02c7cb5cdbdf8b6c0872de0acd.tar.xz
fec imx27: configure phy address from platform data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--board/imx27ads/imx27ads.c1
-rw-r--r--board/pcm038/pcm038.c1
-rw-r--r--drivers/net/fec_imx27.c4
-rw-r--r--include/fec.h24
4 files changed, 16 insertions, 14 deletions
diff --git a/board/imx27ads/imx27ads.c b/board/imx27ads/imx27ads.c
index 9defd71e37..5ce8b8e5c2 100644
--- a/board/imx27ads/imx27ads.c
+++ b/board/imx27ads/imx27ads.c
@@ -53,6 +53,7 @@ static struct device_d sdram_dev = {
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
+ .phy_addr = 1,
};
static struct device_d fec_dev = {
diff --git a/board/pcm038/pcm038.c b/board/pcm038/pcm038.c
index 2182a3649e..73a2eae666 100644
--- a/board/pcm038/pcm038.c
+++ b/board/pcm038/pcm038.c
@@ -70,6 +70,7 @@ static struct device_d sram_dev = {
static struct fec_platform_data fec_info = {
.xcv_type = MII100,
+ .phy_addr = 1,
};
static struct device_d fec_dev = {
diff --git a/drivers/net/fec_imx27.c b/drivers/net/fec_imx27.c
index 279c06434e..3cf8d6a69d 100644
--- a/drivers/net/fec_imx27.c
+++ b/drivers/net/fec_imx27.c
@@ -34,8 +34,6 @@
#include <asm/arch/clock.h>
#include <xfuncs.h>
-#define CONFIG_PHY_ADDR 1 /* FIXME */
-
typedef struct {
uint8_t data[1500]; /**< actual data */
int length; /**< actual length */
@@ -620,7 +618,7 @@ int fec_probe(struct device_d *dev)
if (fec->xcv_type != SEVENWIRE) {
fec->miiphy.read = fec_miiphy_read;
fec->miiphy.write = fec_miiphy_write;
- fec->miiphy.address = CONFIG_PHY_ADDR;
+ fec->miiphy.address = pdata->phy_addr;
fec->miiphy.flags = pdata->xcv_type == MII10 ? MIIPHY_FORCE_10 : 0;
fec->miiphy.edev = edev;
diff --git a/include/fec.h b/include/fec.h
index f8247da57a..8f6bdb3fdc 100644
--- a/include/fec.h
+++ b/include/fec.h
@@ -25,21 +25,23 @@
#ifndef __INCLUDE_NETWORK_FEC_H
#define __INCLUDE_NETWORK_FEC_H
-/**
+/*
+ * Supported phy types on this platform
+ */
+typedef enum {
+ SEVENWIRE,
+ MII10,
+ MII100,
+} xceiver_type;
+
+/*
* Define the phy connected externally for FEC drivers
* (like MPC52xx and i.MX27)
*/
struct fec_platform_data {
- ulong xcv_type; /**< phy's type. See enum xceiver_type */
+ xceiver_type xcv_type;
+ int phy_addr;
};
-/**
- * Supported phy types on this platform
- */
-typedef enum {
- SEVENWIRE, /**< 7-wire */
- MII10, /**< MII 10Mbps */
- MII100 /**< MII 100Mbps */
-} xceiver_type;
-
#endif /* __INCLUDE_NETWORK_FEC_H */
+