OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [isdn/] [sc/] [hardware.h] - Blame information for rev 1772

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 * Hardware specific macros, defines and structures
3
 */
4
 
5
#ifndef HARDWARE_H
6
#define HARDWARE_H
7
 
8
#include <asm/param.h>                  /* For HZ */
9
 
10
/*
11
 * General hardware parameters common to all ISA adapters
12
 */
13
 
14
#define MAX_CARDS       4               /* The maximum number of cards to
15
                                           control or probe for. If you change
16
                                           this, you must also change the number
17
                                           of elements in io, irq, and ram to
18
                                           match. Initialized in init.c */
19
/*
20
extern unsigned int io[];
21
extern unsigned char irq[];
22
extern unsigned long ram[];
23
*/
24
 
25
#define SIGNATURE       0x87654321      /* Board reset signature */
26
#define SIG_OFFSET      0x1004          /* Where to find signature in shared RAM */
27
#define TRACE_OFFSET    0x1008          /* Trace enable word offset in shared RAM */
28
#define BUFFER_OFFSET   0x1800          /* Beginning of buffers */
29
 
30
/* I/O Port parameters */
31
#define IOBASE_MIN      0x180           /* Lowest I/O port address */
32
#define IOBASE_MAX      0x3C0           /* Highest I/O port address */
33
#define IOBASE_OFFSET   0x20            /* Inter-board I/O port gap used during
34
                                           probing */
35
#define FIFORD_OFFSET   0x0
36
#define FIFOWR_OFFSET   0x400
37
#define FIFOSTAT_OFFSET 0x1000
38
#define RESET_OFFSET    0x2800
39
#define PG0_OFFSET      0x3000          /* Offset from I/O Base for Page 0 register */
40
#define PG1_OFFSET      0x3400          /* Offset from I/O Base for Page 1 register */
41
#define PG2_OFFSET      0x3800          /* Offset from I/O Base for Page 2 register */
42
#define PG3_OFFSET      0x3C00          /* Offset from I/O Base for Page 3 register */
43
 
44
#define FIFO_READ       0                /* FIFO Read register */
45
#define FIFO_WRITE      1               /* FIFO Write rgister */
46
#define LO_ADDR_PTR     2               /* Extended RAM Low Addr Pointer */
47
#define HI_ADDR_PTR     3               /* Extended RAM High Addr Pointer */
48
#define NOT_USED_1      4
49
#define FIFO_STATUS     5               /* FIFO Status Register */
50
#define NOT_USED_2      6
51
#define MEM_OFFSET      7
52
#define SFT_RESET       10              /* Reset Register */
53
#define EXP_BASE        11              /* Shared RAM Base address */
54
#define EXP_PAGE0       12              /* Shared RAM Page0 register */
55
#define EXP_PAGE1       13              /* Shared RAM Page1 register */
56
#define EXP_PAGE2       14              /* Shared RAM Page2 register */
57
#define EXP_PAGE3       15              /* Shared RAM Page3 register */
58
#define IRQ_SELECT      16              /* IRQ selection register */
59
#define MAX_IO_REGS     17              /* Total number of I/O ports */
60
 
61
/* FIFO register values */
62
#define RF_HAS_DATA     0x01            /* fifo has data */
63
#define RF_QUART_FULL   0x02            /* fifo quarter full */
64
#define RF_HALF_FULL    0x04            /* fifo half full */
65
#define RF_NOT_FULL     0x08            /* fifo not full */
66
#define WF_HAS_DATA     0x10            /* fifo has data */
67
#define WF_QUART_FULL   0x20            /* fifo quarter full */
68
#define WF_HALF_FULL    0x40            /* fifo half full */
69
#define WF_NOT_FULL     0x80            /* fifo not full */
70
 
71
/* Shared RAM parameters */
72
#define SRAM_MIN        0xC0000         /* Lowest host shared RAM address */
73
#define SRAM_MAX        0xEFFFF         /* Highest host shared RAM address */
74
#define SRAM_PAGESIZE   0x4000          /* Size of one RAM page (16K) */
75
 
76
/* Shared RAM buffer parameters */
77
#define BUFFER_SIZE     0x800           /* The size of a buffer in bytes */
78
#define BUFFER_BASE     BUFFER_OFFSET   /* Offset from start of shared RAM
79
                                           where buffer start */
80
#define BUFFERS_MAX     16              /* Maximum number of send/receive
81
                                           buffers per channel */
82
#define HDLC_PROTO      0x01            /* Frame Format for Layer 2 */
83
 
84
#define BRI_BOARD       0
85
#define POTS_BOARD      1
86
#define PRI_BOARD       2
87
 
88
/*
89
 * Specific hardware parameters for the DataCommute/BRI
90
 */
91
#define BRI_CHANNELS    2               /* Number of B channels */
92
#define BRI_BASEPG_VAL  0x98
93
#define BRI_MAGIC       0x60000         /* Magic Number */
94
#define BRI_MEMSIZE     0x10000         /* Ammount of RAM (64K) */
95
#define BRI_PARTNO      "72-029"
96
#define BRI_FEATURES    ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L3_TRANS;
97
/*
98
 * Specific hardware parameters for the DataCommute/PRI
99
 */
100
#define PRI_CHANNELS    23              /* Number of B channels */
101
#define PRI_BASEPG_VAL  0x88
102
#define PRI_MAGIC       0x20000         /* Magic Number */
103
#define PRI_MEMSIZE     0x100000        /* Amount of RAM (1M) */
104
#define PRI_PARTNO      "72-030"
105
#define PRI_FEATURES    ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L3_TRANS;
106
 
107
/*
108
 * Some handy macros
109
 */
110
 
111
/* Return the number of jiffies in a given number of msecs */
112
#define milliseconds(x) (x/(1000/HZ))
113
 
114
/* Determine if a channel number is valid for the adapter */
115
#define IS_VALID_CHANNEL(y,x)   ((x>0) && (x <= adapter[y]->channels))
116
 
117
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.