2 /*----------------------------------------------------------------------------*/
3 /* Residual Data header definitions and prototypes */
4 /*----------------------------------------------------------------------------*/
6 /* Structure map for RESIDUAL on PowerPC Reference Platform */
7 /* residual.h - Residual data structure passed in r3. */
8 /* Load point passed in r4 to boot image. */
9 /* For enum's: if given in hex then they are bit significant, */
10 /* i.e. only one bit is on for each enum */
11 /* Reserved fields must be filled with zeros. */
19 #define MAX_CPUS 32 /* These should be set to the maximum */
20 #define MAX_MEMS 64 /* number possible for this system. */
21 #define MAX_DEVICES 256 /* Changing these will change the */
22 #define AVE_PNP_SIZE 32 /* structure, hence the version of */
23 #define MAX_MEM_SEGS 64 /* this header file. */
25 /*----------------------------------------------------------------------------*/
26 /* Public structures... */
27 /*----------------------------------------------------------------------------*/
31 typedef enum _L1CACHE_TYPE {
37 typedef enum _TLB_TYPE {
43 typedef enum _FIRMWARE_SUPPORT {
53 SCSI_InitiatorID_Override = 0x0200,
58 typedef enum _FIRMWARE_SUPPLIERS {
60 MotoFirmware = 0x01, /* 7/18/95 */
61 FirmWorks = 0x02, /* 10/5/95 */
62 Bull = 0x03, /* 04/03/96 */
65 typedef enum _ENDIAN_SWITCH_METHODS {
67 UsePCIConfigA8 = 0x02,
69 } ENDIAN_SWITCH_METHODS;
71 typedef enum _SPREAD_IO_METHODS {
73 /*UsePCIConfigA8 = 0x02,*/
78 /* Box dependent stuff */
79 unsigned char PrintableModel[32]; /* Null terminated string.
81 vvv,<20h>,<model designation>,<0x0>
82 where vvv is the vendor ID
83 e.g. IBM PPS MODEL 6015<0x0> */
84 unsigned char Serial[16]; /* 12/94:
85 Serial Number; must be of the form:
86 vvv<serial number> where vvv is the
88 e.g. IBM60151234567<20h><20h> */
89 unsigned char Reserved[48];
90 unsigned long FirmwareSupplier; /* See FirmwareSuppliers enum */
91 unsigned long FirmwareSupports; /* See FirmwareSupport enum */
92 unsigned long NvramSize; /* Size of nvram in bytes */
93 unsigned long NumSIMMSlots;
94 unsigned short EndianSwitchMethod; /* See EndianSwitchMethods enum */
95 unsigned short SpreadIOMethod; /* See SpreadIOMethods enum */
97 unsigned long RAMErrLogOffset; /* Heap offset to error log */
98 unsigned long Reserved5;
99 unsigned long Reserved6;
100 unsigned long ProcessorHz; /* Processor clock frequency in Hertz */
101 unsigned long ProcessorBusHz; /* Processor bus clock frequency */
102 unsigned long Reserved7;
103 unsigned long TimeBaseDivisor; /* (Bus clocks per timebase tic)*1000 */
104 unsigned long WordWidth; /* Word width in bits */
105 unsigned long PageSize; /* Page size in bytes */
106 unsigned long CoherenceBlockSize; /* Unit of transfer in/out of cache
107 for which coherency is maintained;
108 normally <= CacheLineSize. */
109 unsigned long GranuleSize; /* Unit of lock allocation to avoid */
110 /* false sharing of locks. */
112 /* L1 Cache variables */
113 unsigned long CacheSize; /* L1 Cache size in KB. This is the */
114 /* total size of the L1, whether */
115 /* combined or split */
116 unsigned long CacheAttrib; /* L1CACHE_TYPE */
117 unsigned long CacheAssoc; /* L1 Cache associativity. Use this
118 for combined cache. If split, put
120 unsigned long CacheLineSize; /* L1 Cache line size in bytes. Use
121 for combined cache. If split, put
123 /* For split L1 Cache: (= combined if combined cache) */
124 unsigned long I_CacheSize;
125 unsigned long I_CacheAssoc;
126 unsigned long I_CacheLineSize;
127 unsigned long D_CacheSize;
128 unsigned long D_CacheAssoc;
129 unsigned long D_CacheLineSize;
131 /* Translation Lookaside Buffer variables */
132 unsigned long TLBSize; /* Total number of TLBs on the system */
133 unsigned long TLBAttrib; /* Combined I+D or split TLB */
134 unsigned long TLBAssoc; /* TLB Associativity. Use this for
135 combined TLB. If split, put zeros
137 /* For split TLB: (= combined if combined TLB) */
138 unsigned long I_TLBSize;
139 unsigned long I_TLBAssoc;
140 unsigned long D_TLBSize;
141 unsigned long D_TLBAssoc;
143 unsigned long ExtendedVPD; /* Offset to extended VPD area;
147 typedef enum _DEVICE_FLAGS {
148 Enabled = 0x4000, /* 1 - PCI device is enabled */
150 Failed = 0x1000, /* 1 - device failed POST code tests */
151 Static = 0x0800, /* 0 - dynamically configurable
153 Dock = 0x0400, /* 0 - not a docking station device
154 1 - is a docking station device */
155 Boot = 0x0200, /* 0 - device cannot be used for BOOT
156 1 - can be a BOOT device */
157 Configurable = 0x0100, /* 1 - device is configurable */
158 Disableable = 0x80, /* 1 - device can be disabled */
159 PowerManaged = 0x40, /* 0 - not managed; 1 - managed */
160 ReadOnly = 0x20, /* 1 - device is read only */
161 Removable = 0x10, /* 1 - device is removable */
168 typedef enum _BUS_ID {
175 MXDEVICE = 0x40, /* Devices on mezzanine bus */
176 PROCESSORDEVICE = 0x80, /* Devices on processor bus */
180 typedef struct _DEVICE_ID {
181 unsigned long BusId; /* See BUS_ID enum above */
182 unsigned long DevId; /* Big Endian format */
183 unsigned long SerialNum; /* For multiple usage of a single
185 unsigned long Flags; /* See DEVICE_FLAGS enum above */
186 unsigned char BaseType; /* See pnp.h for bit definitions */
187 unsigned char SubType; /* See pnp.h for bit definitions */
188 unsigned char Interface; /* See pnp.h for bit definitions */
192 typedef union _BUS_ACCESS {
195 unsigned char LogicalDevNumber;
196 unsigned short ReadDataPort;
199 unsigned char SlotNumber; /* ISA Slot Number generally not
200 available; 0 if unknown */
201 unsigned char LogicalDevNumber;
202 unsigned short ISAReserved;
205 unsigned char SlotNumber;
206 unsigned char LogicalDevNumber;
207 unsigned short MCAReserved;
209 struct _PCMCIAAccess{
210 unsigned char SlotNumber;
211 unsigned char LogicalDevNumber;
212 unsigned short PCMCIAReserved;
215 unsigned char SlotNumber;
216 unsigned char FunctionNumber;
217 unsigned short EISAReserved;
220 unsigned char BusNumber;
221 unsigned char DevFuncNumber;
222 unsigned short PCIReserved;
224 struct _ProcBusAccess{
225 unsigned char BusNumber;
227 unsigned short ProcBusReserved;
231 /* Per logical device information */
232 typedef struct _PPC_DEVICE {
234 BUS_ACCESS BusAccess;
236 /* The following three are offsets into the DevicePnPHeap */
237 /* All are in PnP compressed format */
238 unsigned long AllocatedOffset; /* Allocated resource description */
239 unsigned long PossibleOffset; /* Possible resource description */
240 unsigned long CompatibleOffset; /* Compatible device identifiers */
243 typedef enum _CPU_STATE {
244 CPU_GOOD = 0, /* CPU is present, and active */
245 CPU_GOOD_FW = 1, /* CPU is present, and in firmware */
246 CPU_OFF = 2, /* CPU is present, but inactive */
247 CPU_FAILED = 3, /* CPU is present, but failed POST */
248 CPU_NOT_PRESENT = 255 /* CPU not present */
251 typedef struct _PPC_CPU {
252 unsigned long CpuType; /* Result of mfspr from Processor
253 Version Register (PVR).
254 PVR(0-15) = Version (e.g. 601)
255 PVR(16-31 = EC Level */
256 unsigned char CpuNumber; /* CPU Number for this processor */
257 unsigned char CpuState; /* CPU State, see CPU_STATE enum */
258 unsigned short Reserved;
261 typedef struct _PPC_MEM {
262 unsigned long SIMMSize; /* 0 - absent or bad
266 typedef enum _MEM_USAGE {
268 ResumeBlock = 0x4000, /* for use by power management */
269 SystemROM = 0x2000, /* Flash memory (populated) */
270 UnPopSystemROM = 0x1000, /* Unpopulated part of SystemROM area */
277 Unpopulated = 0x20, /* Unpopulated part of System Memory */
278 Free = 0x10, /* Free part of System Memory */
279 BootImage = 0x08, /* BootImage part of System Memory */
280 FirmwareCode = 0x04, /* FirmwareCode part of System Memory */
281 FirmwareHeap = 0x02, /* FirmwareHeap part of System Memory */
282 FirmwareStack = 0x01 /* FirmwareStack part of System Memory*/
285 typedef struct _MEM_MAP {
286 unsigned long Usage; /* See MEM_USAGE above */
287 unsigned long BasePage; /* Page number measured in 4KB pages */
288 unsigned long PageCount; /* Page count measured in 4KB pages */
291 typedef struct _RESIDUAL {
292 unsigned long ResidualLength; /* Length of Residual */
293 unsigned char Version; /* of this data structure */
294 unsigned char Revision; /* of this data structure */
295 unsigned short EC; /* of this data structure */
297 VPD VitalProductData;
299 unsigned short MaxNumCpus; /* Max CPUs in this system */
300 unsigned short ActualNumCpus; /* ActualNumCpus < MaxNumCpus means */
301 /* that there are unpopulated or */
302 /* otherwise unusable cpu locations */
303 PPC_CPU Cpus[MAX_CPUS];
305 unsigned long TotalMemory; /* Total amount of memory installed */
306 unsigned long GoodMemory; /* Total amount of good memory */
307 unsigned long ActualNumMemSegs;
308 MEM_MAP Segs[MAX_MEM_SEGS];
309 unsigned long ActualNumMemories;
310 PPC_MEM Memories[MAX_MEMS];
312 unsigned long ActualNumDevices;
313 PPC_DEVICE Devices[MAX_DEVICES];
314 unsigned char DevicePnPHeap[2*MAX_DEVICES*AVE_PNP_SIZE];
319 * Forward declaration - we can't include <linux/pci.h> because it
320 * breaks the boot loader
324 extern RESIDUAL *res;
325 extern void print_residual_device_info(void);
326 extern PPC_DEVICE *residual_find_device(unsigned long BusMask,
327 unsigned char * DevID, int BaseType,
328 int SubType, int Interface, int n);
329 extern int residual_pcidev_irq(struct pci_dev *dev);
330 extern void residual_irq_mask(char *irq_edge_mask_lo, char *irq_edge_mask_hi);
331 extern unsigned int residual_isapic_addr(void);
332 extern PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, unsigned packet_tag,
334 extern PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p,
335 unsigned packet_type,
337 extern PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p,
338 unsigned packet_type,
341 #ifdef CONFIG_PREP_RESIDUAL
342 #define have_residual_data (res && res->ResidualLength)
344 #define have_residual_data 0
347 #endif /* __ASSEMBLY__ */
348 #endif /* ndef _RESIDUAL_ */
350 #endif /* __KERNEL__ */