Skip to contentSkip to conversation

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

PATCH New David Saada 3 participants 4 messages Jan 3, 2008 – Jan 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 QE UEC: Add CMD_MII support, extend number of supported UECs to 4

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

Quoted 1 line

diff -purN net/eth.c.orig net/eth.c

eth.c renamed from eth.c.orig +6 -1
@@ -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
+#if defined(CONFIG_UEC_ETH4)
+	uec_initialize(3);
+#endif
 #if defined(FEC_ENET) || defined(CONFIG_ETHER_ON_FCC)
 	fec_initialize(bis);
 #endif
Quoted 1 line

diff -purN drivers/qe/uec.c.orig drivers/qe/uec.c

qe/uec.c renamed from qe/uec.c.orig +145 -0

190 lines not on this page · raw message

#1 lore raw

PATCH 1/1 QE UEC: Add CMD_MII support, extend number of supported UECs to 4

Quoted 2 lines

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.

eth.c int eth_initialize(bd_t *bis) · line 207

Quoted 11 lines
Quoted 1 line

diff -purN net/eth.c.orig net/eth.c

eth.c renamed from eth.c.orig +3 -1
@@ -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.

eth.c int eth_initialize(bd_t *bis) · line 210

Quoted 3 lines
eth.c renamed from eth.c.orig +3 -0
+#if defined(CONFIG_UEC_ETH4)
+	uec_initialize(3);
+#endif

Could you have one patch to add the UEC_ETH4?

Quoted 12 lines
Quoted 1 line

diff -purN drivers/qe/uec.c.orig drivers/qe/uec.c

qe/uec.c renamed from qe/uec.c.orig +1 -0
@@ -29,6 +29,7 @@
 #include "uccf.h"
 #include "uec.h"
 #include "uec_phy.h"
+#include "miiphy.h"
 
 #if defined(CONFIG_QE)
 

qe/uec.c static uec_info_t eth1_uec_info = { · line 50

Quoted 10 lines
qe/uec.c renamed from qe/uec.c.orig +5 -0
@@ -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.

Quoted 15 lines
qe/uec.c renamed from qe/uec.c.orig +10 -0
+#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

qe/uec.c int uec_initialize(int index) · line 1316

Quoted 10 lines
qe/uec.c renamed from qe/uec.c.orig +8 -0
 		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

#2 lore raw

PATCH 1/1 QE UEC: Add CMD_MII support, extend number of supported UECs to 4

Quoted 4 lines

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

No problem. Will split the patch. Merging is on you though :) Regarding the MII support: This will include also a fix in the TSEC driver to enable it to address all MII addresses on the bus, regardless of the port (as someone asked here).

Quoted 4 lines

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.

Quoted 4 lines

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

Quoted 5 lines

project.

I don't know if you can agree it.

So, please repost the UEC_ETH4 support patch.

Regarding the thread number: As each UEC requires 8+ threads (4 for tx, 4 for rx), extending the number of UECs to 4 will exceed the number of QE threads. Now, 4 threads per TX/RX is only required for the GBE UEC. FE only requires one thread. So I'll change the driver in a way that it will use 4+4 threads in case of GBE, and 1+1 in case of FE. I already tested it here - and it worked fine. This way we won't need these CFG options per UEC any more. Is this ok?

David.

#3 lore raw

PATCH 1/1 QE UEC: Add CMD_MII support, extend number of supported UECs to 4

Quoted 8 lines
Quoted 3 lines

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

No problem. Will split the patch. Merging is on you though :) Regarding the MII support: This will include also a fix in the TSEC driver to enable it to address all MII addresses on the bus, regardless
of the port (as someone asked here).

Thanks

Quoted 9 lines

Regarding the thread number: As each UEC requires 8+ threads (4 for tx,
4 for rx), extending the number of UECs to 4 will exceed the number of QE threads. Now, 4 threads per TX/RX is only required for the GBE UEC. FE only requires one thread. So I'll change the driver in a way that it
will use 4+4 threads in case of GBE, and 1+1 in case of FE. I already tested it here - and it worked fine. This way we won't need these CFG options per UEC any more. Is this ok?

It looks good to me.

Thanks,
Dave