1/*
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 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#ifndef __NEC_VR41XX_H
17#define __NEC_VR41XX_H
18
19#include <linux/interrupt.h>
20
21/*
22 * CPU Revision
23 */
24/* VR4122 0x00000c70-0x00000c72 */
25#define PRID_VR4122_REV1_0	0x00000c70
26#define PRID_VR4122_REV2_0	0x00000c70
27#define PRID_VR4122_REV2_1	0x00000c70
28#define PRID_VR4122_REV3_0	0x00000c71
29#define PRID_VR4122_REV3_1	0x00000c72
30
31/* VR4181A 0x00000c73-0x00000c7f */
32#define PRID_VR4181A_REV1_0	0x00000c73
33#define PRID_VR4181A_REV1_1	0x00000c74
34
35/* VR4131 0x00000c80-0x00000c8f */
36#define PRID_VR4131_REV1_2	0x00000c80
37#define PRID_VR4131_REV2_0	0x00000c81
38#define PRID_VR4131_REV2_1	0x00000c82
39#define PRID_VR4131_REV2_2	0x00000c83
40
41/*
42 * Bus Control Uint
43 */
44extern void vr41xx_bcu_init(void);
45
46/*
47 * Clock Mask Unit
48 */
49extern void vr41xx_cmu_init(u16 mask);
50extern void vr41xx_clock_supply(u16 mask);
51extern void vr41xx_clock_mask(u16 mask);
52
53/*
54 * Interrupt Control Unit
55 */
56
57/* GIU Interrupt Numbers */
58#define GIU_IRQ(x)	(40 + (x))
59
60extern void (*board_irq_init)(void);
61extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq));
62
63/*
64 * Gegeral-Purpose I/O Unit
65 */
66extern void vr41xx_enable_giuint(int pin);
67extern void vr41xx_disable_giuint(int pin);
68extern void vr41xx_clear_giuint(int pin);
69
70enum {
71	TRIGGER_LEVEL,
72	TRIGGER_EDGE
73};
74
75enum {
76	SIGNAL_THROUGH,
77	SIGNAL_HOLD
78};
79
80extern void vr41xx_set_irq_trigger(int pin, int trigger, int hold);
81
82enum {
83	LEVEL_LOW,
84	LEVEL_HIGH
85};
86
87extern void vr41xx_set_irq_level(int pin, int level);
88
89enum {
90	PIO_INPUT,
91	PIO_OUTPUT
92};
93
94enum {
95	DATA_LOW,
96	DATA_HIGH
97};
98
99/*
100 * Serial Interface Unit
101 */
102extern void vr41xx_siu_init(int interface, int module);
103extern void vr41xx_siu_ifselect(int interface, int module);
104extern int vr41xx_serial_ports;
105
106/* SIU interfaces */
107enum {
108	SIU_RS232C,
109	SIU_IRDA
110};
111
112/* IrDA interfaces */
113enum {
114	IRDA_SHARP = 1,
115	IRDA_TEMIC,
116	IRDA_HP
117};
118
119/*
120 * Debug Serial Interface Unit
121 */
122extern void vr41xx_dsiu_init(void);
123
124/*
125 * PCI Control Unit
126 */
127struct vr41xx_pci_address_space {
128	u32 internal_base;
129	u32 address_mask;
130	u32 pci_base;
131};
132
133struct vr41xx_pci_address_map {
134	struct vr41xx_pci_address_space *mem1;
135	struct vr41xx_pci_address_space *mem2;
136	struct vr41xx_pci_address_space *io;
137};
138
139extern void vr41xx_pciu_init(struct vr41xx_pci_address_map *map);
140
141/*
142 * MISC
143 */
144extern void vr41xx_time_init(void);
145extern void vr41xx_timer_setup(struct irqaction *irq);
146
147extern void vr41xx_restart(char *command);
148extern void vr41xx_halt(void);
149extern void vr41xx_power_off(void);
150
151#endif /* __NEC_VR41XX_H */
152