[U-Boot-Users] [PATCH] QE UEC: Add CMD_MII support, extend number of supported UECs to 4

Liu Dave DaveLiu at freescale.com
Mon Jan 14 10:37:36 CET 2008


> Description: QE UEC: Add CMD_MII support, extend number of supported
> UECs to 4

David, I prefer to have two patch for this.
One is the CMD_MII support
The second is the extend UEC to 4.

> > diff -purN net/eth.c.orig net/eth.c
> --- net/eth.c.orig	Wed Jan  2 13:39:04 2008
> +++ net/eth.c	Thu Jan  3 18:44:45 2008
> @@ -202,7 +202,12 @@ int eth_initialize(bd_t *bis)
>  #if defined(CONFIG_UEC_ETH2)
>  	uec_initialize(1);
>  #endif
> -
> +#if defined(CONFIG_UEC_ETH3)
> +	uec_initialize(2);
> +#endif

The UEC_ETH3 is ready in the main tree.

> +#if defined(CONFIG_UEC_ETH4)
> +	uec_initialize(3);
> +#endif

Could you have one patch to add the UEC_ETH4?

> > diff -purN drivers/qe/uec.c.orig drivers/qe/uec.c
> --- drivers/qe/uec.c.orig	Wed Jan  2 13:39:04 2008
> +++ drivers/qe/uec.c	Thu Jan  3 17:23:17 2008
> @@ -29,6 +29,7 @@
>  #include "uccf.h"
>  #include "uec.h"
>  #include "uec_phy.h"
> +#include "miiphy.h"
>  
>  #if defined(CONFIG_QE)
>  
> @@ -40,8 +41,13 @@ static uec_info_t eth1_uec_info = {
>  		.tx_clock	= CFG_UEC1_TX_CLK,
>  		.eth_type	= CFG_UEC1_ETH_TYPE,
>  	},
> +#ifdef CFG_UEC1_NUM_TX_RX_THR	
> +	.num_threads_tx		= CFG_UEC1_NUM_TX_RX_THR,
> +	.num_threads_rx		= CFG_UEC1_NUM_TX_RX_THR,
> +#else
>  	.num_threads_tx		= UEC_NUM_OF_THREADS_4,
>  	.num_threads_rx		= UEC_NUM_OF_THREADS_4,
> +#endif

I don't like so much CFG_  option for the driver, which cause too many
CFG_UEC[x]_NUM_TX_RX_THR in config.h. for every board.

and I think the threads number is not belonged to board specific things.
The u-boot don't need to consider the UEC performance.

The default 4 threads should work for you.
If it doesn't work for you, I suggest you keep the changes only for your
project.

I don't know if you can agree it.

> +#define MAXCONTROLLERS	(4)
> +
> +static uec_private_t *privlist[MAXCONTROLLERS];
> +
> +static int uec_miiphy_read(char *devname, unsigned char addr,
> +			    unsigned char reg, unsigned short *value);
> +static int uec_miiphy_write(char *devname, unsigned char addr,
> +			     unsigned char reg, unsigned short value);
> +u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);
> +void phy_write (struct uec_mii_info *mii_info, u16 regnum, u16 val);
>  
>  static int uec_mac_enable(uec_private_t *uec, comm_dir_e mode)
>  {
> @@ -1238,11 +1306,21 @@ int uec_initialize(int index)
>  #ifdef CONFIG_UEC_ETH2
>  		uec_info = &eth2_uec_info;
>  #endif
> +	} else if (index == 2) {
> +#ifdef CONFIG_UEC_ETH3
> +		uec_info = &eth3_uec_info;
> +#endif
> +	} else if (index == 3) {
> +#ifdef CONFIG_UEC_ETH4
> +		uec_info = &eth4_uec_info;
> +#endif

So, please repost the UEC_ETH4 support patch.

Big thanks,
Dave




More information about the U-Boot mailing list