public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] include/linux/mii.h: update for supporting GE
@ 2010-12-03  5:52 Macpaul Lin
  2010-12-08 23:05 ` Wolfgang Denk
  2011-01-21  7:09 ` Wolfgang Denk
  0 siblings, 2 replies; 13+ messages in thread
From: Macpaul Lin @ 2010-12-03  5:52 UTC (permalink / raw)
  To: u-boot

This file has been synced (copy) from Linux source code.
This commit was based on kernel 2.6.32.
It updates gigabit related phy registers and basic definitions.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
---
Change v1: pull header file from Linux.
Change v2: clean up unused code for u-boot.

 include/linux/mii.h |  181 ++++++++++++++++++++++++++++++---------------------
 1 files changed, 107 insertions(+), 74 deletions(-)

diff --git a/include/linux/mii.h b/include/linux/mii.h
index 7c63095..6e7ffab 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -10,98 +10,132 @@
 
 /* Generic MII registers. */
 
-#define MII_BMCR	    0x00	/* Basic mode control register */
-#define MII_BMSR	    0x01	/* Basic mode status register  */
-#define MII_PHYSID1	    0x02	/* PHYS ID 1		       */
-#define MII_PHYSID2	    0x03	/* PHYS ID 2		       */
-#define MII_ADVERTISE	    0x04	/* Advertisement control reg   */
-#define MII_LPA		    0x05	/* Link partner ability reg    */
-#define MII_EXPANSION	    0x06	/* Expansion register	       */
-#define MII_DCOUNTER	    0x12	/* Disconnect counter	       */
-#define MII_FCSCOUNTER	    0x13	/* False carrier counter       */
-#define MII_NWAYTEST	    0x14	/* N-way auto-neg test reg     */
-#define MII_RERRCOUNTER     0x15	/* Receive error counter       */
-#define MII_SREVISION	    0x16	/* Silicon revision	       */
-#define MII_RESV1	    0x17	/* Reserved...		       */
-#define MII_LBRERROR	    0x18	/* Lpback, rx, bypass error    */
-#define MII_PHYADDR	    0x19	/* PHY address		       */
-#define MII_RESV2	    0x1a	/* Reserved...		       */
-#define MII_TPISTATUS	    0x1b	/* TPI status for 10mbps       */
-#define MII_NCONFIG	    0x1c	/* Network interface config    */
+#define MII_BMCR            0x00        /* Basic mode control register */
+#define MII_BMSR            0x01        /* Basic mode status register  */
+#define MII_PHYSID1         0x02        /* PHYS ID 1                   */
+#define MII_PHYSID2         0x03        /* PHYS ID 2                   */
+#define MII_ADVERTISE       0x04        /* Advertisement control reg   */
+#define MII_LPA             0x05        /* Link partner ability reg    */
+#define MII_EXPANSION       0x06        /* Expansion register          */
+#define MII_CTRL1000        0x09        /* 1000BASE-T control          */
+#define MII_STAT1000        0x0a        /* 1000BASE-T status           */
+#define MII_ESTATUS	    0x0f	/* Extended Status */
+#define MII_DCOUNTER        0x12        /* Disconnect counter          */
+#define MII_FCSCOUNTER      0x13        /* False carrier counter       */
+#define MII_NWAYTEST        0x14        /* N-way auto-neg test reg     */
+#define MII_RERRCOUNTER     0x15        /* Receive error counter       */
+#define MII_SREVISION       0x16        /* Silicon revision            */
+#define MII_RESV1           0x17        /* Reserved...                 */
+#define MII_LBRERROR        0x18        /* Lpback, rx, bypass error    */
+#define MII_PHYADDR         0x19        /* PHY address                 */
+#define MII_RESV2           0x1a        /* Reserved...                 */
+#define MII_TPISTATUS       0x1b        /* TPI status for 10mbps       */
+#define MII_NCONFIG         0x1c        /* Network interface config    */
 
 /* Basic mode control register. */
-#define BMCR_RESV		0x003f	/* Unused...		       */
-#define BMCR_SPEED1000		0x0040	/* MSB of Speed (1000)	       */
-#define BMCR_CTST		0x0080	/* Collision test	       */
-#define BMCR_FULLDPLX		0x0100	/* Full duplex		       */
-#define BMCR_ANRESTART		0x0200	/* Auto negotiation restart    */
-#define BMCR_ISOLATE		0x0400	/* Disconnect DP83840 from MII */
-#define BMCR_PDOWN		0x0800	/* Powerdown the DP83840       */
-#define BMCR_ANENABLE		0x1000	/* Enable auto negotiation     */
-#define BMCR_SPEED100		0x2000	/* Select 100Mbps	       */
-#define BMCR_LOOPBACK		0x4000	/* TXD loopback bits	       */
-#define BMCR_RESET		0x8000	/* Reset the DP83840	       */
+#define BMCR_RESV               0x003f  /* Unused...                   */
+#define BMCR_SPEED1000		0x0040  /* MSB of Speed (1000)         */
+#define BMCR_CTST               0x0080  /* Collision test              */
+#define BMCR_FULLDPLX           0x0100  /* Full duplex                 */
+#define BMCR_ANRESTART          0x0200  /* Auto negotiation restart    */
+#define BMCR_ISOLATE            0x0400  /* Disconnect DP83840 from MII */
+#define BMCR_PDOWN              0x0800  /* Powerdown the DP83840       */
+#define BMCR_ANENABLE           0x1000  /* Enable auto negotiation     */
+#define BMCR_SPEED100           0x2000  /* Select 100Mbps              */
+#define BMCR_LOOPBACK           0x4000  /* TXD loopback bits           */
+#define BMCR_RESET              0x8000  /* Reset the DP83840           */
 
 /* Basic mode status register. */
-#define BMSR_ERCAP		0x0001	/* Ext-reg capability	       */
-#define BMSR_JCD		0x0002	/* Jabber detected	       */
-#define BMSR_LSTATUS		0x0004	/* Link status		       */
-#define BMSR_ANEGCAPABLE	0x0008	/* Able to do auto-negotiation */
-#define BMSR_RFAULT		0x0010	/* Remote fault detected       */
-#define BMSR_ANEGCOMPLETE	0x0020	/* Auto-negotiation complete   */
-#define BMSR_RESV		0x07c0	/* Unused...		       */
-#define BMSR_10HALF		0x0800	/* Can do 10mbps, half-duplex  */
-#define BMSR_10FULL		0x1000	/* Can do 10mbps, full-duplex  */
-#define BMSR_100HALF		0x2000	/* Can do 100mbps, half-duplex */
-#define BMSR_100FULL		0x4000	/* Can do 100mbps, full-duplex */
-#define BMSR_100BASE4		0x8000	/* Can do 100mbps, 4k packets  */
+#define BMSR_ERCAP              0x0001  /* Ext-reg capability          */
+#define BMSR_JCD                0x0002  /* Jabber detected             */
+#define BMSR_LSTATUS            0x0004  /* Link status                 */
+#define BMSR_ANEGCAPABLE        0x0008  /* Able to do auto-negotiation */
+#define BMSR_RFAULT             0x0010  /* Remote fault detected       */
+#define BMSR_ANEGCOMPLETE       0x0020  /* Auto-negotiation complete   */
+#define BMSR_RESV               0x00c0  /* Unused...                   */
+#define BMSR_ESTATEN		0x0100	/* Extended Status in R15 */
+#define BMSR_100HALF2           0x0200  /* Can do 100BASE-T2 HDX */
+#define BMSR_100FULL2           0x0400  /* Can do 100BASE-T2 FDX */
+#define BMSR_10HALF             0x0800  /* Can do 10mbps, half-duplex  */
+#define BMSR_10FULL             0x1000  /* Can do 10mbps, full-duplex  */
+#define BMSR_100HALF            0x2000  /* Can do 100mbps, half-duplex */
+#define BMSR_100FULL            0x4000  /* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4           0x8000  /* Can do 100mbps, 4k packets  */
 
 /* Advertisement control register. */
-#define ADVERTISE_SLCT		0x001f	/* Selector bits	       */
-#define ADVERTISE_CSMA		0x0001	/* Only selector supported     */
-#define ADVERTISE_10HALF	0x0020	/* Try for 10mbps half-duplex  */
-#define ADVERTISE_10FULL	0x0040	/* Try for 10mbps full-duplex  */
-#define ADVERTISE_100HALF	0x0080	/* Try for 100mbps half-duplex */
-#define ADVERTISE_100FULL	0x0100	/* Try for 100mbps full-duplex */
-#define ADVERTISE_100BASE4	0x0200	/* Try for 100mbps 4k packets  */
-#define ADVERTISE_RESV		0x1c00	/* Unused...		       */
-#define ADVERTISE_RFAULT	0x2000	/* Say we can detect faults    */
-#define ADVERTISE_LPACK		0x4000	/* Ack link partners response  */
-#define ADVERTISE_NPAGE		0x8000	/* Next page bit	       */
+#define ADVERTISE_SLCT          0x001f  /* Selector bits               */
+#define ADVERTISE_CSMA          0x0001  /* Only selector supported     */
+#define ADVERTISE_10HALF        0x0020  /* Try for 10mbps half-duplex  */
+#define ADVERTISE_1000XFULL     0x0020  /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL        0x0040  /* Try for 10mbps full-duplex  */
+#define ADVERTISE_1000XHALF     0x0040  /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF       0x0080  /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE    0x0080  /* Try for 1000BASE-X pause    */
+#define ADVERTISE_100FULL       0x0100  /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM 0x0100  /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4      0x0200  /* Try for 100mbps 4k packets  */
+#define ADVERTISE_PAUSE_CAP     0x0400  /* Try for pause               */
+#define ADVERTISE_PAUSE_ASYM    0x0800  /* Try for asymetric pause     */
+#define ADVERTISE_RESV          0x1000  /* Unused...                   */
+#define ADVERTISE_RFAULT        0x2000  /* Say we can detect faults    */
+#define ADVERTISE_LPACK         0x4000  /* Ack link partners response  */
+#define ADVERTISE_NPAGE         0x8000  /* Next page bit               */
 
 #define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
 			ADVERTISE_CSMA)
 #define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-		       ADVERTISE_100HALF | ADVERTISE_100FULL)
+                       ADVERTISE_100HALF | ADVERTISE_100FULL)
 
 /* Link partner ability register. */
-#define LPA_SLCT		0x001f	/* Same as advertise selector  */
-#define LPA_10HALF		0x0020	/* Can do 10mbps half-duplex   */
-#define LPA_10FULL		0x0040	/* Can do 10mbps full-duplex   */
-#define LPA_100HALF		0x0080	/* Can do 100mbps half-duplex  */
-#define LPA_100FULL		0x0100	/* Can do 100mbps full-duplex  */
-#define LPA_100BASE4		0x0200	/* Can do 100mbps 4k packets   */
-#define LPA_RESV		0x1c00	/* Unused...		       */
-#define LPA_RFAULT		0x2000	/* Link partner faulted        */
-#define LPA_LPACK		0x4000	/* Link partner acked us       */
-#define LPA_NPAGE		0x8000	/* Next page bit	       */
+#define LPA_SLCT                0x001f  /* Same as advertise selector  */
+#define LPA_10HALF              0x0020  /* Can do 10mbps half-duplex   */
+#define LPA_1000XFULL           0x0020  /* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL              0x0040  /* Can do 10mbps full-duplex   */
+#define LPA_1000XHALF           0x0040  /* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF             0x0080  /* Can do 100mbps half-duplex  */
+#define LPA_1000XPAUSE          0x0080  /* Can do 1000BASE-X pause     */
+#define LPA_100FULL             0x0100  /* Can do 100mbps full-duplex  */
+#define LPA_1000XPAUSE_ASYM     0x0100  /* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4            0x0200  /* Can do 100mbps 4k packets   */
+#define LPA_PAUSE_CAP           0x0400  /* Can pause                   */
+#define LPA_PAUSE_ASYM          0x0800  /* Can pause asymetrically     */
+#define LPA_RESV                0x1000  /* Unused...                   */
+#define LPA_RFAULT              0x2000  /* Link partner faulted        */
+#define LPA_LPACK               0x4000  /* Link partner acked us       */
+#define LPA_NPAGE               0x8000  /* Next page bit               */
 
 #define LPA_DUPLEX		(LPA_10FULL | LPA_100FULL)
 #define LPA_100			(LPA_100FULL | LPA_100HALF | LPA_100BASE4)
 
 /* Expansion register for auto-negotiation. */
-#define EXPANSION_NWAY		0x0001	/* Can do N-way auto-nego      */
-#define EXPANSION_LCWP		0x0002	/* Got new RX page code word   */
-#define EXPANSION_ENABLENPAGE	0x0004	/* This enables npage words    */
-#define EXPANSION_NPCAPABLE	0x0008	/* Link partner supports npage */
-#define EXPANSION_MFAULTS	0x0010	/* Multiple faults detected    */
-#define EXPANSION_RESV		0xffe0	/* Unused...		       */
+#define EXPANSION_NWAY          0x0001  /* Can do N-way auto-nego      */
+#define EXPANSION_LCWP          0x0002  /* Got new RX page code word   */
+#define EXPANSION_ENABLENPAGE   0x0004  /* This enables npage words    */
+#define EXPANSION_NPCAPABLE     0x0008  /* Link partner supports npage */
+#define EXPANSION_MFAULTS       0x0010  /* Multiple faults detected    */
+#define EXPANSION_RESV          0xffe0  /* Unused...                   */
+
+#define ESTATUS_1000_TFULL	0x2000	/* Can do 1000BT Full */
+#define ESTATUS_1000_THALF	0x1000	/* Can do 1000BT Half */
 
 /* N-way test register. */
-#define NWAYTEST_RESV1		0x00ff	/* Unused...		       */
-#define NWAYTEST_LOOPBACK	0x0100	/* Enable loopback for N-way   */
-#define NWAYTEST_RESV2		0xfe00	/* Unused...		       */
+#define NWAYTEST_RESV1          0x00ff  /* Unused...                   */
+#define NWAYTEST_LOOPBACK       0x0100  /* Enable loopback for N-way   */
+#define NWAYTEST_RESV2          0xfe00  /* Unused...                   */
+
+/* 1000BASE-T Control register */
+#define ADVERTISE_1000FULL      0x0200  /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF      0x0100  /* Advertise 1000BASE-T half duplex */
 
+/* 1000BASE-T Status register */
+#define LPA_1000LOCALRXOK       0x2000  /* Link partner local receiver status */
+#define LPA_1000REMRXOK         0x1000  /* Link partner remote receiver status */
+#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */
+
+/* Flow control flags */
+#define FLOW_CTRL_TX		0x01
+#define FLOW_CTRL_RX		0x02
 
 /**
  * mii_nway_result
@@ -114,7 +148,7 @@
  *
  * The one exception to IEEE 802.3u is that 100baseT4 is placed
  * between 100T-full and 100T-half.  If your phy does not support
- * 100T4 this is fine.	If your phy places 100T4 elsewhere in the
+ * 100T4 this is fine. If your phy places 100T4 elsewhere in the
  * priority order, you will need to roll your own function.
  */
 static inline unsigned int mii_nway_result (unsigned int negotiated)
@@ -154,5 +188,4 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock,
 	return 0;
 }
 
-
 #endif /* __LINUX_MII_H__ */
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH v2] include/linux/mii.h: update for supporting GE
  2010-12-03  5:52 [U-Boot] " Macpaul Lin
@ 2010-12-08 23:05 ` Wolfgang Denk
  2011-01-21  7:09 ` Wolfgang Denk
  1 sibling, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2010-12-08 23:05 UTC (permalink / raw)
  To: u-boot

Dear Macpaul Lin,

In message <1291355554-18586-1-git-send-email-macpaul@andestech.com> you wrote:
> This file has been synced (copy) from Linux source code.
> This commit was based on kernel 2.6.32.
> It updates gigabit related phy registers and basic definitions.
> 
> Signed-off-by: Macpaul Lin <macpaul@andestech.com>
> ---
> Change v1: pull header file from Linux.
> Change v2: clean up unused code for u-boot.
> 
>  include/linux/mii.h |  181 ++++++++++++++++++++++++++++++---------------------
>  1 files changed, 107 insertions(+), 74 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Plans break down. You cannot plan the future. Only presumptuous fools
plan. The wise man _steers_.        - Terry Pratchett, _Making_Money_

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH v2] include/linux/mii.h: update for supporting GE
  2010-12-03  5:52 [U-Boot] " Macpaul Lin
  2010-12-08 23:05 ` Wolfgang Denk
@ 2011-01-21  7:09 ` Wolfgang Denk
  2011-01-21  8:04   ` Kumar Gala
  1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Denk @ 2011-01-21  7:09 UTC (permalink / raw)
  To: u-boot

Dear Macpaul Lin,

In message <1291355554-18586-1-git-send-email-macpaul@andestech.com> you wrote:
> This file has been synced (copy) from Linux source code.
> This commit was based on kernel 2.6.32.
> It updates gigabit related phy registers and basic definitions.
> 
> Signed-off-by: Macpaul Lin <macpaul@andestech.com>
> ---
> Change v1: pull header file from Linux.
> Change v2: clean up unused code for u-boot.
> 
>  include/linux/mii.h |  181 ++++++++++++++++++++++++++++++---------------------
>  1 files changed, 107 insertions(+), 74 deletions(-)

This patch causes build warnings for a number of boards, for example:

Configuring for MPC8568MDS board...
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec.c:32:
/home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
In file included from uec.c:31:
uec_phy.h:34:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec.c:32:
/home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
In file included from uec.c:31:
uec_phy.h:35:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec_phy.c:27:
/home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
In file included from uec_phy.c:26:
uec_phy.h:34:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec_phy.c:27:
/home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
In file included from uec_phy.c:26:
uec_phy.h:35:1: warning: this is the location of the previous definition
   text    data     bss     dec     hex filename
 238866   22824   25252  286942   460de /work/wd/tmp-ppc/u-boot
Configuring for MPC8569MDS board...
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec.c:32:
/home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
In file included from uec.c:31:
uec_phy.h:34:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec.c:32:
/home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
In file included from uec.c:31:
uec_phy.h:35:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec_phy.c:27:
/home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
In file included from uec_phy.c:26:
uec_phy.h:34:1: warning: this is the location of the previous definition
In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
                 from uec_phy.c:27:
/home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
In file included from uec_phy.c:26:
uec_phy.h:35:1: warning: this is the location of the previous definition
   text    data     bss     dec     hex filename
 327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
...

etc. etc.


Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Insults are effective only where emotion is present.
	-- Spock, "Who Mourns for Adonais?"  stardate 3468.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
@ 2011-01-21  7:17 macpaul at andestech.com
  0 siblings, 0 replies; 13+ messages in thread
From: macpaul at andestech.com @ 2011-01-21  7:17 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

 > 
> Dear Macpaul Lin,
> 
> In message 
> <1291355554-18586-1-git-send-email-macpaul@andestech.com> you wrote:
> > This file has been synced (copy) from Linux source code.
> > This commit was based on kernel 2.6.32.
> > It updates gigabit related phy registers and basic definitions.
> > 
> > Signed-off-by: Macpaul Lin <macpaul@andestech.com>
> > ---
> > Change v1: pull header file from Linux.
> > Change v2: clean up unused code for u-boot.
> > 
> >  include/linux/mii.h |  181 
> ++++++++++++++++++++++++++++++---------------------
> >  1 files changed, 107 insertions(+), 74 deletions(-)
> 
> This patch causes build warnings for a number of boards, for example:
> 
> Configuring for MPC8568MDS board...
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: 
> "LPA_1000FULL" redefined
> In file included from uec.c:31:
> uec_phy.h:34:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec.c:31:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: 
> "LPA_1000FULL" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:34:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
>    text    data     bss     dec     hex filename
>  238866   22824   25252  286942   460de /work/wd/tmp-ppc/u-boot
> Configuring for MPC8569MDS board...
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: 
> "LPA_1000FULL" redefined
> In file included from uec.c:31:
> uec_phy.h:34:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec.c:31:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: 
> "LPA_1000FULL" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:34:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
>    text    data     bss     dec     hex filename
>  327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
> ...

Okay,
Will try to fix this ASAP.

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
@ 2011-01-21  7:26 macpaul at andestech.com
  0 siblings, 0 replies; 13+ messages in thread
From: macpaul at andestech.com @ 2011-01-21  7:26 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: 
> "LPA_1000FULL" redefined
> In file included from uec.c:31:
> uec_phy.h:34:1: warning: this is the location of the previous 
> definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec.c:32:
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                  from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
>    text    data     bss     dec     hex filename
>  327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
> ...

I've found that the problem is because uec_phy.c defined these gigabit
related definitions since they might be ported from Linux kernel.
The redifinition in uec_phy.c should be removed, however I can send
the patch for fixing this but I need to get a proper ppc cross-compiler.
I will check these stuff after I found and download the ppc cross compiler.

Just send a note to mailist.

Best regards,
Macpaul Lin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
@ 2011-01-21  7:31 macpaul at andestech.com
  2011-01-21  8:05 ` Kumar Gala
  2011-01-21  8:23 ` Wolfgang Denk
  0 siblings, 2 replies; 13+ messages in thread
From: macpaul at andestech.com @ 2011-01-21  7:31 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,  

> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous 
> definition
>    text    data     bss     dec     hex filename
>  327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot

Moreover, after checking drivers/qe/uec_phy.h, I've found
some definitions differs from standard linux code.

In uec_phy:
drivers/qe/uec_phy.h:34:#define LPA_1000FULL            0x0400
drivers/qe/uec_phy.h:35:#define LPA_1000HALF            0x0200

In Linux:
include/linux/mii.h:133:#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
include/linux/mii.h:134:#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */

Do you know if this is a wrong defintion on uec_phy ?
I'm afraid the fix will lead some mis-behavior for boards has uec_phy.

Best regards,
Macpaul Lin

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  7:09 ` Wolfgang Denk
@ 2011-01-21  8:04   ` Kumar Gala
  2011-01-21  8:25     ` Wolfgang Denk
  0 siblings, 1 reply; 13+ messages in thread
From: Kumar Gala @ 2011-01-21  8:04 UTC (permalink / raw)
  To: u-boot


On Jan 21, 2011, at 1:09 AM, Wolfgang Denk wrote:

> Dear Macpaul Lin,
> 
> In message <1291355554-18586-1-git-send-email-macpaul@andestech.com> you wrote:
>> This file has been synced (copy) from Linux source code.
>> This commit was based on kernel 2.6.32.
>> It updates gigabit related phy registers and basic definitions.
>> 
>> Signed-off-by: Macpaul Lin <macpaul@andestech.com>
>> ---
>> Change v1: pull header file from Linux.
>> Change v2: clean up unused code for u-boot.
>> 
>> include/linux/mii.h |  181 ++++++++++++++++++++++++++++++---------------------
>> 1 files changed, 107 insertions(+), 74 deletions(-)
> 
> This patch causes build warnings for a number of boards, for example:
> 
> Configuring for MPC8568MDS board...
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
> In file included from uec.c:31:
> uec_phy.h:34:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
> In file included from uec.c:31:
> uec_phy.h:35:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:34:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous definition
>   text    data     bss     dec     hex filename
> 238866   22824   25252  286942   460de /work/wd/tmp-ppc/u-boot
> Configuring for MPC8569MDS board...
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
> In file included from uec.c:31:
> uec_phy.h:34:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec.c:32:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
> In file included from uec.c:31:
> uec_phy.h:35:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:133:1: warning: "LPA_1000FULL" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:34:1: warning: this is the location of the previous definition
> In file included from /home/wd/git/u-boot/work/include/miiphy.h:37,
>                 from uec_phy.c:27:
> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: "LPA_1000HALF" redefined
> In file included from uec_phy.c:26:
> uec_phy.h:35:1: warning: this is the location of the previous definition
>   text    data     bss     dec     hex filename
> 327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
> ...
> 
> etc. etc.
> 
> 
> Please fix.
> 
> Best regards,
> 
> Wolfgang Denk

I posted a fix for this:

http://patchwork.ozlabs.org/patch/79439/

- k

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  7:31 [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE macpaul at andestech.com
@ 2011-01-21  8:05 ` Kumar Gala
  2011-01-21  8:27   ` Wolfgang Denk
  2011-01-21  8:23 ` Wolfgang Denk
  1 sibling, 1 reply; 13+ messages in thread
From: Kumar Gala @ 2011-01-21  8:05 UTC (permalink / raw)
  To: u-boot


On Jan 21, 2011, at 1:31 AM, <macpaul@andestech.com> wrote:

> Dear Wolfgang,  
> 
>> /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
>> "LPA_1000HALF" redefined
>> In file included from uec_phy.c:26:
>> uec_phy.h:35:1: warning: this is the location of the previous 
>> definition
>>   text    data     bss     dec     hex filename
>> 327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
> 
> Moreover, after checking drivers/qe/uec_phy.h, I've found
> some definitions differs from standard linux code.
> 
> In uec_phy:
> drivers/qe/uec_phy.h:34:#define LPA_1000FULL            0x0400
> drivers/qe/uec_phy.h:35:#define LPA_1000HALF            0x0200
> 
> In Linux:
> include/linux/mii.h:133:#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
> include/linux/mii.h:134:#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */
> 
> Do you know if this is a wrong defintion on uec_phy ?
> I'm afraid the fix will lead some mis-behavior for boards has uec_phy.

See:

http://patchwork.ozlabs.org/patch/79439/

- k

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  7:31 [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE macpaul at andestech.com
  2011-01-21  8:05 ` Kumar Gala
@ 2011-01-21  8:23 ` Wolfgang Denk
  2011-01-21  9:52   ` Anton Vorontsov
  1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Denk @ 2011-01-21  8:23 UTC (permalink / raw)
  To: u-boot

Dear Macpaul,

In message <50FD90C65C53FB45BADEEBCD84FF07F202CEB58B@ATCPCS06.andestech.com> you wrote:
> 
> > /home/wd/git/u-boot/work/include/linux/mii.h:134:1: warning: 
> > "LPA_1000HALF" redefined
> > In file included from uec_phy.c:26:
> > uec_phy.h:35:1: warning: this is the location of the previous 
> > definition
> >    text    data     bss     dec     hex filename
> >  327682   28828  230568  587078   8f546 /work/wd/tmp-ppc/u-boot
>
> Moreover, after checking drivers/qe/uec_phy.h, I've found
> some definitions differs from standard linux code.
>
> In uec_phy:
> drivers/qe/uec_phy.h:34:#define LPA_1000FULL            0x0400
> drivers/qe/uec_phy.h:35:#define LPA_1000HALF            0x0200
>
> In Linux:
> include/linux/mii.h:133:#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
> include/linux/mii.h:134:#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */
>
> Do you know if this is a wrong defintion on uec_phy ?
> I'm afraid the fix will lead some mis-behavior for boards has uec_phy.

These definitions were added by commit 91cdaa3a:

commit 91cdaa3a9d7562b869d96774e9c9ddf142c0848d
Author: Anton Vorontsov <avorontsov@ru.mvista.com>
Date:   Mon Mar 24 20:46:24 2008 +0300

    uec: add support for gbit mii status readings
    
    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>


Anton, can you please comment?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's no honorable way to kill, no gentle way to destroy.  There is
nothing good in war.  Except its ending.
	-- Abraham Lincoln, "The Savage Curtain", stardate 5906.5

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  8:04   ` Kumar Gala
@ 2011-01-21  8:25     ` Wolfgang Denk
  0 siblings, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2011-01-21  8:25 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <222DA5A3-7289-4F01-B0CE-8D02DDDB25AE@kernel.crashing.org> you wrote:
> 
...
> I posted a fix for this:
> 
> http://patchwork.ozlabs.org/patch/79439/

I see.  But I'm still scared about the changed values in the #defines

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
For every complex problem, there is a solution that is simple,  neat,
and wrong.                                               - Mark Twain

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  8:05 ` Kumar Gala
@ 2011-01-21  8:27   ` Wolfgang Denk
  2011-01-21  9:17     ` Kumar Gala
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Denk @ 2011-01-21  8:27 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <4E0178ED-1410-4CA6-B173-9DF8BCBC497A@kernel.crashing.org> you wrote:
> 
> > Do you know if this is a wrong defintion on uec_phy ?
> > I'm afraid the fix will lead some mis-behavior for boards has uec_phy.
> 
> See:
> 
> http://patchwork.ozlabs.org/patch/79439/

Have you tested this patch on the affected boards?  I'd be surprised
if both the old and the new values would work?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I see that Microsoft's campaign  to  destroy  all  knowledge  of  any
operating   environment   but  its  own  environment-of-the-year  has
succeeded in creating a generation of users who don't understand  the
concept of a shell...
            -- L. Peter Deutsch in <m0x5jNX-000R2UC@lamp.aladdin.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  8:27   ` Wolfgang Denk
@ 2011-01-21  9:17     ` Kumar Gala
  0 siblings, 0 replies; 13+ messages in thread
From: Kumar Gala @ 2011-01-21  9:17 UTC (permalink / raw)
  To: u-boot


On Jan 21, 2011, at 2:27 AM, Wolfgang Denk wrote:

> Dear Kumar Gala,
> 
> In message <4E0178ED-1410-4CA6-B173-9DF8BCBC497A@kernel.crashing.org> you wrote:
>> 
>>> Do you know if this is a wrong defintion on uec_phy ?
>>> I'm afraid the fix will lead some mis-behavior for boards has uec_phy.
>> 
>> See:
>> 
>> http://patchwork.ozlabs.org/patch/79439/
> 
> Have you tested this patch on the affected boards?  I'd be surprised
> if both the old and the new values would work?

I haven't, but I'll see if we have a system working with uec & 1G link.

- k

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE
  2011-01-21  8:23 ` Wolfgang Denk
@ 2011-01-21  9:52   ` Anton Vorontsov
  0 siblings, 0 replies; 13+ messages in thread
From: Anton Vorontsov @ 2011-01-21  9:52 UTC (permalink / raw)
  To: u-boot

On Fri, Jan 21, 2011 at 09:23:12AM +0100, Wolfgang Denk wrote:
[...]
> > In uec_phy:
> > drivers/qe/uec_phy.h:34:#define LPA_1000FULL            0x0400
> > drivers/qe/uec_phy.h:35:#define LPA_1000HALF            0x0200
> >
> > In Linux:
> > include/linux/mii.h:133:#define LPA_1000FULL            0x0800  /* Link partner 1000BASE-T full duplex */
> > include/linux/mii.h:134:#define LPA_1000HALF            0x0400  /* Link partner 1000BASE-T half duplex */
> >
> > Do you know if this is a wrong defintion on uec_phy ?
> > I'm afraid the fix will lead some mis-behavior for boards has uec_phy.
> 
> These definitions were added by commit 91cdaa3a:
> 
> commit 91cdaa3a9d7562b869d96774e9c9ddf142c0848d
> Author: Anton Vorontsov <avorontsov@ru.mvista.com>
> Date:   Mon Mar 24 20:46:24 2008 +0300
> 
>     uec: add support for gbit mii status readings
>     
>     Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> 
> 
> Anton, can you please comment?

I think that was just a shift-by-one mistake, Linux code is
correct.

It seems that the only way to trigger this is to force half-duplex
on a gigabit link (and u-boot will think that it's a full duplex
link).

I believe it's safe to fix the wrong definition.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru at gmail.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-01-21  9:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-21  7:31 [U-Boot] ??: [PATCH v2] include/linux/mii.h: update for supporting GE macpaul at andestech.com
2011-01-21  8:05 ` Kumar Gala
2011-01-21  8:27   ` Wolfgang Denk
2011-01-21  9:17     ` Kumar Gala
2011-01-21  8:23 ` Wolfgang Denk
2011-01-21  9:52   ` Anton Vorontsov
  -- strict thread matches above, loose matches on Subject: below --
2011-01-21  7:26 macpaul at andestech.com
2011-01-21  7:17 macpaul at andestech.com
2010-12-03  5:52 [U-Boot] " Macpaul Lin
2010-12-08 23:05 ` Wolfgang Denk
2011-01-21  7:09 ` Wolfgang Denk
2011-01-21  8:04   ` Kumar Gala
2011-01-21  8:25     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox