Ignore:
Timestamp:
Apr 28, 2005, 5:25:08 PM (15 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
03f655c
Parents:
ff33f2e9
Message:

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

  • libchip/network/README.sonic: Rewritten to account for removal of dmv177.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/network/README.sonic

    rff33f2e9 rce7d49bc  
    1818was minimal.
    1919
    20 The powerpc/dmv177 BSP uses this driver and can serve as an example
    21 configuration table.
     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 TracChangeset for help on using the changeset viewer.