]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/freescale/mpc8544ds/mpc8544ds.c
Merge branch 'u-boot/master' into u-boot-arm/master
[karo-tx-uboot.git] / board / freescale / mpc8544ds / mpc8544ds.c
index a48c8155c5086be73a23cea3785ed67fa6727566..dfd8fa652258fbdee9c4ca69de2936493f42a6bf 100644 (file)
@@ -1,23 +1,7 @@
 /*
  * Copyright 2007,2009-2010 Freescale Semiconductor, Inc.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -33,6 +17,7 @@
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <fsl_mdio.h>
 #include <tsec.h>
 #include <netdev.h>
 
@@ -248,9 +233,37 @@ get_board_sys_clk(ulong dummy)
        return val;
 }
 
+
+#define MIIM_CIS8204_SLED_CON          0x1b
+#define MIIM_CIS8204_SLEDCON_INIT      0x1115
+/*
+ * Hack to write all 4 PHYs with the LED values
+ */
+int board_phy_config(struct phy_device *phydev)
+{
+       static int do_once;
+       uint phyid;
+       struct mii_dev *bus = phydev->bus;
+
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
+       if (do_once)
+               return 0;
+
+       for (phyid = 0; phyid < 4; phyid++)
+               bus->write(bus, phyid, MDIO_DEVAD_NONE, MIIM_CIS8204_SLED_CON,
+                               MIIM_CIS8204_SLEDCON_INIT);
+
+       do_once = 1;
+
+       return 0;
+}
+
+
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_TSEC_ENET
+       struct fsl_pq_mdio_info mdio_info;
        struct tsec_info_struct tsec_info[2];
        int num = 0;
 
@@ -282,6 +295,9 @@ int board_eth_init(bd_t *bis)
                fsl_sgmii_riser_init(tsec_info, num);
        }
 
+       mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
+       mdio_info.name = DEFAULT_MII_NAME;
+       fsl_pq_mdio_init(bis, &mdio_info);
 
        tsec_eth_init(bis, tsec_info, num);
 #endif