diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-15 20:21:00 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-08-15 20:21:00 +0000 |
commit | 61f8fb0e3d35c1da13d6a429d68cc694517095de (patch) | |
tree | 05b9f933d56e6e362a55aa9ac85722093eeb6450 /c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c | |
parent | 2008-08-15 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-61f8fb0e3d35c1da13d6a429d68cc694517095de.tar.bz2 |
2008-08-15 Allan Hessenflow <allanh@kallisti.com>
* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
preinstall.am, console/console.c, include/bsp.h,
network/networkconfig.c, start/start.S, startup/bspstart.c,
startup/linkcmds: New files.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c b/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c new file mode 100644 index 0000000000..08f8a09927 --- /dev/null +++ b/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c @@ -0,0 +1,71 @@ +/* networkconfig.c + * + * This file contains the network driver attach function and configuration + * for the bf537Stamp. + * + * Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA + * written by Allan Hessenflow <allanh@kallisti.com> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + + + +#include <bsp.h> +#include <rtems/rtems_bsdnet.h> +#include <libcpu/interrupt.h> +#include <libcpu/ethernet.h> + + +static bfin_ethernet_configuration_t ethConfig = { + SCLK, + (void *) EMAC_BASE_ADDRESS, + (void *) DMA1_BASE_ADDRESS, /* ethernet receive */ + (void *) DMA2_BASE_ADDRESS, /* ethernet transmit */ + 16, /* receive descriptors */ + 16, /* transmit descriptors */ + mii, /* phy type */ + 1 /* phy address */ +}; + +static bfin_isr_t ethISRs[] = { + /* careful - shared with a bunch of things */ +/* + {SIC_MAC_ERROR_VECTOR, + bfin_ethernet_mac_isr, + 0, + 0, + NULL}, +*/ + /* careful - shared with porth irqa */ + {SIC_DMA1_MAC_RX_VECTOR, + bfin_ethernet_rxdma_isr, + 0, + 0, + NULL}, + /* careful - shared with porth irqb */ + {SIC_DMA2_MAC_TX_VECTOR, + bfin_ethernet_txdma_isr, + 0, + 0, + NULL} +}; + +int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *config, + int attaching) { + int result; + int i; + + result = bfin_ethernet_driver_attach(config, attaching, ðConfig); + for (i = 0; i < sizeof(ethISRs) / sizeof(ethISRs[0]); i++) { + bfin_interrupt_register(ðISRs[i]); + bfin_interrupt_enable(ðISRs[i], TRUE); + } + + return result; +} + |