Changeset 3c6fe2e in rtems


Ignore:
Timestamp:
Jul 14, 2008, 8:46:06 AM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
574fb67
Parents:
9ec91233
Message:

added haleakala BSP contributed by Michael Hamel

Files:
22 added
18 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r9ec91233 r3c6fe2e  
     12008-07-14      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
     2
     3        * make/custom/haleakala.cfg:
     4        added PPC405 haleakala BSP contributed by Michael Hamel
     5
    162008-07-09      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    27
    38        * aclocal/bsp-alias.m4, aclocal/check-bsps.m4,
    4         make/custom/m5484FireEngine.cfg:
     9        * make/custom/m5484FireEngine.cfg:
    510        added pgh360 BSP variant
    611        added m5484FireEngine BSP
  • c/src/lib/libbsp/powerpc/ChangeLog

    r9ec91233 r3c6fe2e  
     12008-07-14      Thomas Doefler <Thomas.Doerfler@embedded-brains.de>
     2        * haleakala: added new BSP
     3
    142008-07-11      Sebastian Huber <sebastian.huber@embedded-brains.de>
    25
  • c/src/lib/libbsp/powerpc/acinclude.m4

    r9ec91233 r3c6fe2e  
    99  gen83xx )
    1010    AC_CONFIG_SUBDIRS([gen83xx]);;
     11  haleakala )
     12    AC_CONFIG_SUBDIRS([haleakala]);;
    1113  mbx8xx )
    1214    AC_CONFIG_SUBDIRS([mbx8xx]);;
  • c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c

    r9ec91233 r3c6fe2e  
    1919
    2020/*
    21 <<<<<<< bspstart.c
    2221 *  $Id$
    23 =======
    24  *  $Id$
    25 >>>>>>> 1.11
    2622 */
    2723
  • c/src/lib/libbsp/powerpc/shared/console/uart.c

    r9ec91233 r3c6fe2e  
    7575uread(int uart, unsigned int reg)
    7676{
    77 
    78   return in_8((unsigned char*)(uart_data[uart].ioBase + reg));
    79 
     77        return in_8((unsigned char*)(uart_data[uart].ioBase + reg));
    8078}
    8179
     
    8381uwrite(int uart, int reg, unsigned int val)
    8482{
    85   out_8((unsigned char*)(uart_data[uart].ioBase + reg), val);
     83        out_8((unsigned char*)(uart_data[uart].ioBase + reg), val);
    8684}
    8785
  • c/src/lib/libcpu/powerpc/ChangeLog

    r9ec91233 r3c6fe2e  
     12008-07-14      Thomas Doerfler <thomas.doerfler@embedded-brains.de>
     2
     3        * Makefile.am, new-exceptions/raw_exception.c,
     4        * new-exceptions/bspsupport/irq.c, ppc403/clock/clock_4xx.c,
     5        * ppc403/include/ppc405ex.h, ppc403/include/ppc405gp.h,
     6        * ppc403/timer/timer.c, rtems/powerpc/powerpc.h,
     7        * shared/include/cpuIdent.c, shared/include/cpuIdent.h,
     8        * shared/include/powerpc-utility.h:
     9        Added support for PPC405EX (contributed by Michael Hamel)
     10       
    1112008-07-11      Sebastian Huber <sebastian.huber@embedded-brains.de>
    212
     
    1626
    1727        * new-exceptions/bspsupport/ppc_exc.S,
    18         new-exceptions/bspsupport/ppc_exc_asm_macros.h,
    19         new-exceptions/bspsupport/ppc_exc_bspsupp.h,
    20         new-exceptions/bspsupport/ppc_exc_hdl.c,
    21         new-exceptions/bspsupport/vectors.h,
    22         new-exceptions/bspsupport/vectors_init.c: Conistent code layout in most
    23         assember code sections and usage of defines for registers.  Usage of
    24         standard header files to avoid multiple definitions.
     28        * new-exceptions/bspsupport/ppc_exc_asm_macros.h,
     29        * new-exceptions/bspsupport/ppc_exc_bspsupp.h,
     30        * new-exceptions/bspsupport/ppc_exc_hdl.c,
     31        * new-exceptions/bspsupport/vectors.h,
     32        * new-exceptions/bspsupport/vectors_init.c:
     33        Conistent code layout in most assember code sections and usage of
     34        defines for registers.  Usage of standard header files to avoid
     35        multiple definitions.
    2536       
    2637        Optimized exception code: Removed many branches and exploit branch
  • c/src/lib/libcpu/powerpc/Makefile.am

    r9ec91233 r3c6fe2e  
    127127endif
    128128
    129 endif
    130 
     129endif # ppc403
     130
     131if ppc405
     132
     133## ppc4xx/include
     134include_ppc4xxdir = $(includedir)/ppc4xx
     135include_ppc4xx_HEADERS = ppc403/include/ppc405gp.h \
     136                         ppc403/include/ppc405ex.h
     137
     138endif # ppc405
     139
     140
     141## mpc5xx
    131142EXTRA_DIST += mpc5xx/README
    132143if mpc5xx
     
    342353
    343354if mpc83xx
     355
    344356include_mpc83xxdir = $(includedir)/mpc83xx
    345357include_mpc83xx_HEADERS  = mpc83xx/include/mpc83xx.h
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq.c

    r9ec91233 r3c6fe2e  
    3939
    4040SPR_RW(BOOKE_TSR)
     41SPR_RW(PPC405_TSR)
    4142
    4243/* legacy mode for bookE DEC exception;
     
    5354         * before C_dispatch_irq_handler()
    5455         * re-enables MSR_EE.
     56         * Note that PPC405 uses a different SPR# for TSR
    5557         */
    56         _write_BOOKE_TSR( BOOKE_TSR_DIS );
     58        if ( ppc_cpu_is_bookE()==PPC_BOOKE_405)
     59                _write_PPC405_TSR( BOOKE_TSR_DIS );
     60        else
     61                _write_BOOKE_TSR( BOOKE_TSR_DIS );
    5762        return C_dispatch_irq_handler(frame, ASM_DEC_VECTOR);   
    5863}
  • c/src/lib/libcpu/powerpc/new-exceptions/raw_exception.c

    r9ec91233 r3c6fe2e  
    163163static const cat_ini_t ppc_405_vector_categories[LAST_VALID_EXC + 1] = {
    164164  [ ASM_EXT_VECTOR             ] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC,
    165   [ ASM_BOOKE_DEC_VECTOR       ] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC,
     165  [ ASM_BOOKE_DEC_VECTOR       ] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC,             /* PIT */
     166  [ ASM_BOOKE_FIT_VECTOR       ] = PPC_EXC_CLASSIC | PPC_EXC_ASYNC,             /* FIT */
    166167
    167168  [ ASM_PROT_VECTOR            ] = PPC_EXC_CLASSIC,
     
    372373            break;
    373374        case PPC_405:
     375        case PPC_405GP:
     376        case PPC_405EX:
    374377                        rval = ppc_405_vector_categories[vector];
    375378            break;
  • c/src/lib/libcpu/powerpc/ppc403/timer/timer.c

    r9ec91233 r3c6fe2e  
    11/*  timer.c
    22 *
    3  *  This file manages the interval timer on the PowerPC 403*.
     3 *  This file manages the interval timer on the PowerPC 405.
    44 *  We shall use the bottom 32 bits of the timebase register,
    55 *
     
    3333 *  Modifications for PPC405GP by Dennis Ehlin
    3434 *
     35 *  Further mods for PPC405EX/EXr by Michael Hamel
     36 *
    3537 *  $Id$
    3638 *
     
    3840
    3941#include <rtems.h>
     42#include <libcpu/powerpc-utility.h>
    4043
    41 static volatile uint32_t   Timer_starting;
    42 static rtems_boolean Timer_driver_Find_average_overhead;
     44extern uint32_t bsp_timer_least_valid;
     45extern uint32_t bsp_timer_average_overhead;
    4346
    44 /*
    45  *  This is so small that this code will be reproduced where needed.
    46  */
    47 static inline uint32_t   get_itimer(void)
    48 {
    49    uint32_t   ret;
    50 
    51 #ifndef ppc405
    52    asm volatile ("mfspr %0, 0x3dd" : "=r" ((ret))); /* TBLO */
    53 #else /* ppc405 */
    54 /*   asm volatile ("mfspr %0, 0x3dd" : "=r" ((ret)));  TBLO */
    55 
    56    asm volatile ("mfspr %0, 0x10c" : "=r" ((ret))); /* 405GP TBL */
    57 #endif /* ppc405 */
    58 
    59    return ret;
    60 }
     47static volatile uint32_t        startedAt;
     48static rtems_boolean            subtractOverhead;
    6149
    6250void Timer_initialize()
    6351{
    64   uint32_t   iocr;
    65 
    66 #ifndef ppc405
    67   asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); /* IOCR */
    68   iocr &= ~4;
    69   iocr |= 4;  /* Select external timer clock */
    70   asm volatile ("mtdcr 0xa0, %0" : "=r" (iocr) : "0" (iocr)); /* IOCR */
    71 #else /* ppc405 */
    72   asm volatile ("mfdcr %0, 0x0b2" : "=r" (iocr));  /*405GP CPC0_CR1 */
    73 /*  asm volatile ("mfdcr %0, 0xa0" : "=r" (iocr)); IOCR */
    74 
    75   /* iocr |= 0x800000;  select external timer clock CETE*/
    76   iocr &= ~0x800000; /* timer clocked from system clock CETE*/
    77 
    78   asm volatile ("mtdcr 0x0b2, %0" : "=r" (iocr) : "0" (iocr)); /* 405GP CPC0_CR1 */
    79 /*  asm volatile ("mtdcr 0xa0, %0" : "=r" (iocr) : "0" (iocr));  IOCR */
    80 #endif /* ppc405 */
    81 
    82   Timer_starting = get_itimer();
     52  /* We are going to rely on clock.c to sort out where the clock comes from */
     53  startedAt = ppc_time_base();
    8354}
    8455
    8556int Read_timer()
    8657{
    87   uint32_t   clicks;
    88   uint32_t   total;
    89   extern uint32_t bsp_timer_least_valid;
    90   extern uint32_t bsp_timer_average_overhead;
     58        uint32_t   clicks, total;
    9159
    92   clicks = get_itimer();
    93 
    94   total = clicks - Timer_starting;
    95 
    96   if ( Timer_driver_Find_average_overhead == 1 )
    97     return total;          /* in XXX microsecond units */
    98 
    99   else {
    100     if ( total < bsp_timer_least_valid )
    101       return 0;            /* below timer resolution */
    102     return (total - bsp_timer_average_overhead);
    103   }
     60        clicks = ppc_time_base();
     61        total = clicks - startedAt;
     62        if ( ! subtractOverhead )
     63                return total;          /* in XXX microsecond units */
     64        else if ( total < bsp_timer_least_valid )
     65                return 0;            /* below timer resolution */
     66        else
     67                return (total - bsp_timer_average_overhead);
    10468}
    10569
    10670rtems_status_code Empty_function( void )
    10771{
    108   return RTEMS_SUCCESSFUL;
     72        return RTEMS_SUCCESSFUL;
    10973}
    11074
    111 void Set_find_average_overhead(
    112   rtems_boolean find_flag
    113 )
     75void Set_find_average_overhead( rtems_boolean find_flag)
    11476{
    115   Timer_driver_Find_average_overhead = find_flag;
     77        subtractOverhead = find_flag;
    11678}
  • c/src/lib/libcpu/powerpc/preinstall.am

    r9ec91233 r3c6fe2e  
    4545        @: > $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
    4646PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
     47
     48$(PROJECT_INCLUDE)/libcpu/powerpc-utility.h: shared/include/powerpc-utility.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
     49        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/powerpc-utility.h
     50PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/powerpc-utility.h
    4751
    4852if !mpc5xx
     
    9498PREINSTALL_FILES += $(PROJECT_INCLUDE)/tty_drv.h
    9599endif
    96 endif
     100endif # ppc403
     101if ppc405
     102$(PROJECT_INCLUDE)/ppc4xx/$(dirstamp):
     103        @$(MKDIR_P) $(PROJECT_INCLUDE)/ppc4xx
     104        @: > $(PROJECT_INCLUDE)/ppc4xx/$(dirstamp)
     105PREINSTALL_DIRS += $(PROJECT_INCLUDE)/ppc4xx/$(dirstamp)
     106
     107$(PROJECT_INCLUDE)/ppc4xx/ppc405gp.h: ppc403/include/ppc405gp.h $(PROJECT_INCLUDE)/ppc4xx/$(dirstamp)
     108        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ppc4xx/ppc405gp.h
     109PREINSTALL_FILES += $(PROJECT_INCLUDE)/ppc4xx/ppc405gp.h
     110
     111$(PROJECT_INCLUDE)/ppc4xx/ppc405ex.h: ppc403/include/ppc405ex.h $(PROJECT_INCLUDE)/ppc4xx/$(dirstamp)
     112        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ppc4xx/ppc405ex.h
     113PREINSTALL_FILES += $(PROJECT_INCLUDE)/ppc4xx/ppc405ex.h
     114endif # ppc405
    97115if mpc5xx
    98116$(PROJECT_INCLUDE)/mpc5xx/$(dirstamp):
  • c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h

    r9ec91233 r3c6fe2e  
    113113#define PPC_D_CACHE             1024
    114114
     115#define PPC_HAS_EXCEPTION_PREFIX 0
     116#define PPC_HAS_EVPR             1
     117
     118#elif defined (ppc405)
     119
     120#define PPC_CACHE_ALIGNMENT     32
     121#define PPC_HAS_RI           0
     122#define PPC_HAS_RFCI            1
     123#define PPC_USE_MULTIPLE        1
     124#define PPC_I_CACHE             16384
     125#define PPC_D_CACHE             16384           /* except GP/CR */
    115126#define PPC_HAS_EXCEPTION_PREFIX 0
    116127#define PPC_HAS_EVPR             1
  • c/src/lib/libcpu/powerpc/shared/include/cpuIdent.c

    r9ec91233 r3c6fe2e  
    3232  switch (cpu) {
    3333    case PPC_405:               return "PPC405";
     34        case PPC_405GP:         return "PPC405GP";
     35        case PPC_405EX:         return "PPC405EX";
    3436    case PPC_601:               return "MPC601";
    3537    case PPC_5XX:               return "MPC5XX";
     
    7072  switch (pvr) {
    7173    case PPC_405:
     74        case PPC_405GP:
     75        case PPC_405EX:
    7276    case PPC_601:
    7377    case PPC_5XX:
     
    129133  switch ( current_ppc_cpu ) {
    130134        case PPC_405:
     135        case PPC_405GP:
     136        case PPC_405EX:
    131137                current_ppc_features.is_bookE                   = PPC_BOOKE_405;
    132138        break;
  • c/src/lib/libcpu/powerpc/shared/include/cpuIdent.h

    r9ec91233 r3c6fe2e  
    3333  PPC_7400 = 0xC,
    3434  PPC_405  = 0x2001,
     35  PPC_405EX = 0x1291,   /* + 405EXr */
     36  PPC_405GP = 0x4011,   /* + 405CR */
     37  PPC_405GPr = 0x5091,
     38  PPC_405EZ = 0x4151,
     39  PPC_405EP = 0x5121,
    3540  PPC_7455 = 0x8001, /* Kate Feng */
    3641  PPC_7457 = 0x8002,
  • c/src/lib/libcpu/powerpc/shared/include/powerpc-utility.h

    r9ec91233 r3c6fe2e  
    1515 * Germany
    1616 * rtems@embedded-brains.de
     17 *
     18 * access function for Device Control Registers inspired by "ppc405common.h"
     19 * from Michael Hamel ADInstruments May 2008
    1720 *
    1821 * The license and distribution terms for this file may be found in the file
     
    190193}
    191194
     195
    192196static inline void *ppc_stack_pointer()
    193197{
     
    301305        PPC_Set_decrementer( dec);
    302306}
     307
     308#define PPC_STRINGOF(x) #x
    303309
    304310/* Do not use the following macros.  Use the inline functions instead. */
     
    325331        PPC_INTERNAL_MACRO_SET_SPECIAL_PURPOSE_REGISTER( spr, val)
    326332
     333/*
     334 * PPC4xx have Device Control Registers...
     335 */
     336#define PPC_DEVICE_CONTROL_REGISTER(dcr)                        \
     337  ({uint32_t val;asm volatile ("mfspr %0," PPC_STRINGOF(dcr)    \
     338                               : "=r" (val)); val;})
     339
     340#define PPC_SET_DEVICE_CONTROL_REGISTER(dcr,val)        \
     341  do {                                                  \
     342    asm volatile ("mtspr " PPC_STRINGOF(dcr)",%0"       \
     343                  :: "r" (val));                        \
     344    } while (0)
     345
     346
    327347static inline uint32_t ppc_special_purpose_register_0()
    328348{
  • cpukit/preinstall.am

    r9ec91233 r3c6fe2e  
    127127PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/tar.h
    128128
     129$(PROJECT_INCLUDE)/rtems/status-checks.h: include/rtems/status-checks.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     130        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/status-checks.h
     131PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/status-checks.h
     132
    129133$(PROJECT_INCLUDE)/rtems/endian.h: include/rtems/endian.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    130134        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/endian.h
     
    134138        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/irq.h
    135139PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/irq.h
     140
     141$(PROJECT_INCLUDE)/rtems/irq-extension.h: include/rtems/irq-extension.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     142        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/irq-extension.h
     143PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/irq-extension.h
    136144
    137145$(PROJECT_INCLUDE)/rtems/imfs.h: libfs/src/imfs/imfs.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
  • cpukit/score/cpu/powerpc/ChangeLog

    r9ec91233 r3c6fe2e  
     12008-07-14      Thomas Doerfler <thomas.doerfler@embedded-brains.de>
     2        * rtems/powerpc/registers.h:
     3
     4        Added PPC405EX support contributed by Michael Hamel
     5
    162008-07-10      Sebastian Huber <sebastian.huber@embedded-brains.de>
    27
  • cpukit/score/cpu/powerpc/rtems/powerpc/registers.h

    r9ec91233 r3c6fe2e  
    293293#define BOOKE_DECAR     54
    294294
     295#define PPC405_TSR      0x3D8
    295296#define BOOKE_TSR       336
    296297#define BOOKE_TSR_ENW           (1<<31)
     
    299300#define BOOKE_TSR_FIS           (1<<26)
    300301
     302#define PPC405_TCR      0x3DA
    301303#define BOOKE_TCR       340
    302304#define BOOKE_TCR_WP(x)         (((x)&3)<<30)
Note: See TracChangeset for help on using the changeset viewer.