83xx, uec: adjust enet_interface settings on the fly.
If using UCC as Ethernet Controller and type = FAST_ETH, it was not possible to switch between 10 and 100 MBit interfaces. This patch adds this for following interfaces:
10_MII
10_RMII
10_RGMII
100_MII
100_RMII
100_RGMII
--- drivers/qe/uec.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-)
drivers/qe/uec.c +73 -0
@@ -65,6 +65,22 @@ static uec_info_t uec_info[] = {#define MAXCONTROLLERS (8) +static char *enet_interface_name[] = { +"10_MII" , +"10_RMII" , +"10_RGMII" , +"100_MII" , +"100_RMII" , +"100_RGMII" , +"1000_GMII" , +"1000_RGMII" , +"1000_RGMII_ID" , +"1000_RGMII_RXID" , +"1000_TBI" , +"1000_RTBI" , +"1000_SGMII" +}; +static struct eth_device *devlist[MAXCONTROLLERS ];u16 phy_read (struct uec_mii_info *mii_info,u16 regnum);
@@ -497,6 +513,60 @@ bus_fail:return err; } +static void adjust_fast_enet_interface (int speed,struct eth_device *dev) +{ +uec_private_t *uec = (uec_private_t *)dev->priv; +uec_t *uec_regs; +int change =0 ; + +extern void change_phy_interface_mode (struct eth_device *dev, +enet_interface_e mode); + uec_regs = uec->uec_regs; + +switch (speed) { +case 100 : +switch (uec->uec_info->enet_interface) { +case ENET_10_MII : +case ENET_10_RMII : +case ENET_10_RGMII : + uec->uec_info->enet_interface +=3 ; + change =1 ; +break ; +default : +break ; + } +break ; +case 10 : +switch (uec->uec_info->enet_interface) { +case ENET_100_MII : +case ENET_100_RMII : +case ENET_100_RGMII : + uec->uec_info->enet_interface -=3 ; + change =1 ; +break ; +default : +break ; + } +break ; +default : +/* do nothing, not supported yet */ +printf ("%s: speed: %d and mode: %d not supported yet.\n" , + __func__, speed, uec->uec_info->enet_interface); +break ; + } +if (change) { +printf ("switching to %s\n" , + enet_interface_name[uec->uec_info->enet_interface]); +/* change phy */ +change_phy_interface_mode (dev, + uec->uec_info->enet_interface); +/* change the MAC interface mode */ +uec_set_mac_if_mode (uec, + uec->uec_info->enet_interface); + + } +} +static void adjust_link (struct eth_device *dev) {uec_private_t *uec = (uec_private_t *)dev->priv;
@@ -547,6 +617,8 @@ static void adjust_link(struct eth_device *dev) dev->name, mii_info->speed);break ; } + }else if (uec->uec_info->uf_info.eth_type ==FAST_ETH ) { +adjust_fast_enet_interface (mii_info->speed, dev); }printf ("%s: Speed %dBT\n" , dev->name, mii_info->speed);
@@ -1215,6 +1287,7 @@ static int uec_init(struct eth_device* dev, bd_t *bd)if (err || i <=0 )printf ("warning: %s: timeout on PHY link\n" , dev->name); +adjust_link (dev); uec->the_first_run =1 ; }
Signature · 5 lines
1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
drivers/qe/uec.c static void adjust_link(struct eth_device *dev) · line 622
Quoted 10 lines · On Thu, 7 Jan 2010 09:01:32 +0100 Heiko Schocher <[email protected]> wrote:
static void
adjust_link(struct eth_device *dev)
{drivers/qe/uec.c +2
-0uec_private_t *uec = (uec_private_t *)dev->priv;@@ -547,6 +617,8 @@ static void adjust_link(struct eth_device *dev) dev->name, mii_info->speed);break ; } + }else if (uec->uec_info->uf_info.eth_type ==FAST_ETH ) { +adjust_fast_enet_interface (mii_info->speed, dev); }
did you make any effort to refactor this into the existing eth_type == GIGA_ETH code? I'm not sure why that code became conditional in commit 24c3aca3f1358b113d3215adb5433b156e99f72b "mpc83xx: Add support for the MPC832XEMDS board" in the first place - Dave?
Kim
Quoted 5 lines
did you make any effort to refactor this into the existing
eth_type==GIGA_ETHcode? I'm not sure why that code became conditional in commit24c3aca3f1358b113d3215adb5433b156e99f72b"mpc83xx: Add support for the MPC832XEMDS board" in the first place - Dave?
I don't remember why I added the eth_type==GIGA_ETH condition. If it is possible, please refactor it as Kim.
Thanks, Dave
Hello Liu,
Quoted 8 lines · Liu Dave-R63238 wrote:
Quoted 5 lines
did you make any effort to refactor this into the existing
eth_type==GIGA_ETHcode? I'm not sure why that code became conditional in commit24c3aca3f1358b113d3215adb5433b156e99f72b"mpc83xx: Add support for the MPC832XEMDS board" in the first place - Dave?I don't remember why I added the eth_type==GIGA_ETH condition. If it is possible, please refactor it as Kim.
Hmm.. while looking at this code, a question comes in mind:
Did this code (eth_type==GIGA_ETH) work correctly?
I see there is a switching possible from 1000 to 100 or 10, but never back to 1000, because the 1000 case did nothing ...? Is this intentionally?
Also uec->uec_info->enet_interface is never updated, which should be done ... or?
If the above mentioned is no problem, following patch comes in my mind:
If using UCC as Ethernet Controller and type = FAST_ETH, it was not possible to switch between 10 and 100 MBit interfaces. This patch adds this for following interfaces:
10_MII
10_RMII
10_RGMII
100_MII
100_RMII
100_RGMII
--- drivers/qe/uec.c | 104 ++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 78 insertions(+), 26 deletions(-)
drivers/qe/uec.c +78 -26
@@ -65,6 +65,22 @@ static uec_info_t uec_info[] = {#define MAXCONTROLLERS (8) +static char *enet_interface_name[] = { +"10_MII" , +"10_RMII" , +"10_RGMII" , +"100_MII" , +"100_RMII" , +"100_RGMII" , +"1000_GMII" , +"1000_RGMII" , +"1000_RGMII_ID" , +"1000_RGMII_RXID" , +"1000_TBI" , +"1000_RTBI" , +"1000_SGMII" +}; +static struct eth_device *devlist[MAXCONTROLLERS ];u16 phy_read (struct uec_mii_info *mii_info,u16 regnum);
@@ -497,6 +513,66 @@ bus_fail:return err; } +static void adjust_enet_interface_speed (int speed,struct eth_device *dev) +{ +uec_private_t *uec = (uec_private_t *)dev->priv; +uec_t *uec_regs; +int change =0 ; + +extern void change_phy_interface_mode (struct eth_device *dev, +enet_interface_e mode); + uec_regs = uec->uec_regs; + +switch (speed) { +case 1000 : +break ; +case 100 : +switch (uec->uec_info->enet_interface) { +case ENET_10_MII : +case ENET_10_RMII : +case ENET_10_RGMII : + uec->uec_info->enet_interface +=3 ; + change =1 ; +break ; +default : + uec->uec_info->enet_interface =ENET_100_RGMII ; + change =1 ; +break ; + } +break ; +case 10 : +switch (uec->uec_info->enet_interface) { +case ENET_100_MII : +case ENET_100_RMII : +case ENET_100_RGMII : + uec->uec_info->enet_interface -=3 ; + change =1 ; +break ; +default : + uec->uec_info->enet_interface =ENET_10_RGMII ; + change =1 ; +break ; + } +break ; +default : +/* do nothing, not supported yet */ +printf ("%s: speed: %d and mode: %d not supported yet.\n" , + __func__, speed, uec->uec_info->enet_interface); +break ; + } +if (change) { +printf ("switching to %s\n" , + enet_interface_name[uec->uec_info->enet_interface]); +/* change phy */ +change_phy_interface_mode (dev, + uec->uec_info->enet_interface); +/* change the MAC interface mode */ +uec_set_mac_if_mode (uec, + uec->uec_info->enet_interface); + + } +} +static void adjust_link (struct eth_device *dev) {uec_private_t *uec = (uec_private_t *)dev->priv;
@@ -522,32 +598,7 @@ static void adjust_link(struct eth_device *dev) }if (mii_info->speed != uec->oldspeed) { -if (uec->uec_info->uf_info.eth_type ==GIGA_ETH ) { -switch (mii_info->speed) { -case 1000 : -break ; -case 100 : -printf ("switching to rgmii 100\n" ); -/* change phy to rgmii 100 */ -change_phy_interface_mode (dev, -ENET_100_RGMII ); -/* change the MAC interface mode */ -uec_set_mac_if_mode (uec,ENET_100_RGMII ); -break ; -case 10 : -printf ("switching to rgmii 10\n" ); -/* change phy to rgmii 10 */ -change_phy_interface_mode (dev, -ENET_10_RGMII ); -/* change the MAC interface mode */ -uec_set_mac_if_mode (uec,ENET_10_RGMII ); -break ; -default : -printf ("%s: Ack,Speed(%d)is illegal\n" , - dev->name, mii_info->speed); -break ; - } - } +adjust_enet_interface_speed (mii_info->speed, dev);printf ("%s: Speed %dBT\n" , dev->name, mii_info->speed); uec->oldspeed = mii_info->speed;
@@ -1215,6 +1266,7 @@ static int uec_init(struct eth_device* dev, bd_t *bd)if (err || i <=0 )printf ("warning: %s: timeout on PHY link\n" , dev->name); +adjust_link (dev); uec->the_first_run =1 ; }
Signature · 7 lines
1.6.2.5 bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 5 lines
Quoted 2 lines
I don't remember why I added the eth_type==GIGA_ETH condition. If it is possible, please refactor it as Kim.
Hmm.. while looking at this code, a question comes in mind:
Did this code (eth_type==GIGA_ETH) work correctly?
Yes, It worked correctly. But later there are lots of change, I'm not sure if it is correct right now.
Quoted 3 lines
I see there is a switching possible from 1000 to 100 or 10, but never back to 1000, because the 1000 case did nothing ...? Is this intentionally?
The code was assuming the initial speed is 1000Mbps, so the 1000 case did nothing.
Quoted 2 lines
Also
uec->uec_info->enet_interfaceis never updated, which should be done ... or?
IIRC, the enet_interface was designed for interface type according to board design. So it was placed on uec_info, it is never updated.
eg: SGMII if board is SGMII connection
RGMII if board is RGMII connection...
RMII if board is RMII....
Thanks, Dave
Hello Liu,
Quoted 8 lines · Liu Dave-R63238 wrote:
Quoted 4 lines
Quoted 2 lines
I don't remember why I added the eth_type==GIGA_ETH condition. If it is possible, please refactor it as Kim.
Hmm.. while looking at this code, a question comes in mind:
Did this code (eth_type==GIGA_ETH) work correctly?Yes, It worked correctly. But later there are lots of change, I'm not sure if it is correct right now.
Quoted 6 lines
Quoted 3 lines
I see there is a switching possible from 1000 to 100 or 10, but never back to 1000, because the 1000 case did nothing ...? Is this intentionally?
The code was assuming the initial speed is 1000Mbps, so the 1000 case did nothing.
Hmm.. but what happend, if you connect a 100Mbps, and then back to the 1000Mpbs?
Quoted 8 lines
Quoted 2 lines
Also
uec->uec_info->enet_interfaceis never updated, which should be done ... or?IIRC, the
enet_interfacewas designed for interface type according to board design. So it was placed onuec_info, it is never updated.
eg: SGMII if board is SGMII connection
RGMII if board is RGMII connection...
RMII if board is RMII....
Ah, OK, thanks.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 5 lines
Quoted 2 lines
The code was assuming the initial speed is 1000Mbps, so the 1000 case did nothing.
Hmm.. but what happend, if you connect a 100Mbps, and then back to the 1000Mpbs?
The ethernet port may be broken :)
Quoted 53 lines · Heiko Schocher
If using UCC as Ethernet Controller and type =
FAST_ETH, it was not possible to switch between 10 and 100 MBit interfaces. This patch adds this for following interfaces:10_MII
10_RMII
10_RGMII
100_MII
100_RMII
100_RGMIISigned-off-by Heiko Schocher <[email protected]>---
?drivers/qe/uec.c | ? 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ ?1 files changed, 73 insertions(+), 0 deletions(-)drivers/qe/uec.c +22
-0@@ -65,6 +65,22 @@ static uec_info_t uec_info[] = { ?#define MAXCONTROLLERS (8) +static char *enet_interface_name[] = { + ? ? ? "10_MII", + ? ? ? "10_RMII", + ? ? ? "10_RGMII", + ? ? ? "100_MII", + ? ? ? "100_RMII", + ? ? ? "100_RGMII", + ? ? ? "1000_GMII", + ? ? ? "1000_RGMII", + ? ? ? "1000_RGMII_ID", + ? ? ? "1000_RGMII_RXID", + ? ? ? "1000_TBI", + ? ? ? "1000_RTBI", + ? ? ? "1000_SGMII" +}; + ?static struct eth_device *devlist[MAXCONTROLLERS]; ?u16 phy_read (struct uec_mii_info *mii_info, u16 regnum);@@ -497,6 +513,60 @@ bus_fail: ? ? ? ?return err; ?} +static ?void adjust_fast_enet_interface(int speed, struct eth_device *dev) +{ + ? ? ? uec_private_t ? *uec = (uec_private_t *)dev->priv; + ? ? ? uec_t ? ? ? ? ? *uec_regs; + ? ? ? int ? ? ? ? ? ? change = 0; +
drivers/qe/uec.c bus_fail: · line 531
Quoted 10 lines
drivers/qe/uec.c +10
-0+ ? ? ? extern void change_phy_interface_mode(struct eth_device *dev, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?enet_interface_e mode); + ? ? ? uec_regs = uec->uec_regs; + + ? ? ? switch (speed) { + ? ? ? case 100: + ? ? ? ? ? ? ? switch (uec->uec_info->enet_interface) { + ? ? ? ? ? ? ? case ENET_10_MII: + ? ? ? ? ? ? ? case ENET_10_RMII: + ? ? ? ? ? ? ? case ENET_10_RGMII:
I know you aren't responsible for this design choice, but I'd love it if we stopped this sort of thing. There's no sensible reason to unite speed and interface type into one variable. They are, in fact, two nearly-independent variables. If they directly corresponded to some register value, it might make sense, but really they encourage a rigidity of thought about a concept which is much more fluid. The speed will vary based on the link partner. The interface is usually hardwired by the board designer, and at most, modifiable at boot time by DIP switches.
drivers/qe/uec.c bus_fail: · line 532
Quoted 1 line
drivers/qe/uec.c +1
-0+ ? ? ? ? ? ? ? ? ? ? ? uec->uec_info->enet_interface += 3;
And then we end up with something *highly* fragile like this. *3* has no meaning, except in the very specific context of the particular order in which the interfaces have been specified in this driver. All it takes is some architect deciding to add support for 10M SGMII, or 10M WHATEVERMII, and now everything breaks in a way that is not immediately apparent....
Andy
Hello Andy,
Quoted 62 lines · Andy Fleming
Quoted 61 lines · Heiko Schocher
If using UCC as Ethernet Controller and type =
FAST_ETH, it was not possible to switch between 10 and 100 MBit interfaces. This patch adds this for following interfaces:10_MII
10_RMII
10_RGMII
100_MII
100_RMII
100_RGMIISigned-off-by Heiko Schocher <[email protected]>--- drivers/qe/uec.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-)drivers/qe/uec.c +30
-0@@ -65,6 +65,22 @@ static uec_info_t uec_info[] = {#define MAXCONTROLLERS (8) +static char *enet_interface_name[] = { +"10_MII" , +"10_RMII" , +"10_RGMII" , +"100_MII" , +"100_RMII" , +"100_RGMII" , +"1000_GMII" , +"1000_RGMII" , +"1000_RGMII_ID" , +"1000_RGMII_RXID" , +"1000_TBI" , +"1000_RTBI" , +"1000_SGMII" +}; +static struct eth_device *devlist[MAXCONTROLLERS ];u16 phy_read (struct uec_mii_info *mii_info,u16 regnum);@@ -497,6 +513,60 @@ bus_fail:return err; } +static void adjust_fast_enet_interface (int speed,struct eth_device *dev) +{ +uec_private_t *uec = (uec_private_t *)dev->priv; +uec_t *uec_regs; +int change =0 ; + +extern void change_phy_interface_mode (struct eth_device *dev, +enet_interface_e mode); + uec_regs = uec->uec_regs; + +switch (speed) { +case 100 : +switch (uec->uec_info->enet_interface) { +case ENET_10_MII :
Quoted 8 lines
drivers/qe/uec.c bus_fail: · line 531
Quoted 2 lines
drivers/qe/uec.c +2
-0+case ENET_10_RMII : +case ENET_10_RGMII :I know you aren't responsible for this design choice, but I'd love it if we stopped this sort of thing. There's no sensible reason to unite speed and interface type into one variable. They are, in fact, two nearly-independent variables. If they directly corresponded to some
Yes, you are right! That would be the right way ...
Quoted 5 lines
register value, it might make sense, but really they encourage a rigidity of thought about a concept which is much more fluid. The speed will vary based on the link partner. The interface is usually hardwired by the board designer, and at most, modifiable at boot time by DIP switches.
Yep, I try to prepare such a patch, which splits this variable in two (If others have no objections).
Thanks.
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[U-Boot] 83xx, uec: split enet_interface in two variables, was: 83xx, uec: adjust enet_interface settings on the fly.
In reply to Andy FlemingThere's no sensible reason to unite speed and interface type into one variable. So split this variable enet_interface into two
vars: enet_interface_type, which hold the interface type and speed.
Also: add the possibility for switching between 10 and 100 MBit interfaces on the fly, when running in FAST_ETH mode.
--- board/freescale/mpc8360emds/mpc8360emds.c | 3 +- drivers/qe/uec.c | 122 ++++++++++++++++------------- drivers/qe/uec.h | 34 ++++---- drivers/qe/uec_phy.c | 84 +++++++++++--------- include/configs/MPC8323ERDB.h | 6 +- include/configs/MPC832XEMDS.h | 6 +- include/configs/MPC8360EMDS.h | 6 +- include/configs/MPC8360ERDK.h | 6 +- include/configs/MPC8568MDS.h | 6 +- include/configs/MPC8569MDS.h | 30 +++++--- include/configs/kmeter1.h | 3 +- 11 files changed, 175 insertions(+), 131 deletions(-)
board/freescale/mpc8360emds/mpc8360emds.c +2 -1
@@ -159,7 +159,8 @@ int board_eth_init(bd_t *bd)int i;for (i =0 ; i <ARRAY_SIZE (uec_info); i++) - uec_info[i].enet_interface =ENET_1000_RGMII_RXID ; + uec_info[i].enet_interface_type =RGMII_RXID ; + uec_info[i].speed =1000 ; }return uec_eth_init (bd, uec_info,ARRAY_SIZE (uec_info)); }
drivers/qe/uec.c +69 -53
202 lines not on this page · raw message
drivers/qe/uec.h +16 -18
@@ -662,22 +662,18 @@ typedef enum uec_num_of_threads {/* UEC ethernet interface type */ -typedef enum enet_interface { -ENET_10_MII , -ENET_10_RMII , -ENET_10_RGMII , -ENET_100_MII , -ENET_100_RMII , -ENET_100_RGMII , -ENET_1000_GMII , -ENET_1000_RGMII , -ENET_1000_RGMII_ID , -ENET_1000_RGMII_RXID , -ENET_1000_RGMII_TXID , -ENET_1000_TBI , -ENET_1000_RTBI , -ENET_1000_SGMII -}enet_interface_e ; +typedef enum enet_interface_type { +MII , +RMII , +RGMII , +GMII , +RGMII_ID , +RGMII_RXID , +RGMII_TXID , +TBI , +RTBI , +SGMII +}enet_interface_type_e ;/* UEC initialization info struct */
@@ -696,7 +692,8 @@ typedef enum enet_interface { .tx_bd_ring_len = 16, \ .rx_bd_ring_len = 16, \ .phy_address = CONFIG_SYS_UEC##num##_PHY_ADDR, \ - .enet_interface = CONFIG_SYS_UEC##num##_INTERFACE_MODE, \ + .enet_interface_type = CONFIG_SYS_UEC##num##_INTERFACE_TYPE, \ + .speed = CONFIG_SYS_UEC##num##_INTERFACE_SPEED, \ } typedef struct uec_info {
@@ -708,7 +705,8 @@ typedef struct uec_info {u16 rx_bd_ring_len;u16 tx_bd_ring_len;u8 phy_address; -enet_interface_e enet_interface; +enet_interface_type_e enet_interface_type; +int speed; } uec_info_t;/* UEC driver initialized info
drivers/qe/uec_phy.c +46 -38
122 lines not on this page · raw message
include/configs/MPC8323ERDB.h +4 -2
@@ -347,7 +347,8 @@#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 4 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_100_MII +#define CONFIG_SYS_UEC1_INTERFACE_TYPE MII +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100#endif #define CONFIG_UEC_ETH2 /* ETH4 */
@@ -358,7 +359,8 @@#define CONFIG_SYS_UEC2_TX_CLK QE_CLK3#define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 0 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_100_MII +#define CONFIG_SYS_UEC2_INTERFACE_TYPE MII +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100#endif /*
include/configs/MPC832XEMDS.h +4 -2
@@ -362,7 +362,8 @@#define CONFIG_SYS_UEC1_TX_CLK QE_CLK10#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 3 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_100_MII +#define CONFIG_SYS_UEC1_INTERFACE_TYPE MII +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100#endif #define CONFIG_UEC_ETH2 /* ETH4 */
@@ -373,7 +374,8 @@#define CONFIG_SYS_UEC2_TX_CLK QE_CLK8#define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 4 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_100_MII +#define CONFIG_SYS_UEC2_INTERFACE_TYPE MII +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100#endif /*
include/configs/MPC8360EMDS.h +4 -2
@@ -400,7 +400,8 @@#define CONFIG_SYS_UEC1_TX_CLK QE_CLK9#define CONFIG_SYS_UEC1_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 0 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000#endif #define CONFIG_UEC_ETH2 /* GETH2 */
@@ -411,7 +412,8 @@#define CONFIG_SYS_UEC2_TX_CLK QE_CLK4#define CONFIG_SYS_UEC2_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 1 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000#endif /*
include/configs/MPC8360ERDK.h +4 -2
@@ -318,7 +318,8 @@#define CONFIG_SYS_UEC1_TX_CLK QE_CLK9#define CONFIG_SYS_UEC1_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 2 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_1000_RGMII_RXID +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_RXID +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000#endif #define CONFIG_UEC_ETH2 /* GETH2 */
@@ -329,7 +330,8 @@#define CONFIG_SYS_UEC2_TX_CLK QE_CLK4#define CONFIG_SYS_UEC2_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 4 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_1000_RGMII_RXID +#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_RXID +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000#endif /*
include/configs/MPC8568MDS.h +4 -2
@@ -333,7 +333,8 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC1_TX_CLK QE_CLK16#define CONFIG_SYS_UEC1_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 7 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000#endif #define CONFIG_UEC_ETH2 /* GETH2 */
@@ -344,7 +345,8 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC2_TX_CLK QE_CLK16#define CONFIG_SYS_UEC2_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 1 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000#endif #endif /* CONFIG_QE */
include/configs/MPC8569MDS.h +20 -10
@@ -317,12 +317,14 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC1_TX_CLK QE_CLK12#define CONFIG_SYS_UEC1_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 7 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 1000#elif defined(CONFIG_SYS_UCC_RMII_MODE )#define CONFIG_SYS_UEC1_TX_CLK QE_CLK16/* CLK16 for RMII */ #define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 8/* 0x8 for RMII */ -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_100_RMII +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RMII +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100#endif /* CONFIG_SYS_UCC_RGMII_MODE */ #endif /* CONFIG_UEC_ETH1 */
@@ -336,12 +338,14 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC2_TX_CLK QE_CLK17#define CONFIG_SYS_UEC2_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 1 -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 1000#elif defined(CONFIG_SYS_UCC_RMII_MODE )#define CONFIG_SYS_UEC2_TX_CLK QE_CLK16/* CLK 16 for RMII */ #define CONFIG_SYS_UEC2_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC2_PHY_ADDR 0x9/* 0x9 for RMII */ -#define CONFIG_SYS_UEC2_INTERFACE_MODE ENET_100_RMII +#define CONFIG_SYS_UEC2_INTERFACE_TYPE RMII +#define CONFIG_SYS_UEC2_INTERFACE_SPEED 100#endif /* CONFIG_SYS_UCC_RGMII_MODE */ #endif /* CONFIG_UEC_ETH2 */
@@ -355,12 +359,14 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC3_TX_CLK QE_CLK12#define CONFIG_SYS_UEC3_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC3_PHY_ADDR 2 -#define CONFIG_SYS_UEC3_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC3_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC3_INTERFACE_SPEED 1000#elif defined(CONFIG_SYS_UCC_RMII_MODE )#define CONFIG_SYS_UEC3_TX_CLK QE_CLK16/* CLK_16 for RMII */ #define CONFIG_SYS_UEC3_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC3_PHY_ADDR 0xA/* 0xA for RMII */ -#define CONFIG_SYS_UEC3_INTERFACE_MODE ENET_100_RMII +#define CONFIG_SYS_UEC3_INTERFACE_TYPE RMII +#define CONFIG_SYS_UEC3_INTERFACE_SPEED 100#endif /* CONFIG_SYS_UCC_RGMII_MODE */ #endif /* CONFIG_UEC_ETH3 */
@@ -374,12 +380,14 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC4_TX_CLK QE_CLK17#define CONFIG_SYS_UEC4_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC4_PHY_ADDR 3 -#define CONFIG_SYS_UEC4_INTERFACE_MODE ENET_1000_RGMII_ID +#define CONFIG_SYS_UEC4_INTERFACE_TYPE RGMII_ID +#define CONFIG_SYS_UEC4_INTERFACE_SPEED 1000#elif defined(CONFIG_SYS_UCC_RMII_MODE )#define CONFIG_SYS_UEC4_TX_CLK QE_CLK16/* CLK16 for RMII */ #define CONFIG_SYS_UEC4_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC4_PHY_ADDR 0xB/* 0xB for RMII */ -#define CONFIG_SYS_UEC4_INTERFACE_MODE ENET_100_RMII +#define CONFIG_SYS_UEC4_INTERFACE_TYPE RMII +#define CONFIG_SYS_UEC4_INTERFACE_SPEED 100#endif /* CONFIG_SYS_UCC_RGMII_MODE */ #endif /* CONFIG_UEC_ETH4 */
@@ -392,7 +400,8 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC6_TX_CLK QE_CLK_NONE#define CONFIG_SYS_UEC6_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC6_PHY_ADDR 4 -#define CONFIG_SYS_UEC6_INTERFACE_MODE ENET_1000_SGMII +#define CONFIG_SYS_UEC6_INTERFACE_TYPE SGMII +#define CONFIG_SYS_UEC6_INTERFACE_SPEED 1000#endif /* CONFIG_UEC_ETH6 */ #undef CONFIG_UEC_ETH8/* GETH8 */
@@ -404,7 +413,8 @@ extern unsigned long get_clock_freq(void);#define CONFIG_SYS_UEC8_TX_CLK QE_CLK_NONE#define CONFIG_SYS_UEC8_ETH_TYPE GIGA_ETH#define CONFIG_SYS_UEC8_PHY_ADDR 6 -#define CONFIG_SYS_UEC8_INTERFACE_MODE ENET_1000_SGMII +#define CONFIG_SYS_UEC8_INTERFACE_TYPE SGMII +#define CONFIG_SYS_UEC8_INTERFACE_SPEED 1000#endif /* CONFIG_UEC_ETH8 */ #endif /* CONFIG_QE */
include/configs/kmeter1.h +2 -1
@@ -293,7 +293,8 @@#define CONFIG_SYS_UEC1_TX_CLK QE_CLK17#define CONFIG_SYS_UEC1_ETH_TYPE FAST_ETH#define CONFIG_SYS_UEC1_PHY_ADDR 0 -#define CONFIG_SYS_UEC1_INTERFACE_MODE ENET_100_RMII +#define CONFIG_SYS_UEC1_INTERFACE_TYPE RMII +#define CONFIG_SYS_UEC1_INTERFACE_SPEED 100#endif /*
Signature · 5 lines
1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Ben Warren
Applied[U-Boot] 83xx, uec: split enet_interface in two variables, was: 83xx, uec: adjust enet_interface settings on the fly.
Hi Heiko,
Quoted 8 lines · Heiko Schocher
There's no sensible reason to unite speed and interface type into one variable. So split this variable
enet_interfaceinto two
vars:enet_interface_type, which hold the interface type and speed.Also: add the possibility for switching between 10 and 100 MBit interfaces on the fly, when running in
FAST_ETHmode.Signed-off-by Heiko Schocher <[email protected]>
Quoted 14 lines
--- board/freescale/mpc8360emds/mpc8360emds.c | 3 +- drivers/qe/uec.c | 122 ++++++++++++++++------------- drivers/qe/uec.h | 34 ++++---- drivers/qe/uec_phy.c | 84 +++++++++++--------- include/configs/MPC8323ERDB.h | 6 +- include/configs/MPC832XEMDS.h | 6 +- include/configs/MPC8360EMDS.h | 6 +- include/configs/MPC8360ERDK.h | 6 +- include/configs/MPC8568MDS.h | 6 +- include/configs/MPC8569MDS.h | 30 +++++--- include/configs/kmeter1.h | 3 +- 11 files changed, 175 insertions(+), 131 deletions(-)
Applied to net repo.
thanks,
Ben