source: rtems/c/src/libchip/network/README.sonic @ ce7d49bc

4.104.114.84.9
Last change on this file since ce7d49bc was ce7d49bc, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 28, 2005 at 5:25:08 PM

2005-04-28 Joel Sherrill <joel@…>

  • libchip/network/README.sonic: Rewritten to account for removal of dmv177.
  • Property mode set to 100644
File size: 3.5 KB
Line 
1#
2#  $Id$
3#
4
5This SONIC driver does not make any attempt to support the SONIC chip
6in any of the following modes:
7
8  + 16-bit
9  + little endian
10 
11It does not attempt to handle SONIC's older than Revision C.  There is
12a bug in chips before that revision that must be handled in the driver.
13
14The configuration table should be discussed here but if you look in the
15include file for the sonic, it is reasonably obvious. :)
16
17The performance impact of transforming this driver into libchip format
18was minimal.
19
20The powerpc/dmv177 BSP used this driver and the following should
21serve as an example configuration table.  This BSP was obsoleted after
22the 4.6 release series so the code is included here.
23
24======================================================================
25
26/*
27 *  DMV177 SONIC Configuration Information
28 *
29 *  References:
30 *
31 *  1) SVME/DMV-171 Single Board Computer Documentation Package, #805905,
32 *     DY 4 Systems Inc., Kanata, Ontario, September, 1996.
33 *
34 *  $Id$
35 */
36
37#include <bsp.h>
38#include <rtems/rtems_bsdnet.h>
39#include <libchip/sonic.h>
40
41void dmv177_sonic_write_register(
42  void       *base,
43  unsigned32  regno,
44  unsigned32  value
45)
46{
47  volatile unsigned32 *p = base;
48
49#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
50  printf( "%p Write 0x%04x to %s (0x%02x)\n",
51      &p[regno], value, SONIC_Reg_name[regno], regno );
52  fflush( stdout );
53#endif
54  p[regno] = value;
55}
56
57unsigned32 dmv177_sonic_read_register(
58  void       *base,
59  unsigned32  regno
60)
61{
62  volatile unsigned32 *p = base;
63  unsigned32           value;
64
65  value = p[regno];
66#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
67  printf( "%p Read 0x%04x from %s (0x%02x)\n",
68      &p[regno], value, SONIC_Reg_name[regno], regno );
69  fflush( stdout );
70#endif
71  return value;
72}
73
74/*
75 * Default sizes of transmit and receive descriptor areas
76 */
77#define RDA_COUNT     20 /* 20 */
78#define TDA_COUNT     20 /* 10 */
79
80/*
81 * Default device configuration register values
82 * Conservative, generic values.
83 * DCR:
84 *      No extended bus mode
85 *      Unlatched bus retry
86 *      Programmable outputs unused
87 *      Asynchronous bus mode
88 *      User definable pins unused
89 *      No wait states (access time controlled by DTACK*)
90 *      32-bit DMA
91 *      Empty/Fill DMA mode
92 *      Maximum Transmit/Receive FIFO
93 * DC2:
94 *      Extended programmable outputs unused
95 *      Normal HOLD request
96 *      Packet compress output unused
97 *      No reject on CAM match
98 */
99#define SONIC_DCR \
100   (DCR_DW32 | DCR_WAIT0 | DCR_PO0 | DCR_PO1  | DCR_RFT24 | DCR_TFT28)
101#ifndef SONIC_DCR
102# define SONIC_DCR (DCR_DW32 | DCR_TFT28)
103#endif
104#ifndef SONIC_DC2
105# define SONIC_DC2 (0)
106#endif
107
108/*
109 * Default location of device registers
110 */
111#ifndef SONIC_BASE_ADDRESS
112# define SONIC_BASE_ADDRESS 0xF3000000
113# warning "Using default SONIC_BASE_ADDRESS."
114#endif
115
116/*
117 * Default interrupt vector
118 */
119#ifndef SONIC_VECTOR
120# define SONIC_VECTOR 1
121# warning "Using default SONIC_VECTOR."
122#endif
123
124sonic_configuration_t dmv177_sonic_configuration = {
125  SONIC_BASE_ADDRESS,        /* base address */
126  SONIC_VECTOR,              /* vector number */
127  SONIC_DCR,                 /* DCR register value */
128  SONIC_DC2,                 /* DC2 register value */
129  TDA_COUNT,                 /* number of transmit descriptors */
130  RDA_COUNT,                 /* number of receive descriptors */
131  dmv177_sonic_write_register,
132  dmv177_sonic_read_register
133};
134
135int rtems_dmv177_sonic_driver_attach(struct rtems_bsdnet_ifconfig *config)
136{
137  return rtems_sonic_driver_attach( config, &dmv177_sonic_configuration );
138 
139}
140
141======================================================================
Note: See TracBrowser for help on using the repository browser.