]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fm-eth: Add ability for board code to disable a port
authorKumar Gala <galak@kernel.crashing.org>
Wed, 14 Sep 2011 17:01:35 +0000 (12:01 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 3 Oct 2011 13:52:15 +0000 (08:52 -0500)
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>
drivers/net/fm/fm.h
drivers/net/fm/init.c
drivers/net/fm/p1023.c
drivers/net/fm/p4080.c
drivers/net/fm/p5020.c
include/fm_eth.h

index be6714f27a9cd99faf064da9e3af976134d42ee4..228df330f185627c22b64ca797a9f179f48a03d3 100644 (file)
@@ -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 */
index 5f05ab14afc975e61c3397760fffd3ebfd435503..512d7dd3de0ecee98c8bc853c2185713e9a9fbaf 100644 (file)
@@ -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);
index c196e79b68830cd8360e6d0e80d12da0050e79e5..b17dc40b8a8f900fe73ee7386652d1929f447afd 100644 (file)
@@ -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);
index 6761a2f43b6f8589fe2bcfdbdd9e1d2fb843b4b7..791caab7ecda51772c086d12e9f573e7e0dc3d39 100644 (file)
@@ -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);
index 59638eb2aa3b7281f792756f1b3f72dec97261b3..69c27d22371fa7b1a36c54283cde092fe30c03b6 100644 (file)
@@ -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);
index 2ca584ac09c79f18663dde17722b48a954875412..c7c68820d57a7ef795139d82cb9b15a8eace85d9 100644 (file)
@@ -110,5 +110,6 @@ void fdt_fixup_fman_ethernet(void *fdt);
 phy_interface_t fm_info_get_enet_if(enum fm_port port);
 void fm_info_set_phy_address(enum fm_port port, int address);
 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
+void fm_disable_port(enum fm_port port);
 
 #endif