544
561
s->identify_set = 1;
564
static void ide_cfata_identify(IDEState *s)
570
p = (uint16_t *) s->identify_data;
574
memset(p, 0, sizeof(s->identify_data));
576
cur_sec = s->cylinders * s->heads * s->sectors;
578
put_le16(p + 0, 0x848a); /* CF Storage Card signature */
579
put_le16(p + 1, s->cylinders); /* Default cylinders */
580
put_le16(p + 3, s->heads); /* Default heads */
581
put_le16(p + 6, s->sectors); /* Default sectors per track */
582
put_le16(p + 7, s->nb_sectors >> 16); /* Sectors per card */
583
put_le16(p + 8, s->nb_sectors); /* Sectors per card */
584
snprintf(buf, sizeof(buf), "QM%05d", s->drive_serial);
585
padstr((uint8_t *)(p + 10), buf, 20); /* Serial number in ASCII */
586
put_le16(p + 22, 0x0004); /* ECC bytes */
587
padstr((uint8_t *) (p + 23), QEMU_VERSION, 8); /* Firmware Revision */
588
padstr((uint8_t *) (p + 27), "QEMU MICRODRIVE", 40);/* Model number */
589
#if MAX_MULT_SECTORS > 1
590
put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
592
put_le16(p + 47, 0x0000);
594
put_le16(p + 49, 0x0f00); /* Capabilities */
595
put_le16(p + 51, 0x0002); /* PIO cycle timing mode */
596
put_le16(p + 52, 0x0001); /* DMA cycle timing mode */
597
put_le16(p + 53, 0x0003); /* Translation params valid */
598
put_le16(p + 54, s->cylinders); /* Current cylinders */
599
put_le16(p + 55, s->heads); /* Current heads */
600
put_le16(p + 56, s->sectors); /* Current sectors */
601
put_le16(p + 57, cur_sec); /* Current capacity */
602
put_le16(p + 58, cur_sec >> 16); /* Current capacity */
603
if (s->mult_sectors) /* Multiple sector setting */
604
put_le16(p + 59, 0x100 | s->mult_sectors);
605
put_le16(p + 60, s->nb_sectors); /* Total LBA sectors */
606
put_le16(p + 61, s->nb_sectors >> 16); /* Total LBA sectors */
607
put_le16(p + 63, 0x0203); /* Multiword DMA capability */
608
put_le16(p + 64, 0x0001); /* Flow Control PIO support */
609
put_le16(p + 65, 0x0096); /* Min. Multiword DMA cycle */
610
put_le16(p + 66, 0x0096); /* Rec. Multiword DMA cycle */
611
put_le16(p + 68, 0x00b4); /* Min. PIO cycle time */
612
put_le16(p + 82, 0x400c); /* Command Set supported */
613
put_le16(p + 83, 0x7068); /* Command Set supported */
614
put_le16(p + 84, 0x4000); /* Features supported */
615
put_le16(p + 85, 0x000c); /* Command Set enabled */
616
put_le16(p + 86, 0x7044); /* Command Set enabled */
617
put_le16(p + 87, 0x4000); /* Features enabled */
618
put_le16(p + 91, 0x4060); /* Current APM level */
619
put_le16(p + 129, 0x0002); /* Current features option */
620
put_le16(p + 130, 0x0005); /* Reassigned sectors */
621
put_le16(p + 131, 0x0001); /* Initial power mode */
622
put_le16(p + 132, 0x0000); /* User signature */
623
put_le16(p + 160, 0x8100); /* Power requirement */
624
put_le16(p + 161, 0x8001); /* CF command set */
629
memcpy(s->io_buffer, p, sizeof(s->identify_data));
547
632
static void ide_set_signature(IDEState *s)
549
634
s->select &= 0xf0; /* clear head */
2777
3026
/* hd_table must contain 4 block drivers */
2778
3027
/* PowerMac uses memory mapped registers, not I/O. Return the memory
2779
3028
I/O index to access the ide. */
2780
int pmac_ide_init (BlockDriverState **hd_table,
2781
SetIRQFunc *set_irq, void *irq_opaque, int irq)
3029
int pmac_ide_init (BlockDriverState **hd_table, qemu_irq irq)
2783
3031
IDEState *ide_if;
2784
3032
int pmac_ide_memory;
2786
3034
ide_if = qemu_mallocz(sizeof(IDEState) * 2);
2787
ide_init2(&ide_if[0], hd_table[0], hd_table[1],
2788
set_irq, irq_opaque, irq);
3035
ide_init2(&ide_if[0], hd_table[0], hd_table[1], irq);
2790
3037
pmac_ide_memory = cpu_register_io_memory(0, pmac_ide_read,
2791
3038
pmac_ide_write, &ide_if[0]);
2792
3039
return pmac_ide_memory;
3042
/***********************************************************/
3043
/* CF-ATA Microdrive */
3045
#define METADATA_SIZE 0x20
3047
/* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface. */
3050
struct pcmcia_card_s card;
3064
/* Register bitfields */
3067
OPT_MODE_IOMAP16 = 1,
3068
OPT_MODE_IOMAP1 = 2,
3069
OPT_MODE_IOMAP2 = 3,
3080
STAT_CHANGED = 0x80,
3091
static inline void md_interrupt_update(struct md_s *s)
3096
qemu_set_irq(s->card.slot->irq,
3097
!(s->stat & STAT_INT) && /* Inverted */
3098
!(s->ctrl & (CTRL_IEN | CTRL_SRST)) &&
3099
!(s->opt & OPT_SRESET));
3102
static void md_set_irq(void *opaque, int irq, int level)
3104
struct md_s *s = (struct md_s *) opaque;
3106
s->stat |= STAT_INT;
3108
s->stat &= ~STAT_INT;
3110
md_interrupt_update(s);
3113
static void md_reset(struct md_s *s)
3115
s->opt = OPT_MODE_MMAP;
3123
static uint8_t md_attr_read(void *opaque, uint32_t at)
3125
struct md_s *s = (struct md_s *) opaque;
3126
if (at < s->attr_base) {
3127
if (at < s->card.cis_len)
3128
return s->card.cis[at];
3136
case 0x00: /* Configuration Option Register */
3138
case 0x02: /* Card Configuration Status Register */
3139
if (s->ctrl & CTRL_IEN)
3140
return s->stat & ~STAT_INT;
3143
case 0x04: /* Pin Replacement Register */
3144
return (s->pins & PINS_CRDY) | 0x0c;
3145
case 0x06: /* Socket and Copy Register */
3149
printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at);
3156
static void md_attr_write(void *opaque, uint32_t at, uint8_t value)
3158
struct md_s *s = (struct md_s *) opaque;
3162
case 0x00: /* Configuration Option Register */
3163
s->opt = value & 0xcf;
3164
if (value & OPT_SRESET)
3166
md_interrupt_update(s);
3168
case 0x02: /* Card Configuration Status Register */
3169
if ((s->stat ^ value) & STAT_PWRDWN)
3170
s->pins |= PINS_CRDY;
3172
s->stat |= value & 0x74;
3173
md_interrupt_update(s);
3174
/* Word 170 in Identify Device must be equal to STAT_XE */
3176
case 0x04: /* Pin Replacement Register */
3177
s->pins &= PINS_CRDY;
3178
s->pins |= value & PINS_MRDY;
3180
case 0x06: /* Socket and Copy Register */
3183
printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at);
3187
static uint16_t md_common_read(void *opaque, uint32_t at)
3189
struct md_s *s = (struct md_s *) opaque;
3193
switch (s->opt & OPT_MODE) {
3195
if ((at & ~0x3ff) == 0x400)
3198
case OPT_MODE_IOMAP16:
3201
case OPT_MODE_IOMAP1:
3202
if ((at & ~0xf) == 0x3f0)
3204
else if ((at & ~0xf) == 0x1f0)
3207
case OPT_MODE_IOMAP2:
3208
if ((at & ~0xf) == 0x370)
3210
else if ((at & ~0xf) == 0x170)
3215
case 0x0: /* Even RD Data */
3217
return ide_data_readw(s->ide, 0);
3219
/* TODO: 8-bit accesses */
3223
s->io = ide_data_readw(s->ide, 0);
3226
s->cycle = !s->cycle;
3228
case 0x9: /* Odd RD Data */
3230
case 0xd: /* Error */
3231
return ide_ioport_read(s->ide, 0x1);
3232
case 0xe: /* Alternate Status */
3233
if (s->ide->cur_drive->bs)
3234
return s->ide->cur_drive->status;
3237
case 0xf: /* Device Address */
3238
return 0xc2 | ((~s->ide->select << 2) & 0x3c);
3240
return ide_ioport_read(s->ide, at);
3246
static void md_common_write(void *opaque, uint32_t at, uint16_t value)
3248
struct md_s *s = (struct md_s *) opaque;
3251
switch (s->opt & OPT_MODE) {
3253
if ((at & ~0x3ff) == 0x400)
3256
case OPT_MODE_IOMAP16:
3259
case OPT_MODE_IOMAP1:
3260
if ((at & ~0xf) == 0x3f0)
3262
else if ((at & ~0xf) == 0x1f0)
3265
case OPT_MODE_IOMAP2:
3266
if ((at & ~0xf) == 0x370)
3268
else if ((at & ~0xf) == 0x170)
3273
case 0x0: /* Even WR Data */
3275
ide_data_writew(s->ide, 0, value);
3278
/* TODO: 8-bit accesses */
3280
ide_data_writew(s->ide, 0, s->io | (value << 8));
3282
s->io = value & 0xff;
3283
s->cycle = !s->cycle;
3286
s->io = value & 0xff;
3287
s->cycle = !s->cycle;
3289
case 0xd: /* Features */
3290
ide_ioport_write(s->ide, 0x1, value);
3292
case 0xe: /* Device Control */
3294
if (value & CTRL_SRST)
3296
md_interrupt_update(s);
3299
if (s->stat & STAT_PWRDWN) {
3300
s->pins |= PINS_CRDY;
3301
s->stat &= ~STAT_PWRDWN;
3303
ide_ioport_write(s->ide, at, value);
3307
static void md_save(QEMUFile *f, void *opaque)
3309
struct md_s *s = (struct md_s *) opaque;
3311
uint8_t drive1_selected;
3313
qemu_put_8s(f, &s->opt);
3314
qemu_put_8s(f, &s->stat);
3315
qemu_put_8s(f, &s->pins);
3317
qemu_put_8s(f, &s->ctrl);
3318
qemu_put_be16s(f, &s->io);
3319
qemu_put_byte(f, s->cycle);
3321
drive1_selected = (s->ide->cur_drive != s->ide);
3322
qemu_put_8s(f, &s->ide->cmd);
3323
qemu_put_8s(f, &drive1_selected);
3325
for (i = 0; i < 2; i ++)
3326
ide_save(f, &s->ide[i]);
3329
static int md_load(QEMUFile *f, void *opaque, int version_id)
3331
struct md_s *s = (struct md_s *) opaque;
3333
uint8_t drive1_selected;
3335
qemu_get_8s(f, &s->opt);
3336
qemu_get_8s(f, &s->stat);
3337
qemu_get_8s(f, &s->pins);
3339
qemu_get_8s(f, &s->ctrl);
3340
qemu_get_be16s(f, &s->io);
3341
s->cycle = qemu_get_byte(f);
3343
qemu_get_8s(f, &s->ide->cmd);
3344
qemu_get_8s(f, &drive1_selected);
3345
s->ide->cur_drive = &s->ide[(drive1_selected != 0)];
3347
for (i = 0; i < 2; i ++)
3348
ide_load(f, &s->ide[i]);
3353
static int md_iid = 0;
3355
static const uint8_t dscm1xxxx_cis[0x14a] = {
3356
[0x000] = CISTPL_DEVICE, /* 5V Device Information */
3357
[0x002] = 0x03, /* Tuple length = 4 bytes */
3358
[0x004] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
3359
[0x006] = 0x01, /* Size = 2K bytes */
3360
[0x008] = CISTPL_ENDMARK,
3362
[0x00a] = CISTPL_DEVICE_OC, /* Additional Device Information */
3363
[0x00c] = 0x04, /* Tuple length = 4 byest */
3364
[0x00e] = 0x03, /* Conditions: Ext = 0, Vcc 3.3V, MWAIT = 1 */
3365
[0x010] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */
3366
[0x012] = 0x01, /* Size = 2K bytes */
3367
[0x014] = CISTPL_ENDMARK,
3369
[0x016] = CISTPL_JEDEC_C, /* JEDEC ID */
3370
[0x018] = 0x02, /* Tuple length = 2 bytes */
3371
[0x01a] = 0xdf, /* PC Card ATA with no Vpp required */
3374
[0x01e] = CISTPL_MANFID, /* Manufacture ID */
3375
[0x020] = 0x04, /* Tuple length = 4 bytes */
3376
[0x022] = 0xa4, /* TPLMID_MANF = 00a4 (IBM) */
3378
[0x026] = 0x00, /* PLMID_CARD = 0000 */
3381
[0x02a] = CISTPL_VERS_1, /* Level 1 Version */
3382
[0x02c] = 0x12, /* Tuple length = 23 bytes */
3383
[0x02e] = 0x04, /* Major Version = JEIDA 4.2 / PCMCIA 2.1 */
3384
[0x030] = 0x01, /* Minor Version = 1 */
3400
[0x050] = CISTPL_ENDMARK,
3402
[0x052] = CISTPL_FUNCID, /* Function ID */
3403
[0x054] = 0x02, /* Tuple length = 2 bytes */
3404
[0x056] = 0x04, /* TPLFID_FUNCTION = Fixed Disk */
3405
[0x058] = 0x01, /* TPLFID_SYSINIT: POST = 1, ROM = 0 */
3407
[0x05a] = CISTPL_FUNCE, /* Function Extension */
3408
[0x05c] = 0x02, /* Tuple length = 2 bytes */
3409
[0x05e] = 0x01, /* TPLFE_TYPE = Disk Device Interface */
3410
[0x060] = 0x01, /* TPLFE_DATA = PC Card ATA Interface */
3412
[0x062] = CISTPL_FUNCE, /* Function Extension */
3413
[0x064] = 0x03, /* Tuple length = 3 bytes */
3414
[0x066] = 0x02, /* TPLFE_TYPE = Basic PC Card ATA Interface */
3415
[0x068] = 0x08, /* TPLFE_DATA: Rotating, Unique, Single */
3416
[0x06a] = 0x0f, /* TPLFE_DATA: Sleep, Standby, Idle, Auto */
3418
[0x06c] = CISTPL_CONFIG, /* Configuration */
3419
[0x06e] = 0x05, /* Tuple length = 5 bytes */
3420
[0x070] = 0x01, /* TPCC_RASZ = 2 bytes, TPCC_RMSZ = 1 byte */
3421
[0x072] = 0x07, /* TPCC_LAST = 7 */
3422
[0x074] = 0x00, /* TPCC_RADR = 0200 */
3424
[0x078] = 0x0f, /* TPCC_RMSK = 200, 202, 204, 206 */
3426
[0x07a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3427
[0x07c] = 0x0b, /* Tuple length = 11 bytes */
3428
[0x07e] = 0xc0, /* TPCE_INDX = Memory Mode, Default, Iface */
3429
[0x080] = 0xc0, /* TPCE_IF = Memory, no BVDs, no WP, READY */
3430
[0x082] = 0xa1, /* TPCE_FS = Vcc only, no I/O, Memory, Misc */
3431
[0x084] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
3432
[0x086] = 0x55, /* NomV: 5.0 V */
3433
[0x088] = 0x4d, /* MinV: 4.5 V */
3434
[0x08a] = 0x5d, /* MaxV: 5.5 V */
3435
[0x08c] = 0x4e, /* Peakl: 450 mA */
3436
[0x08e] = 0x08, /* TPCE_MS = 1 window, 1 byte, Host address */
3437
[0x090] = 0x00, /* Window descriptor: Window length = 0 */
3438
[0x092] = 0x20, /* TPCE_MI: support power down mode, RW */
3440
[0x094] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3441
[0x096] = 0x06, /* Tuple length = 6 bytes */
3442
[0x098] = 0x00, /* TPCE_INDX = Memory Mode, no Default */
3443
[0x09a] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
3444
[0x09c] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
3445
[0x09e] = 0xb5, /* NomV: 3.3 V */
3447
[0x0a2] = 0x3e, /* Peakl: 350 mA */
3449
[0x0a4] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3450
[0x0a6] = 0x0d, /* Tuple length = 13 bytes */
3451
[0x0a8] = 0xc1, /* TPCE_INDX = I/O and Memory Mode, Default */
3452
[0x0aa] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
3453
[0x0ac] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
3454
[0x0ae] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
3455
[0x0b0] = 0x55, /* NomV: 5.0 V */
3456
[0x0b2] = 0x4d, /* MinV: 4.5 V */
3457
[0x0b4] = 0x5d, /* MaxV: 5.5 V */
3458
[0x0b6] = 0x4e, /* Peakl: 450 mA */
3459
[0x0b8] = 0x64, /* TPCE_IO = 16-byte boundary, 16/8 accesses */
3460
[0x0ba] = 0xf0, /* TPCE_IR = MASK, Level, Pulse, Share */
3461
[0x0bc] = 0xff, /* IRQ0..IRQ7 supported */
3462
[0x0be] = 0xff, /* IRQ8..IRQ15 supported */
3463
[0x0c0] = 0x20, /* TPCE_MI = support power down mode */
3465
[0x0c2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3466
[0x0c4] = 0x06, /* Tuple length = 6 bytes */
3467
[0x0c6] = 0x01, /* TPCE_INDX = I/O and Memory Mode */
3468
[0x0c8] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
3469
[0x0ca] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
3470
[0x0cc] = 0xb5, /* NomV: 3.3 V */
3472
[0x0d0] = 0x3e, /* Peakl: 350 mA */
3474
[0x0d2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3475
[0x0d4] = 0x12, /* Tuple length = 18 bytes */
3476
[0x0d6] = 0xc2, /* TPCE_INDX = I/O Primary Mode */
3477
[0x0d8] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
3478
[0x0da] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
3479
[0x0dc] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
3480
[0x0de] = 0x55, /* NomV: 5.0 V */
3481
[0x0e0] = 0x4d, /* MinV: 4.5 V */
3482
[0x0e2] = 0x5d, /* MaxV: 5.5 V */
3483
[0x0e4] = 0x4e, /* Peakl: 450 mA */
3484
[0x0e6] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
3485
[0x0e8] = 0x61, /* Range: 2 fields, 2 bytes addr, 1 byte len */
3486
[0x0ea] = 0xf0, /* Field 1 address = 0x01f0 */
3488
[0x0ee] = 0x07, /* Address block length = 8 */
3489
[0x0f0] = 0xf6, /* Field 2 address = 0x03f6 */
3491
[0x0f4] = 0x01, /* Address block length = 2 */
3492
[0x0f6] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
3493
[0x0f8] = 0x20, /* TPCE_MI = support power down mode */
3495
[0x0fa] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3496
[0x0fc] = 0x06, /* Tuple length = 6 bytes */
3497
[0x0fe] = 0x02, /* TPCE_INDX = I/O Primary Mode, no Default */
3498
[0x100] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
3499
[0x102] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
3500
[0x104] = 0xb5, /* NomV: 3.3 V */
3502
[0x108] = 0x3e, /* Peakl: 350 mA */
3504
[0x10a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3505
[0x10c] = 0x12, /* Tuple length = 18 bytes */
3506
[0x10e] = 0xc3, /* TPCE_INDX = I/O Secondary Mode, Default */
3507
[0x110] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */
3508
[0x112] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */
3509
[0x114] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */
3510
[0x116] = 0x55, /* NomV: 5.0 V */
3511
[0x118] = 0x4d, /* MinV: 4.5 V */
3512
[0x11a] = 0x5d, /* MaxV: 5.5 V */
3513
[0x11c] = 0x4e, /* Peakl: 450 mA */
3514
[0x11e] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */
3515
[0x120] = 0x61, /* Range: 2 fields, 2 byte addr, 1 byte len */
3516
[0x122] = 0x70, /* Field 1 address = 0x0170 */
3518
[0x126] = 0x07, /* Address block length = 8 */
3519
[0x128] = 0x76, /* Field 2 address = 0x0376 */
3521
[0x12c] = 0x01, /* Address block length = 2 */
3522
[0x12e] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */
3523
[0x130] = 0x20, /* TPCE_MI = support power down mode */
3525
[0x132] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */
3526
[0x134] = 0x06, /* Tuple length = 6 bytes */
3527
[0x136] = 0x03, /* TPCE_INDX = I/O Secondary Mode */
3528
[0x138] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */
3529
[0x13a] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */
3530
[0x13c] = 0xb5, /* NomV: 3.3 V */
3532
[0x140] = 0x3e, /* Peakl: 350 mA */
3534
[0x142] = CISTPL_NO_LINK, /* No Link */
3535
[0x144] = 0x00, /* Tuple length = 0 bytes */
3537
[0x146] = CISTPL_END, /* Tuple End */
3540
static int dscm1xxxx_attach(void *opaque)
3542
struct md_s *md = (struct md_s *) opaque;
3543
md->card.attr_read = md_attr_read;
3544
md->card.attr_write = md_attr_write;
3545
md->card.common_read = md_common_read;
3546
md->card.common_write = md_common_write;
3547
md->card.io_read = md_common_read;
3548
md->card.io_write = md_common_write;
3550
md->attr_base = md->card.cis[0x74] | (md->card.cis[0x76] << 8);
3554
md_interrupt_update(md);
3556
md->card.slot->card_string = "DSCM-1xxxx Hitachi Microdrive";
3560
static int dscm1xxxx_detach(void *opaque)
3562
struct md_s *md = (struct md_s *) opaque;
3567
struct pcmcia_card_s *dscm1xxxx_init(BlockDriverState *bdrv)
3569
struct md_s *md = (struct md_s *) qemu_mallocz(sizeof(struct md_s));
3570
md->card.state = md;
3571
md->card.attach = dscm1xxxx_attach;
3572
md->card.detach = dscm1xxxx_detach;
3573
md->card.cis = dscm1xxxx_cis;
3574
md->card.cis_len = sizeof(dscm1xxxx_cis);
3576
ide_init2(md->ide, bdrv, 0, qemu_allocate_irqs(md_set_irq, md, 1)[0]);
3578
md->ide->mdata_size = METADATA_SIZE;
3579
md->ide->mdata_storage = (uint8_t *) qemu_mallocz(METADATA_SIZE);
3581
register_savevm("microdrive", md_iid ++, 0, md_save, md_load, md);