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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-mips/] [vr41xx/] [vr41xx.h] - Blame information for rev 1774

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

Line No. Rev Author Line
1 1276 phoenix
/*
2
 * include/asm-mips/vr41xx/vr41xx.h
3
 *
4
 * Include file for NEC VR4100 series.
5
 *
6
 * Copyright (C) 1999 Michael Klar
7
 * Copyright (C) 2001, 2002 Paul Mundt
8
 * Copyright (C) 2002 MontaVista Software, Inc.
9
 * Copyright (C) 2002 TimeSys Corp.
10
 * Copyright (C) 2003 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
11
 *
12
 * This program is free software; you can redistribute it and/or modify it
13
 * under the terms of the GNU General Public License as published by the
14
 * Free Software Foundation; either version 2 of the License, or (at your
15
 * option) any later version.
16
 */
17
#ifndef __NEC_VR41XX_H
18
#define __NEC_VR41XX_H
19
 
20
#include <linux/interrupt.h>
21
 
22
/*
23
 * CPU Revision
24
 */
25
/* VR4122 0x00000c70-0x00000c72 */
26
#define PRID_VR4122_REV1_0      0x00000c70
27
#define PRID_VR4122_REV2_0      0x00000c70
28
#define PRID_VR4122_REV2_1      0x00000c70
29
#define PRID_VR4122_REV3_0      0x00000c71
30
#define PRID_VR4122_REV3_1      0x00000c72
31
 
32
/* VR4181A 0x00000c73-0x00000c7f */
33
#define PRID_VR4181A_REV1_0     0x00000c73
34
#define PRID_VR4181A_REV1_1     0x00000c74
35
 
36
/* VR4131 0x00000c80-0x00000c83 */
37
#define PRID_VR4131_REV1_2      0x00000c80
38
#define PRID_VR4131_REV2_0      0x00000c81
39
#define PRID_VR4131_REV2_1      0x00000c82
40
#define PRID_VR4131_REV2_2      0x00000c83
41
 
42
/* VR4133 0x00000c84- */
43
#define PRID_VR4133             0x00000c84
44
 
45
/*
46
 * Bus Control Uint
47
 */
48
extern void vr41xx_bcu_init(void);
49
extern unsigned long vr41xx_get_vtclock_frequency(void);
50
extern unsigned long vr41xx_get_tclock_frequency(void);
51
 
52
/*
53
 * Clock Mask Unit
54
 */
55
extern void vr41xx_cmu_init(void);
56
extern void vr41xx_clock_supply(unsigned int clock);
57
extern void vr41xx_clock_mask(unsigned int clock);
58
 
59
enum {
60
        PIU_CLOCK,
61
        SIU_CLOCK,
62
        AIU_CLOCK,
63
        KIU_CLOCK,
64
        FIR_CLOCK,
65
        DSIU_CLOCK,
66
        CSI_CLOCK,
67
        PCIU_CLOCK,
68
        HSP_CLOCK,
69
        PCI_CLOCK,
70
        CEU_CLOCK,
71
        ETHER0_CLOCK,
72
        ETHER1_CLOCK
73
};
74
 
75
/*
76
 * Interrupt Control Unit
77
 */
78
/* CPU core Interrupt Numbers */
79
#define MIPS_CPU_IRQ_BASE       0
80
#define MIPS_CPU_IRQ(x)         (MIPS_CPU_IRQ_BASE + (x))
81
#define MIPS_SOFTINT0_IRQ       MIPS_CPU_IRQ(0)
82
#define MIPS_SOFTINT1_IRQ       MIPS_CPU_IRQ(1)
83
#define INT0_CASCADE_IRQ        MIPS_CPU_IRQ(2)
84
#define INT1_CASCADE_IRQ        MIPS_CPU_IRQ(3)
85
#define INT2_CASCADE_IRQ        MIPS_CPU_IRQ(4)
86
#define INT3_CASCADE_IRQ        MIPS_CPU_IRQ(5)
87
#define INT4_CASCADE_IRQ        MIPS_CPU_IRQ(6)
88
#define MIPS_COUNTER_IRQ        MIPS_CPU_IRQ(7)
89
 
90
/* SYINT1 Interrupt Numbers */
91
#define SYSINT1_IRQ_BASE        8
92
#define SYSINT1_IRQ(x)          (SYSINT1_IRQ_BASE + (x))
93
#define BATTRY_IRQ              SYSINT1_IRQ(0)
94
#define POWER_IRQ               SYSINT1_IRQ(1)
95
#define RTCLONG1_IRQ            SYSINT1_IRQ(2)
96
#define ELAPSEDTIME_IRQ         SYSINT1_IRQ(3)
97
/* RFU */
98
#define PIU_IRQ                 SYSINT1_IRQ(5)
99
#define AIU_IRQ                 SYSINT1_IRQ(6)
100
#define KIU_IRQ                 SYSINT1_IRQ(7)
101
#define GIUINT_CASCADE_IRQ      SYSINT1_IRQ(8)
102
#define SIU_IRQ                 SYSINT1_IRQ(9)
103
#define BUSERR_IRQ              SYSINT1_IRQ(10)
104
#define SOFTINT_IRQ             SYSINT1_IRQ(11)
105
#define CLKRUN_IRQ              SYSINT1_IRQ(12)
106
#define DOZEPIU_IRQ             SYSINT1_IRQ(13)
107
#define SYSINT1_IRQ_LAST        DOZEPIU_IRQ
108
 
109
/* SYSINT2 Interrupt Numbers */
110
#define SYSINT2_IRQ_BASE        24
111
#define SYSINT2_IRQ(x)          (SYSINT2_IRQ_BASE + (x))
112
#define RTCLONG2_IRQ            SYSINT2_IRQ(0)
113
#define LED_IRQ                 SYSINT2_IRQ(1)
114
#define HSP_IRQ                 SYSINT2_IRQ(2)
115
#define TCLOCK_IRQ              SYSINT2_IRQ(3)
116
#define FIR_IRQ                 SYSINT2_IRQ(4)
117
#define CEU_IRQ                 SYSINT2_IRQ(4)  /* same number as FIR_IRQ */
118
#define DSIU_IRQ                SYSINT2_IRQ(5)
119
#define PCI_IRQ                 SYSINT2_IRQ(6)
120
#define SCU_IRQ                 SYSINT2_IRQ(7)
121
#define CSI_IRQ                 SYSINT2_IRQ(8)
122
#define BCU_IRQ                 SYSINT2_IRQ(9)
123
#define ETHERNET_IRQ            SYSINT2_IRQ(10)
124
#define SYSINT2_IRQ_LAST        ETHERNET_IRQ
125
 
126
/* GIU Interrupt Numbers */
127
#define GIU_IRQ_BASE            40
128
#define GIU_IRQ(x)              (GIU_IRQ_BASE + (x))    /* IRQ 40-71 */
129
#define GIU_IRQ_LAST            GIU_IRQ(31)
130
#define GIU_IRQ_TO_PIN(x)       ((x) - GIU_IRQ_BASE)    /* Pin 0-31 */
131
 
132
extern void (*board_irq_init)(void);
133
extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
134
extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq));
135
 
136
/*
137
 * RTC
138
 */
139
extern void vr41xx_set_rtclong1_cycle(uint32_t cycles);
140
extern uint32_t vr41xx_read_rtclong1_counter(void);
141
 
142
extern void vr41xx_set_rtclong2_cycle(uint32_t cycles);
143
extern uint32_t vr41xx_read_rtclong2_counter(void);
144
 
145
extern void vr41xx_set_tclock_cycle(uint32_t cycles);
146
extern uint32_t vr41xx_read_tclock_counter(void);
147
 
148
/*
149
 * General-Purpose I/O Unit
150
 */
151
enum {
152
        TRIGGER_LEVEL,
153
        TRIGGER_EDGE,
154
        TRIGGER_EDGE_FALLING,
155
        TRIGGER_EDGE_RISING
156
};
157
 
158
enum {
159
        SIGNAL_THROUGH,
160
        SIGNAL_HOLD
161
};
162
 
163
extern void vr41xx_set_irq_trigger(int pin, int trigger, int hold);
164
 
165
enum {
166
        LEVEL_LOW,
167
        LEVEL_HIGH
168
};
169
 
170
extern void vr41xx_set_irq_level(int pin, int level);
171
 
172
enum {
173
        PIO_INPUT,
174
        PIO_OUTPUT
175
};
176
 
177
enum {
178
        DATA_LOW,
179
        DATA_HIGH
180
};
181
 
182
/*
183
 * Serial Interface Unit
184
 */
185
extern void vr41xx_siu_init(int interface, int module);
186
extern void vr41xx_siu_ifselect(int interface, int module);
187
extern int vr41xx_serial_ports;
188
 
189
/* SIU interfaces */
190
enum {
191
        SIU_RS232C,
192
        SIU_IRDA
193
};
194
 
195
/* IrDA interfaces */
196
enum {
197
        IRDA_SHARP = 1,
198
        IRDA_TEMIC,
199
        IRDA_HP
200
};
201
 
202
/*
203
 * Debug Serial Interface Unit
204
 */
205
extern void vr41xx_dsiu_init(void);
206
 
207
/*
208
 * PCI Control Unit
209
 */
210
struct vr41xx_pci_address_space {
211
        u32 internal_base;
212
        u32 address_mask;
213
        u32 pci_base;
214
};
215
 
216
struct vr41xx_pci_address_map {
217
        struct vr41xx_pci_address_space *mem1;
218
        struct vr41xx_pci_address_space *mem2;
219
        struct vr41xx_pci_address_space *io;
220
};
221
 
222
extern void vr41xx_pciu_init(struct vr41xx_pci_address_map *map);
223
 
224
/*
225
 * MISC
226
 */
227
extern void vr41xx_time_init(void);
228
extern void vr41xx_timer_setup(struct irqaction *irq);
229
 
230
extern void vr41xx_restart(char *command);
231
extern void vr41xx_halt(void);
232
extern void vr41xx_power_off(void);
233
 
234
#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
235
extern struct ide_ops vr41xx_ide_ops;
236
#endif
237
 
238
#endif /* __NEC_VR41XX_H */

powered by: WebSVN 2.1.0

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