diff options
author | Wolfgang Denk <wd@denx.de> | 2011-04-20 23:01:52 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-04-20 23:01:52 +0200 |
commit | aef293bc85dad4f8d645e46d723606a747236a60 (patch) | |
tree | b18d3f3bb2dfafc6116a7f079fc0e7411936f78a /board | |
parent | 9dd5dad88777a7c6a63f8c103706b57364a135f4 (diff) | |
parent | 995daa0b81f35c93a1d14e5c6a932bc304d06718 (diff) | |
download | u-boot-imx-aef293bc85dad4f8d645e46d723606a747236a60.zip u-boot-imx-aef293bc85dad4f8d645e46d723606a747236a60.tar.gz u-boot-imx-aef293bc85dad4f8d645e46d723606a747236a60.tar.bz2 |
Merge branch 'phylib' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mpc8360emds/mpc8360emds.c | 10 | ||||
-rw-r--r-- | board/freescale/mpc837xemds/mpc837xemds.c | 10 | ||||
-rw-r--r-- | board/freescale/mpc8536ds/mpc8536ds.c | 6 | ||||
-rw-r--r-- | board/freescale/mpc8544ds/mpc8544ds.c | 30 | ||||
-rw-r--r-- | board/freescale/mpc8569mds/mpc8569mds.c | 4 | ||||
-rw-r--r-- | board/freescale/mpc8572ds/mpc8572ds.c | 6 | ||||
-rw-r--r-- | board/freescale/p1022ds/p1022ds.c | 6 | ||||
-rw-r--r-- | board/freescale/p1_p2_rdb/p1_p2_rdb.c | 6 | ||||
-rw-r--r-- | board/freescale/p2020ds/p2020ds.c | 7 |
9 files changed, 79 insertions, 6 deletions
diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index 0babd26..51d8035 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -16,6 +16,7 @@ #include <mpc83xx.h> #include <i2c.h> #include <miiphy.h> +#include <phy.h> #if defined(CONFIG_PCI) #include <pci.h> #endif @@ -160,8 +161,9 @@ int board_eth_init(bd_t *bd) int i; for (i = 0; i < ARRAY_SIZE(uec_info); i++) - uec_info[i].enet_interface_type = RGMII_RXID; - uec_info[i].speed = 1000; + uec_info[i].enet_interface_type = + PHY_INTERFACE_MODE_RGMII_RXID; + uec_info[i].speed = SPEED_1000; } return uec_eth_init(bd, uec_info, ARRAY_SIZE(uec_info)); } @@ -398,7 +400,7 @@ void ft_board_setup(void *blob, bd_t *bd) "phy-connection-type", 0); if (prop && (strcmp(prop, "rgmii-id") == 0)) fdt_fixup_phy_connection(blob, path, - RGMII_RXID); + PHY_INTERFACE_MODE_RGMII_RXID); } #endif #if defined(CONFIG_HAS_ETH1) @@ -410,7 +412,7 @@ void ft_board_setup(void *blob, bd_t *bd) "phy-connection-type", 0); if (prop && (strcmp(prop, "rgmii-id") == 0)) fdt_fixup_phy_connection(blob, path, - RGMII_RXID); + PHY_INTERFACE_MODE_RGMII_RXID); } #endif } diff --git a/board/freescale/mpc837xemds/mpc837xemds.c b/board/freescale/mpc837xemds/mpc837xemds.c index 51dd692..650a4fe 100644 --- a/board/freescale/mpc837xemds/mpc837xemds.c +++ b/board/freescale/mpc837xemds/mpc837xemds.c @@ -21,6 +21,8 @@ #include <libfdt.h> #include <fdt_support.h> #include <fsl_esdhc.h> +#include <fsl_mdio.h> +#include <phy.h> #include "pci.h" #include "../common/pq-mds-pib.h" @@ -86,6 +88,7 @@ int board_mmc_init(bd_t *bd) #if defined(CONFIG_TSEC1) || defined(CONFIG_TSEC2) int board_eth_init(bd_t *bd) { + struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[2]; struct immap __iomem *im = (struct immap __iomem *)CONFIG_SYS_IMMR; u32 rcwh = in_be32(&im->reset.rcwh); @@ -131,6 +134,11 @@ int board_eth_init(bd_t *bd) } num++; #endif + + mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR; + mdio_info.name = DEFAULT_MII_NAME; + fsl_pq_mdio_init(bd, &mdio_info); + return tsec_eth_init(bd, tsec_info, num); } @@ -148,7 +156,7 @@ static void __ft_tsec_fixup(void *blob, bd_t *bd, const char *alias, return; } - err = fdt_fixup_phy_connection(blob, off, SGMII); + err = fdt_fixup_phy_connection(blob, off, PHY_INTERFACE_MODE_SGMII); if (err) { printf("WARNING: could not set phy-connection-type for %s: " diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c index f83f629..b292e13 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -36,6 +36,7 @@ #include <libfdt.h> #include <spd_sdram.h> #include <fdt_support.h> +#include <fsl_mdio.h> #include <tsec.h> #include <netdev.h> #include <sata.h> @@ -234,6 +235,7 @@ int board_early_init_r(void) 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; @@ -268,6 +270,10 @@ int board_eth_init(bd_t *bis) } #endif + 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 return pci_eth_init(bis); diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index a48c815..6fe8d39 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -33,6 +33,7 @@ #include <miiphy.h> #include <libfdt.h> #include <fdt_support.h> +#include <fsl_mdio.h> #include <tsec.h> #include <netdev.h> @@ -248,9 +249,35 @@ 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 (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 +309,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 diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c index ecda222..89557d2 100644 --- a/board/freescale/mpc8569mds/mpc8569mds.c +++ b/board/freescale/mpc8569mds/mpc8569mds.c @@ -39,6 +39,7 @@ #include <libfdt.h> #include <fdt_support.h> #include <fsl_esdhc.h> +#include <phy.h> #include "bcsr.h" #if defined(CONFIG_PQ_MDS_PIB) @@ -550,7 +551,8 @@ void ft_board_setup(void *blob, bd_t *bd) break; } - err = fdt_fixup_phy_connection(blob, nodeoff, RMII); + err = fdt_fixup_phy_connection(blob, nodeoff, + PHY_INTERFACE_MODE_RMII); if (err < 0) { printf("WARNING: could not set phy-connection-type " diff --git a/board/freescale/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c index f444805..b20299e 100644 --- a/board/freescale/mpc8572ds/mpc8572ds.c +++ b/board/freescale/mpc8572ds/mpc8572ds.c @@ -35,6 +35,7 @@ #include <libfdt.h> #include <fdt_support.h> #include <tsec.h> +#include <fsl_mdio.h> #include <netdev.h> #include "../common/sgmii_riser.h" @@ -187,6 +188,7 @@ int board_early_init_r(void) #ifdef CONFIG_TSEC_ENET int board_eth_init(bd_t *bis) { + struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[4]; int num = 0; @@ -233,6 +235,10 @@ int board_eth_init(bd_t *bis) fsl_sgmii_riser_init(tsec_info, num); #endif + 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); return pci_eth_init(bis); diff --git a/board/freescale/p1022ds/p1022ds.c b/board/freescale/p1022ds/p1022ds.c index 8b78404..73a1021 100644 --- a/board/freescale/p1022ds/p1022ds.c +++ b/board/freescale/p1022ds/p1022ds.c @@ -22,6 +22,7 @@ #include <asm/io.h> #include <libfdt.h> #include <fdt_support.h> +#include <fsl_mdio.h> #include <tsec.h> #include <asm/fsl_law.h> #include <netdev.h> @@ -279,6 +280,7 @@ int board_early_init_r(void) */ int board_eth_init(bd_t *bis) { + struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[2]; unsigned int num = 0; @@ -291,6 +293,10 @@ int board_eth_init(bd_t *bis) num++; #endif + 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); + return tsec_eth_init(bis, tsec_info, num) + pci_eth_init(bis); } diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c b/board/freescale/p1_p2_rdb/p1_p2_rdb.c index 307c3e2..0b4ae9d 100644 --- a/board/freescale/p1_p2_rdb/p1_p2_rdb.c +++ b/board/freescale/p1_p2_rdb/p1_p2_rdb.c @@ -31,6 +31,7 @@ #include <miiphy.h> #include <libfdt.h> #include <fdt_support.h> +#include <fsl_mdio.h> #include <tsec.h> #include <vsc7385.h> #include <netdev.h> @@ -179,6 +180,7 @@ int board_early_init_r(void) #ifdef CONFIG_TSEC_ENET int board_eth_init(bd_t *bis) { + struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[4]; int num = 0; char *tmp; @@ -216,6 +218,10 @@ int board_eth_init(bd_t *bis) puts("No address specified for VSC7385 microcode.\n"); #endif + 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); return pci_eth_init(bis); diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index 238b4d9..d3af6cf 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -34,6 +34,7 @@ #include <miiphy.h> #include <libfdt.h> #include <fdt_support.h> +#include <fsl_mdio.h> #include <tsec.h> #include <asm/fsl_law.h> #include <netdev.h> @@ -201,6 +202,7 @@ int board_early_init_r(void) #ifdef CONFIG_TSEC_ENET int board_eth_init(bd_t *bis) { + struct fsl_pq_mdio_info mdio_info; struct tsec_info_struct tsec_info[4]; int num = 0; @@ -235,6 +237,11 @@ int board_eth_init(bd_t *bis) fsl_sgmii_riser_init(tsec_info, num); #endif + 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); return pci_eth_init(bis); |