AX88180: new gigabit network driver
PATCH 1/1 AX88180: new gigabit network driver
From: Michael Hennerich <[email protected]>
A new driver for the AXIS AX88180 gigabit ethernet chip.
--- drivers/net/Makefile | 1 + drivers/net/ax88180.c | 943 +++++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ax88180.h | 348 ++++++++++++++++++ 3 files changed, 1292 insertions(+), 0 deletions(-) create mode 100644 drivers/net/ax88180.c create mode 100644 drivers/net/ax88180.h
drivers/net/Makefile +1 -0
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB := $(obj)libnet.a COBJS-y += 3c589.o +COBJS-$(CONFIG_DRIVER_AX88180) += ax88180.o COBJS-y += bcm570x.o bcm570x_autoneg.o 5701rls.o COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o COBJS-y += cs8900.o
drivers/net/ax88180.c new file +943 -0
943 lines not on this page · raw message
drivers/net/ax88180.h new file +348 -0
348 lines not on this page · raw message
Signature · 1 line
1.5.5.3
PATCH 1/1 AX88180: new gigabit network driver
Quoted 3 lines · In message <[email protected]> you wrote:
From: Michael Hennerich <[email protected]>
A new driver for the AXIS AX88180 gigabit ethernet chip.
...
Quoted 18 lines
+++
b/drivers/net/ax88180.cdrivers/net/ax88180.c new file +16
-0@@ -0,0 +1,943 @@ +/* ax88180: ASIX AX88180 Non-PCI Gigabit Ethernet u-boot driver +* Licensed under the GPL-2. +*/ +/* +* ======================================================================== +* ASIX AX88180 Non-PCI 16/32-bit Gigabit Ethernet Linux Driver +* +* The AX88180 Ethernet controller is high performance and highly +* integrated local CPU bus Ethernet controllers with embedded 40K bytes +* SRAM and supports both 16-bit and 32-bit SRAM-Like interfaces +* for any embedded systems. +* The AX88180 is a single chip 10/100/1000Mbps Gigabit Ethernet controller +* that supports both MII and RGMII interfaces and is compliant to +* IEEE 802.3, IEEE 802.3u and IEEE 802.3z standards. +* +* Please visit ASIX's web site (http://www.asix.com.tw) for more details.
drivers/net/ax88180.c line 26
Quoted 10 lines
drivers/net/ax88180.c new file +10
-0+* +* Module Name : ax88180.c +* Purpose : This file is the main file. +* Author : Allan Chou <[email protected]> +* Date : 2006-09-06 +* Notes : +* History : +* $Log:$ +* 1.0.0 2006-09-06 +* New release for AX88180 US2 chip.
Who holds the Copyright for this code?
...
drivers/net/ax88180.c line 91
Quoted 9 lines
drivers/net/ax88180.c new file +9
-0+#define READ_RXBUF (data) data = readw(AX88180_BASE + RXBUFFER_START + RXBUF_OFFSET_16BIT) +#define WRITE_TXBUF (data) writew(data, AX88180_BASE + TXBUFFER_START + TXBUF_OFFSET_16BIT) +#define READ_MACREG (regaddr, regdata) regdata = readw(AX88180_BASE + MACREG_OFFSET_16BIT + regaddr) +#define WRITE_MACREG (regaddr, regdata) writew(regdata, AX88180_BASE + MACREG_OFFSET_16BIT + regaddr); +#else /* defined(__bfin__) */ +#define READ_RXBUF (data) data = *(volatile unsigned short *)(AX88180_BASE + RXBUFFER_START) +#define WRITE_TXBUF (data) *(volatile unsigned short *)(AX88180_BASE + TXBUFFER_START) = data +#define READ_MACREG (regaddr, regdata) regdata = *(volatile unsigned short*)(AX88180_BASE + regaddr) +#define WRITE_MACREG (regaddr, regdata) *(volatile unsigned short*)(AX88180_BASE + regaddr) = regdata;
Lines MUCH too long!!! ditto in rest of file.
Quoted 11 lines
drivers/net/ax88180.c new file +11
-0+for (k1 =0 ; k1 <10000 ; k1++) { \ +READ_MACREG (MDIOCTRL , tmpval1); \ +if ((tmpval1 &READ_PHY ) ==0 ) { \ +break ; \ + } \ +udelay (1 ); \ + } \ +READ_MACREG (MDIODP , regdata); \ +} +#define WRITE_PHYREG (phyaddr, regaddr, regdata) { \ + unsigned long tmpval2, k2; \
drivers/net/ax88180.c line 134
Quoted 10 lines
drivers/net/ax88180.c new file +10
-0+WRITE_MACREG (MDIODP , regdata); \ +WRITE_MACREG (MDIOCTRL ,WRITE_PHY | (regaddr <<8 ) | phyaddr); \ +for (k2 =0 ; k2 <10000 ; k2++) { \ +READ_MACREG (MDIOCTRL , tmpval2); \ +if ((tmpval2 &WRITE_PHY ) ==0 ) { \ +break ; \ + } \ +udelay (1 ); \ + } \ +}
I have no ide where this code is coming from, but I cannot help but asking myself if the author of this code ever heard about the concept of functions?
Quoted 1 line
drivers/net/ax88180.c new file +1
-0+#define RESET_MAC { \
...
Quoted 1 line
+#define
RESET_PHY{ \
...
Quoted 1 line
+#define
INIT_TXRX_VARIABLES{ \
...
Quoted 1 line
+#define
DISPLAY_ALLMACREG{ \
...
Quoted 1 line
+#define
DISPLAY_ALLPHYREG{ \
And so on - all the macros shall be changed into functions.
Stopped reviewing here.
Please fix and resubmit - as is, this code has no chance to go into mainline.
Best regards,
Wolfgang Denk
Signature · 5 lines
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 A well-written program is its own heaven; a poorly-written program is its own hell. -- Geoffrey James, "The Tao of Programming"
PATCH 1/1 AX88180: new gigabit network driver
In reply to Mike FrysingerQuoted 3 lines · In message <[email protected]> you wrote:
From: Michael Hennerich <[email protected]>
A new driver for the AXIS AX88180 gigabit ethernet chip.
By the way:
drivers/net/ax88180.c line 3
Quoted 6 lines
drivers/net/ax88180.c new file +3
-0@@ -0,0 +1,943 @@ +/* ax88180: ASIX AX88180 Non-PCI Gigabit Ethernet u-boot driver +* Licensed under the GPL-2. +*/
It seems the original driver source from http://www.asix.com.tw
contained a full GPL license header plus copyright note.
May I ask who messed with that, and why?
drivers/net/ax88180.c line 26
Quoted 4 lines
drivers/net/ax88180.c new file +4
-0+* ======================================================================== +* $Log:$ +* 1.0.0 2006-09-06 +* New release for AX88180 US2 chip.
Also, this is old stuff. Why did you not base your work on more recent code (like version 1.0.1 , 2006-06-14) ?
Best regards,
Wolfgang Denk
Signature · 5 lines
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 are three things I always forget. Names, faces - the third I can't remember. - Italo Svevo
PATCH 1/1 AX88180: new gigabit network driver
Quoted 6 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:
From: Michael Hennerich <[email protected]>
A new driver for the AXIS AX88180 gigabit ethernet chip.
By the way:
Quoted 8 lines
drivers/net/ax88180.c line 3
Quoted 6 lines
drivers/net/ax88180.c new file +3
-0@@ -0,0 +1,943 @@ +/* ax88180: ASIX AX88180 Non-PCI Gigabit Ethernet u-boot driver +* Licensed under the GPL-2. +*/ It seems the original driver source from http://www.asix.com.tw
just like the header says ...
Quoted 3 lines
contained a full GPL license header plus copyright note.
May I ask who messed with that, and why?
you're comparing different versions and wondering why they're different ?
Quoted 8 lines
Quoted 5 lines
drivers/net/ax88180.c new file +1
-0+* ========================================================================
+ * $Log:$
+ * 1.0.0 2006-09-06
+ * New release for AX88180 US2 chip.Also, this is old stuff. Why did you not base your work on more recent code (like version 1.0.1 , 2006-06-14) ?
we based our work on the latest at the time. i guess a new version has come out huh.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080601/46fb104a/attachment.pgp
PATCH 1/1 AX88180: new gigabit network driver
Quoted 7 lines · Mike Frysinger
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · In message
From: Michael Hennerich <[email protected]> = + * $Log:$
+ * 1.0.0 2006-09-06
+ * New release for AX88180 US2 chip.
Quoted 5 lines
Quoted 2 lines
Also, this is old stuff. Why did you not base your work on more recent code (like version 1.0.1 , 2006-06-14) ?
we based our work on the latest at the time. i guess a new version has come out huh.
actually, it would seem that ASIX sent us this code directly
i guess i'll just keep this Blackfin local as there isnt real interest on our side to get it cleaned up ... sorry for the noise
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080602/e4de9630/attachment.pgp