Skip to contentSkip to conversation

AT92RM9200 EMAC driver for NET MULTI API

PATCH New Jens Scharsig 4 participants 4 messages Oct 8, 2009 – Dec 7, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AT92RM9200 EMAC driver for NET MULTI API

This patch adds a new net api driver for AT91RM9200 EMAC

* adds NET_MULTI api EMAC (CONFIG_DRIVER_AT91EMAC)
* generic PHY initialization

---

This patch was tested with full MII interface and LXT971 Phy on our upcomming new board.
I have also tested the RMII interface with DM9161 Phy on a CARMEVA-board.

I have no u-boot supported AT91RM9200 boards.

My appeal to all AT91RM9200 boards maintainers: Please test

Changes to make your board use NET_MULTI api:

* include/configs/<board>.h
1. change CONFIG_DRIVER_ETHER to CONFIG_DRIVER_AT91EMAC
2. define CONFIG_NET_MULTI
3. set CONFIG_SYS_RX_ETH_BUFFER, if you want more than standard rx buffers
4. define CONFIG_AT91C_USE_RMII, if you board use RMII interface

* add following code to board file

    #ifdef CONFIG_DRIVER_AT91EMAC
    int board_eth_init(bd_t *bis)
    {
	    int rc = 0;
	    rc = at91emac_register(bis, AT91C_BASE_EMAC);
	    return rc;
    }
    #endif
README +10 -0
index dee0e67..00d33be 100644
@@ -817,6 +817,16 @@ The following options need to be configured:
 
 - NETWORK Support (other):
 
+		CONFIG_DRIVER_AT91EMAC
+		Support for AT91RM9200 EMAC.
+
+			CONFIG_RMII
+			Define this to use reduced MII inteface
+
+			CONFIG_DRIVER_AT91EMAC_QUIET
+			If this defined, the driver is quiet.
+			The driver doen't show link status messages.
+
 		CONFIG_DRIVER_LAN91C96
 		Support for SMSC's LAN91C96 chips.
 
drivers/net/Makefile +1 -0
index fc9887b..3899052 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libnet.a
 
 COBJS-$(CONFIG_DRIVER_3C589) += 3c589.o
 COBJS-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
+COBJS-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
 COBJS-$(CONFIG_DRIVER_AX88180) += ax88180.o
 COBJS-$(CONFIG_BCM570x) += bcm570x.o bcm570x_autoneg.o 5701rls.o
 COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
drivers/net/at91_emac.c new file +466 -0

466 lines not on this page · raw message

include/netdev.h +1 -0
index a91368e..f771105 100644
@@ -41,6 +41,7 @@ int board_eth_init(bd_t *bis);
 int cpu_eth_init(bd_t *bis);
 
 /* Driver initialization prototypes */
+int at91emac_register(bd_t *bis, unsigned long iobase);
 int au1x00_enet_initialize(bd_t*);
 int bfin_EMAC_initialize(bd_t *bis);
 int cs8900_initialize(u8 dev_num, int base_addr);
#1 lore raw

PATCH 1/1 AT92RM9200 EMAC driver for NET MULTI API

Dear Ben,

Quoted 25 lines · In message <[email protected]> Jens Scharsig wrote:

This patch adds a new net api driver for AT91RM9200 EMAC

* adds NET_MULTI api EMAC (CONFIG_DRIVER_AT91EMAC)
* generic PHY initialization

---

This patch was tested with full MII interface and LXT971 Phy on our upcomming new board.
I have also tested the RMII interface with DM9161 Phy on a CARMEVA-board.

I have no u-boot supported AT91RM9200 boards.

My appeal to all AT91RM9200 boards maintainers: Please test

Changes to make your board use NET_MULTI api:

* include/configs/<board>.h
1. change CONFIG_DRIVER_ETHER to CONFIG_DRIVER_AT91EMAC
2. define CONFIG_NET_MULTI
3. set CONFIG_SYS_RX_ETH_BUFFER, if you want more than standard rx buffers
4. define CONFIG_AT91C_USE_RMII, if you board use RMII interface

* add following code to board file

Quoted 8 lines
    #ifdef CONFIG_DRIVER_AT91EMAC
    int board_eth_init(bd_t *bis)
    {
	    int rc = 0;
	    rc = at91emac_register(bis, AT91C_BASE_EMAC);
	    return rc;
    }
    #endif

Could you please check the status of this patch:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/69484

Best regards,

Wolfgang Denk

Signature · 6 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
Nobody trips over mountains. It is the small pebble that  causes  you
to  stumble.  Pass all the pebbles in your path and you will find you
have crossed the mountain.
#2 lore raw

PATCH 1/1 AT92RM9200 EMAC driver for NET MULTI API

Dear Wolfgang Denk,
Dear Ben Warren,

I'm still working on a patch set for AT91 SoC access with c structures. This will include a reintroduce of this patch.

Best regards,

Jens Scharsig

#3 lore raw

PATCH 1/1 AT92RM9200 EMAC driver for NET MULTI API

Hi Jens,

Quoted 7 lines · Jens Scharsig

Dear Wolfgang Denk,
Dear Ben Warren,

I'm still working on a patch set for AT91 SoC access with c structures. This will include a reintroduce of this patch.

That's great. After some time off I'm just getting back into things, so

this is good timing.
A couple of comments:

1. Please add the file summary at the top of your patch (list of files modified/added etc.) git-format-patch takes care of this.
2. If you wish this to go in mainline, all boards that use this controller must also support your new implementation. In other words, you need to touch all include/configs/*.h and their respective board/foo/foo.c files, adding or modifying board_eth_init() calls. In the past I've been able to automate most of this with a simple shell script and can help you if you need it. Don't worry about whether you have hardware or not, especially if it's early in the release cycle.

Quoted 4 lines

Best regards,

Jens Scharsig

regards,
Ben