summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Longchamp <valentin.longchamp@keymile.com>2013-10-18 11:47:21 +0200
committerYork Sun <yorksun@freescale.com>2013-10-24 09:35:59 -0700
commitf51d3b71d4d3eacfbbc6e2cf3fa197774df5f638 (patch)
tree7fba1071d269735aab40c8dcab7027f2811b09af
parent7e157b0ade85282a76db27cbf0ab8a2370d4d7b6 (diff)
net/fman: add a fm_enable_port function
This can be useful if one wants to disable an interface in u-boot because u-boot should not manage it but then later reenable it for FDT fixing or if the kernel uses this interface. Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> [York Sun: fix conflict in fm_eth.h] Acked-by: York Sun <yorksun@freescale.com>
-rw-r--r--drivers/net/fm/b4860.c7
-rw-r--r--drivers/net/fm/fm.h1
-rw-r--r--drivers/net/fm/init.c8
-rw-r--r--drivers/net/fm/p1023.c7
-rw-r--r--drivers/net/fm/p4080.c7
-rw-r--r--drivers/net/fm/p5020.c7
-rw-r--r--drivers/net/fm/p5040.c7
-rw-r--r--drivers/net/fm/t4240.c7
-rw-r--r--include/fm_eth.h1
9 files changed, 52 insertions, 0 deletions
diff --git a/drivers/net/fm/b4860.c b/drivers/net/fm/b4860.c
index 9b3d5324e0..373cc4f424 100644
--- a/drivers/net/fm/b4860.c
+++ b/drivers/net/fm/b4860.c
@@ -37,6 +37,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_be32(&gur->devdisr2, port_to_devdisr[port]);
+}
+
phy_interface_t fman_port_enet_if(enum fm_port port)
{
if (is_device_disabled(port))
diff --git a/drivers/net/fm/fm.h b/drivers/net/fm/fm.h
index 5f197a9829..3ec49a4f3b 100644
--- a/drivers/net/fm/fm.h
+++ b/drivers/net/fm/fm.h
@@ -99,6 +99,7 @@ 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);
+void fman_enable_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 2d13145f14..35edd7ad94 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -145,6 +145,14 @@ void fm_disable_port(enum fm_port port)
fman_disable_port(port);
}
+void fm_enable_port(enum fm_port port)
+{
+ int i = fm_port_to_index(port);
+
+ fm_info[i].enabled = 1;
+ fman_enable_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 0eaad0f45d..b25d10ae0f 100644
--- a/drivers/net/fm/p1023.c
+++ b/drivers/net/fm/p1023.c
@@ -34,6 +34,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_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 febfdd4e87..de71911355 100644
--- a/drivers/net/fm/p4080.c
+++ b/drivers/net/fm/p4080.c
@@ -42,6 +42,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_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 8d49c7bc1f..5c158cd5df 100644
--- a/drivers/net/fm/p5020.c
+++ b/drivers/net/fm/p5020.c
@@ -38,6 +38,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_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/p5040.c b/drivers/net/fm/p5040.c
index 546ebce567..403d7d7948 100644
--- a/drivers/net/fm/p5040.c
+++ b/drivers/net/fm/p5040.c
@@ -44,6 +44,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_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/t4240.c b/drivers/net/fm/t4240.c
index 6253f22f75..1eacb22841 100644
--- a/drivers/net/fm/t4240.c
+++ b/drivers/net/fm/t4240.c
@@ -49,6 +49,13 @@ void fman_disable_port(enum fm_port port)
setbits_be32(&gur->devdisr2, port_to_devdisr[port]);
}
+void fman_enable_port(enum fm_port port)
+{
+ ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+ clrbits_be32(&gur->devdisr2, port_to_devdisr[port]);
+}
+
phy_interface_t fman_port_enet_if(enum fm_port port)
{
ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
diff --git a/include/fm_eth.h b/include/fm_eth.h
index 114bb8cf25..5a4fb70dfa 100644
--- a/include/fm_eth.h
+++ b/include/fm_eth.h
@@ -149,6 +149,7 @@ void fm_info_set_phy_address(enum fm_port port, int address);
int fm_info_get_phy_address(enum fm_port port);
void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
void fm_disable_port(enum fm_port port);
+void fm_enable_port(enum fm_port port);
void set_sgmii_phy(struct mii_dev *bus, enum fm_port base_port,
unsigned int port_num, int phy_base_addr);
int is_qsgmii_riser_card(struct mii_dev *bus, int phy_base_addr,