Changeset e08dbc5 in rtems


Ignore:
Timestamp:
Nov 3, 2009, 6:45:04 PM (10 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
12c09c76
Parents:
16393b2f
Message:

various PowerPC code maintenance

Location:
c/src/lib
Files:
1 deleted
24 edited

Legend:

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

    r16393b2f re08dbc5  
     12009-11-03      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * shared/clock/clock.c: Remove classic decrementer handler
     4        * shared/vme/vme_universe.c: removed non-prototype warnings
     5
    162009-11-03      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • c/src/lib/libbsp/powerpc/gen5200/ChangeLog

    r16393b2f re08dbc5  
     12009-11-02      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * start/start.S: call to boot_card checked, removed warning
     4
    152009-10-22      Sebastian Huber <sebastian.huber@embedded-brains.de>
    26
  • c/src/lib/libbsp/powerpc/gen5200/start/start.S

    r16393b2f re08dbc5  
    9191/***********************************************************************/
    9292
    93 #warning Call to boot_card has changed and needs checking.
    94 #warning The call is "void boot_card(const char* cmdline);"
    95 #warning You need to pass a NULL.
    96 #warning Please check and remove these warnings.
    97        
    9893#include <rtems/powerpc/cache.h>
    9994
  • c/src/lib/libbsp/powerpc/gen83xx/ChangeLog

    r16393b2f re08dbc5  
     12009-11-02      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * start/start.S: call to boot_card checked, removed warning
     4
    152009-10-22      Sebastian Huber <sebastian.huber@embedded-brains.de>
    26
  • c/src/lib/libbsp/powerpc/gen83xx/start/start.S

    r16393b2f re08dbc5  
    2020
    2121
    22 #warning Call to boot_card has changed and needs checking.
    23 #warning The call is "void boot_card(const char* cmdline);"
    24 #warning You need to pass a NULL.
    25 #warning Please check and remove these warnings.
    26        
    2722#include <libcpu/powerpc-utility.h>
    2823#include <rtems/powerpc/cache.h>
  • c/src/lib/libbsp/powerpc/mpc8260ads/ChangeLog

    r16393b2f re08dbc5  
     12009-11-03      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * start/start.S: checked and removed boot_card warning
     4        * irq/irq.c: adapted exception handler parameters
     5        * startup/bspstart.c: removed non-prototype warnings
     6
    172009-10-23      Sebastian Huber <sebastian.huber@embedded-brains.de>
    28
  • c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am

    r16393b2f re08dbc5  
    3131libbsp_a_SOURCES =
    3232
    33 # pclock
    34 libbsp_a_SOURCES += clock/p_clock.c
     33# clock
     34libbsp_a_SOURCES += ../shared/clock/clock.c
     35
    3536# console
    3637libbsp_a_SOURCES += console/console.c
     
    6970    ../../../libcpu/@RTEMS_CPU@/@exceptions@/rtems-cpu.rel \
    7071    ../../../libcpu/@RTEMS_CPU@/@exceptions@/exc_bspsupport.rel \
    71     ../../../libcpu/@RTEMS_CPU@/mpc8260/clock.rel \
    7272    ../../../libcpu/@RTEMS_CPU@/mpc8260/console-generic.rel \
    7373    ../../../libcpu/@RTEMS_CPU@/mpc8260/cpm.rel \
  • c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c

    r16393b2f re08dbc5  
    214214 * High level IRQ handler called from shared_raw_irq_code_entry
    215215 */
    216 int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
     216int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
    217217{
    218218  register unsigned int irq;
  • c/src/lib/libbsp/powerpc/mpc8260ads/start/start.S

    r16393b2f re08dbc5  
    3434#include <rtems/asm.h>
    3535
    36 #warning Call to boot_card has changed and needs checking.
    37 #warning The call is "void boot_card(const char* cmdline);"
    38 #warning You need to pass a NULL.
    39 #warning Please check and remove these warnings.
    40        
    4136/*
    4237 *  The initial stack is set to run BELOW the code base address.
  • c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c

    r16393b2f re08dbc5  
    9090}
    9191
    92 void _BSP_GPLED0_on()
     92void _BSP_GPLED0_on(void)
    9393{
    9494  BCSR *csr;
     
    9797}
    9898
    99 void _BSP_GPLED0_off()
     99void _BSP_GPLED0_off(void)
    100100{
    101101  BCSR *csr;
     
    104104}
    105105
    106 void _BSP_GPLED1_on()
     106void _BSP_GPLED1_on(void)
    107107{
    108108  BCSR *csr;
     
    111111}
    112112
    113 void _BSP_GPLED1_off()
     113void _BSP_GPLED1_off(void)
    114114{
    115115  BCSR *csr;
     
    118118}
    119119
    120 void _BSP_Uart1_enable()
     120void _BSP_Uart1_enable(void)
    121121{
    122122  BCSR *csr;
     
    125125}
    126126
    127 void _BSP_Uart1_disable()
     127void _BSP_Uart1_disable(void)
    128128{
    129129  BCSR *csr;
     
    132132}
    133133
    134 void _BSP_Uart2_enable()
     134void _BSP_Uart2_enable(void)
    135135{
    136136  BCSR *csr;
     
    139139}
    140140
    141 void _BSP_Uart2_disable()
     141void _BSP_Uart2_disable(void)
    142142{
    143143  BCSR *csr;
     
    150150{
    151151  rtems_status_code sc = RTEMS_SUCCESSFUL;
    152   extern void *_WorkspaceBase;
    153152  ppc_cpu_id_t myCpu;
    154153  ppc_cpu_revision_t myCpuRevision;
  • c/src/lib/libbsp/powerpc/shared/clock/clock.c

    r16393b2f re08dbc5  
    9595}
    9696
    97 static int ppc_clock_exception_handler_classic( BSP_Exception_frame *frame, unsigned number)
    98 {
    99         uint32_t reg1;
    100         uint32_t reg2;
    101         uint32_t msr;
    102 
    103         /* Set new decrementer value */
    104         asm volatile(
    105                 "lwz %1, ppc_clock_decrementer_value@sdarel(13);"
    106                 "mfdec %0;"
    107                 "add %0, %0, %1;"
    108                 "mtdec %0"
    109                 : "=r" (reg1), "=r" (reg2)
    110         );
    111 
    112         /* Increment clock ticks */
    113         Clock_driver_ticks += 1;
    114 
    115         /* Enable external exceptions */
    116         msr = ppc_external_exceptions_enable();
    117 
    118         /* Call clock ticker  */
    119         ppc_clock_tick();
    120 
    121         /* Restore machine state */
    122         ppc_external_exceptions_disable( msr);
    123 
    124         return 0;
    125 }
    12697
    12798static int ppc_clock_exception_handler_booke( BSP_Exception_frame *frame, unsigned number)
  • c/src/lib/libbsp/powerpc/shared/vme/vme_universe.c

    r16393b2f re08dbc5  
    393393#ifdef VME_CLEAR_BRIDGE_ERRORS
    394394        {
    395         extern unsigned short (*_BSP_clear_vmebridge_errors)();
     395        extern unsigned short (*_BSP_clear_vmebridge_errors)(void);
    396396
    397397          _BSP_clear_vmebridge_errors = VME_CLEAR_BRIDGE_ERRORS;
  • c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog

    r16393b2f re08dbc5  
     12009-11-03      Thomas Doerfler  <Thomas.Doerfler@embedded-brains.de>
     2
     3        * startup/bspstart.s, console/console.c: various fixes
     4
    152009-10-28      Thomas Doerfler  <Thomas.Doerfler@embedded-brains.de>
    26
  • c/src/lib/libbsp/powerpc/tqm8xx/console/console.c

    r16393b2f re08dbc5  
    6767 * Interrupt-driven input buffer
    6868 */
    69 #define RXBUFSIZE       256
     69#define RXBUFSIZE       16
    7070
    7171#define M8xx_SICR_BRG1 (0)
     
    663663    }
    664664    sccFrstRxBd[chan][i].length = 0;
    665     sccFrstRxBd[chan][i].buffer = rxBuf[chan][i];
     665    sccFrstRxBd[chan][i].buffer = (*rxBuf[chan])[i];
    666666  }
    667667  /*
     
    729729sccPollRead (int minor)
    730730{
    731   unsigned char c;
     731  int c = -1;
    732732  int chan = minor;
    733733
    734   if ((sccCurrRxBd[chan]->status & M8xx_BD_EMPTY) != 0) {
    735     return -1;
    736   }
    737   rtems_cache_invalidate_multiple_data_lines((void *)sccCurrRxBd[chan]->buffer,
    738                                              sccCurrRxBd[chan]->length);
    739   c = *((char *)sccCurrRxBd[chan]->buffer);
    740   /*
    741    * clear status
    742    */
    743   sccCurrRxBd[chan]->status =
    744     (sccCurrRxBd[chan]->status
    745      & (M8xx_BD_WRAP | M8xx_BD_INTERRUPT))
    746     | M8xx_BD_EMPTY;
    747   /*
    748    * advance to next BD
    749    */
    750   if ((sccCurrRxBd[chan]->status & M8xx_BD_WRAP) != 0) {
    751     sccCurrRxBd[chan] = sccFrstRxBd[chan];
    752   }
    753   else {
    754     sccCurrRxBd[chan]++;
    755   }
    756   return c;
     734  while(1) {
     735    if ((sccCurrRxBd[chan]->status & M8xx_BD_EMPTY) != 0) {
     736      return -1;
     737    }
     738   
     739    if (0 == (sccCurrRxBd[chan]->status & (M8xx_BD_OVERRUN
     740                                           | M8xx_BD_PARITY_ERROR
     741                                           | M8xx_BD_FRAMING_ERROR
     742                                           | M8xx_BD_BREAK
     743                                           | M8xx_BD_IDLE))) {
     744      /* character received and no error detected */
     745      rtems_cache_invalidate_multiple_data_lines((void *)sccCurrRxBd[chan]->buffer,
     746                                                 sccCurrRxBd[chan]->length);
     747      c = (unsigned)*((char *)sccCurrRxBd[chan]->buffer);
     748      /*
     749       * clear status
     750       */
     751    }
     752    sccCurrRxBd[chan]->status =
     753      (sccCurrRxBd[chan]->status
     754       & (M8xx_BD_WRAP | M8xx_BD_INTERRUPT))
     755      | M8xx_BD_EMPTY;
     756    /*
     757     * advance to next BD
     758     */
     759    if ((sccCurrRxBd[chan]->status & M8xx_BD_WRAP) != 0) {
     760      sccCurrRxBd[chan] = sccFrstRxBd[chan];
     761    }
     762    else {
     763      sccCurrRxBd[chan]++;
     764    }
     765    if (c >= 0) {
     766      return c;
     767    }
     768  }
    757769}
    758770
  • c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c

    r16393b2f re08dbc5  
    174174  }
    175175
    176   bsp_clicks_per_usec = BSP_bus_frequency/16; /* force to zero to control
    177                             * PIT clock driver from EXTCLK
    178                             */
     176  bsp_clicks_per_usec = BSP_bus_frequency/1000000/16;
    179177  bsp_timer_least_valid = 3;
    180178  bsp_timer_average_overhead = 3;
  • c/src/lib/libcpu/powerpc/ChangeLog

    r16393b2f re08dbc5  
    1 2009-10-23  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
     12009-11-03  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
     2
     3        * shared/include/powerpc-utility.h, shared/include/byteorder.h,
     4        shared/include/cpuIdent.h:
     5        add c++ declaration brackets
     6        * Makefile.am, mpc8260/clock: removed mpc8260 specific clock
     7        driver
     8        * e500/mmu/e500_mmu.h, e500/mmu/mmu.c,: removed "non-prototype"
     9        warning
     10        * mpc8260/timer/timer.c: moved extern declarations outside
     11        function body
     12        * mpc8xx/mmu/mmu.c: enable data cache when MMU is off to avoid
     13        cache confusion during exception entry
     14
     152009-11-02  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
     16
     17        * mpc8xx/mmu/mmu.c:
     18        enable data chache, when MMU is disabled
     19
     202009-10-30  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
     21
     22        * mpc6xx/clock/c_clock.c:
     23        moved timebase/decrementer access from cpukit to libcpu
     24
     252009-10-29  Thomas Doerfler  <Thomas.Doerfler@imd-systems.de>
    226
    327        * shared/include/powerpc-utility.h, mpc6xx/timer/timer.c:
  • c/src/lib/libcpu/powerpc/Makefile.am

    r16393b2f re08dbc5  
    325325mpc8260_console_generic_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
    326326
    327 # mpc8260/clock
    328 noinst_PROGRAMS += mpc8260/clock.rel
    329 mpc8260_clock_rel_SOURCES = mpc8260/clock/clock.c
    330 mpc8260_clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
    331 mpc8260_clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
    332 
    333327# mpc8260/cpm
    334328include_mpc8260_HEADERS += mpc8260/include/cpm.h
  • c/src/lib/libcpu/powerpc/e500/mmu/e500_mmu.h

    r16393b2f re08dbc5  
    130130 */
    131131int
    132 rtems_e500_initlb();
     132rtems_e500_initlb(void);
    133133
    134134/*
  • c/src/lib/libcpu/powerpc/e500/mmu/mmu.c

    r16393b2f re08dbc5  
    181181/* Factory to generate inline macros for accessing the MAS registers */
    182182#define __RDWRMAS(mas,rmas)     \
    183         static inline uint32_t _read_MAS##mas()                                  \
     183        static inline uint32_t _read_MAS##mas(void)                                      \
    184184        { uint32_t x; asm volatile("mfspr %0, %1": "=r"(x):"i"(rmas)); return x; } \
    185185        static inline void _write_MAS##mas(uint32_t x)                             \
  • c/src/lib/libcpu/powerpc/mpc8260/timer/timer.c

    r16393b2f re08dbc5  
    7979}
    8080
     81extern uint32_t bsp_timer_least_valid;
     82extern uint32_t bsp_timer_average_overhead;
    8183int benchmark_timer_read(void)
    8284{
    8385  uint32_t   clicks;
    8486  uint32_t   total;
    85   extern uint32_t bsp_timer_least_valid;
    86   extern uint32_t bsp_timer_average_overhead;
    8787
    8888  clicks = get_itimer();
  • c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c

    r16393b2f re08dbc5  
    5151   *    GPM [0]                 0b0 = PowerPC mode
    5252   *    PPM [1]                 0b0 = Page resolution of protection
    53    *    CIDEF [2]               0b0/0b1 = Default cache-inhibit attribute =
    54    *                                                    NO for IMMU, YES for DMMU!
     53   *    CIDEF [2]               0b0/0b0 = Default cache-inhibit attribute =
     54   *                                                    NO for IMMU, NO for DMMU
     55   *                            NOTE: it is vital that data caching is ON, when
     56   *                            DMMU is off, otherwise valid/dirty values in
     57   *                            cache would be ignored during exception entry
    5558   *    reserved/WTDEF [3]      0b0 = Default write-through attribute = not
    5659   *    RSV4x [4]               0b0 = 4 entries not reserved
     
    6871  reg1 = M8xx_MI_CTR_ITLB_INDX(31);
    6972  _mtspr( M8xx_MI_CTR, reg1 );
    70   reg1 = M8xx_MD_CTR_CIDEF | M8xx_MD_CTR_TWAM | M8xx_MD_CTR_DTLB_INDX(31);
     73  reg1 = M8xx_MD_CTR_TWAM | M8xx_MD_CTR_DTLB_INDX(31);
    7174  _mtspr( M8xx_MD_CTR, reg1 );
    7275  _isync;
  • c/src/lib/libcpu/powerpc/shared/include/byteorder.h

    r16393b2f re08dbc5  
    1919#ifndef _LIBCPU_BYTEORDER_H
    2020#define _LIBCPU_BYTEORDER_H
     21
     22#ifdef __cplusplus
     23extern "C" {
     24#endif
    2125
    2226#ifdef __GNUC__
     
    5054#endif /* __GNUC__ */
    5155
     56#ifdef __cplusplus
     57}
     58#endif
     59
    5260#endif /* _LIBCPU_BYTEORDER_H */
  • c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h

    r16393b2f re08dbc5  
    1818
    1919#include <stdbool.h>
     20
     21#ifdef __cplusplus
     22extern "C" {
     23#endif
    2024
    2125#ifndef ASM
     
    131135#endif /* ASM */
    132136
     137#ifdef __cplusplus
     138}
    133139#endif
     140
     141#endif
  • c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h

    r16393b2f re08dbc5  
    2727 */
    2828
    29 #ifndef LIBCPU_POWERPC_UTILITY_H
    30 #define LIBCPU_POWERPC_UTILITY_H
    31 
    32 #ifndef ASM
     29#ifndef __LIBCPU_POWERPC_UTILITY_H
     30#define __LIBCPU_POWERPC_UTILITY_H
     31
     32#if !defined(ASM)
    3333  #include <rtems.h>
    3434#endif
     
    3838#include <rtems/powerpc/powerpc.h>
    3939
    40 #ifndef ASM
     40#ifdef __cplusplus
     41extern "C" {
     42#endif
     43
     44#if !defined(ASM)
    4145
    4246#include <rtems/bspIo.h>
     
    243247}
    244248
    245 #ifndef ASM
    246249/*
    247250 *  Simple spin delay in microsecond units for device drivers.
     
    292295  } while (0)
    293296
    294 #endif /* ASM */
    295 
    296 #ifndef ASM
    297297/*
    298298 *  Routines to access the decrementer register
     
    307307    asm volatile( "mfdec  %0" : "=r" (_clicks) )
    308308
    309 #endif /* ASM */
    310 
    311 #ifndef ASM
    312309/*
    313310 *  Routines to access the time base register
     
    351348 
    352349}
    353 #endif /* ASM */
    354350
    355351static inline uint32_t ppc_decrementer_register(void)
     
    582578void ppc_code_copy(void *dest, const void *src, size_t n);
    583579
    584 #else /* ASM */
    585 
     580#endif /* ifndef ASM */
     581
     582#if defined(ASM)
    586583#include <rtems/asm.h>
    587584
     
    657654#endif /* ASM */
    658655
    659 #endif /* LIBCPU_POWERPC_UTILITY_H */
     656#ifdef __cplusplus
     657}
     658#endif
     659
     660#endif /* __LIBCPU_POWERPC_UTILITY_H */
Note: See TracChangeset for help on using the changeset viewer.