Revision 741402f9 hw/fdc.c
b/hw/fdc.c | ||
---|---|---|
395 | 395 |
uint8_t lock; |
396 | 396 |
/* Power down config (also with status regB access mode */ |
397 | 397 |
uint8_t pwrd; |
398 |
/* Sun4m quirks? */ |
|
399 |
int sun; |
|
398 | 400 |
/* Floppy drives */ |
399 | 401 |
fdrive_t drives[2]; |
400 | 402 |
}; |
... | ... | |
405 | 407 |
uint32_t retval; |
406 | 408 |
|
407 | 409 |
switch (reg & 0x07) { |
408 |
#ifdef TARGET_SPARC |
|
409 | 410 |
case 0x00: |
410 |
// Identify to Linux as S82078B |
|
411 |
retval = fdctrl_read_statusB(fdctrl); |
|
411 |
if (fdctrl->sun) { |
|
412 |
// Identify to Linux as S82078B |
|
413 |
retval = fdctrl_read_statusB(fdctrl); |
|
414 |
} else { |
|
415 |
retval = (uint32_t)(-1); |
|
416 |
} |
|
412 | 417 |
break; |
413 |
#endif |
|
414 | 418 |
case 0x01: |
415 | 419 |
retval = fdctrl_read_statusB(fdctrl); |
416 | 420 |
break; |
... | ... | |
598 | 602 |
fdctrl->dma_chann = dma_chann; |
599 | 603 |
fdctrl->io_base = io_base; |
600 | 604 |
fdctrl->config = 0x60; /* Implicit seek, polling & FIFO enabled */ |
605 |
fdctrl->sun = 0; |
|
601 | 606 |
if (fdctrl->dma_chann != -1) { |
602 | 607 |
fdctrl->dma_en = 1; |
603 | 608 |
DMA_register_channel(dma_chann, &fdctrl_transfer_handler, fdctrl); |
... | ... | |
631 | 636 |
return fdctrl; |
632 | 637 |
} |
633 | 638 |
|
639 |
fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base, |
|
640 |
BlockDriverState **fds) |
|
641 |
{ |
|
642 |
fdctrl_t *fdctrl; |
|
643 |
|
|
644 |
fdctrl = fdctrl_init(irq, 0, 1, io_base, fds); |
|
645 |
fdctrl->sun = 1; |
|
646 |
|
|
647 |
return fdctrl; |
|
648 |
} |
|
649 |
|
|
634 | 650 |
/* XXX: may change if moved to bdrv */ |
635 | 651 |
int fdctrl_get_drive_type(fdctrl_t *fdctrl, int drive_num) |
636 | 652 |
{ |
... | ... | |
647 | 663 |
|
648 | 664 |
static void fdctrl_raise_irq (fdctrl_t *fdctrl, uint8_t status) |
649 | 665 |
{ |
650 |
#ifdef TARGET_SPARC |
|
651 | 666 |
// Sparc mutation |
652 |
if (!fdctrl->dma_en) { |
|
667 |
if (fdctrl->sun && !fdctrl->dma_en) {
|
|
653 | 668 |
fdctrl->state &= ~FD_CTRL_BUSY; |
654 | 669 |
fdctrl->int_status = status; |
655 | 670 |
return; |
656 | 671 |
} |
657 |
#endif |
|
658 | 672 |
if (~(fdctrl->state & FD_CTRL_INTR)) { |
659 | 673 |
qemu_set_irq(fdctrl->irq, 1); |
660 | 674 |
fdctrl->state |= FD_CTRL_INTR; |
Also available in: Unified diff