25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_vr41xx.c,v 1.29 2005/04/09 12:11:46 debug Exp $ |
* $Id: dev_vr41xx.c,v 1.30 2005/08/05 09:11:48 debug Exp $ |
29 |
* |
* |
30 |
* VR41xx (actually, VR4122 and VR4131) misc functions. |
* VR41xx (actually, VR4122 and VR4131) misc functions. |
31 |
* |
* |
544 |
struct memory *mem, int cpumodel) |
struct memory *mem, int cpumodel) |
545 |
{ |
{ |
546 |
uint64_t baseaddr = 0; |
uint64_t baseaddr = 0; |
547 |
|
char tmps[100]; |
548 |
struct vr41xx_data *d = malloc(sizeof(struct vr41xx_data)); |
struct vr41xx_data *d = malloc(sizeof(struct vr41xx_data)); |
549 |
|
|
550 |
if (d == NULL) { |
if (d == NULL) { |
551 |
fprintf(stderr, "out of memory\n"); |
fprintf(stderr, "out of memory\n"); |
552 |
exit(1); |
exit(1); |
589 |
* which chips. |
* which chips. |
590 |
*/ |
*/ |
591 |
if (cpumodel == 4131) { |
if (cpumodel == 4131) { |
592 |
dev_ns16550_init(machine, mem, baseaddr + 0x800, |
snprintf(tmps, sizeof(tmps), "ns16550 irq=%i addr=0x%llx " |
593 |
8 + VRIP_INTR_SIU, 1, 1, "vr41xx siu"); |
"name2=siu", 8+VRIP_INTR_SIU, (long long)(baseaddr+0x800)); |
594 |
|
device_add(machine, tmps); |
595 |
} else { |
} else { |
596 |
/* This is used by Linux and NetBSD: */ |
/* This is used by Linux and NetBSD: */ |
597 |
dev_ns16550_init(machine, mem, 0xc000000, |
snprintf(tmps, sizeof(tmps), "ns16550 irq=%i addr=0x%x " |
598 |
8 + VRIP_INTR_SIU, 1, 1, "vr41xx serial"); |
"name2=serial", 8+VRIP_INTR_SIU, 0xc000000); |
599 |
|
device_add(machine, tmps); |
600 |
} |
} |
601 |
|
|
602 |
/* Hm... maybe this should not be here. TODO */ |
/* Hm... maybe this should not be here. TODO */ |