Changeset 716f6be in rtems


Ignore:
Timestamp:
May 1, 2007, 7:16:04 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
79a1352
Parents:
e890774
Message:

2007-05-01 Ray Xu <xr@…>

  • lpc22xx/clock/clockdrv.c, lpc22xx/include/lpc22xx.h, lpc22xx/irq/bsp_irq_asm.S, lpc22xx/irq/bsp_irq_init.c, lpc22xx/irq/irq.c, lpc22xx/irq/irq.h, lpc22xx/timer/timer.c: Update BSP to address changes between 4.7 and CVS head as well as to address comments from Ralf and Joel.
Location:
c/src/lib/libcpu/arm
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/ChangeLog

    re890774 r716f6be  
     12007-05-01      Ray Xu <xr@trasin.net>
     2
     3        * lpc22xx/clock/clockdrv.c, lpc22xx/include/lpc22xx.h,
     4        lpc22xx/irq/bsp_irq_asm.S, lpc22xx/irq/bsp_irq_init.c,
     5        lpc22xx/irq/irq.c, lpc22xx/irq/irq.h, lpc22xx/timer/timer.c: Update
     6        BSP to address changes between 4.7 and CVS head as well as to address
     7        comments from Ralf and Joel.
     8
    192007-04-25      Ralf Corsépius <ralf.corsepius@rtems.org>
    210
  • c/src/lib/libcpu/arm/lpc22xx/clock/clockdrv.c

    re890774 r716f6be  
    11/*
    2  *  LPC22XX clock specific using the System Timer
    3  * set the Time0
     2 *  LPC22XX/LPC21xx clock specific using the System Timer
     3 * Copyright (c) 2006 by Ray <rayx.cn@gmail.com>
     4 *  Set the Time0 to generate click for RTEMS
     5 *
    46 *  This is hardware specific part of the clock driver. At the end of this
    57 *  file, the generic part of the driver is #included.
     
    7779 */
    7880 
    79   /* set timer to generate interrupt every BSP_Configuration.microseconds_per_tick */
    80   /* MR0/(LPC22xx_Fpclk/(PR0+1)) = 10/1000 = 0.01s */
    81                        
     81  /* set timer to generate interrupt every BSP_Configuration.microseconds_per_tick
     82   * MR0/(LPC22xx_Fpclk/(PR0+1)) = 10/1000 = 0.01s
     83   */                   
    8284       
    8385#define Clock_driver_support_initialize_hardware() \
     
    104106        BSP_remove_rtems_irq_handler(&clock_isr_data);                  \
    105107     } while (0)
     108
     109uint32_t bsp_clock_nanoseconds_since_last_tick(void)
     110{
     111        uint32_t clicks;
     112       
     113        clicks = T0TC;  /*T0TC is the 32bit time counter 0*/
     114       
     115        return (uint32_t) (BSP_Configuration.microseconds_per_tick - clicks) * 1000;
     116}
     117       
     118#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
     119
     120
    106121
    107122/**
  • c/src/lib/libcpu/arm/lpc22xx/include/lpc22xx.h

    re890774 r716f6be  
    11/*
    2  * Motorola LPC22XX Register definitions
     2 * Philips LPC22XX/LPC21xx Register definitions
    33 *
    4  * Copyright (c) 2003 by Cogent Computer Systems
    5  * Written by Jay Monkman <jtm@lopingdog.com>
     4 * Copyright (c) 2006 by Ray <rayx.cn@gmail.com>
    65 *     
    76 *  The license and distribution terms for this file may be
  • c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S

    re890774 r716f6be  
    11/*
    2  *  LPC22XX Intererrupt handler
     2 *  LPC22XX/LPC21xx Intererrupt handler
    33 *
    4  *  Copyright (c) 2002 by Jay Monkman <jtm@lopingdog.com>
    5  *
    6  *  Modified by ray
     4 *  Modified by Ray <rayx.cn@gmail.com> 2006 from Jay Monkman's code
    75 *
    86 *  The license and distribution terms for this file may be
  • c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c

    re890774 r716f6be  
    11/*
    2  * Motorola LPC22XX Interrupt handler
    3  *
    4  * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
    5  *     
     2 * Motorola LPC22XX/LPC21xx Interrupt handler
     3 *  Modified by Ray 2006 <rayx.cn@gmail.com> to support LPC ARM     
    64 *  The license and distribution terms for this file may be
    75 *  found in the file LICENSE in this distribution or at
     
    2523void BSP_rtems_irq_mngt_init()
    2624{
     25  long *vectorTable;
     26  int i;
    2727
    2828    /* disable all interrupts */
    2929  VICIntEnClr = 0xFFFFFFFF;
    3030
     31  vectorTable = (long *) VECTOR_TABLE;
     32  /* Initialize the vector table contents with default handler */
     33  for (i=0; i<BSP_MAX_INT; i++) {
     34      *(vectorTable + i) = (long)(default_int_handler);
     35  }
    3136   
    3237  /*
     
    6368  VICIntSelect = 0;
    6469 
    65 
    6670}
    6771
  • c/src/lib/libcpu/arm/lpc22xx/irq/irq.c

    re890774 r716f6be  
    22 * Philps LPC22XX Interrupt handler
    33 *
    4  * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
    5  * Modified by ray     
     4 * Copyright (c)  2006 by Ray<rayx.cn@gmail.com>  to support LPC ARM     
    65 *  The license and distribution terms for this file may be
    76 *  found in the file LICENSE in this distribution or at
  • c/src/lib/libcpu/arm/lpc22xx/irq/irq.h

    re890774 r716f6be  
    22 * Interrupt handler Header file
    33 *
    4  * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
     4 * Copyright (c) 2006 by Ray <rayx.cn@gmail.com> to support LPC ARM 
    55 *     
    66 *  The license and distribution terms for this file may be
  • c/src/lib/libcpu/arm/lpc22xx/timer/timer.c

    re890774 r716f6be  
    44 * This uses Timer1 for timing measurments.
    55 * 
    6  *  By Ray xu, modify form Mc9328mxl    RTEMS DSP
     6 *  By Ray xu<rayx.cn@gmail.com>, modify form Mc9328mxl RTEMS DSP
    77 *
    88 *  The license and distribution terms for this file may be
     
    4545void Timer_initialize( void )
    4646{
    47         T1TCR &= 0;      /* disable and clear timer 0  */
    48        g_start = (T1TC/(LPC22xx_Fpclk/1000000));
    49        T1PC  = 0;            /* TC is incrementet on every pclk.*/
    50         T1MR0 = ((LPC22xx_Fpclk/1000* BSP_Configuration.microseconds_per_tick) / 1000); /* initialize the timer period and prescaler */ 
    51        T1EMR = 0;  /*No external match*/
    52         T1TCR = 1; /*enable timer1*/
    5347       g_freq = LPC22xx_Fpclk / 1000;
    5448}
     
    7468  unsigned long long total;
    7569 
    76   t = (T1TC/(LPC22xx_Fpclk/1000000));
     70  return (T0TC/(LPC22xx_Fpclk/1000000));
    7771  /*
    7872   *  Total is calculated by taking into account the number of timer overflow
    7973   *  interrupts since the timer was initialized and clicks since the last
    80    *  interrupts. currently it is not supported
     74   *  interrupts.
    8175   */
    82 
    83   total = (t - g_start);
    84 
    85   /* convert to nanoseconds */
    86 
    87   if ( Timer_driver_Find_average_overhead == 1 ) {
    88     return (int) total;
    89   } else if ( total < LEAST_VALID ) {
    90       return 0;       
    91   }
    92   /*
    93    *  Somehow convert total into microseconds
    94    */
    95 
    96   return (total - AVG_OVERHEAD);
    9776}
    9877
Note: See TracChangeset for help on using the changeset viewer.