25
#include "qemu/osdep.h"
27
#include "hw/qdev-properties.h"
28
#include "hw/qdev-properties-system.h"
30
#include "migration/vmstate.h"
31
#include "qemu/module.h"
32
#include "hw/char/escc.h"
33
#include "ui/console.h"
35
#include "qemu/cutils.h"
77
#define CHN_C(s) ((s)->chn == escc_chn_b ? 'b' : 'a')
83
#define CMD_PTR_MASK 0x07
84
#define CMD_CMD_MASK 0x38
86
#define CMD_CLR_TXINT 0x28
87
#define CMD_CLR_IUS 0x38
89
#define INTR_INTALL 0x01
90
#define INTR_TXINT 0x02
91
#define INTR_PAR_SPEC 0x04
92
#define INTR_RXMODEMSK 0x18
93
#define INTR_RXINT1ST 0x08
94
#define INTR_RXINTALL 0x10
95
#define INTR_WTRQ_TXRX 0x20
98
#define RXCTRL_RXEN 0x01
99
#define RXCTRL_HUNT 0x10
101
#define TXCTRL1_PAREN 0x01
102
#define TXCTRL1_PAREV 0x02
103
#define TXCTRL1_1STOP 0x04
104
#define TXCTRL1_1HSTOP 0x08
105
#define TXCTRL1_2STOP 0x0c
106
#define TXCTRL1_STPMSK 0x0c
107
#define TXCTRL1_CLK1X 0x00
108
#define TXCTRL1_CLK16X 0x40
109
#define TXCTRL1_CLK32X 0x80
110
#define TXCTRL1_CLK64X 0xc0
111
#define TXCTRL1_CLKMSK 0xc0
113
#define TXCTRL2_TXCRC 0x01
114
#define TXCTRL2_TXEN 0x08
115
#define TXCTRL2_BITMSK 0x60
116
#define TXCTRL2_5BITS 0x00
117
#define TXCTRL2_7BITS 0x20
118
#define TXCTRL2_6BITS 0x40
119
#define TXCTRL2_8BITS 0x60
124
#define MINTR_VIS 0x01
126
#define MINTR_STATUSHI 0x10
127
#define MINTR_SOFTIACK 0x20
128
#define MINTR_RST_MASK 0xc0
129
#define MINTR_RST_B 0x40
130
#define MINTR_RST_A 0x80
131
#define MINTR_RST_ALL 0xc0
133
#define MISC1_ENC_MASK 0x60
135
#define CLOCK_TRXC 0x08
139
#define MISC2_BRG_EN 0x01
140
#define MISC2_BRG_SRC 0x02
141
#define MISC2_LCL_LOOP 0x10
142
#define MISC2_PLLCMD0 0x20
143
#define MISC2_PLLCMD1 0x40
144
#define MISC2_PLLCMD2 0x80
146
#define EXTINT_DCD 0x08
147
#define EXTINT_SYNCINT 0x10
148
#define EXTINT_CTSINT 0x20
149
#define EXTINT_TXUNDRN 0x40
150
#define EXTINT_BRKINT 0x80
153
#define STATUS_RXAV 0x01
154
#define STATUS_ZERO 0x02
155
#define STATUS_TXEMPTY 0x04
156
#define STATUS_DCD 0x08
157
#define STATUS_SYNC 0x10
158
#define STATUS_CTS 0x20
159
#define STATUS_TXUNDRN 0x40
160
#define STATUS_BRK 0x80
162
#define SPEC_ALLSENT 0x01
163
#define SPEC_BITS8 0x06
165
#define IVEC_TXINTB 0x00
166
#define IVEC_LONOINT 0x06
167
#define IVEC_LORXINTA 0x0c
168
#define IVEC_LORXINTB 0x04
169
#define IVEC_LOTXINTA 0x08
170
#define IVEC_HINOINT 0x60
171
#define IVEC_HIRXINTA 0x30
172
#define IVEC_HIRXINTB 0x20
173
#define IVEC_HITXINTA 0x10
175
#define INTR_EXTINTB 0x01
176
#define INTR_TXINTB 0x02
177
#define INTR_RXINTB 0x04
178
#define INTR_EXTINTA 0x08
179
#define INTR_TXINTA 0x10
180
#define INTR_RXINTA 0x20
188
#define MISC_2CLKMISS 0x40
195
static uint8_t sunkbd_layout_dip_switch(const char *sunkbd_layout);
196
static void handle_kbd_command(ESCCChannelState *s, int val);
197
static int serial_can_receive(void *opaque);
198
static void serial_receive_byte(ESCCChannelState *s, int ch);
200
static int reg_shift(ESCCState *s)
202
return s->bit_swap ? s->it_shift + 1 : s->it_shift;
205
static int chn_shift(ESCCState *s)
207
return s->bit_swap ? s->it_shift : s->it_shift + 1;
210
static void clear_queue(void *opaque)
212
ESCCChannelState *s = opaque;
213
ESCCSERIOQueue *q = &s->queue;
214
q->rptr = q->wptr = q->count = 0;
217
static void put_queue(void *opaque, int b)
219
ESCCChannelState *s = opaque;
220
ESCCSERIOQueue *q = &s->queue;
222
trace_escc_put_queue(CHN_C(s), b);
223
if (q->count >= ESCC_SERIO_QUEUE_SIZE) {
226
q->data[q->wptr] = b;
227
if (++q->wptr == ESCC_SERIO_QUEUE_SIZE) {
231
serial_receive_byte(s, 0);
234
static uint32_t get_queue(void *opaque)
236
ESCCChannelState *s = opaque;
237
ESCCSERIOQueue *q = &s->queue;
243
val = q->data[q->rptr];
244
if (++q->rptr == ESCC_SERIO_QUEUE_SIZE) {
249
trace_escc_get_queue(CHN_C(s), val);
251
serial_receive_byte(s, 0);
256
static int escc_update_irq_chn(ESCCChannelState *s)
258
if ((((s->wregs[W_INTR] & INTR_TXINT) && (s->txint == 1)) ||
260
((((s->wregs[W_INTR] & INTR_RXMODEMSK) == INTR_RXINT1ST) ||
261
((s->wregs[W_INTR] & INTR_RXMODEMSK) == INTR_RXINTALL)) &&
264
((s->wregs[W_EXTINT] & EXTINT_BRKINT) &&
265
(s->rregs[R_STATUS] & STATUS_BRK)))) {
272
static void escc_update_irq(ESCCChannelState *s)
276
irq = escc_update_irq_chn(s);
277
irq |= escc_update_irq_chn(s->otherchn);
279
trace_escc_update_irq(irq);
280
qemu_set_irq(s->irq, irq);
283
static void escc_reset_chn(ESCCChannelState *s)
287
s->rxint = s->txint = 0;
288
s->rxint_under_svc = s->txint_under_svc = 0;
289
s->e0_mode = s->led_mode = s->caps_lock_mode = s->num_lock_mode = 0;
293
static void escc_soft_reset_chn(ESCCChannelState *s)
298
s->wregs[W_INTR] &= INTR_PAR_SPEC | INTR_WTRQ_TXRX;
299
s->wregs[W_RXCTRL] &= ~RXCTRL_RXEN;
301
s->wregs[W_TXCTRL1] |= TXCTRL1_1STOP;
302
s->wregs[W_TXCTRL2] &= TXCTRL2_TXCRC | TXCTRL2_8BITS;
303
s->wregs[W_MINTR] &= ~MINTR_SOFTIACK;
304
s->wregs[W_MISC1] &= MISC1_ENC_MASK;
306
s->wregs[W_MISC2] &= MISC2_BRG_EN | MISC2_BRG_SRC |
307
MISC2_PLLCMD1 | MISC2_PLLCMD2;
308
s->wregs[W_MISC2] |= MISC2_PLLCMD0;
310
s->wregs[W_EXTINT] = EXTINT_DCD | EXTINT_SYNCINT | EXTINT_CTSINT |
311
EXTINT_TXUNDRN | EXTINT_BRKINT;
313
s->rregs[R_STATUS] &= STATUS_DCD | STATUS_SYNC | STATUS_CTS | STATUS_BRK;
314
s->rregs[R_STATUS] |= STATUS_TXEMPTY | STATUS_TXUNDRN;
316
s->rregs[R_STATUS] |= STATUS_DCD | STATUS_SYNC | STATUS_CTS;
318
s->rregs[R_SPEC] &= SPEC_ALLSENT;
319
s->rregs[R_SPEC] |= SPEC_BITS8;
320
s->rregs[R_INTR] = 0;
321
s->rregs[R_MISC] &= MISC_2CLKMISS;
324
static void escc_hard_reset_chn(ESCCChannelState *s)
326
escc_soft_reset_chn(s);
333
s->wregs[W_MINTR] &= MINTR_VIS | MINTR_NV;
334
s->wregs[W_MINTR] |= MINTR_RST_B | MINTR_RST_A;
335
s->wregs[W_MISC1] = 0;
336
s->wregs[W_CLOCK] = CLOCK_TRXC;
337
s->wregs[W_MISC2] &= MISC2_PLLCMD1 | MISC2_PLLCMD2;
338
s->wregs[W_MISC2] |= MISC2_LCL_LOOP | MISC2_PLLCMD0;
341
static void escc_reset(DeviceState *d)
343
ESCCState *s = ESCC(d);
346
for (i = 0; i < 2; i++) {
347
ESCCChannelState *cs = &s->chn[i];
356
for (j = 0; j < ESCC_SERIAL_REGS; j++) {
369
cs->rregs[R_STATUS] |= STATUS_TXEMPTY;
375
static inline void set_rxint(ESCCChannelState *s)
382
s->rxint_under_svc = 1;
383
if (s->chn == escc_chn_a) {
384
s->rregs[R_INTR] |= INTR_RXINTA;
385
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
386
s->otherchn->rregs[R_IVEC] = IVEC_HIRXINTA;
388
s->otherchn->rregs[R_IVEC] = IVEC_LORXINTA;
391
s->otherchn->rregs[R_INTR] |= INTR_RXINTB;
392
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
393
s->rregs[R_IVEC] = IVEC_HIRXINTB;
395
s->rregs[R_IVEC] = IVEC_LORXINTB;
401
static inline void set_txint(ESCCChannelState *s)
404
if (!s->rxint_under_svc) {
405
s->txint_under_svc = 1;
406
if (s->chn == escc_chn_a) {
407
if (s->wregs[W_INTR] & INTR_TXINT) {
408
s->rregs[R_INTR] |= INTR_TXINTA;
410
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
411
s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA;
413
s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA;
416
s->rregs[R_IVEC] = IVEC_TXINTB;
417
if (s->wregs[W_INTR] & INTR_TXINT) {
418
s->otherchn->rregs[R_INTR] |= INTR_TXINTB;
425
static inline void clr_rxint(ESCCChannelState *s)
428
s->rxint_under_svc = 0;
429
if (s->chn == escc_chn_a) {
430
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
431
s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
433
s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
435
s->rregs[R_INTR] &= ~INTR_RXINTA;
437
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
438
s->rregs[R_IVEC] = IVEC_HINOINT;
440
s->rregs[R_IVEC] = IVEC_LONOINT;
442
s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB;
450
static inline void clr_txint(ESCCChannelState *s)
453
s->txint_under_svc = 0;
454
if (s->chn == escc_chn_a) {
455
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
456
s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
458
s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
460
s->rregs[R_INTR] &= ~INTR_TXINTA;
462
s->otherchn->rregs[R_INTR] &= ~INTR_TXINTB;
463
if (s->wregs[W_MINTR] & MINTR_STATUSHI) {
464
s->rregs[R_IVEC] = IVEC_HINOINT;
466
s->rregs[R_IVEC] = IVEC_LONOINT;
468
s->otherchn->rregs[R_INTR] &= ~INTR_TXINTB;
476
static void escc_update_parameters(ESCCChannelState *s)
478
int speed, parity, data_bits, stop_bits;
479
QEMUSerialSetParams ssp;
481
if (!qemu_chr_fe_backend_connected(&s->chr) || s->type != escc_serial) {
485
if (s->wregs[W_TXCTRL1] & TXCTRL1_PAREN) {
486
if (s->wregs[W_TXCTRL1] & TXCTRL1_PAREV) {
494
if ((s->wregs[W_TXCTRL1] & TXCTRL1_STPMSK) == TXCTRL1_2STOP) {
499
switch (s->wregs[W_TXCTRL2] & TXCTRL2_BITMSK) {
514
speed = s->clock / ((s->wregs[W_BRGLO] | (s->wregs[W_BRGHI] << 8)) + 2);
515
switch (s->wregs[W_TXCTRL1] & TXCTRL1_CLKMSK) {
531
ssp.data_bits = data_bits;
532
ssp.stop_bits = stop_bits;
533
trace_escc_update_parameters(CHN_C(s), speed, parity, data_bits, stop_bits);
534
qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
537
static void escc_mem_write(void *opaque, hwaddr addr,
538
uint64_t val, unsigned size)
540
ESCCState *serial = opaque;
546
saddr = (addr >> reg_shift(serial)) & 1;
547
channel = (addr >> chn_shift(serial)) & 1;
548
s = &serial->chn[channel];
551
trace_escc_mem_writeb_ctrl(CHN_C(s), s->reg, val & 0xff);
555
newreg = val & CMD_PTR_MASK;
565
if (s->rxint_under_svc) {
566
s->rxint_under_svc = 0;
570
} else if (s->txint_under_svc) {
571
s->txint_under_svc = 0;
580
s->wregs[s->reg] = val;
581
if (val & RXCTRL_HUNT) {
582
s->rregs[R_STATUS] |= STATUS_SYNC;
585
case W_INTR ... W_IVEC:
586
case W_SYNC1 ... W_TXBUF:
587
case W_MISC1 ... W_CLOCK:
588
case W_MISC2 ... W_EXTINT:
589
s->wregs[s->reg] = val;
592
s->wregs[s->reg] = val;
603
s->rregs[R_SPEC] |= SPEC_ALLSENT;
604
escc_update_parameters(s);
607
s->wregs[s->reg] = val;
608
escc_update_parameters(s);
612
s->wregs[s->reg] = val;
613
s->rregs[s->reg] = val;
614
escc_update_parameters(s);
617
switch (val & MINTR_RST_MASK) {
622
trace_escc_soft_reset_chn(CHN_C(&serial->chn[0]));
623
escc_soft_reset_chn(&serial->chn[0]);
626
trace_escc_soft_reset_chn(CHN_C(&serial->chn[1]));
627
escc_soft_reset_chn(&serial->chn[1]);
630
trace_escc_hard_reset();
631
escc_hard_reset_chn(&serial->chn[0]);
632
escc_hard_reset_chn(&serial->chn[1]);
646
trace_escc_mem_writeb_data(CHN_C(s), val);
655
if (s->wregs[W_TXCTRL2] & TXCTRL2_TXEN) {
656
if (s->wregs[W_MISC2] & MISC2_LCL_LOOP) {
657
serial_receive_byte(s, s->tx);
658
} else if (qemu_chr_fe_backend_connected(&s->chr)) {
663
qemu_chr_fe_write_all(&s->chr, &s->tx, 1);
664
} else if (s->type == escc_kbd && !s->disabled) {
665
handle_kbd_command(s, val);
668
s->rregs[R_STATUS] |= STATUS_TXEMPTY;
669
s->rregs[R_SPEC] |= SPEC_ALLSENT;
677
static uint64_t escc_mem_read(void *opaque, hwaddr addr,
680
ESCCState *serial = opaque;
686
saddr = (addr >> reg_shift(serial)) & 1;
687
channel = (addr >> chn_shift(serial)) & 1;
688
s = &serial->chn[channel];
691
trace_escc_mem_readb_ctrl(CHN_C(s), s->reg, s->rregs[s->reg]);
692
ret = s->rregs[s->reg];
696
s->rregs[R_STATUS] &= ~STATUS_RXAV;
698
if (s->type == escc_kbd || s->type == escc_mouse) {
703
trace_escc_mem_readb_data(CHN_C(s), ret);
704
qemu_chr_fe_accept_input(&s->chr);
712
static const MemoryRegionOps escc_mem_ops = {
713
.read = escc_mem_read,
714
.write = escc_mem_write,
715
.endianness = DEVICE_NATIVE_ENDIAN,
717
.min_access_size = 1,
718
.max_access_size = 1,
722
static int serial_can_receive(void *opaque)
724
ESCCChannelState *s = opaque;
727
if (((s->wregs[W_RXCTRL] & RXCTRL_RXEN) == 0)
728
|| ((s->rregs[R_STATUS] & STATUS_RXAV) == STATUS_RXAV)) {
737
static void serial_receive_byte(ESCCChannelState *s, int ch)
739
trace_escc_serial_receive_byte(CHN_C(s), ch);
740
s->rregs[R_STATUS] |= STATUS_RXAV;
745
static void serial_receive_break(ESCCChannelState *s)
747
s->rregs[R_STATUS] |= STATUS_BRK;
751
static void serial_receive1(void *opaque, const uint8_t *buf, int size)
753
ESCCChannelState *s = opaque;
754
serial_receive_byte(s, buf[0]);
757
static void serial_event(void *opaque, QEMUChrEvent event)
759
ESCCChannelState *s = opaque;
760
if (event == CHR_EVENT_BREAK) {
761
serial_receive_break(s);
765
static const VMStateDescription vmstate_escc_chn = {
768
.minimum_version_id = 1,
769
.fields = (const VMStateField[]) {
770
VMSTATE_UINT32(vmstate_dummy, ESCCChannelState),
771
VMSTATE_UINT32(reg, ESCCChannelState),
772
VMSTATE_UINT32(rxint, ESCCChannelState),
773
VMSTATE_UINT32(txint, ESCCChannelState),
774
VMSTATE_UINT32(rxint_under_svc, ESCCChannelState),
775
VMSTATE_UINT32(txint_under_svc, ESCCChannelState),
776
VMSTATE_UINT8(rx, ESCCChannelState),
777
VMSTATE_UINT8(tx, ESCCChannelState),
778
VMSTATE_BUFFER(wregs, ESCCChannelState),
779
VMSTATE_BUFFER(rregs, ESCCChannelState),
780
VMSTATE_END_OF_LIST()
784
static const VMStateDescription vmstate_escc = {
787
.minimum_version_id = 1,
788
.fields = (const VMStateField[]) {
789
VMSTATE_STRUCT_ARRAY(chn, ESCCState, 2, 2, vmstate_escc_chn,
791
VMSTATE_END_OF_LIST()
795
static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src,
798
ESCCChannelState *s = (ESCCChannelState *)dev;
802
assert(evt->type == INPUT_EVENT_KIND_KEY);
803
key = evt->u.key.data;
804
qcode = qemu_input_key_value_to_qcode(key->key);
805
trace_escc_sunkbd_event_in(qcode, QKeyCode_str(qcode),
808
if (qcode == Q_KEY_CODE_CAPS_LOCK) {
810
s->caps_lock_mode ^= 1;
811
if (s->caps_lock_mode == 2) {
815
s->caps_lock_mode ^= 2;
816
if (s->caps_lock_mode == 3) {
822
if (qcode == Q_KEY_CODE_NUM_LOCK) {
824
s->num_lock_mode ^= 1;
825
if (s->num_lock_mode == 2) {
829
s->num_lock_mode ^= 2;
830
if (s->num_lock_mode == 3) {
836
if (qcode >= qemu_input_map_qcode_to_sun_len) {
840
keycode = qemu_input_map_qcode_to_sun[qcode];
844
trace_escc_sunkbd_event_out(keycode);
845
put_queue(s, keycode);
848
static const QemuInputHandler sunkbd_handler = {
849
.name = "sun keyboard",
850
.mask = INPUT_EVENT_MASK_KEY,
851
.event = sunkbd_handle_event,
854
static uint8_t sunkbd_layout_dip_switch(const char *kbd_layout)
857
static uint8_t ret = 0xff;
859
if ((ret == 0xff) && kbd_layout) {
861
struct layout_values {
901
i < sizeof(languages) / sizeof(struct layout_values);
903
if (!strcmp(kbd_layout, languages[i].lang)) {
904
ret = languages[i].dip;
910
if ((kbd_layout[0] >= '0') && (kbd_layout[0] <= '9')) {
914
if (!qemu_strtoui(kbd_layout, NULL, 0, &tmp)) {
927
static void handle_kbd_command(ESCCChannelState *s, int val)
929
trace_escc_kbd_command(val);
948
put_queue(s, sunkbd_layout_dip_switch(s->sunkbd_layout));
955
static void sunmouse_event(void *opaque,
956
int dx, int dy, int dz, int buttons_state)
958
ESCCChannelState *s = opaque;
961
trace_escc_sunmouse_event(dx, dy, buttons_state);
964
if (buttons_state & MOUSE_EVENT_LBUTTON) {
967
if (buttons_state & MOUSE_EVENT_MBUTTON) {
970
if (buttons_state & MOUSE_EVENT_RBUTTON) {
980
} else if (ch < -127) {
984
put_queue(s, ch & 0xff);
990
} else if (ch < -127) {
994
put_queue(s, ch & 0xff);
1002
static void escc_init1(Object *obj)
1004
ESCCState *s = ESCC(obj);
1005
SysBusDevice *dev = SYS_BUS_DEVICE(obj);
1008
for (i = 0; i < 2; i++) {
1009
sysbus_init_irq(dev, &s->chn[i].irq);
1010
s->chn[i].chn = 1 - i;
1012
s->chn[0].otherchn = &s->chn[1];
1013
s->chn[1].otherchn = &s->chn[0];
1015
sysbus_init_mmio(dev, &s->mmio);
1018
static void escc_realize(DeviceState *dev, Error **errp)
1020
ESCCState *s = ESCC(dev);
1023
s->chn[0].disabled = s->disabled;
1024
s->chn[1].disabled = s->disabled;
1026
memory_region_init_io(&s->mmio, OBJECT(dev), &escc_mem_ops, s, "escc",
1027
ESCC_SIZE << s->it_shift);
1029
for (i = 0; i < 2; i++) {
1030
if (qemu_chr_fe_backend_connected(&s->chn[i].chr)) {
1031
s->chn[i].clock = s->frequency / 2;
1032
qemu_chr_fe_set_handlers(&s->chn[i].chr, serial_can_receive,
1033
serial_receive1, serial_event, NULL,
1034
&s->chn[i], NULL, true);
1038
if (s->chn[0].type == escc_mouse) {
1039
qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0,
1042
if (s->chn[1].type == escc_kbd) {
1043
s->chn[1].hs = qemu_input_handler_register((DeviceState *)(&s->chn[1]),
1048
static Property escc_properties[] = {
1049
DEFINE_PROP_UINT32("frequency", ESCCState, frequency, 0),
1050
DEFINE_PROP_UINT32("it_shift", ESCCState, it_shift, 0),
1051
DEFINE_PROP_BOOL("bit_swap", ESCCState, bit_swap, false),
1052
DEFINE_PROP_UINT32("disabled", ESCCState, disabled, 0),
1053
DEFINE_PROP_UINT32("chnBtype", ESCCState, chn[0].type, 0),
1054
DEFINE_PROP_UINT32("chnAtype", ESCCState, chn[1].type, 0),
1055
DEFINE_PROP_CHR("chrB", ESCCState, chn[0].chr),
1056
DEFINE_PROP_CHR("chrA", ESCCState, chn[1].chr),
1057
DEFINE_PROP_STRING("chnA-sunkbd-layout", ESCCState, chn[1].sunkbd_layout),
1058
DEFINE_PROP_END_OF_LIST(),
1061
static void escc_class_init(ObjectClass *klass, void *data)
1063
DeviceClass *dc = DEVICE_CLASS(klass);
1065
dc->reset = escc_reset;
1066
dc->realize = escc_realize;
1067
dc->vmsd = &vmstate_escc;
1068
device_class_set_props(dc, escc_properties);
1069
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
1072
static const TypeInfo escc_info = {
1074
.parent = TYPE_SYS_BUS_DEVICE,
1075
.instance_size = sizeof(ESCCState),
1076
.instance_init = escc_init1,
1077
.class_init = escc_class_init,
1080
static void escc_register_types(void)
1082
type_register_static(&escc_info);
1085
type_init(escc_register_types)