diff options
Diffstat (limited to 'arch/mips/include/asm/lasat')
-rw-r--r-- | arch/mips/include/asm/lasat/ds1603.h | 18 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/eeprom.h | 17 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/head.h | 22 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/lasat.h | 258 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/lasatint.h | 14 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/picvue.h | 15 | ||||
-rw-r--r-- | arch/mips/include/asm/lasat/serial.h | 13 |
7 files changed, 357 insertions, 0 deletions
diff --git a/arch/mips/include/asm/lasat/ds1603.h b/arch/mips/include/asm/lasat/ds1603.h new file mode 100644 index 000000000000..edcd7544b358 --- /dev/null +++ b/arch/mips/include/asm/lasat/ds1603.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* Lasat 100 */ | ||
4 | #define DS1603_REG_100 (KSEG1ADDR(0x1c810000)) | ||
5 | #define DS1603_RST_100 (1 << 2) | ||
6 | #define DS1603_CLK_100 (1 << 0) | ||
7 | #define DS1603_DATA_SHIFT_100 1 | ||
8 | #define DS1603_DATA_100 (1 << DS1603_DATA_SHIFT_100) | ||
9 | |||
10 | /* Lasat 200 */ | ||
11 | #define DS1603_REG_200 (KSEG1ADDR(0x11000000)) | ||
12 | #define DS1603_RST_200 (1 << 3) | ||
13 | #define DS1603_CLK_200 (1 << 4) | ||
14 | #define DS1603_DATA_200 (1 << 5) | ||
15 | |||
16 | #define DS1603_DATA_REG_200 (DS1603_REG_200 + 0x10000) | ||
17 | #define DS1603_DATA_READ_SHIFT_200 9 | ||
18 | #define DS1603_DATA_READ_200 (1 << DS1603_DATA_READ_SHIFT_200) | ||
diff --git a/arch/mips/include/asm/lasat/eeprom.h b/arch/mips/include/asm/lasat/eeprom.h new file mode 100644 index 000000000000..3dac203697fa --- /dev/null +++ b/arch/mips/include/asm/lasat/eeprom.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #include <asm/addrspace.h> | ||
2 | |||
3 | /* lasat 100 */ | ||
4 | #define AT93C_REG_100 KSEG1ADDR(0x1c810000) | ||
5 | #define AT93C_RDATA_REG_100 AT93C_REG_100 | ||
6 | #define AT93C_RDATA_SHIFT_100 4 | ||
7 | #define AT93C_WDATA_SHIFT_100 4 | ||
8 | #define AT93C_CS_M_100 (1 << 5) | ||
9 | #define AT93C_CLK_M_100 (1 << 3) | ||
10 | |||
11 | /* lasat 200 */ | ||
12 | #define AT93C_REG_200 KSEG1ADDR(0x11000000) | ||
13 | #define AT93C_RDATA_REG_200 (AT93C_REG_200+0x10000) | ||
14 | #define AT93C_RDATA_SHIFT_200 8 | ||
15 | #define AT93C_WDATA_SHIFT_200 2 | ||
16 | #define AT93C_CS_M_200 (1 << 0) | ||
17 | #define AT93C_CLK_M_200 (1 << 1) | ||
diff --git a/arch/mips/include/asm/lasat/head.h b/arch/mips/include/asm/lasat/head.h new file mode 100644 index 000000000000..f5589f31a197 --- /dev/null +++ b/arch/mips/include/asm/lasat/head.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Image header stuff | ||
3 | */ | ||
4 | #ifndef _HEAD_H | ||
5 | #define _HEAD_H | ||
6 | |||
7 | #define LASAT_K_MAGIC0_VAL 0xfedeabba | ||
8 | #define LASAT_K_MAGIC1_VAL 0x00bedead | ||
9 | |||
10 | #ifndef _LANGUAGE_ASSEMBLY | ||
11 | #include <linux/types.h> | ||
12 | struct bootloader_header { | ||
13 | u32 magic[2]; | ||
14 | u32 version; | ||
15 | u32 image_start; | ||
16 | u32 image_size; | ||
17 | u32 kernel_start; | ||
18 | u32 kernel_entry; | ||
19 | }; | ||
20 | #endif | ||
21 | |||
22 | #endif /* _HEAD_H */ | ||
diff --git a/arch/mips/include/asm/lasat/lasat.h b/arch/mips/include/asm/lasat/lasat.h new file mode 100644 index 000000000000..caeba1e302a2 --- /dev/null +++ b/arch/mips/include/asm/lasat/lasat.h | |||
@@ -0,0 +1,258 @@ | |||
1 | /* | ||
2 | * lasat.h | ||
3 | * | ||
4 | * Thomas Horsten <thh@lasat.com> | ||
5 | * Copyright (C) 2000 LASAT Networks A/S. | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * Configuration for LASAT boards, loads the appropriate include files. | ||
21 | */ | ||
22 | #ifndef _LASAT_H | ||
23 | #define _LASAT_H | ||
24 | |||
25 | #ifndef _LANGUAGE_ASSEMBLY | ||
26 | |||
27 | extern struct lasat_misc { | ||
28 | volatile u32 *reset_reg; | ||
29 | volatile u32 *flash_wp_reg; | ||
30 | u32 flash_wp_bit; | ||
31 | } *lasat_misc; | ||
32 | |||
33 | enum lasat_mtdparts { | ||
34 | LASAT_MTD_BOOTLOADER, | ||
35 | LASAT_MTD_SERVICE, | ||
36 | LASAT_MTD_NORMAL, | ||
37 | LASAT_MTD_CONFIG, | ||
38 | LASAT_MTD_FS, | ||
39 | LASAT_MTD_LAST | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * The format of the data record in the EEPROM. | ||
44 | * See Documentation/LASAT/eeprom.txt for a detailed description | ||
45 | * of the fields in this struct, and the LASAT Hardware Configuration | ||
46 | * field specification for a detailed description of the config | ||
47 | * field. | ||
48 | */ | ||
49 | #include <linux/types.h> | ||
50 | |||
51 | #define LASAT_EEPROM_VERSION 7 | ||
52 | struct lasat_eeprom_struct { | ||
53 | unsigned int version; | ||
54 | unsigned int cfg[3]; | ||
55 | unsigned char hwaddr[6]; | ||
56 | unsigned char print_partno[12]; | ||
57 | unsigned char term0; | ||
58 | unsigned char print_serial[14]; | ||
59 | unsigned char term1; | ||
60 | unsigned char prod_partno[12]; | ||
61 | unsigned char term2; | ||
62 | unsigned char prod_serial[14]; | ||
63 | unsigned char term3; | ||
64 | unsigned char passwd_hash[16]; | ||
65 | unsigned char pwdnull; | ||
66 | unsigned char vendid; | ||
67 | unsigned char ts_ref; | ||
68 | unsigned char ts_signoff; | ||
69 | unsigned char reserved[11]; | ||
70 | unsigned char debugaccess; | ||
71 | unsigned short prid; | ||
72 | unsigned int serviceflag; | ||
73 | unsigned int ipaddr; | ||
74 | unsigned int netmask; | ||
75 | unsigned int crc32; | ||
76 | }; | ||
77 | |||
78 | struct lasat_eeprom_struct_pre7 { | ||
79 | unsigned int version; | ||
80 | unsigned int flags[3]; | ||
81 | unsigned char hwaddr0[6]; | ||
82 | unsigned char hwaddr1[6]; | ||
83 | unsigned char print_partno[9]; | ||
84 | unsigned char term0; | ||
85 | unsigned char print_serial[14]; | ||
86 | unsigned char term1; | ||
87 | unsigned char prod_partno[9]; | ||
88 | unsigned char term2; | ||
89 | unsigned char prod_serial[14]; | ||
90 | unsigned char term3; | ||
91 | unsigned char passwd_hash[24]; | ||
92 | unsigned char pwdnull; | ||
93 | unsigned char vendor; | ||
94 | unsigned char ts_ref; | ||
95 | unsigned char ts_signoff; | ||
96 | unsigned char reserved[6]; | ||
97 | unsigned int writecount; | ||
98 | unsigned int ipaddr; | ||
99 | unsigned int netmask; | ||
100 | unsigned int crc32; | ||
101 | }; | ||
102 | |||
103 | /* Configuration descriptor encoding - see the doc for details */ | ||
104 | |||
105 | #define LASAT_W0_DSCTYPE(v) (((v)) & 0xf) | ||
106 | #define LASAT_W0_BMID(v) (((v) >> 0x04) & 0xf) | ||
107 | #define LASAT_W0_CPUTYPE(v) (((v) >> 0x08) & 0xf) | ||
108 | #define LASAT_W0_BUSSPEED(v) (((v) >> 0x0c) & 0xf) | ||
109 | #define LASAT_W0_CPUCLK(v) (((v) >> 0x10) & 0xf) | ||
110 | #define LASAT_W0_SDRAMBANKSZ(v) (((v) >> 0x14) & 0xf) | ||
111 | #define LASAT_W0_SDRAMBANKS(v) (((v) >> 0x18) & 0xf) | ||
112 | #define LASAT_W0_L2CACHE(v) (((v) >> 0x1c) & 0xf) | ||
113 | |||
114 | #define LASAT_W1_EDHAC(v) (((v)) & 0xf) | ||
115 | #define LASAT_W1_HIFN(v) (((v) >> 0x04) & 0x1) | ||
116 | #define LASAT_W1_ISDN(v) (((v) >> 0x05) & 0x1) | ||
117 | #define LASAT_W1_IDE(v) (((v) >> 0x06) & 0x1) | ||
118 | #define LASAT_W1_HDLC(v) (((v) >> 0x07) & 0x1) | ||
119 | #define LASAT_W1_USVERSION(v) (((v) >> 0x08) & 0x1) | ||
120 | #define LASAT_W1_4MACS(v) (((v) >> 0x09) & 0x1) | ||
121 | #define LASAT_W1_EXTSERIAL(v) (((v) >> 0x0a) & 0x1) | ||
122 | #define LASAT_W1_FLASHSIZE(v) (((v) >> 0x0c) & 0xf) | ||
123 | #define LASAT_W1_PCISLOTS(v) (((v) >> 0x10) & 0xf) | ||
124 | #define LASAT_W1_PCI1OPT(v) (((v) >> 0x14) & 0xf) | ||
125 | #define LASAT_W1_PCI2OPT(v) (((v) >> 0x18) & 0xf) | ||
126 | #define LASAT_W1_PCI3OPT(v) (((v) >> 0x1c) & 0xf) | ||
127 | |||
128 | /* Routines specific to LASAT boards */ | ||
129 | |||
130 | #define LASAT_BMID_MASQUERADE2 0 | ||
131 | #define LASAT_BMID_MASQUERADEPRO 1 | ||
132 | #define LASAT_BMID_SAFEPIPE25 2 | ||
133 | #define LASAT_BMID_SAFEPIPE50 3 | ||
134 | #define LASAT_BMID_SAFEPIPE100 4 | ||
135 | #define LASAT_BMID_SAFEPIPE5000 5 | ||
136 | #define LASAT_BMID_SAFEPIPE7000 6 | ||
137 | #define LASAT_BMID_SAFEPIPE1000 7 | ||
138 | #if 0 | ||
139 | #define LASAT_BMID_SAFEPIPE30 7 | ||
140 | #define LASAT_BMID_SAFEPIPE5100 8 | ||
141 | #define LASAT_BMID_SAFEPIPE7100 9 | ||
142 | #endif | ||
143 | #define LASAT_BMID_UNKNOWN 0xf | ||
144 | #define LASAT_MAX_BMID_NAMES 9 /* no larger than 15! */ | ||
145 | |||
146 | #define LASAT_HAS_EDHAC (1 << 0) | ||
147 | #define LASAT_EDHAC_FAST (1 << 1) | ||
148 | #define LASAT_HAS_EADI (1 << 2) | ||
149 | #define LASAT_HAS_HIFN (1 << 3) | ||
150 | #define LASAT_HAS_ISDN (1 << 4) | ||
151 | #define LASAT_HAS_LEASEDLINE_IF (1 << 5) | ||
152 | #define LASAT_HAS_HDC (1 << 6) | ||
153 | |||
154 | #define LASAT_PRID_MASQUERADE2 0 | ||
155 | #define LASAT_PRID_MASQUERADEPRO 1 | ||
156 | #define LASAT_PRID_SAFEPIPE25 2 | ||
157 | #define LASAT_PRID_SAFEPIPE50 3 | ||
158 | #define LASAT_PRID_SAFEPIPE100 4 | ||
159 | #define LASAT_PRID_SAFEPIPE5000 5 | ||
160 | #define LASAT_PRID_SAFEPIPE7000 6 | ||
161 | #define LASAT_PRID_SAFEPIPE30 7 | ||
162 | #define LASAT_PRID_SAFEPIPE5100 8 | ||
163 | #define LASAT_PRID_SAFEPIPE7100 9 | ||
164 | |||
165 | #define LASAT_PRID_SAFEPIPE1110 10 | ||
166 | #define LASAT_PRID_SAFEPIPE3020 11 | ||
167 | #define LASAT_PRID_SAFEPIPE3030 12 | ||
168 | #define LASAT_PRID_SAFEPIPE5020 13 | ||
169 | #define LASAT_PRID_SAFEPIPE5030 14 | ||
170 | #define LASAT_PRID_SAFEPIPE1120 15 | ||
171 | #define LASAT_PRID_SAFEPIPE1130 16 | ||
172 | #define LASAT_PRID_SAFEPIPE6010 17 | ||
173 | #define LASAT_PRID_SAFEPIPE6110 18 | ||
174 | #define LASAT_PRID_SAFEPIPE6210 19 | ||
175 | #define LASAT_PRID_SAFEPIPE1020 20 | ||
176 | #define LASAT_PRID_SAFEPIPE1040 21 | ||
177 | #define LASAT_PRID_SAFEPIPE1060 22 | ||
178 | |||
179 | struct lasat_info { | ||
180 | unsigned int li_cpu_hz; | ||
181 | unsigned int li_bus_hz; | ||
182 | unsigned int li_bmid; | ||
183 | unsigned int li_memsize; | ||
184 | unsigned int li_flash_size; | ||
185 | unsigned int li_prid; | ||
186 | unsigned char li_bmstr[16]; | ||
187 | unsigned char li_namestr[32]; | ||
188 | unsigned char li_typestr[16]; | ||
189 | /* Info on the Flash layout */ | ||
190 | unsigned int li_flash_base; | ||
191 | unsigned long li_flashpart_base[LASAT_MTD_LAST]; | ||
192 | unsigned long li_flashpart_size[LASAT_MTD_LAST]; | ||
193 | struct lasat_eeprom_struct li_eeprom_info; | ||
194 | unsigned int li_eeprom_upgrade_version; | ||
195 | unsigned int li_debugaccess; | ||
196 | }; | ||
197 | |||
198 | extern struct lasat_info lasat_board_info; | ||
199 | |||
200 | static inline unsigned long lasat_flash_partition_start(int partno) | ||
201 | { | ||
202 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
203 | return 0; | ||
204 | |||
205 | return lasat_board_info.li_flashpart_base[partno]; | ||
206 | } | ||
207 | |||
208 | static inline unsigned long lasat_flash_partition_size(int partno) | ||
209 | { | ||
210 | if (partno < 0 || partno >= LASAT_MTD_LAST) | ||
211 | return 0; | ||
212 | |||
213 | return lasat_board_info.li_flashpart_size[partno]; | ||
214 | } | ||
215 | |||
216 | /* Called from setup() to initialize the global board_info struct */ | ||
217 | extern int lasat_init_board_info(void); | ||
218 | |||
219 | /* Write the modified EEPROM info struct */ | ||
220 | extern void lasat_write_eeprom_info(void); | ||
221 | |||
222 | #define N_MACHTYPES 2 | ||
223 | /* for calibration of delays */ | ||
224 | |||
225 | /* the lasat_ndelay function is necessary because it is used at an | ||
226 | * early stage of the boot process where ndelay is not calibrated. | ||
227 | * It is used for the bit-banging rtc and eeprom drivers */ | ||
228 | |||
229 | #include <linux/delay.h> | ||
230 | |||
231 | /* calculating with the slowest board with 100 MHz clock */ | ||
232 | #define LASAT_100_DIVIDER 20 | ||
233 | /* All 200's run at 250 MHz clock */ | ||
234 | #define LASAT_200_DIVIDER 8 | ||
235 | |||
236 | extern unsigned int lasat_ndelay_divider; | ||
237 | |||
238 | static inline void lasat_ndelay(unsigned int ns) | ||
239 | { | ||
240 | __delay(ns / lasat_ndelay_divider); | ||
241 | } | ||
242 | |||
243 | #define IS_LASAT_200() (current_cpu_data.cputype == CPU_R5000) | ||
244 | |||
245 | #endif /* !defined (_LANGUAGE_ASSEMBLY) */ | ||
246 | |||
247 | #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef | ||
248 | #define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba | ||
249 | |||
250 | /* Lasat 100 boards */ | ||
251 | #define LASAT_GT_BASE (KSEG1ADDR(0x14000000)) | ||
252 | |||
253 | /* Lasat 200 boards */ | ||
254 | #define Vrc5074_PHYS_BASE 0x1fa00000 | ||
255 | #define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE)) | ||
256 | #define PCI_WINDOW1 0x1a000000 | ||
257 | |||
258 | #endif /* _LASAT_H */ | ||
diff --git a/arch/mips/include/asm/lasat/lasatint.h b/arch/mips/include/asm/lasat/lasatint.h new file mode 100644 index 000000000000..e0d2458b43d0 --- /dev/null +++ b/arch/mips/include/asm/lasat/lasatint.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __ASM_LASAT_LASATINT_H | ||
2 | #define __ASM_LASAT_LASATINT_H | ||
3 | |||
4 | /* lasat 100 */ | ||
5 | #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) | ||
6 | #define LASAT_INT_MASK_REG_100 (KSEG1ADDR(0x1c890000)) | ||
7 | #define LASATINT_MASK_SHIFT_100 0 | ||
8 | |||
9 | /* lasat 200 */ | ||
10 | #define LASAT_INT_STATUS_REG_200 (KSEG1ADDR(0x1104003c)) | ||
11 | #define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c)) | ||
12 | #define LASATINT_MASK_SHIFT_200 16 | ||
13 | |||
14 | #endif /* __ASM_LASAT_LASATINT_H */ | ||
diff --git a/arch/mips/include/asm/lasat/picvue.h b/arch/mips/include/asm/lasat/picvue.h new file mode 100644 index 000000000000..42a492edc40e --- /dev/null +++ b/arch/mips/include/asm/lasat/picvue.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* Lasat 100 */ | ||
2 | #define PVC_REG_100 KSEG1ADDR(0x1c820000) | ||
3 | #define PVC_DATA_SHIFT_100 0 | ||
4 | #define PVC_DATA_M_100 0xFF | ||
5 | #define PVC_E_100 (1 << 8) | ||
6 | #define PVC_RW_100 (1 << 9) | ||
7 | #define PVC_RS_100 (1 << 10) | ||
8 | |||
9 | /* Lasat 200 */ | ||
10 | #define PVC_REG_200 KSEG1ADDR(0x11000000) | ||
11 | #define PVC_DATA_SHIFT_200 24 | ||
12 | #define PVC_DATA_M_200 (0xFF << PVC_DATA_SHIFT_200) | ||
13 | #define PVC_E_200 (1 << 16) | ||
14 | #define PVC_RW_200 (1 << 17) | ||
15 | #define PVC_RS_200 (1 << 18) | ||
diff --git a/arch/mips/include/asm/lasat/serial.h b/arch/mips/include/asm/lasat/serial.h new file mode 100644 index 000000000000..1c37d70579b8 --- /dev/null +++ b/arch/mips/include/asm/lasat/serial.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <asm/lasat/lasat.h> | ||
2 | |||
3 | /* Lasat 100 boards serial configuration */ | ||
4 | #define LASAT_BASE_BAUD_100 (7372800 / 16) | ||
5 | #define LASAT_UART_REGS_BASE_100 0x1c8b0000 | ||
6 | #define LASAT_UART_REGS_SHIFT_100 2 | ||
7 | #define LASATINT_UART_100 16 | ||
8 | |||
9 | /* * LASAT 200 boards serial configuration */ | ||
10 | #define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) | ||
11 | #define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300) | ||
12 | #define LASAT_UART_REGS_SHIFT_200 3 | ||
13 | #define LASATINT_UART_200 21 | ||