Changeset 11edb53 in rtems


Ignore:
Timestamp:
Nov 27, 2000, 5:52:48 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
66fedb46
Parents:
a080705
Message:

2000-11-27 Joel Sherrill <joel@…>

  • README, sim68000.setup, clock/clockdrv.c: Modified to add support for timer as clock tick source. Compiles but untested.
Location:
c/src/lib/libbsp/m68k/sim68000
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/sim68000/README

    ra080705 r11edb53  
    55BSP for the BSVC 68000 simulator.  This is definitely under construction.
    66The initialization/setup script for BSVC is the part that likely needs
    7 work.
     7work.  I have written the timer based on the timer sample included with
     8bsvc 2.1. 
     9
     10At this point, hello does not even print.
    811
    912--joel
  • c/src/lib/libbsp/m68k/sim68000/clock/clockdrv.c

    ra080705 r11edb53  
    77#include <bsp.h>
    88
    9 #define CLOCK_VECTOR 0
     9#define CLOCK_VECTOR 84
    1010
    1111#define Clock_driver_support_install_isr( _new, _old )  \
     
    1313
    1414
    15 #define Clock_driver_support_initialize_hardware()
     15typedef struct {
     16  volatile unsigned8  cr;       /*  0 -  0 : Timer Control Register */
     17  volatile unsigned8  pad0;     /*  1 -  1 : pad */
     18  volatile unsigned8  ivr;      /*  2 -  2 : Timer Interrupt Vector Register */
     19  volatile unsigned8  pad1;     /*  3 -  3 : pad */
     20  volatile unsigned32 cpr;      /*  4 -  7 : Timer Counter Preload Register */
     21  volatile unsigned8  pad2[12]; /*  8 - 19 : pad */
     22  volatile unsigned32 sr;       /* 20 - 23 : Timer Status Register */
     23} timer_hw_t;
    1624
    17 #define Clock_driver_support_at_tick() \
    18   Clock_driver_support_initialize_hardware()
     25#define TIMER_BASE (timer_hw_t *)0x72001
    1926
    20 #define Clock_driver_support_shutdown_hardware()
     27/* 8 microseconds per click, 125,000 per second */
     28
     29/* XXX should check that microseconds_per_tick is >= 8 */
     30void Clock_driver_support_initialize_hardware()
     31{
     32  timer_hw_t *t = TIMER_BASE;
     33
     34  t->ivr = CLOCK_VECTOR;
     35  t->cpr = rtems_configuration_get_microseconds_per_tick() / 8;
     36  t->cr  = 0xA0;  /* initialize with timer disabled */
     37  t->cr  = 0xA1;  /* enable timer */
     38}
     39
     40void Clock_driver_support_at_tick()
     41{
     42  timer_hw_t *t = TIMER_BASE;
     43 
     44  t->sr  = 0xA0;  /* Negate timer interrupt request */
     45}
     46 
     47
     48void Clock_driver_support_shutdown_hardware()
     49{
     50  timer_hw_t *t = TIMER_BASE;
     51
     52  t->cr  = 0xA0;  /* initialize with timer disabled */
     53}
    2154
    2255#include "../../../shared/clockdrv_shell.c"
  • c/src/lib/libbsp/m68k/sim68000/sim68000.setup

    ra080705 r11edb53  
    66COMMAND {AttachDevice 0 RAM {BaseAddress = 40000 Size = 20000}}
    77COMMAND {AttachDevice 0 M68681 {BaseAddress = 71001 OffsetToFirstRegister = 0 OffsetBetweenRegisters = 2 InterruptLevel = 4 PortAStandardInputOutputFlag = 0 PortBStandardInputOutputFlag = 0 PortACommand = xterm -T "M68681 Port A" -132 -fn fixed -e /usr3/tmp/bsvc-2.1/bin/xtermpipe PortBCommand = }}
     8COMMAND {AttachDevice 0 Timer {BaseAddress = 72001 IRQ = 5}}
Note: See TracChangeset for help on using the changeset viewer.