diff options
| author | Markus Klotzbuecher <mk@denx.de> | 2006-03-24 15:43:16 +0100 | 
|---|---|---|
| committer | Markus Klotzbücher <mk@pollux.denx.de> | 2006-03-24 15:43:16 +0100 | 
| commit | 2770bcb21c82835a5351176e5b2a9221d7fc8ef9 (patch) | |
| tree | 78edf9afc584e1a76d219bd64d260224a84f0d10 /drivers/tsec.c | |
| parent | 0b953ffc653fc5ab3d3fa47abf0dd9b8bd0703f5 (diff) | |
| parent | 05d8dce9d07cf4073ea15fbc448c1ce22b6baf0f (diff) | |
| download | olio-uboot-2014.01-2770bcb21c82835a5351176e5b2a9221d7fc8ef9.tar.xz olio-uboot-2014.01-2770bcb21c82835a5351176e5b2a9221d7fc8ef9.zip | |
Merge with http://www.denx.de/git/u-boot.git
Diffstat (limited to 'drivers/tsec.c')
| -rw-r--r-- | drivers/tsec.c | 51 | 
1 files changed, 51 insertions, 0 deletions
| diff --git a/drivers/tsec.c b/drivers/tsec.c index f860dae8b..4c5e1b5d3 100644 --- a/drivers/tsec.c +++ b/drivers/tsec.c @@ -940,6 +940,56 @@ static struct phy_info phy_info_lxt971 = {  	},  }; +/* Parse the DP83865's link and auto-neg status register for speed and duplex + * information */ +uint mii_parse_dp83865_lanr(uint mii_reg, struct tsec_private *priv) +{ +	switch (mii_reg & MIIM_DP83865_SPD_MASK) { + +	case MIIM_DP83865_SPD_1000: +		priv->speed = 1000; +		break; + +	case MIIM_DP83865_SPD_100: +		priv->speed = 100; +		break; + +	default: +		priv->speed = 10; +		break; + +	} + +	if (mii_reg & MIIM_DP83865_DPX_FULL) +		priv->duplexity = 1; +	else +		priv->duplexity = 0; + +	return 0; +} + +struct phy_info phy_info_dp83865 = { +	0x20005c7, +	"NatSemi DP83865", +	4, +	(struct phy_cmd[]) { /* config */ +		{MIIM_CONTROL, MIIM_DP83865_CR_INIT, NULL}, +		{miim_end,} +	}, +	(struct phy_cmd[]) { /* startup */ +		/* Status is read once to clear old link state */ +		{MIIM_STATUS, miim_read, NULL}, +		/* Auto-negotiate */ +		{MIIM_STATUS, miim_read, &mii_parse_sr}, +		/* Read the link and auto-neg status */ +		{MIIM_DP83865_LANR, miim_read, &mii_parse_dp83865_lanr}, +		{miim_end,} +	}, +	(struct phy_cmd[]) { /* shutdown */ +		{miim_end,} +	}, +}; +  struct phy_info *phy_info[] = {  #if 0  	&phy_info_cis8201, @@ -949,6 +999,7 @@ struct phy_info *phy_info[] = {  	&phy_info_M88E1111S,  	&phy_info_dm9161,  	&phy_info_lxt971, +	&phy_info_dp83865,  	NULL  }; |