@ -18,16 +18,16 @@
# include "../common/qixis.h"
# include "ls2085 aqds_qixis.h"
# include "ls2080 aqds_qixis.h"
# ifdef CONFIG_FSL_MC_ENET
/* - In LS2085 A there are only 16 SERDES lanes, spread across 2 SERDES banks.
/* - In LS2080 A there are only 16 SERDES lanes, spread across 2 SERDES banks.
* Bank 1 - > Lanes A , B , C , D , E , F , G , H
* Bank 2 - > Lanes A , B , C , D , E , F , G , H
*/
/* Mapping of 16 SERDES lanes to LS2085 A QDS board slots. A value of '0' here
/* Mapping of 16 SERDES lanes to LS2080 A QDS board slots. A value of '0' here
* means that the mapping must be determined dynamically , or that the lane
* maps to something other than a board slot .
*/
@ -74,16 +74,16 @@ static int sgmii_riser_phy_addr[] = {
# define SFP_TX 0
static const char * const mdio_names [ ] = {
" LS2085 A_QDS_MDIO0 " ,
" LS2085 A_QDS_MDIO1 " ,
" LS2085 A_QDS_MDIO2 " ,
" LS2085 A_QDS_MDIO3 " ,
" LS2085 A_QDS_MDIO4 " ,
" LS2085 A_QDS_MDIO5 " ,
" LS2080 A_QDS_MDIO0 " ,
" LS2080 A_QDS_MDIO1 " ,
" LS2080 A_QDS_MDIO2 " ,
" LS2080 A_QDS_MDIO3 " ,
" LS2080 A_QDS_MDIO4 " ,
" LS2080 A_QDS_MDIO5 " ,
DEFAULT_WRIOP_MDIO2_NAME ,
} ;
struct ls2085 a_qds_mdio {
struct ls2080 a_qds_mdio {
u8 muxval ;
struct mii_dev * realbus ;
} ;
@ -95,7 +95,7 @@ static void sgmii_configure_repeater(int serdes_port)
int i , j , ret ;
int dpmac_id = 0 , dpmac , mii_bus = 0 ;
unsigned short value ;
char dev [ 2 ] [ 20 ] = { " LS2085 A_QDS_MDIO0 " , " LS2085 A_QDS_MDIO3 " } ;
char dev [ 2 ] [ 20 ] = { " LS2080 A_QDS_MDIO0 " , " LS2080 A_QDS_MDIO3 " } ;
uint8_t i2c_addr [ ] = { 0x58 , 0x59 , 0x5a , 0x5b , 0x5c , 0x5d , 0x5f , 0x60 } ;
uint8_t ch_a_eq [ ] = { 0x1 , 0x2 , 0x3 , 0x7 } ;
@ -222,7 +222,7 @@ static void qsgmii_configure_repeater(int dpmac)
uint8_t ch_b_eq [ ] = { 0x1 , 0x2 , 0x3 , 0x7 } ;
uint8_t ch_b_ctl2 [ ] = { 0x81 , 0x82 , 0x83 , 0x84 } ;
const char * dev = " LS2085 A_QDS_MDIO0 " ;
const char * dev = " LS2080 A_QDS_MDIO0 " ;
int ret = 0 ;
unsigned short value ;
@ -318,7 +318,7 @@ error:
return ;
}
static const char * ls2085 a_qds_mdio_name_for_muxval ( u8 muxval )
static const char * ls2080 a_qds_mdio_name_for_muxval ( u8 muxval )
{
return mdio_names [ muxval ] ;
}
@ -326,7 +326,7 @@ static const char *ls2085a_qds_mdio_name_for_muxval(u8 muxval)
struct mii_dev * mii_dev_for_muxval ( u8 muxval )
{
struct mii_dev * bus ;
const char * name = ls2085 a_qds_mdio_name_for_muxval ( muxval ) ;
const char * name = ls2080 a_qds_mdio_name_for_muxval ( muxval ) ;
if ( ! name ) {
printf ( " No bus for muxval %x \n " , muxval ) ;
@ -343,7 +343,7 @@ struct mii_dev *mii_dev_for_muxval(u8 muxval)
return bus ;
}
static void ls2085 a_qds_enable_SFP_TX ( u8 muxval )
static void ls2080 a_qds_enable_SFP_TX ( u8 muxval )
{
u8 brdcfg9 ;
@ -353,7 +353,7 @@ static void ls2085a_qds_enable_SFP_TX(u8 muxval)
QIXIS_WRITE ( brdcfg [ 9 ] , brdcfg9 ) ;
}
static void ls2085 a_qds_mux_mdio ( u8 muxval )
static void ls2080 a_qds_mux_mdio ( u8 muxval )
{
u8 brdcfg4 ;
@ -365,54 +365,54 @@ static void ls2085a_qds_mux_mdio(u8 muxval)
}
}
static int ls2085 a_qds_mdio_read ( struct mii_dev * bus , int addr ,
static int ls2080 a_qds_mdio_read ( struct mii_dev * bus , int addr ,
int devad , int regnum )
{
struct ls2085 a_qds_mdio * priv = bus - > priv ;
struct ls2080 a_qds_mdio * priv = bus - > priv ;
ls2085 a_qds_mux_mdio ( priv - > muxval ) ;
ls2080 a_qds_mux_mdio ( priv - > muxval ) ;
return priv - > realbus - > read ( priv - > realbus , addr , devad , regnum ) ;
}
static int ls2085 a_qds_mdio_write ( struct mii_dev * bus , int addr , int devad ,
static int ls2080 a_qds_mdio_write ( struct mii_dev * bus , int addr , int devad ,
int regnum , u16 value )
{
struct ls2085 a_qds_mdio * priv = bus - > priv ;
struct ls2080 a_qds_mdio * priv = bus - > priv ;
ls2085 a_qds_mux_mdio ( priv - > muxval ) ;
ls2080 a_qds_mux_mdio ( priv - > muxval ) ;
return priv - > realbus - > write ( priv - > realbus , addr , devad , regnum , value ) ;
}
static int ls2085 a_qds_mdio_reset ( struct mii_dev * bus )
static int ls2080 a_qds_mdio_reset ( struct mii_dev * bus )
{
struct ls2085 a_qds_mdio * priv = bus - > priv ;
struct ls2080 a_qds_mdio * priv = bus - > priv ;
return priv - > realbus - > reset ( priv - > realbus ) ;
}
static int ls2085 a_qds_mdio_init ( char * realbusname , u8 muxval )
static int ls2080 a_qds_mdio_init ( char * realbusname , u8 muxval )
{
struct ls2085 a_qds_mdio * pmdio ;
struct ls2080 a_qds_mdio * pmdio ;
struct mii_dev * bus = mdio_alloc ( ) ;
if ( ! bus ) {
printf ( " Failed to allocate ls2085 a_qds MDIO bus \n " ) ;
printf ( " Failed to allocate ls2080 a_qds MDIO bus \n " ) ;
return - 1 ;
}
pmdio = malloc ( sizeof ( * pmdio ) ) ;
if ( ! pmdio ) {
printf ( " Failed to allocate ls2085 a_qds private data \n " ) ;
printf ( " Failed to allocate ls2080 a_qds private data \n " ) ;
free ( bus ) ;
return - 1 ;
}
bus - > read = ls2085 a_qds_mdio_read ;
bus - > write = ls2085 a_qds_mdio_write ;
bus - > reset = ls2085 a_qds_mdio_reset ;
sprintf ( bus - > name , ls2085 a_qds_mdio_name_for_muxval ( muxval ) ) ;
bus - > read = ls2080 a_qds_mdio_read ;
bus - > write = ls2080 a_qds_mdio_write ;
bus - > reset = ls2080 a_qds_mdio_reset ;
sprintf ( bus - > name , ls2080 a_qds_mdio_name_for_muxval ( muxval ) ) ;
pmdio - > realbus = miiphy_get_dev_by_name ( realbusname ) ;
@ -511,7 +511,7 @@ static void initialize_dpmac_to_slot(void)
}
}
void ls2085 a_handle_phy_interface_sgmii ( int dpmac_id )
void ls2080 a_handle_phy_interface_sgmii ( int dpmac_id )
{
int lane , slot ;
struct mii_dev * bus ;
@ -632,7 +632,7 @@ serdes2:
}
}
void ls2085 a_handle_phy_interface_qsgmii ( int dpmac_id )
void ls2080 a_handle_phy_interface_qsgmii ( int dpmac_id )
{
int lane = 0 , slot ;
struct mii_dev * bus ;
@ -706,7 +706,7 @@ void ls2085a_handle_phy_interface_qsgmii(int dpmac_id)
qsgmii_configure_repeater ( dpmac_id ) ;
}
void ls2085 a_handle_phy_interface_xsgmii ( int i )
void ls2080 a_handle_phy_interface_xsgmii ( int i )
{
struct ccsr_gur __iomem * gur = ( void * ) CONFIG_SYS_FSL_GUTS_ADDR ;
int serdes1_prtcl = ( in_le32 ( & gur - > rcwsr [ 28 ] ) &
@ -725,7 +725,7 @@ void ls2085a_handle_phy_interface_xsgmii(int i)
* error .
*/
wriop_set_phy_address ( i , i + 4 ) ;
ls2085 a_qds_enable_SFP_TX ( SFP_TX ) ;
ls2080 a_qds_enable_SFP_TX ( SFP_TX ) ;
break ;
default :
@ -778,25 +778,25 @@ int board_eth_init(bd_t *bis)
fm_memac_mdio_init ( bis , memac_mdio1_info ) ;
/* Register the muxing front-ends to the MDIO buses */
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT1 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT2 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT3 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT4 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT5 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT6 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT1 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT2 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT3 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT4 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT5 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO1_NAME , EMI1_SLOT6 ) ;
ls2085 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO2_NAME , EMI2 ) ;
ls2080 a_qds_mdio_init ( DEFAULT_WRIOP_MDIO2_NAME , EMI2 ) ;
for ( i = WRIOP1_DPMAC1 ; i < NUM_WRIOP_PORTS ; i + + ) {
switch ( wriop_get_enet_if ( i ) ) {
case PHY_INTERFACE_MODE_QSGMII :
ls2085 a_handle_phy_interface_qsgmii ( i ) ;
ls2080 a_handle_phy_interface_qsgmii ( i ) ;
break ;
case PHY_INTERFACE_MODE_SGMII :
ls2085 a_handle_phy_interface_sgmii ( i ) ;
ls2080 a_handle_phy_interface_sgmii ( i ) ;
break ;
case PHY_INTERFACE_MODE_XGMII :
ls2085 a_handle_phy_interface_xsgmii ( i ) ;
ls2080 a_handle_phy_interface_xsgmii ( i ) ;
break ;
default :
break ;