1 |
/* |
/* |
2 |
* Copyright (C) 2004-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2006 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_sgi_ip30.c,v 1.18 2005/10/26 14:37:04 debug Exp $ |
* $Id: dev_sgi_ip30.c,v 1.20 2006/01/01 13:17:17 debug Exp $ |
29 |
* |
* |
30 |
* SGI IP30 stuff. |
* SGI IP30 stuff. |
31 |
* |
* |
60 |
/* |
/* |
61 |
* dev_sgi_ip30_access(): |
* dev_sgi_ip30_access(): |
62 |
*/ |
*/ |
63 |
int dev_sgi_ip30_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(sgi_ip30) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
64 |
{ |
{ |
65 |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
66 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
151 |
/* |
/* |
152 |
* dev_sgi_ip30_2_access(): |
* dev_sgi_ip30_2_access(): |
153 |
*/ |
*/ |
154 |
int dev_sgi_ip30_2_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(sgi_ip30_2) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
155 |
{ |
{ |
156 |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
157 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
204 |
/* |
/* |
205 |
* dev_sgi_ip30_3_access(): |
* dev_sgi_ip30_3_access(): |
206 |
*/ |
*/ |
207 |
int dev_sgi_ip30_3_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(sgi_ip30_3) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
208 |
{ |
{ |
209 |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
210 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
267 |
/* |
/* |
268 |
* dev_sgi_ip30_4_access(): |
* dev_sgi_ip30_4_access(): |
269 |
*/ |
*/ |
270 |
int dev_sgi_ip30_4_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(sgi_ip30_4) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
271 |
{ |
{ |
272 |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
273 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
311 |
/* |
/* |
312 |
* dev_sgi_ip30_5_access(): |
* dev_sgi_ip30_5_access(): |
313 |
*/ |
*/ |
314 |
int dev_sgi_ip30_5_access(struct cpu *cpu, struct memory *mem, |
DEVICE_ACCESS(sgi_ip30_5) |
|
uint64_t relative_addr, unsigned char *data, size_t len, |
|
|
int writeflag, void *extra) |
|
315 |
{ |
{ |
316 |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
struct sgi_ip30_data *d = (struct sgi_ip30_data *) extra; |
317 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
359 |
|
|
360 |
memory_device_register(mem, "sgi_ip30_1", baseaddr, |
memory_device_register(mem, "sgi_ip30_1", baseaddr, |
361 |
DEV_SGI_IP30_LENGTH, dev_sgi_ip30_access, (void *)d, |
DEV_SGI_IP30_LENGTH, dev_sgi_ip30_access, (void *)d, |
362 |
MEM_DEFAULT, NULL); |
DM_DEFAULT, NULL); |
363 |
memory_device_register(mem, "sgi_ip30_2", 0x10000000, |
memory_device_register(mem, "sgi_ip30_2", 0x10000000, |
364 |
0x10000, dev_sgi_ip30_2_access, (void *)d, MEM_DEFAULT, NULL); |
0x10000, dev_sgi_ip30_2_access, (void *)d, DM_DEFAULT, NULL); |
365 |
memory_device_register(mem, "sgi_ip30_3", 0x1f000000, |
memory_device_register(mem, "sgi_ip30_3", 0x1f000000, |
366 |
0x10000, dev_sgi_ip30_3_access, (void *)d, MEM_DEFAULT, NULL); |
0x10000, dev_sgi_ip30_3_access, (void *)d, DM_DEFAULT, NULL); |
367 |
memory_device_register(mem, "sgi_ip30_4", 0x1f600000, |
memory_device_register(mem, "sgi_ip30_4", 0x1f600000, |
368 |
0x10000, dev_sgi_ip30_4_access, (void *)d, MEM_DEFAULT, NULL); |
0x10000, dev_sgi_ip30_4_access, (void *)d, DM_DEFAULT, NULL); |
369 |
memory_device_register(mem, "sgi_ip30_5", 0x1f6c0000, |
memory_device_register(mem, "sgi_ip30_5", 0x1f6c0000, |
370 |
0x10000, dev_sgi_ip30_5_access, (void *)d, MEM_DEFAULT, NULL); |
0x10000, dev_sgi_ip30_5_access, (void *)d, DM_DEFAULT, NULL); |
371 |
|
|
372 |
machine_add_tickfunction(machine, dev_sgi_ip30_tick, d, 16); |
machine_add_tickfunction(machine, dev_sgi_ip30_tick, d, 16); |
373 |
|
|