Skip to contentSkip to conversation

LL TEMAC V5 refactored

U-Boot Superseded Stephan Linz 2 participants 5 messages Nov 27, 2011

Subsystems (2)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

@Michal: please, can you test this code on Xilinx PPC4xx platforms and acknowledge the results? I have no access to a ml405 and ml507.

Note: To use the driver on Microblaze, you will need additional platform patches by Michal Simek:
- http://patchwork.ozlabs.org/patch/112535/
- http://patchwork.ozlabs.org/patch/112534/
- http://patchwork.ozlabs.org/patch/112532/

I will collect all related patches on a public bundle:
- http://patchwork.ozlabs.org/bundle/rexut/net-ll_temac/

br,
Stephan Linz

#1 lore raw

PATCH v5 1/1 net: ll_temac: Add LL TEMAC driver to u-boot

Xilinx LocalLink Tri-Mode Ether MAC driver can be
used by Xilinx Microblaze or Xilinx ppc405/440 in
SDMA and FIFO mode. DCR or XPS bus can be used.

The driver uses and requires MII and PHYLIB.

---
v5: Remove more endless loops
Remove useless parenthesis in pointer operations
Move phyaddr predefinition on top
Remove supernumerary newlines
Remove parenthesis around numbers (globally)
v4: Separate fifo and sdma code from driver core
Split sdma code into separate DCR and XPS bus access code Add extensive register struct definitions and enumerations Add new callbacks into fifo an sdma code
Prepare CDMAC buffer handling to be unique for every instance Separate Xilinx specific indirect DCR access, so we can move to arch Remove useless 'emac' parameter from indirect access helper functions Correct MDIO clock setup.
Remove endless loops
Common code beautifying

v3: Use helper functions for fifo mode
Use helper functions for indirect accesses
Code cleanup
Add comments for MAGIC values
Simplify code in fifo mode

v2: Remove helper function for access to temac
Remove SDMA/FIFO/DCR macros and configure it in board Setup mac by write_hwaddr

---
 drivers/net/Makefile               |    2 +
 drivers/net/xilinx_ll_temac.c      |  395 ++++++++++++++++++++++++++++++++++
 drivers/net/xilinx_ll_temac.h      |  302 ++++++++++++++++++++++++++
 drivers/net/xilinx_ll_temac_fifo.c |   93 ++++++++
 drivers/net/xilinx_ll_temac_fifo.h |  112 ++++++++++
 drivers/net/xilinx_ll_temac_sdma.c |  414 ++++++++++++++++++++++++++++++++++++
 drivers/net/xilinx_ll_temac_sdma.h |  273 ++++++++++++++++++++++++
 include/netdev.h                   |    2 +
 8 files changed, 1593 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/xilinx_ll_temac.c
 create mode 100644 drivers/net/xilinx_ll_temac.h
 create mode 100644 drivers/net/xilinx_ll_temac_fifo.c
 create mode 100644 drivers/net/xilinx_ll_temac_fifo.h
 create mode 100644 drivers/net/xilinx_ll_temac_sdma.c
 create mode 100644 drivers/net/xilinx_ll_temac_sdma.h
drivers/net/Makefile +2 -0
index d3df82e..14d71a7 100644
@@ -76,6 +76,8 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
 COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
 COBJS-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o
 COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
+COBJS-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o \
+		xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o
 
 COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
drivers/net/xilinx_ll_temac.c new file +395 -0

395 lines not on this page · raw message

drivers/net/xilinx_ll_temac.h new file +302 -0

302 lines not on this page · raw message

drivers/net/xilinx_ll_temac_fifo.c new file +93 -0

93 lines not on this page · raw message

drivers/net/xilinx_ll_temac_fifo.h new file +112 -0

112 lines not on this page · raw message

drivers/net/xilinx_ll_temac_sdma.c new file +414 -0

414 lines not on this page · raw message

drivers/net/xilinx_ll_temac_sdma.h new file +273 -0

273 lines not on this page · raw message

include/netdev.h +2 -0
index 04d9f75..061c1f1 100644
@@ -100,6 +100,8 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
 							unsigned long dma_addr);
 int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
 							int txpp, int rxpp);
+int xilinx_ll_temac_initialize(bd_t *bis, unsigned long base_addr,
+						int mode, unsigned long ctrl);
 
 /* Boards with PCI network controllers can call this from their board_eth_init()
  * function to initialize whatever's on board.
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v5 1/1 net: ll_temac: Add LL TEMAC driver to u-boot

Dear Stephan Linz,

Quoted 7 lines · In message <[email protected]> you wrote:

Xilinx LocalLink Tri-Mode Ether MAC driver can be
used by Xilinx Microblaze or Xilinx ppc405/440 in
SDMA and FIFO mode. DCR or XPS bus can be used.

The driver uses and requires MII and PHYLIB.

Checkpatch says:

total: 4 errors, 23 warnings, 1605 lines checked

Please fix.

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
The trouble with our times is that the future is not what it used  to
be.                                                     - Paul Valery
#3 lore raw

PATCH v5 1/1 net: ll_temac: Add LL TEMAC driver to u-boot

Am Sonntag, den 27.11.2011, 19:10 +0100 schrieb Wolfgang Denk:

Quoted 7 lines

Dear Stephan Linz,

Quoted 4 lines · In message <[email protected]> you wrote:

Xilinx LocalLink Tri-Mode Ether MAC driver can be
used by Xilinx Microblaze or Xilinx ppc405/440 in
SDMA and FIFO mode. DCR or XPS bus can be used.

Quoted 7 lines
Quoted 3 lines

The driver uses and requires MII and PHYLIB.

Checkpatch says:

total: 4 errors, 23 warnings, 1605 lines checked

Oops, forget to check -- sorry, it's new to me.

OK. The errors have been eliminated, some Warnings too. Unfortunately I can not eliminate all warnings, especially "Use of volatile is usually wrong:" because "struct eth_device" force it.

Signature · 8 lines
Viele Gr??e,
Stephan Linz
______________________________________________________________________________
MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start
OpenDCC: http://www.li-pro.net/opendcc.phtml
PC/M: http://www.li-pro.net/pcm.phtml
Sourceforge: http://sourceforge.net/users/slz
Gitorious: https://gitorious.org/~slz
#4 lore raw

PATCH v5 1/1 net: ll_temac: Add LL TEMAC driver to u-boot

Dear Stephan Linz,

Quoted 4 lines · In message <1322419778.3870.334.camel@keto> you wrote:

OK. The errors have been eliminated, some Warnings too. Unfortunately I can not eliminate all warnings, especially "Use of volatile is usually wrong:" because "struct eth_device" force it.

Yes, one day we should fix that, too.

Next time please mention in the comment section that you intentionally ignore certain CP warnings, and why.

Thanks.

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
"It is better to have tried and failed than to have  failed  to  try,
but the result's the same."                           - Mike Dennison