Changeset a81e4f1 in rtems


Ignore:
Timestamp:
Apr 9, 2005, 1:59:49 AM (15 years ago)
Author:
Eric Norum <WENorum@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
edbd3df6
Parents:
1a58b1f9
Message:

FPGA interrupt status register is now 16-bit.

Location:
c/src/lib/libbsp/m68k/uC5282
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/uC5282/ChangeLog

    r1a58b1f9 ra81e4f1  
     12005-04-08  Eric Norum <norume@aps.anl.gov>
     2
     3        * startup/bspstart.c: FPGA interrupt status register is now 16-bit.
     4
    152005-03-12  Eric Norum <norume@aps.anl.gov>
    26
  • c/src/lib/libbsp/m68k/uC5282/README

    r1a58b1f9 ra81e4f1  
    146146          .                                                  .
    147147          .                                                  .
    148           |                                                  | 3FFF FFFF
     148          |                                                 x| 3FFF FFFF
    149149          +--------------------------------------------------+
    1501504000 0000 | Internal peripheral system (IPSBAR)              |
     
    166166          |                                                  | fFFF FFFF
    167167          +--------------------------------------------------+
     168
     169x - Final 16-bit location of CS2* space is reserved for FPGA interrupt status.
    168170
    169171============================================================================
  • c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c

    r1a58b1f9 ra81e4f1  
    363363
    364364/*
    365  * VME interrupt support
     365 * 'VME' interrupt support
     366 * Interrupt vectors 192-255 are set aside for use by external logic
     367 * which drives IRQ1*.  The actual interrupt source is read from the
     368 * external logic at FPGA_IRQ_INFO.  The most-significant bit of the
     369 * value read from this location is set as long as the external logic
     370 * has interrupts to be serviced.  The least-significant six bits
     371 * indicate the interrupt source within the external logic and are used
     372 * to select the specified interupt handler.
    366373 */
    367374#define NVECTOR 256
     375#define FPGA_VECTOR (64+1)  /* IRQ1* pin connected to external FPGA */
     376#define FPGA_EPPAR  MCF5282_EPORT_EPPAR_EPPA1_BOTHEDGE
     377#define FPGA_EPDDR  MCF5282_EPORT_EPDDR_EPDD1
     378#define FPGA_EPIER  MCF5282_EPORT_EPIER_EPIE1
     379#define FPGA_EPPDR  MCF5282_EPORT_EPPDR_EPPD1
     380#define FPGA_IRQ_INFO    *((vuint16 *)(0x31000000 + 0xfffffe))
    368381
    369382static struct handlerTab {
     
    385398trampoline (rtems_vector_number v)
    386399{
    387     if (handlerTab[v].func)
     400    /*
     401     * Handle FPGA interrupts until all have been consumed
     402     */
     403    if (v == FPGA_VECTOR) {
     404        while (((MCF5282_EPORT_EPPDR & FPGA_EPPDR) == 0)
     405            && ((v = FPGA_IRQ_INFO) & 0x80)) {
     406            v = 192 + (v & 0x3f);
     407            if (handlerTab[v].func)
     408                (*handlerTab[v].func)(handlerTab[v].arg, (unsigned long)v);
     409            else
     410                rtems_fatal_error_occurred(v);
     411        }
     412    }
     413    else if (handlerTab[v].func)
    388414        (*handlerTab[v].func)(handlerTab[v].arg, (unsigned long)v);
    389415}
     
    393419{
    394420    rtems_isr_entry old_handler;
    395 
     421    rtems_interrupt_level level;
     422
     423    /*
     424     * Register the handler information
     425     */
    396426    if (vector >= NVECTOR)
    397427        return -1;
    398428    handlerTab[vector].func = handler;
    399429    handlerTab[vector].arg = usrArg;
     430
     431    /*
     432     * If this is an external FPGA ('VME') vector set up the real IRQ.
     433     */
     434    if ((vector >= 192) && (vector <= 255)) {
     435        int i;
     436        static volatile int setupDone;
     437        rtems_interrupt_disable(level);
     438        if (setupDone) {
     439            rtems_interrupt_enable(level);
     440            return 0;
     441        }
     442        MCF5282_EPORT_EPPAR &= ~FPGA_EPPAR;
     443        MCF5282_EPORT_EPDDR &= ~FPGA_EPDDR;
     444        MCF5282_EPORT_EPIER |=  FPGA_EPIER;
     445        setupDone = 1;
     446        i = BSP_installVME_isr(FPGA_VECTOR, NULL, NULL);
     447        rtems_interrupt_enable(level);
     448        return i;
     449    }
     450
     451    /*
     452     * Make the connection between the interrupt and the local handler
     453     */
    400454    rtems_interrupt_catch(trampoline, vector, &old_handler);
    401455
     
    408462        int l, p;
    409463        int source = vector - 64;
    410         rtems_interrupt_level level;
    411464        static unsigned char installed[8];
    412465
Note: See TracChangeset for help on using the changeset viewer.