April 8, 2001 J. D. Monnier Notes on Interrupts Programming =============================== We have been able to get the PCI-PMC interrupts to work. I appreciate all of your help. We were VERY close to getting them work at the time of my last email and I will tell you what worked below. ps. -- one last EASY question, before I sign off: what is the maximum update rate for the tick routines? they are set at 1000 Hz, but I couldn't see any good reason we can't run faster -- we might want to. [see sysClkRateSet( ) in mv2400 BSP sysLib docs, and in configuration files]. --------- --------- Important Steps: 1. From FPGA point of view, we had to enable the PCI-PMC interrupts on the plx9050: Outl((unsigned long)(plx9050regs + intcsr),swaplong(0x43)); /* Make LINT1 active high and enable PCI interrupts*/ // See plx9050 manuals (/home/iota/Documentation/plx9050.pdf) for all bits // of control register This code is in files like: /home/iota/mc/DAQ/PICNIC.cpp 2. From the mv2400 pint of view: As others said, it turns out the MPIC (Multi-Processor Interrupt Controller) was enabled already and that the MASKBIT can be set through the intEnable command [I confirmed through direct PCIbus read/writes to the appropriate interrupt registers]. For some not-quite-clear reason, the interrupt is coming on the PMC_INT_LVL4 interrupt level rather than the PMC_INT_LVL1 interrupt which we thought was mapped from the PCI INTA interrupt. Based on some documentation (/home/iota/Documentation/PowerPlusII.html), this can be understood if the PMC is on the "secondary" PCI bus rather than the "primary" PCI bus -- however, we could not find this discussed anywhere else -- any help in understanding this small mystery would be interested. So: to connect and enable the interrupt to our function test_handler: connectStatus = intConnect(INUM_TO_IVEC(INT_VEC_IRQ0 + PMC_INT_LVL4),(VOIDFUNCPTR)test_handler,(int)PMC_INT_LVL4); enableStatus = intEnable( PMC_INT_LVL4 ) ; Note: intConnect and intEnable are wired to the mv2400 dependent routines in /home/iota/target/config/mv2400/hawkMPIC.c routines: sysMpicIntConnect and sysMpicIntEnable 3. Another interesting thing, is that to include the proper defines (e.g., for INT_VEC_IRQ0 and PMC_INT_LVL4) we had to include a number of header files. Importantly we had to also include the statement #define INCLUDE_MPIC so the header files are interpreted correctly!! A minimal set of header files that does the job: #include "intLib.h" #include "iv.h" // or #include "arch/ppc/ivPpc.h" #define INCLUDE_MPIC // Required for correct MACROS in mv2400.h #include "mv2400.h"