aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/slavio_serial.c15
-rw-r--r--hw/sun4m.c3
-rw-r--r--hw/sun4m.h3
3 files changed, 16 insertions, 5 deletions
diff --git a/hw/slavio_serial.c b/hw/slavio_serial.c
index 6705d4429a..42d233ee69 100644
--- a/hw/slavio_serial.c
+++ b/hw/slavio_serial.c
@@ -100,6 +100,7 @@ typedef struct ChannelState {
SERIOQueue queue;
CharDriverState *chr;
int e0_mode, led_mode, caps_lock_mode, num_lock_mode;
+ int disabled;
} ChannelState;
struct SerialState {
@@ -193,7 +194,10 @@ static void slavio_serial_reset_chn(ChannelState *s)
s->wregs[11] = 8;
s->wregs[14] = 0x30;
s->wregs[15] = 0xf8;
- s->rregs[0] = 0x44;
+ if (s->disabled)
+ s->rregs[0] = 0x7c;
+ else
+ s->rregs[0] = 0x44;
s->rregs[1] = 6;
s->rx = s->tx = 0;
@@ -437,7 +441,7 @@ static void slavio_serial_mem_writeb(void *opaque, target_phys_addr_t addr, uint
if (s->wregs[5] & 8) { // tx enabled
if (s->chr)
qemu_chr_write(s->chr, &s->tx, 1);
- else if (s->type == kbd) {
+ else if (s->type == kbd && !s->disabled) {
handle_kbd_command(s, val);
}
}
@@ -611,6 +615,8 @@ SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq,
s->chn[0].chr = chr1;
s->chn[1].chr = chr2;
+ s->chn[0].disabled = 0;
+ s->chn[1].disabled = 0;
for (i = 0; i < 2; i++) {
s->chn[i].irq = irq;
@@ -765,7 +771,8 @@ static void sunmouse_event(void *opaque,
put_queue(s, 0);
}
-void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq)
+void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
+ int disabled)
{
int slavio_serial_io_memory, i;
SerialState *s;
@@ -782,6 +789,8 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq)
s->chn[1].otherchn = &s->chn[0];
s->chn[0].type = mouse;
s->chn[1].type = kbd;
+ s->chn[0].disabled = disabled;
+ s->chn[1].disabled = disabled;
slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s);
cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory);
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 428519a5a5..141a21e1a0 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -436,7 +436,8 @@ static void sun4m_hw_init(const struct hwdef *hwdef, int RAM_size,
slavio_timer_init_all(hwdef->counter_base, slavio_irq[hwdef->clock1_irq],
slavio_cpu_irq);
- slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[hwdef->ms_kb_irq]);
+ slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[hwdef->ms_kb_irq],
+ nographic);
// Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device
// Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device
slavio_serial_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq],
diff --git a/hw/sun4m.h b/hw/sun4m.h
index e0ae5faf97..1e8ffbb076 100644
--- a/hw/sun4m.h
+++ b/hw/sun4m.h
@@ -41,7 +41,8 @@ void slavio_timer_init_all(target_phys_addr_t base, qemu_irq master_irq,
/* slavio_serial.c */
SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq,
CharDriverState *chr1, CharDriverState *chr2);
-void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq);
+void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
+ int disabled);
/* slavio_misc.c */
void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base,