Skip to content

Commit 2d53b48

Browse files
committed
Explicitly setup the secondary IDE interrupt of PIIX on Milan.
The secondary IDE interrupt is connected to MBIRQ0 on PIIX, but the Milan's ROM bootloader (at least version 0.99.7) doesn't seem to setup the MBIRQ0 register to route it to IRQ15.
1 parent 45478fd commit 2d53b48

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

sys/arch/atari/pci/pci_machdep.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: pci_machdep.c,v 1.54 2014/03/29 19:28:26 christos Exp $ */
1+
/* $NetBSD: pci_machdep.c,v 1.55 2018/01/31 15:36:29 tsutsui Exp $ */
22

33
/*
44
* Copyright (c) 1996 Leo Weppelman. All rights reserved.
@@ -32,7 +32,7 @@
3232
*/
3333

3434
#include <sys/cdefs.h>
35-
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.54 2014/03/29 19:28:26 christos Exp $");
35+
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.55 2018/01/31 15:36:29 tsutsui Exp $");
3636

3737
#include "opt_mbtype.h"
3838

@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.54 2014/03/29 19:28:26 christos Ex
4949

5050
#include <dev/pci/pcivar.h>
5151
#include <dev/pci/pcireg.h>
52+
#include <dev/pci/pcidevs.h>
5253

5354
#include <uvm/uvm_extern.h>
5455

@@ -449,6 +450,19 @@ enable_pci_devices(void)
449450
/*
450451
* On the Milan, we accept the BIOS's choice.
451452
*/
453+
/* ..except the secondary IDE interrupt that the BIOS doesn't setup. */
454+
#define PIIX_PCIB_MBIRQ0 0x70
455+
if ((PCI_VENDOR(id) == PCI_VENDOR_INTEL) &&
456+
(PCI_PRODUCT(id) == PCI_PRODUCT_INTEL_82371FB_ISA)) {
457+
/* Set Interrupt Routing for MBIRQ0 to IRQ15 */
458+
csr = pci_conf_read(pc, tag, PIIX_PCIB_MBIRQ0);
459+
csr &= ~0x00000ff;
460+
csr |= 0x000000f; /* IRQ15 */
461+
pci_conf_write(pc, tag, PIIX_PCIB_MBIRQ0, csr);
462+
#ifdef DEBUG_PCI_MACHDEP
463+
printf("\npcib0: enable and route MBIRQ0 to irq 15\n");
464+
#endif
465+
}
452466
#endif
453467
}
454468

0 commit comments

Comments
 (0)