25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_vr41xx.c,v 1.43 2007/01/21 21:02:57 debug Exp $ |
* $Id: dev_vr41xx.c,v 1.46 2007/06/15 19:57:34 debug Exp $ |
29 |
* |
* |
30 |
* VR41xx (VR4122 and VR4131) misc functions. |
* COMMENT: VR41xx (VR4122 and VR4131) misc functions |
31 |
* |
* |
32 |
* This is just a big hack. |
* This is just a big hack. |
33 |
* |
* |
394 |
*/ |
*/ |
395 |
static void timer_tick(struct timer *timer, void *extra) |
static void timer_tick(struct timer *timer, void *extra) |
396 |
{ |
{ |
397 |
struct vr41xx_data *d = (struct vr41xx_data *) extra; |
struct vr41xx_data *d = extra; |
398 |
d->pending_timer_interrupts ++; |
d->pending_timer_interrupts ++; |
399 |
} |
} |
400 |
|
|
406 |
if (d->pending_timer_interrupts > 0) |
if (d->pending_timer_interrupts > 0) |
407 |
INTERRUPT_ASSERT(d->timer_irq); |
INTERRUPT_ASSERT(d->timer_irq); |
408 |
|
|
409 |
if (cpu->machine->use_x11) |
if (cpu->machine->x11_md.in_use) |
410 |
vr41xx_keytick(cpu, d); |
vr41xx_keytick(cpu, d); |
411 |
} |
} |
412 |
|
|
481 |
|
|
482 |
DEVICE_ACCESS(vr41xx) |
DEVICE_ACCESS(vr41xx) |
483 |
{ |
{ |
484 |
struct vr41xx_data *d = (struct vr41xx_data *) extra; |
struct vr41xx_data *d = extra; |
485 |
uint64_t idata = 0, odata = 0; |
uint64_t idata = 0, odata = 0; |
486 |
int regnr; |
int regnr; |
487 |
int revision = 0; |
int revision = 0; |
674 |
struct vr41xx_data *dev_vr41xx_init(struct machine *machine, |
struct vr41xx_data *dev_vr41xx_init(struct machine *machine, |
675 |
struct memory *mem, int cpumodel) |
struct memory *mem, int cpumodel) |
676 |
{ |
{ |
677 |
|
struct vr41xx_data *d; |
678 |
uint64_t baseaddr = 0; |
uint64_t baseaddr = 0; |
679 |
char tmps[300]; |
char tmps[300]; |
680 |
int i; |
int i; |
|
struct vr41xx_data *d = malloc(sizeof(struct vr41xx_data)); |
|
681 |
|
|
682 |
if (d == NULL) { |
CHECK_ALLOCATION(d = malloc(sizeof(struct vr41xx_data))); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
683 |
memset(d, 0, sizeof(struct vr41xx_data)); |
memset(d, 0, sizeof(struct vr41xx_data)); |
684 |
|
|
685 |
/* Connect to MIPS irq 2: */ |
/* Connect to MIPS irq 2: */ |
734 |
machine->path, machine->bootstrap_cpu, VRIP_INTR_KIU); |
machine->path, machine->bootstrap_cpu, VRIP_INTR_KIU); |
735 |
INTERRUPT_CONNECT(tmps, d->kiu_irq); |
INTERRUPT_CONNECT(tmps, d->kiu_irq); |
736 |
|
|
737 |
if (machine->use_x11) |
if (machine->x11_md.in_use) |
738 |
machine->main_console_handle = d->kiu_console_handle; |
machine->main_console_handle = d->kiu_console_handle; |
739 |
|
|
740 |
switch (cpumodel) { |
switch (cpumodel) { |
794 |
device_add(machine, tmps); |
device_add(machine, tmps); |
795 |
|
|
796 |
machine_add_tickfunction(machine, dev_vr41xx_tick, d, |
machine_add_tickfunction(machine, dev_vr41xx_tick, d, |
797 |
DEV_VR41XX_TICKSHIFT, 0.0); |
DEV_VR41XX_TICKSHIFT); |
798 |
|
|
799 |
/* Some machines (?) use ISA space at 0x15000000 instead of |
/* Some machines (?) use ISA space at 0x15000000 instead of |
800 |
0x14000000, eg IBM WorkPad Z50. */ |
0x14000000, eg IBM WorkPad Z50. */ |