From 063c12633d5ad74d52152d9c358e715475e17629 Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Fri, 8 Apr 2011 02:10:54 -0500 Subject: tsec: Convert tsec to use PHY Lib This converts tsec to use the new PHY Lib. All of the old PHY support is ripped out. The old MDIO driver is split off, and placed in fsl_mdio.c. The initialization is modified to initialize the MDIO driver as well. The powerpc config file is modified to configure PHYLIB if TSEC_ENET is configured. Signed-off-by: Mingkai Hu Signed-off-by: Andy Fleming Signed-off-by: Kumar Gala Acked-by: Detlev Zundel --- arch/powerpc/include/asm/config.h | 9 +++++++++ arch/powerpc/include/asm/fsl_enet.h | 10 ++++++++++ 2 files changed, 19 insertions(+) (limited to 'arch') diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h index 536f142331..624d8c2cc0 100644 --- a/arch/powerpc/include/asm/config.h +++ b/arch/powerpc/include/asm/config.h @@ -80,6 +80,15 @@ #endif #endif +/* The TSEC driver uses the PHYLIB infrastructure */ +#ifndef CONFIG_PHYLIB +#if defined(CONFIG_TSEC_ENET) +#define CONFIG_PHYLIB + +#include +#endif /* TSEC_ENET */ +#endif /* !CONFIG_PHYLIB */ + /* All PPC boards must swap IDE bytes */ #define CONFIG_IDE_SWAP_IO diff --git a/arch/powerpc/include/asm/fsl_enet.h b/arch/powerpc/include/asm/fsl_enet.h index 4fb2857f3e..1f8f8e493f 100644 --- a/arch/powerpc/include/asm/fsl_enet.h +++ b/arch/powerpc/include/asm/fsl_enet.h @@ -28,6 +28,16 @@ enum fsl_phy_enet_if { FSL_ETH_IF_NONE, }; +struct tsec_mii_mng { + u32 miimcfg; /* MII management configuration reg */ + u32 miimcom; /* MII management command reg */ + u32 miimadd; /* MII management address reg */ + u32 miimcon; /* MII management control reg */ + u32 miimstat; /* MII management status reg */ + u32 miimind; /* MII management indication reg */ + u32 ifstat; /* Interface Status Register */ +} __attribute__ ((packed)); + int fdt_fixup_phy_connection(void *blob, int offset, enum fsl_phy_enet_if phyc); #endif /* __ASM_PPC_FSL_ENET_H */ -- cgit v1.2.1 From 865ff856403fb4bec6fe7f18101364384880068f Mon Sep 17 00:00:00 2001 From: Andy Fleming Date: Wed, 13 Apr 2011 00:37:12 -0500 Subject: fsl: Change fsl_phy_enet_if to phy_interface_t The fsl_phy_enet_if enum was, essentially, the phy_interface_t enum. This meant that drivers which used fsl_phy_enet_if to deal with PHY interfaces would have to convert between the two (or we would have to have them mirror each other, and deal with the ensuing maintenance headache). Instead, we switch all clients of fsl_phy_enet_if over to phy_interface_t, which should become the standard, anyway. Signed-off-by: Andy Fleming Acked-by: Detlev Zundel --- arch/powerpc/cpu/mpc8xxx/fdt.c | 23 +++-------------------- arch/powerpc/include/asm/fsl_enet.h | 17 ++--------------- 2 files changed, 5 insertions(+), 35 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c index 0c166fd6c9..520cb90280 100644 --- a/arch/powerpc/cpu/mpc8xxx/fdt.c +++ b/arch/powerpc/cpu/mpc8xxx/fdt.c @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #if defined(CONFIG_MP) && (defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)) static int ft_del_cpuhandle(void *blob, int cpuhandle) @@ -218,27 +218,10 @@ void fdt_fixup_crypto_node(void *blob, int sec_rev) } #endif -int fdt_fixup_phy_connection(void *blob, int offset, enum fsl_phy_enet_if phyc) +int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc) { - static const char *fsl_phy_enet_if_str[] = { - [MII] = "mii", - [RMII] = "rmii", - [GMII] = "gmii", - [RGMII] = "rgmii", - [RGMII_ID] = "rgmii-id", - [RGMII_RXID] = "rgmii-rxid", - [SGMII] = "sgmii", - [TBI] = "tbi", - [RTBI] = "rtbi", - [XAUI] = "xgmii", - [FSL_ETH_IF_NONE] = "", - }; - - if (phyc > ARRAY_SIZE(fsl_phy_enet_if_str)) - return fdt_setprop_string(blob, offset, "phy-connection-type", ""); - return fdt_setprop_string(blob, offset, "phy-connection-type", - fsl_phy_enet_if_str[phyc]); + phy_string_for_interface(phyc)); } #ifdef CONFIG_SYS_SRIO diff --git a/arch/powerpc/include/asm/fsl_enet.h b/arch/powerpc/include/asm/fsl_enet.h index 1f8f8e493f..8227b667cb 100644 --- a/arch/powerpc/include/asm/fsl_enet.h +++ b/arch/powerpc/include/asm/fsl_enet.h @@ -13,20 +13,7 @@ #ifndef __ASM_PPC_FSL_ENET_H #define __ASM_PPC_FSL_ENET_H -enum fsl_phy_enet_if { - MII, - RMII, - GMII, - RGMII, - RGMII_ID, - RGMII_RXID, - RGMII_TXID, - SGMII, - TBI, - RTBI, - XAUI, - FSL_ETH_IF_NONE, -}; +#include struct tsec_mii_mng { u32 miimcfg; /* MII management configuration reg */ @@ -38,6 +25,6 @@ struct tsec_mii_mng { u32 ifstat; /* Interface Status Register */ } __attribute__ ((packed)); -int fdt_fixup_phy_connection(void *blob, int offset, enum fsl_phy_enet_if phyc); +int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc); #endif /* __ASM_PPC_FSL_ENET_H */ -- cgit v1.2.1