summaryrefslogtreecommitdiff
path: root/drivers/net/fm
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2011-09-14 12:01:35 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-10-03 08:52:15 -0500
commit69a852425883a4abd8dc726da34e3149a08ee95d (patch)
treed919f003c01ee119e4938d67b15a3cdb9f0c407c /drivers/net/fm
parent2b3a1cdd9ed14441ae91845851aaf91adddbafc0 (diff)
fm-eth: Add ability for board code to disable a port
The SoC configuration may have more ports enabled than a given board actually can utilize. Add a routinue that allows the board code to disable a port that it knows isn't being used. fm_disable_port() needs to be called before cpu_eth_init(). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/net/fm')
-rw-r--r--drivers/net/fm/fm.h1
-rw-r--r--drivers/net/fm/init.c8
-rw-r--r--drivers/net/fm/p1023.c6
-rw-r--r--drivers/net/fm/p4080.c6
-rw-r--r--drivers/net/fm/p5020.c6
5 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/fm/fm.h b/drivers/net/fm/fm.h
index be6714f27a..228df330f1 100644
--- a/drivers/net/fm/fm.h
+++ b/drivers/net/fm/fm.h
@@ -110,6 +110,7 @@ u32 fm_muram_base(int fm_idx);
int fm_init_common(int index, struct ccsr_fman *reg);
int fm_eth_initialize(struct ccsr_fman *reg, struct fm_eth_info *info);
phy_interface_t fman_port_enet_if(enum fm_port port);
+void fman_disable_port(enum fm_port port);
struct fsl_enet_mac {
void *base; /* MAC controller registers base address */
diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index 5f05ab14af..512d7dd3de 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -123,6 +123,14 @@ void fman_enet_init(void)
return ;
}
+void fm_disable_port(enum fm_port port)
+{
+ int i = fm_port_to_index(port);
+
+ fm_info[i].enabled = 0;
+ fman_disable_port(port);
+}
+
void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus)
{
int i = fm_port_to_index(port);
diff --git a/drivers/net/fm/p1023.c b/drivers/net/fm/p1023.c
index c196e79b68..b17dc40b8a 100644
--- a/drivers/net/fm/p1023.c
+++ b/drivers/net/fm/p1023.c
@@ -36,6 +36,12 @@ static int is_device_disabled(enum fm_port port)
return port_to_devdisr[port] & devdisr;
}
+void fman_disable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ setbits_be32(&gur->devdisr, port_to_devdisr[port]);
+}
+
phy_interface_t fman_port_enet_if(enum fm_port port)
{
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
diff --git a/drivers/net/fm/p4080.c b/drivers/net/fm/p4080.c
index 6761a2f43b..791caab7ec 100644
--- a/drivers/net/fm/p4080.c
+++ b/drivers/net/fm/p4080.c
@@ -44,6 +44,12 @@ static int is_device_disabled(enum fm_port port)
return port_to_devdisr[port] & devdisr2;
}
+void fman_disable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
+}
+
phy_interface_t fman_port_enet_if(enum fm_port port)
{
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
diff --git a/drivers/net/fm/p5020.c b/drivers/net/fm/p5020.c
index 59638eb2aa..69c27d2237 100644
--- a/drivers/net/fm/p5020.c
+++ b/drivers/net/fm/p5020.c
@@ -40,6 +40,12 @@ static int is_device_disabled(enum fm_port port)
return port_to_devdisr[port] & devdisr2;
}
+void fman_disable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+ setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
+}
+
phy_interface_t fman_port_enet_if(enum fm_port port)
{
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);