]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tsec: Remove PHY command relocation fixups
authorPeter Tyser <ptyser@xes-inc.com>
Mon, 21 Sep 2009 16:20:31 +0000 (11:20 -0500)
committerWolfgang Denk <wd@denx.de>
Sat, 3 Oct 2009 08:17:56 +0000 (10:17 +0200)
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
drivers/net/tsec.c

index 5c3d261ecdae06687fc5f14c7c7c8d30f084b912..3f74118dbe69e65a6a414727afbc64b75276e68f 100644 (file)
@@ -35,8 +35,6 @@ typedef volatile struct rtxbd {
 
 #define MAXCONTROLLERS (8)
 
-static int relocated = 0;
-
 static struct tsec_private *privlist[MAXCONTROLLERS];
 static int num_tsecs = 0;
 
@@ -59,7 +57,6 @@ uint read_phy_reg(struct tsec_private *priv, uint regnum);
 struct phy_info *get_phy_info(struct eth_device *dev);
 void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd);
 static void adjust_link(struct eth_device *dev);
-static void relocate_cmds(void);
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
        && !defined(BITBANGMII)
 static int tsec_miiphy_write(char *devname, unsigned char addr,
@@ -321,9 +318,6 @@ static int init_phy(struct eth_device *dev)
        asm("sync");
        while (priv->phyregs->miimind & MIIMIND_BUSY) ;
 
-       if (0 == relocated)
-               relocate_cmds();
-
        /* Get the cmd structure corresponding to the attached
         * PHY */
        curphy = get_phy_info(dev);
@@ -1800,49 +1794,6 @@ void phy_run_commands(struct tsec_private *priv, struct phy_cmd *cmd)
        }
 }
 
-/* Relocate the function pointers in the phy cmd lists */
-static void relocate_cmds(void)
-{
-       struct phy_cmd **cmdlistptr;
-       struct phy_cmd *cmd;
-       int i, j, k;
-
-       for (i = 0; phy_info[i]; i++) {
-               /* First thing's first: relocate the pointers to the
-                * PHY command structures (the structs were done) */
-               phy_info[i] = (struct phy_info *)((uint) phy_info[i]
-                                                 + gd->reloc_off);
-               phy_info[i]->name += gd->reloc_off;
-               phy_info[i]->config =
-                   (struct phy_cmd *)((uint) phy_info[i]->config
-                                      + gd->reloc_off);
-               phy_info[i]->startup =
-                   (struct phy_cmd *)((uint) phy_info[i]->startup
-                                      + gd->reloc_off);
-               phy_info[i]->shutdown =
-                   (struct phy_cmd *)((uint) phy_info[i]->shutdown
-                                      + gd->reloc_off);
-
-               cmdlistptr = &phy_info[i]->config;
-               j = 0;
-               for (; cmdlistptr <= &phy_info[i]->shutdown; cmdlistptr++) {
-                       k = 0;
-                       for (cmd = *cmdlistptr;
-                            cmd->mii_reg != miim_end;
-                            cmd++) {
-                               /* Only relocate non-NULL pointers */
-                               if (cmd->funct)
-                                       cmd->funct += gd->reloc_off;
-
-                               k++;
-                       }
-                       j++;
-               }
-       }
-
-       relocated = 1;
-}
-
 #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) \
        && !defined(BITBANGMII)