[U-Boot-Users] [DNX#2007012342000015] [PATCH 1/2] Add support for 802.3ae to MII-PHY cod [...]

OTRS Notification Master otrs at denx.de
Tue Jan 23 00:30:05 CET 2007


Hello list,

inside the automatic U-Boot patch tracking system a new ticket
[DNX#2007012342000015] was created:

<snip>
> Hello,
> 
> This patch adds 'IEEE 802.3ae clause 25' capabilities to the MIIPHY
> driver, which is needed for communicating with some 10GbE PHYs.  There
> are two main differences between this and the standard 802.3 PHY
> framing:
> 
> 1.	802.3ae devices use a start bit sequence of '00' instead of '01'
> 2.	Register addressing is indirect.  Read and write requests must be
> preceded by an 'address' write, which sets page and offset.  The 'read'
> opcode is now auto-incrementing.  A new 'fixed read' opcode is used for
> successive reads of a single address.
> 	
> Signed-off-by: Ben Warren <bwarren at qstreams.com>
> ---
>  common/cmd_mii.c    |   72 ++++++++++++++++---
>  common/miiphyutil.c |  189
> +++++++++++++++++++++++++++++++++++++++------------
>  include/miiphy.h    |   26 +++++++
>  3 files changed, 233 insertions(+), 54 deletions(-)
> 
> diff --git a/common/cmd_mii.c b/common/cmd_mii.c
> index e659536..aade843 100644
> --- a/common/cmd_mii.c
> +++ b/common/cmd_mii.c
> @@ -126,11 +126,23 @@ #endif
>  		} else {
>  			printf ("%04X\n", data & 0x0000FFFF);
>  		}
> +	} else if (op == 'R') {
> +		if (miiphy_read_fixed (devname, addr, reg, &data) != 0) {
> +			puts ("Error reading from the PHY\n");
> +			rcode = 1;
> +		} else {
> +			printf ("%04X\n", data & 0x0000FFFF);
> +		}
>  	} else if (op == 'w') {
>  		if (miiphy_write (devname, addr, reg, data) != 0) {
>  			puts ("Error writing to the PHY\n");
>  			rcode = 1;
>  		}
> +	} else if (op == 'a') {
> +		if (miiphy_ind_address (devname, addr, reg, data) != 0) {
> +			puts ("Error writing to the PHY\n");
> +			rcode = 1;
> +		}
>  	} else if (op == 'd') {
>  		if (argc == 2)
>  			miiphy_listdev ();
> @@ -157,11 +169,13 @@ #endif
>  U_BOOT_CMD(
>  	mii,	5,	1,	do_mii,
>  	"mii     - MII utility commands\n",
> -	"device                     - list available devices\n"
> -	"mii device <devname>           - set current device\n"
> -	"mii info   <addr>              - display MII PHY info\n"
> -	"mii read   <addr> <reg>        - read  MII PHY <addr> register
> <reg>\n"
> -	"mii write  <addr> <reg> <data> - write MII PHY <addr> register
> <reg>\n"
> +	"device                      - list available devices\n"
> +	"mii device  <devname>           - set current device\n"
> +	"mii info    <addr>              - display MII PHY info\n"
> +	"mii read    <addr> <reg>        - read  MII PHY register\n"
> +	"mii write   <addr> <reg> <data> - write MII PHY register\n"
> +	"mii Read    <addr>              - read  MII PHY (fixed-address)\n"
> +	"mii address <addr> <page> <reg> - set   MII PHY page and offset\n"
>  );
>  
>  #else /* ! CONFIG_TERSE_MII
> ================================================= */
> @@ -522,6 +536,28 @@ #endif
>  			if ((addrlo != addrhi) && (reglo != reghi))
>  				printf("\n");
>  		}
> +	} else if (op[0] == 'R') {
> +		for (addr = addrlo; addr <= addrhi; addr++) {
> +			for (reg = reglo; reg <= reghi; reg++) {
> +				data = 0xffff;
> +				if (miiphy_read_fixed(devname, addr, 
> +							reg, &data) != 0) {
> +					printf(
> +					"Error reading from the PHY "
> +					"addr=%02x reg=%02x\n", addr, reg);
> +					rcode = 1;
> +				} else {
> +					if ((addrlo != addrhi) || 
> +						(reglo != reghi))
> +						printf(
> +						"addr=%02x reg=%02x data=", 
> +							(uint)addr, (uint)reg);
> +					printf("%04X\n", data & 0x0000FFFF);
> +				}
> +			}
> +			if ((addrlo != addrhi) && (reglo != reghi))
> +				printf("\n");
> +		}
>  	} else if (op[0] == 'w') {
>  		for (addr = addrlo; addr <= addrhi; addr++) {
>  			for (reg = reglo; reg <= reghi; reg++) {
</snip>

Your U-Boot support team



More information about the U-Boot mailing list