Changeset a3def339 in rtems


Ignore:
Timestamp:
Dec 14, 2007, 9:15:08 PM (12 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.9, master
Children:
8fdadc8
Parents:
c933967b
Message:

2007-12-14 Till Straumann <strauman@…>

  • Makefile.am, irq/irq.c (removed), irq/irq_init.c: Use shared exception/interrupt support from libcpu/new-exceptions/bspsupport. NOTE: CHANGES MUST BE TESTED ON REAL HARDWARE.
Location:
c/src/lib/libbsp/powerpc/ep1a
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/ep1a/ChangeLog

    rc933967b ra3def339  
     12007-12-14      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * Makefile.am, irq/irq.c (removed), irq/irq_init.c:
     4        Use shared exception/interrupt support from
     5        libcpu/new-exceptions/bspsupport. NOTE: CHANGES MUST BE
     6        TESTED ON REAL HARDWARE.
     7
    182007-12-11      Joel Sherrill <joel.sherrill@OARcorp.com>
    29
  • c/src/lib/libbsp/powerpc/ep1a/Makefile.am

    rc933967b ra3def339  
    7575###
    7676include_bsp_HEADERS += ../../powerpc/shared/irq/irq.h \
     77        ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/ppc_exc_bspsupp.h \
     78        ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h \
    7779        ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/irq_supp.h
    7880
    7981noinst_PROGRAMS += irq.rel
    80 irq_rel_SOURCES = irq/irq_init.c irq/irq.c ../../powerpc/shared/irq/i8259.c \
    81     ../../powerpc/shared/irq/irq_asm.S
     82irq_rel_SOURCES = irq/irq_init.c ../shared/irq/openpic_i8259_irq.c ../../powerpc/shared/irq/i8259.c
    8283irq_rel_CPPFLAGS = $(AM_CPPFLAGS)
    8384irq_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
    84 
    85 ##
    86 include_bsp_HEADERS += ../../powerpc/shared/vectors/vectors.h
    87 
    88 noinst_PROGRAMS += vectors.rel
    89 vectors_rel_SOURCES = ../../powerpc/shared/vectors/vectors_init.c \
    90     ../../powerpc/shared/vectors/vectors.S
    91 vectors_rel_CPPFLAGS = $(AM_CPPFLAGS)
    92 vectors_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
    9385
    9486##
     
    125117libbsp_a_SOURCES =
    126118libbsp_a_LIBADD = pclock.rel console.rel irq.rel openpic.rel pci.rel \
    127     vectors.rel startup.rel vme.rel
     119    startup.rel vme.rel
    128120
    129121libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/shared/cpuIdent.rel \
     
    132124    ../../../libcpu/@RTEMS_CPU@/mpc6xx/clock.rel \
    133125    ../../../libcpu/@RTEMS_CPU@/@exceptions@/raw_exception.rel \
     126    ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
     127    ../../../libcpu/@RTEMS_CPU@/@exceptions@/irq_bspsupport.rel \
    134128    ../../../libcpu/@RTEMS_CPU@/mpc6xx/mmu.rel \
    135129    ../../../libcpu/@RTEMS_CPU@/mpc6xx/timer.rel
  • c/src/lib/libbsp/powerpc/ep1a/irq/irq_init.c

    rc933967b ra3def339  
    3636#define SHOW_ISA_PCI_BRIDGE_SETTINGS
    3737*/
    38 
    39 typedef struct {
    40   unsigned char bus;    /* few chance the PCI/ISA bridge is not on first bus but ... */
    41   unsigned char device;
    42   unsigned char function;
    43 } pci_isa_bridge_device;
    44 
    45 pci_isa_bridge_device* via_82c586 = 0;
    46 static pci_isa_bridge_device bridge;
    47 
    48 extern unsigned int external_exception_vector_prolog_code_size[];
    49 extern void external_exception_vector_prolog_code();
    50 extern unsigned int decrementer_exception_vector_prolog_code_size[];
    51 extern void decrementer_exception_vector_prolog_code();
    5238
    5339/*
     
    153139};
    154140
    155 void VIA_isa_bridge_interrupts_setup(void)
    156 {
    157   pci_isa_bridge_device pci_dev;
    158   uint32_t temp;
    159   unsigned char tmp;
    160   unsigned char maxBus;
    161   unsigned found = 0;
    162 
    163   maxBus = pci_bus_count();
    164   pci_dev.function      = 0; /* Assumes the bidge is the first function */
    165      
    166   for (pci_dev.bus = 0; pci_dev.bus < maxBus; pci_dev.bus++) {
    167 #ifdef SCAN_PCI_PRINT       
    168     printk("isa_bridge_interrupts_setup: Scanning bus %d\n", pci_dev.bus);
    169 #endif       
    170     for (pci_dev.device = 0; pci_dev.device < PCI_MAX_DEVICES; pci_dev.device++) {
    171 #ifdef SCAN_PCI_PRINT       
    172       printk("isa_bridge_interrupts_setup: Scanning device %d\n", pci_dev.device);
    173 #endif       
    174       pci_read_config_dword(pci_dev.bus, pci_dev.device,  pci_dev.function,
    175                                PCI_VENDOR_ID, &temp);
    176 #ifdef SCAN_PCI_PRINT       
    177       printk("Vendor/device = %x\n", temp);
    178 #endif
    179       if ((temp == (((unsigned short) PCI_VENDOR_ID_VIA) | (PCI_DEVICE_ID_VIA_82C586_0 << 16)))
    180          ) {
    181         bridge = pci_dev;
    182         via_82c586 = &bridge;
    183 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    184         /*
    185          * Should print : bus = 0, device = 11, function = 0 on a MCP750.
    186          */
    187         printk("Via PCI/ISA bridge found at bus = %d, device = %d, function = %d\n",
    188                via_82c586->bus,
    189                via_82c586->device,
    190                via_82c586->function);
    191 #endif       
    192         found = 1;
    193         goto loop_exit;
    194            
    195       }
    196     }
    197   }
    198 loop_exit:
    199   if (!found) BSP_panic("VIA_82C586 PCI/ISA bridge not found!n");
    200      
    201   tmp = inb(0x810);
    202   if  ( !(tmp & 0x2)) {
    203 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    204     printk("This is a second generation MCP750 board\n");
    205     printk("We must reprogram the PCI/ISA bridge...\n");
    206 #endif       
    207     pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    208                          0x47,  &tmp);
    209 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    210     printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);
    211 #endif       
    212     /*
    213      * Enable 4D0/4D1 ISA interrupt level/edge config registers
    214      */
    215     tmp |= 0x20;
    216     pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    217                           0x47, tmp);
    218     /*
    219      * Now program the ISA interrupt edge/level
    220      */
    221     tmp = ELCRS_INT9_LVL | ELCRS_INT10_LVL | ELCRS_INT11_LVL;
    222     outb(tmp, ISA8259_S_ELCR);
    223     tmp = ELCRM_INT5_LVL;
    224     outb(tmp, ISA8259_M_ELCR);;
    225     /*
    226      * Set the Interrupt inputs to non-inverting level interrupt
    227      */
    228     pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    229                             0x54, &tmp);
    230 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    231     printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);
    232 #endif       
    233     tmp = 0;
    234     pci_write_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    235                           0x54, tmp);
    236   }
    237   else {
    238 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    239     printk("This is a first generation MCP750 board\n");
    240     printk("We just show the actual value used by PCI/ISA bridge\n");
    241 #endif       
    242     pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    243                          0x47,  &tmp);
    244 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    245     printk(" PCI ISA bridge control2 = %x\n", (unsigned) tmp);
    246 #endif       
    247     /*
    248      * Show the Interrupt inputs inverting/non-inverting level status
    249      */
    250     pci_read_config_byte(via_82c586->bus, via_82c586->device, via_82c586->function,
    251                          0x54, &tmp);
    252 #ifdef SHOW_ISA_PCI_BRIDGE_SETTINGS     
    253     printk(" PCI ISA bridge PCI/IRQ Edge/Level Select = %x\n", (unsigned) tmp);
    254 #endif       
    255   }
    256 }
    257 
    258141  /*
    259142   * This code assumes the exceptions management setup has already
     
    264147void BSP_rtems_irq_mng_init(unsigned cpuId)
    265148{
    266   rtems_raw_except_connect_data vectorDesc;
    267149  int i;
    268150
     
    310192    }
    311193 
    312   /*
    313    * We must connect the raw irq handler for the two
    314    * expected interrupt sources : decrementer and external interrupts.
    315    */
    316     vectorDesc.exceptIndex      =       ASM_DEC_VECTOR;
    317     vectorDesc.hdl.vector       =       ASM_DEC_VECTOR;
    318     vectorDesc.hdl.raw_hdl      =       decrementer_exception_vector_prolog_code;
    319     vectorDesc.hdl.raw_hdl_size =       (unsigned) decrementer_exception_vector_prolog_code_size;
    320     vectorDesc.on               =       nop_func;
    321     vectorDesc.off              =       nop_func;
    322     vectorDesc.isOn             =       connected;
    323     if (!ppc_set_exception (&vectorDesc)) {
    324       BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
    325     }
    326     vectorDesc.exceptIndex      =       ASM_EXT_VECTOR;
    327     vectorDesc.hdl.vector       =       ASM_EXT_VECTOR;
    328     vectorDesc.hdl.raw_hdl      =       external_exception_vector_prolog_code;
    329     vectorDesc.hdl.raw_hdl_size =       (unsigned) external_exception_vector_prolog_code_size;
    330     if (!ppc_set_exception (&vectorDesc)) {
    331       BSP_panic("Unable to initialize RTEMS external raw exception\n");
    332     }
    333194#ifdef TRACE_IRQ_INIT 
    334195    printk("RTEMS IRQ management is now operationnal\n");
  • c/src/lib/libbsp/powerpc/ep1a/preinstall.am

    rc933967b ra3def339  
    9494PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
    9595
     96$(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/ppc_exc_bspsupp.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     97        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h
     98PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/ppc_exc_bspsupp.h
     99
     100$(PROJECT_INCLUDE)/bsp/vectors.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     101        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
     102PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
     103
    96104$(PROJECT_INCLUDE)/bsp/irq_supp.h: ../../../libcpu/@RTEMS_CPU@/@exceptions@/bspsupport/irq_supp.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    97105        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq_supp.h
    98106PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq_supp.h
    99 
    100 $(PROJECT_INCLUDE)/bsp/vectors.h: ../../powerpc/shared/vectors/vectors.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    101         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/vectors.h
    102 PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/vectors.h
    103107
    104108$(PROJECT_INCLUDE)/bsp/vmeUniverse.h: ../../shared/vmeUniverse/vmeUniverse.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
Note: See TracChangeset for help on using the changeset viewer.