1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Thomas Horsten <thh@lasat.com>
6 * Copyright (C) 2000 LASAT Networks A/S.
8 * Configuration for LASAT boards, loads the appropriate include files.
13 #ifndef _LANGUAGE_ASSEMBLY
15 extern struct lasat_misc {
16 volatile u32 *reset_reg;
17 volatile u32 *flash_wp_reg;
31 * The format of the data record in the EEPROM.
32 * See the LASAT Hardware Configuration field specification for a detailed
33 * description of the config field.
35 #include <linux/types.h>
37 #define LASAT_EEPROM_VERSION 7
38 struct lasat_eeprom_struct {
41 unsigned char hwaddr[6];
42 unsigned char print_partno[12];
44 unsigned char print_serial[14];
46 unsigned char prod_partno[12];
48 unsigned char prod_serial[14];
50 unsigned char passwd_hash[16];
51 unsigned char pwdnull;
54 unsigned char ts_signoff;
55 unsigned char reserved[11];
56 unsigned char debugaccess;
58 unsigned int serviceflag;
64 struct lasat_eeprom_struct_pre7 {
66 unsigned int flags[3];
67 unsigned char hwaddr0[6];
68 unsigned char hwaddr1[6];
69 unsigned char print_partno[9];
71 unsigned char print_serial[14];
73 unsigned char prod_partno[9];
75 unsigned char prod_serial[14];
77 unsigned char passwd_hash[24];
78 unsigned char pwdnull;
81 unsigned char ts_signoff;
82 unsigned char reserved[6];
83 unsigned int writecount;
89 /* Configuration descriptor encoding - see the doc for details */
91 #define LASAT_W0_DSCTYPE(v) (((v)) & 0xf)
92 #define LASAT_W0_BMID(v) (((v) >> 0x04) & 0xf)
93 #define LASAT_W0_CPUTYPE(v) (((v) >> 0x08) & 0xf)
94 #define LASAT_W0_BUSSPEED(v) (((v) >> 0x0c) & 0xf)
95 #define LASAT_W0_CPUCLK(v) (((v) >> 0x10) & 0xf)
96 #define LASAT_W0_SDRAMBANKSZ(v) (((v) >> 0x14) & 0xf)
97 #define LASAT_W0_SDRAMBANKS(v) (((v) >> 0x18) & 0xf)
98 #define LASAT_W0_L2CACHE(v) (((v) >> 0x1c) & 0xf)
100 #define LASAT_W1_EDHAC(v) (((v)) & 0xf)
101 #define LASAT_W1_HIFN(v) (((v) >> 0x04) & 0x1)
102 #define LASAT_W1_ISDN(v) (((v) >> 0x05) & 0x1)
103 #define LASAT_W1_IDE(v) (((v) >> 0x06) & 0x1)
104 #define LASAT_W1_HDLC(v) (((v) >> 0x07) & 0x1)
105 #define LASAT_W1_USVERSION(v) (((v) >> 0x08) & 0x1)
106 #define LASAT_W1_4MACS(v) (((v) >> 0x09) & 0x1)
107 #define LASAT_W1_EXTSERIAL(v) (((v) >> 0x0a) & 0x1)
108 #define LASAT_W1_FLASHSIZE(v) (((v) >> 0x0c) & 0xf)
109 #define LASAT_W1_PCISLOTS(v) (((v) >> 0x10) & 0xf)
110 #define LASAT_W1_PCI1OPT(v) (((v) >> 0x14) & 0xf)
111 #define LASAT_W1_PCI2OPT(v) (((v) >> 0x18) & 0xf)
112 #define LASAT_W1_PCI3OPT(v) (((v) >> 0x1c) & 0xf)
114 /* Routines specific to LASAT boards */
116 #define LASAT_BMID_MASQUERADE2 0
117 #define LASAT_BMID_MASQUERADEPRO 1
118 #define LASAT_BMID_SAFEPIPE25 2
119 #define LASAT_BMID_SAFEPIPE50 3
120 #define LASAT_BMID_SAFEPIPE100 4
121 #define LASAT_BMID_SAFEPIPE5000 5
122 #define LASAT_BMID_SAFEPIPE7000 6
123 #define LASAT_BMID_SAFEPIPE1000 7
125 #define LASAT_BMID_SAFEPIPE30 7
126 #define LASAT_BMID_SAFEPIPE5100 8
127 #define LASAT_BMID_SAFEPIPE7100 9
129 #define LASAT_BMID_UNKNOWN 0xf
130 #define LASAT_MAX_BMID_NAMES 9 /* no larger than 15! */
132 #define LASAT_HAS_EDHAC (1 << 0)
133 #define LASAT_EDHAC_FAST (1 << 1)
134 #define LASAT_HAS_EADI (1 << 2)
135 #define LASAT_HAS_HIFN (1 << 3)
136 #define LASAT_HAS_ISDN (1 << 4)
137 #define LASAT_HAS_LEASEDLINE_IF (1 << 5)
138 #define LASAT_HAS_HDC (1 << 6)
140 #define LASAT_PRID_MASQUERADE2 0
141 #define LASAT_PRID_MASQUERADEPRO 1
142 #define LASAT_PRID_SAFEPIPE25 2
143 #define LASAT_PRID_SAFEPIPE50 3
144 #define LASAT_PRID_SAFEPIPE100 4
145 #define LASAT_PRID_SAFEPIPE5000 5
146 #define LASAT_PRID_SAFEPIPE7000 6
147 #define LASAT_PRID_SAFEPIPE30 7
148 #define LASAT_PRID_SAFEPIPE5100 8
149 #define LASAT_PRID_SAFEPIPE7100 9
151 #define LASAT_PRID_SAFEPIPE1110 10
152 #define LASAT_PRID_SAFEPIPE3020 11
153 #define LASAT_PRID_SAFEPIPE3030 12
154 #define LASAT_PRID_SAFEPIPE5020 13
155 #define LASAT_PRID_SAFEPIPE5030 14
156 #define LASAT_PRID_SAFEPIPE1120 15
157 #define LASAT_PRID_SAFEPIPE1130 16
158 #define LASAT_PRID_SAFEPIPE6010 17
159 #define LASAT_PRID_SAFEPIPE6110 18
160 #define LASAT_PRID_SAFEPIPE6210 19
161 #define LASAT_PRID_SAFEPIPE1020 20
162 #define LASAT_PRID_SAFEPIPE1040 21
163 #define LASAT_PRID_SAFEPIPE1060 22
166 unsigned int li_cpu_hz;
167 unsigned int li_bus_hz;
168 unsigned int li_bmid;
169 unsigned int li_memsize;
170 unsigned int li_flash_size;
171 unsigned int li_prid;
172 unsigned char li_bmstr[16];
173 unsigned char li_namestr[32];
174 unsigned char li_typestr[16];
175 /* Info on the Flash layout */
176 unsigned int li_flash_base;
177 unsigned long li_flashpart_base[LASAT_MTD_LAST];
178 unsigned long li_flashpart_size[LASAT_MTD_LAST];
179 struct lasat_eeprom_struct li_eeprom_info;
180 unsigned int li_eeprom_upgrade_version;
181 unsigned int li_debugaccess;
184 extern struct lasat_info lasat_board_info;
186 static inline unsigned long lasat_flash_partition_start(int partno)
188 if (partno < 0 || partno >= LASAT_MTD_LAST)
191 return lasat_board_info.li_flashpart_base[partno];
194 static inline unsigned long lasat_flash_partition_size(int partno)
196 if (partno < 0 || partno >= LASAT_MTD_LAST)
199 return lasat_board_info.li_flashpart_size[partno];
202 /* Called from setup() to initialize the global board_info struct */
203 extern int lasat_init_board_info(void);
205 /* Write the modified EEPROM info struct */
206 extern void lasat_write_eeprom_info(void);
208 #define N_MACHTYPES 2
209 /* for calibration of delays */
211 /* the lasat_ndelay function is necessary because it is used at an
212 * early stage of the boot process where ndelay is not calibrated.
213 * It is used for the bit-banging rtc and eeprom drivers */
215 #include <linux/delay.h>
216 #include <linux/smp.h>
218 /* calculating with the slowest board with 100 MHz clock */
219 #define LASAT_100_DIVIDER 20
220 /* All 200's run at 250 MHz clock */
221 #define LASAT_200_DIVIDER 8
223 extern unsigned int lasat_ndelay_divider;
225 static inline void lasat_ndelay(unsigned int ns)
227 __delay(ns / lasat_ndelay_divider);
230 #define IS_LASAT_200() (current_cpu_data.cputype == CPU_R5000)
232 #endif /* !defined (_LANGUAGE_ASSEMBLY) */
234 #define LASAT_SERVICEMODE_MAGIC_1 0xdeadbeef
235 #define LASAT_SERVICEMODE_MAGIC_2 0xfedeabba
237 /* Lasat 100 boards */
238 #define LASAT_GT_BASE (KSEG1ADDR(0x14000000))
240 /* Lasat 200 boards */
241 #define Vrc5074_PHYS_BASE 0x1fa00000
242 #define Vrc5074_BASE (KSEG1ADDR(Vrc5074_PHYS_BASE))
243 #define PCI_WINDOW1 0x1a000000
245 #endif /* _LASAT_H */