Changeset 35bb69b in rtems


Ignore:
Timestamp:
Apr 6, 2001, 3:52:03 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
37731c2
Parents:
bfbc4d3
Message:

2001-03-30 Eric Valette <valette@…>

  • clock/.cvsignore, clock/Makefile.am, clock/p_clock.c, include/8xx_immap.h, include/commproc.h, include/mbx.h, irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, vectors/.cvsignore, vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h, vectors/vectors_init.c: New files.
  • Makefile.am, configure.in, console/console.c, include/Makefile.am, network/network.c, startup/Makefile.am, startup/bspstart.c, startup/imbx8xx.c, startup/linkcmds, startup/mmutlbtab.c, startup/start.S, wrapup/Makefile.am: The modifications to this BSP reflect the conversion of the mpc8xx CPU to the "new exception processing model."
Location:
c/src/lib/libbsp/powerpc/mbx8xx
Files:
17 added
13 edited

Legend:

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

    rbfbc4d3 r35bb69b  
     12001-03-30      Eric Valette <valette@crf.canon.fr>
     2
     3        * clock/.cvsignore, clock/Makefile.am, clock/p_clock.c,
     4        include/8xx_immap.h, include/commproc.h, include/mbx.h,
     5        irq/.cvsignore, irq/Makefile.am, irq/irq.c, irq/irq.h,
     6        irq/irq_asm.S, irq/irq_init.c, vectors/.cvsignore,
     7        vectors/Makefile.am, vectors/vectors.S, vectors/vectors.h,
     8        vectors/vectors_init.c: New files.
     9        * Makefile.am, configure.in, console/console.c,
     10        include/Makefile.am, network/network.c, startup/Makefile.am,
     11        startup/bspstart.c, startup/imbx8xx.c, startup/linkcmds,
     12        startup/mmutlbtab.c, startup/start.S, wrapup/Makefile.am:
     13        The modifications to this BSP reflect the conversion of the
     14        mpc8xx CPU to the "new exception processing model."
     15
    1162000-11-09      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    217
  • c/src/lib/libbsp/powerpc/mbx8xx/Makefile.am

    rbfbc4d3 r35bb69b  
    88# wrapup is the one that actually builds and installs the library
    99#  from the individual .rel files built in other directories
    10 SUBDIRS = console include network startup wrapup
     10SUBDIRS = clock console include irq network startup vectors wrapup
    1111
    1212include $(top_srcdir)/../../bsp.am
  • c/src/lib/libbsp/powerpc/mbx8xx/configure.in

    rbfbc4d3 r35bb69b  
    2929AC_OUTPUT(
    3030Makefile
     31clock/Makefile
    3132console/Makefile
    3233include/Makefile
     34irq/Makefile
    3335network/Makefile
    3436startup/Makefile
     37vectors/Makefile
    3538wrapup/Makefile)
  • c/src/lib/libbsp/powerpc/mbx8xx/console/console.c

    rbfbc4d3 r35bb69b  
    8181#include <rtems/libio.h>
    8282#include <termios.h>
     83#include <bsp/mbx.h>
    8384
    8485static int _EPPCBug_pollRead( int minor );
     
    8889static rtems_status_code do_poll_write( rtems_device_major_number major, rtems_device_minor_number minor, void * arg);
    8990
    90 
    91 BSP_output_char_function_type BSP_output_char = _BSP_output_char;
     91static void _BSP_null_char( char c ) {return;}
     92
     93BSP_output_char_function_type BSP_output_char = _BSP_null_char;
    9294
    9395
     
    503505}
    504506
     507bd_t *eppcbugInfo= (bd_t *)0xdeadbeef;
     508bd_t fakeEppcBugInfo = {
     509        0x42444944,             /* Should be 0x42444944 "BDID" */
     510        sizeof(bd_t),           /* Size of this structure */
     511        0,                      /* revision of this structure */
     512        0,                      /* EPPCbug date, i.e. 0x11061997 */
     513        0,                      /* Memory start address */
     514        0x1000000,              /* Memory (end) size in bytes */
     515        0x28,                   /* Internal Freq, in Hz */
     516        0,                      /* Bus Freq, in Hz */
     517        0,                      /* Boot device controller */
     518        0                       /* Boot device logical dev */
     519};
     520
    505521
    506522/*
     
    567583
    568584#endif /* mpc860 */
    569 
     585  BSP_output_char = _BSP_output_char;
    570586#else /* NVRAM_CONFIGURE != 1 */
    571587
     
    610626#endif /* mpc860 */
    611627
     628  BSP_output_char = _BSP_output_char;
     629
    612630#endif /* NVRAM_CONFIGURE != 1 */
    613631
    614 
    615   /*
    616    * Set up interrupts
    617    */
    618    m8xx_uart_interrupts_initialize();
    619632
    620633  status = rtems_io_register_name ("/dev/tty0", major, SMC1_MINOR);
  • c/src/lib/libbsp/powerpc/mbx8xx/include/Makefile.am

    rbfbc4d3 r35bb69b  
    77H_FILES = bsp.h coverhd.h
    88
     9BSP_H_FILES = mbx.h commproc.h 8xx_immap.h
     10
    911$(PROJECT_INCLUDE):
     12        $(mkinstalldirs) $@
     13
     14$(PROJECT_INCLUDE)/bsp:
    1015        $(mkinstalldirs) $@
    1116
     
    1621        $(INSTALL_DATA) $< $@
    1722
    18 PREINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp.h \
    19     $(PROJECT_INCLUDE)/coverhd.h
     23$(PROJECT_INCLUDE)/bsp/mbx.h : mbx.h
     24        $(INSTALL_DATA) $< $@
     25
     26$(PROJECT_INCLUDE)/bsp/commproc.h : commproc.h
     27        $(INSTALL_DATA) $< $@
     28
     29$(PROJECT_INCLUDE)/bsp/8xx_immap.h : 8xx_immap.h
     30        $(INSTALL_DATA) $< $@
     31
     32PREINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp \
     33        $(PROJECT_INCLUDE)/bsp.h \
     34        $(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/bsp/mbx.h \
     35        $(PROJECT_INCLUDE)/bsp/commproc.h $(PROJECT_INCLUDE)/bsp/8xx_immap.h
    2036
    2137all-local: $(PREINSTALL_FILES)
  • c/src/lib/libbsp/powerpc/mbx8xx/network/network.c

    rbfbc4d3 r35bb69b  
    3838#include <netinet/in.h>
    3939#include <netinet/if_ether.h>
     40#include <bsp/irq.h>
    4041
    4142/*
     
    7980# error "Driver must have MCLBYTES > RBUF_SIZE"
    8081#endif
    81 
    82 extern unsigned32 simask_copy;
    8382
    8483/*
     
    125124
    126125
     126static void  m8xx_scc1_ethernet_on(const rtems_irq_connect_data* ptr)
     127{
     128}
     129
     130static void  m8xx_scc1_ethernet_off(const rtems_irq_connect_data* ptr)
     131{
     132  /*
     133   * Please put relevant code there
     134   */
     135}
     136
     137static void  m8xx_scc1_ethernet_isOn(const rtems_irq_connect_data* ptr)
     138{
     139  return BSP_irq_enabled_at_cpm (ptr->name);
     140}
     141
    127142/*
    128143 * SCC1 interrupt handler
    129144 */
    130 static rtems_isr
    131 m8xx_scc1_interrupt_handler (rtems_vector_number v)
     145static void m8xx_scc1_interrupt_handler ()
    132146{
    133147    /* Frame received? */
     
    146160                rtems_event_send (enet_driver[0].txDaemonTid, INTERRUPT_EVENT);
    147161        }
    148         m8xx.cisr = 1UL << 30;  /* Clear SCC1 interrupt-in-service bit */
    149162}
    150163
     
    153166 * FEC interrupt handler
    154167 */
    155 static rtems_isr
    156 m860_fec_interrupt_handler (rtems_vector_number v)
     168static void m860_fec_interrupt_handler ()
    157169{
    158170  /*
     
    176188#endif
    177189
     190static rtems_irq_connect_data ethernetSCC1IrqData = {
     191  BSP_CPM_IRQ_SCC1,
     192  (rtems_irq_hdl) m8xx_scc1_interrupt_handler,
     193  (rtems_irq_enable) m8xx_scc1_ethernet_on,
     194  (rtems_irq_disable) m8xx_scc1_ethernet_off,
     195  (rtems_irq_is_enabled)m8xx_scc1_ethernet_isOn
     196};
    178197
    179198/*
     
    349368   * Set up interrupts
    350369   */
    351   status = rtems_interrupt_catch (m8xx_scc1_interrupt_handler,
    352                                   PPC_IRQ_CPM_SCC1,
    353                                   &old_handler);
     370  status = BSP_install_rtems_irq_handler (&ethernetSCC1IrqData);
    354371  if (status != RTEMS_SUCCESSFUL) {
    355372    rtems_panic ("Can't attach M8xx SCC1 interrupt handler: %s\n",
     
    357374  }
    358375  m8xx.scc1.sccm = 0;     /* No interrupts unmasked till necessary */
    359   m8xx.cimr |= (1UL << 30);       /* Enable SCC1 interrupt */
    360376 
    361377  /*
     
    396412  m8xx.pcdir &= ~0x1;
    397413 
    398  
    399   /*
    400    * Set up interrupts
    401    * FIXME: DANGER: WARNING:
    402    * CICR and SIMASK must be set in any module that uses
    403    *   the CPM. Currently those are console-generic.c and
    404    *   network.c. If the registers are not set the same
    405    *   in both places, strange things may happen.
    406    *   If they are only set in one place, then an application
    407    *   that uses only the other module won't work correctly.
    408    *   Put this comment in each module that sets these 2 registers
    409    */
    410 #ifdef mpc860
    411   m8xx.cicr = 0x00e43f80;   /* SCaP=SCC1, SCbP=SCC2, SCcP=SCC3,
    412                                                    SCdP=SCC4, IRL=1, HP=PC15, IEN=1 */
    413 #else
    414   m8xx.cicr = 0x00043F80;   /* SCaP=SCC1, SCbP=SCC2, IRL=1, HP=PC15, IEN=1 */
    415 #endif
    416   simask_copy = m8xx.simask | M8xx_SIMASK_LVM1; /* Enable level interrupts */
    417   m8xx.simask |= M8xx_SIMASK_LVM1; /* Enable level interrupts */
    418  
    419414  /*
    420415   * Enable receiver and transmitter
     
    425420
    426421#ifdef MPC860T
     422/*
     423 * Please organize FEC controller code better by moving code from
     424 * m860_fec_initialize_hardware to m8xx_fec_ethernet_on
     425 */
     426static void m8xx_fec_ethernet_on(){};
     427static void m8xx_fec_ethernet_off(){};
     428static int m8xx_fec_ethernet_isOn (const rtems_irq_connect_data* ptr)
     429{
     430  return BSP_irq_enabled_at_siu (ptr->name);
     431}
     432
     433static rtems_irq_connect_data ethernetFECIrqData = {
     434  BSP_FAST_ETHERNET_CTRL,
     435  (rtems_irq_hdl) m8xx_fec_interrupt_handler,
     436  (rtems_irq_enable) m8xx_fec_ethernet_on,
     437  (rtems_irq_disable) m8xx_fec_ethernet_off,
     438  (rtems_irq_is_enabled)m8xx_fec_ethernet_isOn
     439};
     440
    427441static void
    428442m860_fec_initialize_hardware (struct m860_enet_struct *sc)
     
    459473   * 
    460474   */
    461   m8xx.fec.ivec = 0x02 << 29;
     475  m8xx.fec.ivec = ((((unsigned) BSP_FAST_ETHERNET_CTRL)/2) << 29);
    462476 
    463477  /*
     
    573587   * Set up interrupts
    574588   */
    575   status = rtems_interrupt_catch (m860_fec_interrupt_handler,
    576                                   PPC_IRQ_LVL2,
    577                                   &old_handler);
     589  status = status = BSP_install_rtems_irq_handler (&ethernetFECIrqData);
    578590  if (status != RTEMS_SUCCESSFUL)
    579591    rtems_panic ("Can't attach M860 FEC interrupt handler: %s\n",
     
    15671579   * Process options
    15681580   */
    1569  #if NVRAM_CONFIGURE == 1
     1581#if NVRAM_CONFIGURE == 1
    15701582 
    15711583  /* Configure from NVRAM */
     
    16081620  }
    16091621   
    1610  #else /* NVRAM_CONFIGURE != 1 */
     1622#else /* NVRAM_CONFIGURE != 1 */
    16111623 
    16121624  if (config->hardware_address) {
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/Makefile.am

    rbfbc4d3 r35bb69b  
    1010
    1111C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c imbx8xx.c \
    12     main.c mmutlbtab.c sbrk.c setvec.c gnatinstallhandler.c
     12    main.c mmutlbtab.c sbrk.c gnatinstallhandler.c
    1313C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1414
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c

    rbfbc4d3 r35bb69b  
    3333 */
    3434extern rtems_configuration_table Configuration;
     35extern unsigned long intrStackPtr;
    3536rtems_configuration_table  BSP_Configuration;
    3637
     
    4647void bsp_postdriver_hook(void);
    4748void bsp_libc_init( void *, unsigned32, int );
     49
     50void BSP_panic(char *s)
     51{
     52  printk("%s PANIC %s\n",_RTEMS_version, s);
     53  __asm__ __volatile ("sc");
     54}
     55
     56void _BSP_Fatal_error(unsigned int v)
     57{
     58  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
     59  __asm__ __volatile ("sc");
     60}
    4861
    4962/*
     
    117130  extern void *_WorkspaceBase;
    118131 
     132  ppc_cpu_id_t myCpu;
     133  ppc_cpu_revision_t myCpuRevision;
     134  register unsigned char* intrStack;
     135  register unsigned int intrNestingLevel = 0;
     136 
     137  /*
     138   * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
     139   * store the result in global variables so that it can be used latter...
     140   */
     141  myCpu         = get_ppc_cpu_type();
     142  myCpuRevision = get_ppc_cpu_revision();
     143
    119144  mmu_init();
    120145 
     
    135160#endif
    136161#endif
    137    
     162  /*
     163   * Initialize some SPRG registers related to irq handling
     164   */
     165 
     166  intrStack = (((unsigned char*)&intrStackPtr) - CPU_MINIMUM_STACK_FRAME_SIZE);
     167  asm volatile ("mtspr  273, %0" : "=r" (intrStack) : "0" (intrStack));
     168  asm volatile ("mtspr  272, %0" : "=r" (intrNestingLevel) : "0" (intrNestingLevel));
     169
     170  /*
     171   * Install our own set of exception vectors
     172   */
     173  initialize_exceptions();
     174
     175
    138176  /*
    139177   *  Allocate the memory for the RTEMS Work Space.  This can come from
     
    182220  m8xx.scc2p.tbase=0;
    183221  m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 );
    184 }
    185 
     222  /*
     223   * Initalize RTEMS IRQ system
     224   */
     225  BSP_rtems_irq_mng_init(0);
     226#ifdef SHOW_MORE_INIT_SETTINGS
     227  printk("Exit from bspstart\n");
     228#endif 
     229
     230}
     231
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c

    rbfbc4d3 r35bb69b  
    259259  /* Initialize the Periodic Interrupt Status and Control Register (PISCR) */
    260260  m8xx.piscrk = M8xx_UNLOCK_KEY;        /* unlock PISCR */
    261   m8xx.piscr = 0x0083;                  /* Default MBX and firmware value. */
     261  m8xx.piscr = 0x0083;                  /* Default MBX and firmware value. */
    262262     
    263263  /* Initialize the System Clock and Reset Control Register (SCCR)
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds

    rbfbc4d3 r35bb69b  
    199199  text.size = text.end - text.start;
    200200  PROVIDE(_end = bss.end);
    201        
     201  /*
     202   * Interrupt stack setup
     203   */
     204
     205  IntrStack_start = ALIGN(0x10);
     206  . += 0x4000;
     207  intrStack = .;
     208  PROVIDE(intrStackPtr = intrStack);
     209
    202210  _HeapStart = .;
    203211  __HeapStart = .;
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/mmutlbtab.c

    rbfbc4d3 r35bb69b  
    104104         *
    105105         * Board Control/Status Register #1/#2: CS4, Start address 0xFA100000, (4 x 8 bits?)
    106          *      ASID=0x0, APG=0x0, guarded memory, copyback data cache policy,
     106         *      ASID=0x0, APG=0x0, guarded memory, write-through data cache policy,
    107107         *      R/W,X for all, no ASID comparison, cache-inhibited.
    108108         * EPN          TWC     RPN
    109109         */
    110         { 0xFA100200,   0x11,   0xFA1009F7 },   /* BCSR - PS=4K */
     110        { 0xFA100200,   0x13,   0xFA1009F7 },   /* BCSR - PS=4K */
    111111        /*
    112112         *
    113113         * (IMMR-SPRs) Dual Port RAM: Start address 0xFA200000, 16K,
    114          *      ASID=0x0, APG=0x0, guarded memory, copyback data cache policy,
     114         *      ASID=0x0, APG=0x0, guarded memory, write-through data cache policy,
    115115         *      R/W,X for all, no ASID comparison, cache-inhibited.
    116116         *     
     
    121121         * EPN          TWC     RPN
    122122         */
    123         { 0xFA200200,   0x11,   0xFA2009FF },   /* IMMR - PS=16K */
     123        { 0xFA200200,   0x13,   0xFA2009FF },   /* IMMR - PS=16K */
    124124        /*
    125125         *
  • c/src/lib/libbsp/powerpc/mbx8xx/startup/start.S

    rbfbc4d3 r35bb69b  
    240240        cmpwi   r3, 0x1
    241241        beq     .spin
    242 
     242/*     
     243 * #define LOADED_BY_EPPCBUG
     244 */
    243245/*
    244246 * Initialization code
     
    247249        /* Get the start address. */
    248250        mflr    r1
    249 
     251#ifdef LOADED_BY_EPPCBUG       
     252        /* Save pointer to residual/board data */
     253        lis     r9,eppcbugInfo@ha
     254        stw     r3,eppcbugInfo@l(r9)
     255#endif 
    250256        /* Initialize essential registers. */
    251257        bl      initregs
     
    271277        nop
    272278
    273         lis 5,environ@ha
    274         la 5,environ@l(5)               /* environp */
     279        lis     r5,environ@ha
     280        la      r5,environ@l(r5)                /* environp */
    275281        /* clear argc and argv */
    276282        xor     r3, r3, r3
     
    359365        mr      r9, r0
    360366        mr      r10, r0
    361         mr      r11, r0
     367        mr      r11, r0 
    362368        mr      r12, r0
    363369        mr      r13, r0
  • c/src/lib/libbsp/powerpc/mbx8xx/wrapup/Makefile.am

    rbfbc4d3 r35bb69b  
    1010endif
    1111
    12 BSP_PIECES = startup console $(NETWORKING)
     12BSP_PIECES = clock irq startup console vectors $(NETWORKING)
    1313# pieces to pick up out of libcpu/ppc
    1414# CPU_PIECES = mpc8xx/clock mpc8xx/console-generic mpc8xx/cpm \
     
    1818OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
    1919    $(wildcard ../../../../libcpu/$(RTEMS_CPU)/shared/*/$(ARCH)/*.o) \
    20     $(wildcard ../../../../libcpu/powerpc/old_exception_processing/$(ARCH)/*.rel) \
     20    $(wildcard ../../../../libcpu/powerpc/new_exception_processing/$(ARCH)/*.rel) \
    2121    $(wildcard ../../../../libcpu/$(RTEMS_CPU)/mpc8xx/*/$(ARCH)/*.o)
    2222LIB = $(ARCH)/libbsp.a
Note: See TracChangeset for help on using the changeset viewer.