From fb16be9221feb3dd91e56b0549f4d95d70c57f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sun, 11 Oct 2015 18:31:07 +0000 Subject: [PATCH] new function enable_pci_interrupts() (defer PCI interrupt activation until after PCI scan) --- BaS_gcc/sys/BaS.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/BaS_gcc/sys/BaS.c b/BaS_gcc/sys/BaS.c index 664cc58..8a0cd4c 100644 --- a/BaS_gcc/sys/BaS.c +++ b/BaS_gcc/sys/BaS.c @@ -232,26 +232,32 @@ void enable_coldfire_interrupts() MCF_GPT_GMS_TMS(1); /* route GPT0 interrupt on interrupt controller */ MCF_INTC_ICR62 = MCF_INTC_ICR_IL(7) | MCF_INTC_ICR_IP(6); /* interrupt level 7, interrupt priority 7 */ - - MCF_EPORT_EPIER = 0xfe; /* int 1-7 on */ - MCF_EPORT_EPFR = 0xff; /* clear all pending interrupts */ - MCF_INTC_IMRL = 0xffffff00; /* int 1-7 on */ - //MCF_INTC_IMRH = 0xbffffffe; /* psc3 and timer 0 int on */ - MCF_INTC_IMRH = 0; - FBEE_INTR_ENABLE = FBEE_INTR_INT_IRQ7 | /* enable pseudo bus error */ - FBEE_INTR_INT_MFP_IRQ6 | /* enable MFP interrupts */ - FBEE_INTR_INT_FPGA_IRQ5 | /* enable Firebee (PIC, PCI, ETH PHY, DVI, DSP) interrupts */ - FBEE_INTR_INT_VSYNC_IRQ4 //| /* enable vsync interrupts */ - //FBEE_INTR_PCI_INTA | /* enable PCI interrupts */ - //FBEE_INTR_PCI_INTB | - //FBEE_INTR_PCI_INTC | - //FBEE_INTR_PCI_INTD; - ; + MCF_INTC_IMRH = 0xbffffffe; /* psc3 and timer 0 int on */ #endif xprintf("finished\r\n"); } +void enable_pci_interrupts() +{ + dbg("enable PCI interrupts\r\n"); + MCF_EPORT_EPIER = 0xfe; /* int 1-7 on */ + MCF_EPORT_EPFR = 0xff; /* clear all pending interrupts */ + MCF_INTC_IMRL = 0xffffff00; /* int 1-7 on */ + MCF_INTC_IMRH = 0; +#if defined(MACHINE_FIREBEE) + FBEE_INTR_ENABLE = FBEE_INTR_INT_IRQ7 | /* enable pseudo bus error */ + FBEE_INTR_INT_MFP_IRQ6 | /* enable MFP interrupts */ + FBEE_INTR_INT_FPGA_IRQ5 | /* enable Firebee (PIC, PCI, ETH PHY, DVI, DSP) interrupts */ + FBEE_INTR_INT_VSYNC_IRQ4 | /* enable vsync interrupts */ + FBEE_INTR_PCI_INTA | /* enable PCI interrupts */ + FBEE_INTR_PCI_INTB | + FBEE_INTR_PCI_INTC | + FBEE_INTR_PCI_INTD; + ; +#endif +} + void disable_coldfire_interrupts() { #if defined(MACHINE_FIREBEE) @@ -465,10 +471,11 @@ void BaS(void) fec_irq_enable(0, 5, 1); init_pci(); + enable_pci_interrupts(); video_init(); /* initialize USB devices */ - //init_usb(); + init_usb(); set_ipl(7); /* disable interrupts */