1 |
/* |
/* |
2 |
* Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2003-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_turbochannel.c,v 1.46 2006/01/01 13:17:17 debug Exp $ |
* $Id: dev_turbochannel.c,v 1.48 2006/12/30 13:30:59 debug Exp $ |
29 |
* |
* |
30 |
* Generic framework for TURBOchannel devices, used in DECstation machines. |
* Generic framework for TURBOchannel devices, used in DECstation machines. |
31 |
*/ |
*/ |
49 |
int slot_nr; |
int slot_nr; |
50 |
uint64_t baseaddr; |
uint64_t baseaddr; |
51 |
uint64_t endaddr; |
uint64_t endaddr; |
|
int irq; |
|
52 |
|
|
53 |
int rom_skip; |
int rom_skip; |
54 |
|
|
177 |
*/ |
*/ |
178 |
void dev_turbochannel_init(struct machine *machine, struct memory *mem, |
void dev_turbochannel_init(struct machine *machine, struct memory *mem, |
179 |
int slot_nr, uint64_t baseaddr, uint64_t endaddr, |
int slot_nr, uint64_t baseaddr, uint64_t endaddr, |
180 |
char *device_name, int irq) |
char *device_name, char *irq_path) |
181 |
{ |
{ |
182 |
struct vfb_data *fb; |
struct vfb_data *fb; |
183 |
struct turbochannel_data *d; |
struct turbochannel_data *d; |
202 |
d->slot_nr = slot_nr; |
d->slot_nr = slot_nr; |
203 |
d->baseaddr = baseaddr; |
d->baseaddr = baseaddr; |
204 |
d->endaddr = endaddr; |
d->endaddr = endaddr; |
|
d->irq = irq; |
|
205 |
|
|
206 |
strlcpy(d->device_name, device_name, DEVICE_NAME_BUFLEN); |
strlcpy(d->device_name, device_name, DEVICE_NAME_BUFLEN); |
207 |
|
|
231 |
|
|
232 |
if (strcmp(device_name, "PMAD-AA")==0) { |
if (strcmp(device_name, "PMAD-AA")==0) { |
233 |
/* le in NetBSD, Lance ethernet */ |
/* le in NetBSD, Lance ethernet */ |
234 |
dev_le_init(machine, mem, baseaddr, 0, 0, irq, DEV_LE_LENGTH); |
dev_le_init(machine, mem, baseaddr, 0, 0, |
235 |
|
irq_path, DEV_LE_LENGTH); |
236 |
/* One ROM at 0x1c03e0, and one at 0x3c0000. */ |
/* One ROM at 0x1c03e0, and one at 0x3c0000. */ |
237 |
rom_skip = 0x300; |
rom_skip = 0x300; |
238 |
rom_offset = 0x1c0000; |
rom_offset = 0x1c0000; |
239 |
rom_length = 0x201000; |
rom_length = 0x201000; |
240 |
} else if (strcmp(device_name, "PMAZ-AA")==0) { |
} else if (strcmp(device_name, "PMAZ-AA")==0) { |
241 |
/* asc in NetBSD, SCSI */ |
/* asc in NetBSD, SCSI */ |
242 |
dev_asc_init(machine, mem, baseaddr, irq, d, |
dev_asc_init(machine, mem, baseaddr, irq_path, d, |
243 |
DEV_ASC_DEC, NULL, NULL); |
DEV_ASC_DEC, NULL, NULL); |
244 |
rom_offset = 0xc0000; |
rom_offset = 0xc0000; |
245 |
/* There is a copy at 0x0, at least that's where Linux |
/* There is a copy at 0x0, at least that's where Linux |
257 |
fb = dev_fb_init(machine, mem, baseaddr, VFB_GENERIC, |
fb = dev_fb_init(machine, mem, baseaddr, VFB_GENERIC, |
258 |
1024,864, 1024,1024,8, device_name); |
1024,864, 1024,1024,8, device_name); |
259 |
dev_bt459_init(machine, mem, baseaddr + VFB_CFB_BT459, |
dev_bt459_init(machine, mem, baseaddr + VFB_CFB_BT459, |
260 |
baseaddr + 0x300000, fb, 8, irq, BT459_BA); |
baseaddr + 0x300000, fb, 8, irq_path, BT459_BA); |
261 |
/* ROM at both 0x380000 and 0x3c0000? */ |
/* ROM at both 0x380000 and 0x3c0000? */ |
262 |
rom_offset = 0x380000; |
rom_offset = 0x380000; |
263 |
rom_length = 0x080000; |
rom_length = 0x080000; |
270 |
/* TODO: the CLEAR doesn't get through, as the address |
/* TODO: the CLEAR doesn't get through, as the address |
271 |
range is already in use by the asic */ |
range is already in use by the asic */ |
272 |
dev_bt459_init(machine, mem, baseaddr + SFB_OFFSET_BT459, |
dev_bt459_init(machine, mem, baseaddr + SFB_OFFSET_BT459, |
273 |
baseaddr + SFB_CLEAR, fb, 8, irq, BT459_BBA); |
baseaddr + SFB_CLEAR, fb, 8, irq_path, BT459_BBA); |
274 |
rom_offset = 0x0; /* ? TODO */ |
rom_offset = 0x0; /* ? TODO */ |
275 |
} else if (strcmp(device_name, "PMAG-CA")==0) { |
} else if (strcmp(device_name, "PMAG-CA")==0) { |
276 |
/* px in NetBSD */ |
/* px in NetBSD */ |
277 |
dev_px_init(machine, mem, baseaddr, DEV_PX_TYPE_PX, irq); |
dev_px_init(machine, mem, baseaddr, DEV_PX_TYPE_PX, irq_path); |
278 |
rom_offset = 0x3c0000; |
rom_offset = 0x3c0000; |
279 |
} else if (strcmp(device_name, "PMAG-DA")==0) { |
} else if (strcmp(device_name, "PMAG-DA")==0) { |
280 |
/* pxg in NetBSD */ |
/* pxg in NetBSD */ |
281 |
dev_px_init(machine, mem, baseaddr, DEV_PX_TYPE_PXG, irq); |
dev_px_init(machine, mem, baseaddr, DEV_PX_TYPE_PXG, irq_path); |
282 |
rom_offset = 0x3c0000; |
rom_offset = 0x3c0000; |
283 |
} else if (strcmp(device_name, "PMAG-EA")==0) { |
} else if (strcmp(device_name, "PMAG-EA")==0) { |
284 |
/* pxg+ in NetBSD: TODO (not supported by the kernel |
/* pxg+ in NetBSD: TODO (not supported by the kernel |
288 |
} else if (strcmp(device_name, "PMAG-FA")==0) { |
} else if (strcmp(device_name, "PMAG-FA")==0) { |
289 |
/* "pxg+ Turbo" in NetBSD */ |
/* "pxg+ Turbo" in NetBSD */ |
290 |
dev_px_init(machine, mem, baseaddr, |
dev_px_init(machine, mem, baseaddr, |
291 |
DEV_PX_TYPE_PXGPLUSTURBO, irq); |
DEV_PX_TYPE_PXGPLUSTURBO, irq_path); |
292 |
rom_offset = 0x3c0000; |
rom_offset = 0x3c0000; |
293 |
} else if (strcmp(device_name, "PMAG-DV")==0) { |
} else if (strcmp(device_name, "PMAG-DV")==0) { |
294 |
/* xcfb in NetBSD: TODO */ |
/* xcfb in NetBSD: TODO */ |
298 |
rom_offset = 0x3c0000; |
rom_offset = 0x3c0000; |
299 |
} else if (strcmp(device_name, "PMAG-JA")==0) { |
} else if (strcmp(device_name, "PMAG-JA")==0) { |
300 |
/* "Truecolor", mixed 8- and 24-bit */ |
/* "Truecolor", mixed 8- and 24-bit */ |
301 |
dev_pmagja_init(machine, mem, baseaddr, irq); |
dev_pmagja_init(machine, mem, baseaddr, irq_path); |
302 |
rom_offset = 0; /* NOTE: 0, not 0x3c0000 */ |
rom_offset = 0; /* NOTE: 0, not 0x3c0000 */ |
303 |
} else if (strcmp(device_name, "PMAG-RO")==0) { |
} else if (strcmp(device_name, "PMAG-RO")==0) { |
304 |
/* This works at least B/W in Ultrix, so far. */ |
/* This works at least B/W in Ultrix, so far. */ |
306 |
VFB_GENERIC, 1280,1024, 1280,1024, 8, "PMAG-RO"); |
VFB_GENERIC, 1280,1024, 1280,1024, 8, "PMAG-RO"); |
307 |
/* TODO: bt463 at offset 0x040000, not bt459 */ |
/* TODO: bt463 at offset 0x040000, not bt459 */ |
308 |
dev_bt459_init(machine, mem, baseaddr + 0x40000, 0, |
dev_bt459_init(machine, mem, baseaddr + 0x40000, 0, |
309 |
fb, 8, irq, 0); /* TODO: type */ |
fb, 8, irq_path, 0); /* TODO: type */ |
310 |
dev_bt431_init(mem, baseaddr + 0x40010, fb, 8); /* cursor */ |
dev_bt431_init(mem, baseaddr + 0x40010, fb, 8); /* cursor */ |
311 |
rom_offset = 0x3c0000; |
rom_offset = 0x3c0000; |
312 |
} else if (device_name[0] == '\0') { |
} else if (device_name[0] == '\0') { |