source: rtems/c/src/lib/libbsp/bfin/bf537Stamp/network/networkconfig.c @ 61f8fb0e

4.104.114.9
Last change on this file since 61f8fb0e was 61f8fb0e, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 15, 2008 at 8:21:00 PM

2008-08-15 Allan Hessenflow <allanh@…>

  • 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.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  networkconfig.c
2 *
3 *  This file contains the network driver attach function and configuration
4 *  for the bf537Stamp.
5 *
6 *  Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
7 *            written by Allan Hessenflow <allanh@kallisti.com>
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16
17
18#include <bsp.h>
19#include <rtems/rtems_bsdnet.h>
20#include <libcpu/interrupt.h>
21#include <libcpu/ethernet.h>
22
23
24static bfin_ethernet_configuration_t ethConfig = {
25  SCLK,
26  (void *) EMAC_BASE_ADDRESS,
27  (void *) DMA1_BASE_ADDRESS, /* ethernet receive */
28  (void *) DMA2_BASE_ADDRESS, /* ethernet transmit */
29  16, /* receive descriptors */
30  16, /* transmit descriptors */
31  mii, /* phy type */
32  1 /* phy address */
33};
34
35static bfin_isr_t ethISRs[] = {
36  /* careful - shared with a bunch of things */
37/*
38  {SIC_MAC_ERROR_VECTOR,
39   bfin_ethernet_mac_isr,
40   0,
41   0,
42   NULL},
43*/
44  /* careful - shared with porth irqa */
45  {SIC_DMA1_MAC_RX_VECTOR,
46   bfin_ethernet_rxdma_isr,
47   0,
48   0,
49   NULL},
50  /* careful - shared with porth irqb */
51  {SIC_DMA2_MAC_TX_VECTOR,
52   bfin_ethernet_txdma_isr,
53   0,
54   0,
55   NULL}
56};
57
58int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *config,
59                                     int attaching) {
60  int result;
61  int i;
62
63  result = bfin_ethernet_driver_attach(config, attaching, &ethConfig);
64  for (i = 0; i < sizeof(ethISRs) / sizeof(ethISRs[0]); i++) {
65    bfin_interrupt_register(&ethISRs[i]);
66    bfin_interrupt_enable(&ethISRs[i], TRUE);
67  }
68
69  return result;
70}
71
Note: See TracBrowser for help on using the repository browser.