Changeset 85c005f3 in rtems


Ignore:
Timestamp:
01/12/06 00:15:16 (18 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
1827c35f
Parents:
c2fc65b
Message:
  • vmeUniverse/vmeTsi148.c, vmeUniverse/vmeTsi148.h, vmeUniverse/vmeUniverse.c, vmeUniverse/vmeUniverse.h,

vmeUniverse/vme_amd_defs.h: No longer enable posted-writes
on master windows (creates race-condition on memory-mapped
devices). A new flag allows for signalling that a window
maps 'ordinary memory'. Disable VME IRQ level if no
handler is registered with interrupting vector.

Location:
c/src/lib/libbsp/shared
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/ChangeLog

    rc2fc65b r85c005f3  
     12006-01-11      Till Straumann <strauman@slac.stanford.edu>
     2        * vmeUniverse/vmeTsi148.c, vmeUniverse/vmeTsi148.h,
     3        vmeUniverse/vmeUniverse.c, vmeUniverse/vmeUniverse.h,
     4    vmeUniverse/vme_amd_defs.h: No longer enable posted-writes
     5    on master windows (creates race-condition on memory-mapped
     6    devices). A new flag allows for signalling that a window
     7    maps 'ordinary memory'. Disable VME IRQ level if no
     8    handler is registered with interrupting vector.
     9
    1102006-01-11      Till Straumann <strauman@slac.stanford.edu>
    211
  • c/src/lib/libbsp/shared/vmeUniverse/vmeTsi148.c

    rc2fc65b r85c005f3  
    11481148                        if ( !(ip=irqHdlTbl[vector])) {
    11491149                                /* TODO: log error message - RTEMS has no logger :-( */
    1150                                 printk("vmeTsi148 ISR: ERROR: no handler registered (level %i) IACK 0x%08x\n",
    1151                                                 lvl, vector);
     1150                                vmeTsi148IntDisable(lvl);
     1151                                printk("vmeTsi148 ISR: ERROR: no handler registered (level %i) IACK 0x%08x -- DISABING level %i\n",
     1152                                                lvl, vector, lvl);
    11521153                        } else {
    11531154                                /* dispatch handler, it must clear the IRQ at the device */
  • c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c

    rc2fc65b r85c005f3  
    291291{
    292292unsigned long mode=0;
     293
     294    /* NOTE: reading the CY961 (Echotek ECDR814) with VDW32
     295     *       generated bus errors when reading 32-bit words
     296     *       - very weird, because the registers are 16-bit
     297     *         AFAIK.
     298     *       - 32-bit accesses worked fine on vxWorks which
     299     *         has the port set to 64-bit.
     300     *       ????????
     301     */
     302
    293303        if (!ismaster) {
    294304                mode |= UNIV_SCTL_DAT | UNIV_SCTL_PGM;
    295305                mode |= UNIV_SCTL_USER;
    296         }
     306                if ( VME_AM_IS_MEMORY & address_space )
     307                        mode |= UNIV_SCTL_PWEN | UNIV_SCTL_PREN;
     308                mode |= UNIV_SCTL_EN;
     309        } else {
     310                mode |= UNIV_MCTL_VDW64 | UNIV_MCTL_VCT /* enable block transfers */;
     311                if ( VME_AM_IS_MEMORY & address_space )
     312                        mode |= UNIV_MCTL_PWEN;
     313                mode |= UNIV_MCTL_EN;
     314        }
     315
     316        address_space &= ~VME_AM_IS_MEMORY;
     317
    297318        switch (address_space) {
    298319                case VME_AM_STD_SUP_PGM:
     
    457478                WRITE_LE(offst,preg,12);
    458479#endif
    459                 /* calculate configuration word and enable the port */
    460                 /* NOTE: reading the CY961 (Echotek ECDR814) with VDW32
    461                  *       generated bus errors when reading 32-bit words
    462                  *       - very weird, because the registers are 16-bit
    463                  *         AFAIK.
    464                  *       - 32-bit accesses worked fine on vxWorks which
    465                  *         has the port set to 64-bit.
    466                  *       ????????
    467                  */
    468                 if (ismaster)
    469                         mode |= UNIV_MCTL_EN | UNIV_MCTL_PWEN | UNIV_MCTL_VDW64 | UNIV_MCTL_VCT;
    470                 else
    471                         mode |= UNIV_SCTL_EN | UNIV_SCTL_PWEN | UNIV_SCTL_PREN;
    472480
    473481#ifdef TSILL
     
    546554                        cntrl&UNIV_MCTL_PGM ?   "Pgm" : "Dat",
    547555                        cntrl&UNIV_MCTL_SUPER ? "Sup" : "Usr");
     556                if ( cntrl & UNIV_MCTL_PWEN )
     557                        uprintf(f,", PWEN");
    548558        } else {
    549559                uprintf(f,"%s %s %s %s",
     
    552562                        cntrl&UNIV_SCTL_SUPER ? "Sup," : "    ",
    553563                        cntrl&UNIV_SCTL_USER  ? "Usr" :  "");
     564                if ( cntrl & UNIV_SCTL_PWEN )
     565                        uprintf(f,", PWEN");
     566                if ( cntrl & UNIV_SCTL_PREN )
     567                        uprintf(f,", PREN");
    554568        }
    555569        uprintf(f,"\n");
     
    591605                return -1;
    592606        }
    593         if ( (cntrl & (ismaster ? UNIV_MCTL_AM_MASK : UNIV_SCTL_AM_MASK))
    594             != offst )
     607
     608        if ( ! (VME_MODE_EXACT_MATCH & l->aspace) ) {
     609                cntrl &= (ismaster ? UNIV_MCTL_AM_MASK : UNIV_SCTL_AM_MASK);
     610                offst &= (ismaster ? UNIV_MCTL_AM_MASK : UNIV_SCTL_AM_MASK);
     611        }
     612
     613        if ( cntrl != offst )
    595614                return 0; /* mode doesn't match requested AM */
    596615
     
    13061325                if (status & UNIV_VIRQ_ERR) {
    13071326                                /* TODO: log error message - RTEMS has no logger :-( */
    1308                         printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08x\n", lvl, status);
     1327#ifdef BSP_PIC_DO_EOI
     1328                        linten &= ~msk;
     1329#else
     1330                        vmeUniverseIntDisable(lvl);
     1331#endif
     1332                        printk("vmeUniverse ISR: error read from STATID register; (level: %i) STATID: 0x%08x -- DISABLING\n", lvl, status);
    13091333                } else if (!(ip=universeHdlTbl[status & UNIV_VIRQ_STATID_MASK])) {
     1334#ifdef BSP_PIC_DO_EOI
     1335                        linten &= ~msk;
     1336#else
     1337                        vmeUniverseIntDisable(lvl);
     1338#endif
    13101339                                /* TODO: log error message - RTEMS has no logger :-( */
    1311                         printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08x\n", lvl, status);
     1340                        printk("vmeUniverse ISR: no handler installed for this vector; (level: %i) STATID: 0x%08x -- DISABLING\n", lvl, status);
    13121341                } else {
    13131342                                /* dispatch handler, it must clear the IRQ at the device */
  • c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.h

    rc2fc65b r85c005f3  
    7575#endif
    7676
    77 #endif
     77/* Enables posted writes (and on a VME slave: prefetched reads, too) */
     78#ifndef VME_AM_IS_MEMORY
     79#define VME_AM_IS_MEMORY                        (1<<8)
     80#endif
     81
     82#endif
     83
     84
     85
     86/* When looking for an address translation, ask for a match of VME_MODE_PWEN etc., too */
     87#define VME_MODE_EXACT_MATCH            (1<<31)
    7888
    7989#include <stdarg.h>
  • c/src/lib/libbsp/shared/vmeUniverse/vme_am_defs.h

    rc2fc65b r85c005f3  
    5959#endif
    6060
    61 /* Higher order bits are driver specific */
     61/* Mask for standard address modifiers */
    6262
    6363#ifndef VME_AM_MASK
     
    6565#endif
    6666
     67/* Hint that the a window is mapping memory; the
     68 * driver may assume it to be safe to enable decoupled
     69 * cycles, caching and the like...
     70 */
     71#ifndef VME_AM_IS_MEMORY
     72#define VME_AM_IS_MEMORY                        (1<<8)
    6773#endif
     74
     75/* Flags 1<<11 .. 1<<8  are reserved
     76 * Flags 1<<12 .. 1<<31 are for driver specific options
     77 */
     78
     79#endif
Note: See TracChangeset for help on using the changeset viewer.