source: rtems/c/src/lib/libbsp/sh/gensh4/include/bsp.h @ 8c39829

4.104.114.84.95
Last change on this file since 8c39829 was 8c39829, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:52:46 PM

2003-09-04 Joel Sherrill <joel@…>

  • console/console.c, hw_init/hw_init.c, include/bsp.h, include/coverhd.h, include/sdram.h, start/start.S, startup/bspstart.c, startup/linkcmds, startup/linkcmds.rom, startup/linkcmds.rom2ram: URL for license changed.
  • Property mode set to 100644
File size: 4.1 KB
Line 
1/*
2 *  This include file contains all board IO definitions.
3 *
4 *  generic sh4 BSP
5 *
6 *  Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
7 *  Author: Victor V. Vengerov <vvv@oktet.ru>
8 *
9 *  Based on work:
10 *  Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
11 *
12 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
13 *
14 *  This program is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 *
19 *  COPYRIGHT (c) 1998-2001.
20 *  On-Line Applications Research Corporation (OAR).
21 *
22 *  The license and distribution terms for this file may be
23 *  found in the file LICENSE in this distribution or at
24 *  http://www.rtems.com/license/LICENSE.
25 *
26 *  Minor adaptations for sh2 by:
27 *  John M. Mills (jmills@tga.com)
28 *  TGA Technologies, Inc.
29 *  100 Pinnacle Way, Suite 140
30 *  Norcross, GA 30071 U.S.A.
31 *
32 *  This modified file may be copied and distributed in accordance
33 *  the above-referenced license. It is provided for critique and
34 *  developmental purposes without any warranty nor representation
35 *  by the authors or by TGA Technologies.
36 *
37 *  $Id$
38 */
39
40#ifndef __gensh4_h
41#define __gensh4_h
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#include <rtems.h>
48#include <clockdrv.h>
49#include <console.h>
50#include <bspopts.h>
51
52#include "rtems/score/sh7750_regs.h"
53
54
55/*
56 *  confdefs.h overrides for this BSP:
57 *   - number of termios serial ports (defaults to 1)
58 *   - Interrupt stack space is not minimum if defined.
59 */
60
61/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
62#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
63
64/*
65 *  Define the time limits for RTEMS Test Suite test durations.
66 *  Long test and short test duration limits are provided.  These
67 *  values are in seconds and need to be converted to ticks for the
68 *  application.
69 *
70 */
71
72#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
73#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
74
75/*
76 *  Stuff for Time Test 27
77 */
78
79#define MUST_WAIT_FOR_INTERRUPT 1
80
81#ifndef SH7750_EVT_WDT_ITI
82#   error "..."
83#endif
84
85#define Install_tm27_vector( handler ) \
86{ \
87    rtems_isr_entry old_handler; \
88    rtems_status_code status; \
89    status = rtems_interrupt_catch( (handler), \
90            SH7750_EVT_TO_NUM(SH7750_EVT_WDT_ITI), &old_handler); \
91    if (status != RTEMS_SUCCESSFUL) \
92        printf("Status of rtems_interrupt_catch = %d", status); \
93}
94
95#define Cause_tm27_intr() \
96{ \
97    *(volatile rtems_unsigned16 *)SH7750_IPRB |= 0xf000; \
98    *(volatile rtems_unsigned16 *)SH7750_WTCSR = SH7750_WTCSR_KEY; \
99    *(volatile rtems_unsigned16 *)SH7750_WTCNT = SH7750_WTCNT_KEY | 0xfe; \
100    *(volatile rtems_unsigned16 *)SH7750_WTCSR = \
101                            SH7750_WTCSR_KEY | SH7750_WTCSR_TME; \
102}
103
104#define Clear_tm27_intr() \
105{ \
106    *(volatile rtems_unsigned16 *)SH7750_WTCSR = SH7750_WTCSR_KEY; \
107}
108
109#define Lower_tm27_intr() \
110{ \
111    sh_set_interrupt_level((SH7750_IPRB & 0xf000) << SH4_SR_IMASK_S); \
112}
113
114/* Constants */
115
116/*
117 *  Simple spin delay in microsecond units for device drivers.
118 *  This is very dependent on the clock speed of the target.
119 */
120
121#define delay( microseconds ) CPU_delay(microseconds)
122#define sh_delay( microseconds ) CPU_delay( microseconds )
123
124
125/*
126 * Defined in the linker script 'linkcmds'
127 */
128
129extern unsigned32       HeapStart ;
130extern unsigned32       HeapEnd ;
131extern unsigned32       WorkSpaceStart ;
132extern unsigned32       WorkSpaceEnd ;
133
134extern void *CPU_Interrupt_stack_low ;
135extern void *CPU_Interrupt_stack_high ;
136
137/*
138 * Defined in start.S
139 */
140extern unsigned32 boot_mode;
141#define SH4_BOOT_MODE_FLASH 0
142#define SH4_BOOT_MODE_IPL   1
143 
144/* miscellaneous stuff assumed to exist */
145
146extern rtems_configuration_table BSP_Configuration;
147
148extern void bsp_cleanup( void );
149
150
151/*
152 *  Device Driver Table Entries
153 */
154
155/*
156 * We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
157 */
158#undef CONSOLE_DRIVER_TABLE_ENTRY
159#define CONSOLE_DRIVER_TABLE_ENTRY \
160  { console_initialize, console_open, console_close, \
161      console_read, console_write, console_control }
162 
163/*
164 * NOTE: Use the standard Clock driver entry
165 */
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif
172/* end of include file */
Note: See TracBrowser for help on using the repository browser.