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

4.104.114.84.95
Last change on this file since 66387986 was 96462044, checked in by Joel Sherrill <joel.sherrill@…>, on 10/11/01 at 19:04:12

2001-10-11 Alexandra Kossovsky <sasha@…>

  • Makefile.am, README, bsp_specs, .cvsignore, include/Makefile.am, include/bsp.h, include/coverhd.h, include/sdram.h, include/.cvsignore, start/Makefile.am, start/start.S, start/.cvsignore, startup/Makefile.am, startup/bspstart.c, startup/linkcmds, startup/linkcmds.rom, startup/linkcmds.rom2ram, startup/.cvsignore, wrapup/Makefile.am, wrapup/.cvsignore, hw_init/Makefile.am, hw_init/hw_init.c, hw_init/.cvsignore, times, configure.ac: New files. Reviewed and updated to latest automake and autoconf standards by Ralf Corsepius <corsepiu@…>.
  • Property mode set to 100644
File size: 4.2 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.OARcorp.com/rtems/license.html.
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 "rtems/score/sh7750_regs.h"
51
52/*
53 *  confdefs.h overrides for this BSP:
54 *   - number of termios serial ports (defaults to 1)
55 *   - Interrupt stack space is not minimum if defined.
56 */
57
58/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
59#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
60
61/*
62 *  Define the time limits for RTEMS Test Suite test durations.
63 *  Long test and short test duration limits are provided.  These
64 *  values are in seconds and need to be converted to ticks for the
65 *  application.
66 *
67 */
68
69#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
70#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
71
72/*
73 *  Stuff for Time Test 27
74 */
75
76#define MUST_WAIT_FOR_INTERRUPT 1
77
78#ifndef SH7750_EVT_WDT_ITI
79#   error "..."
80#endif
81
82#define Install_tm27_vector( handler ) \
83{ \
84    rtems_isr_entry old_handler; \
85    rtems_status_code status; \
86    status = rtems_interrupt_catch( (handler), \
87            SH7750_EVT_TO_NUM(SH7750_EVT_WDT_ITI), &old_handler); \
88    if (status != RTEMS_SUCCESSFUL) \
89        printf("Status of rtems_interrupt_catch = %d", status); \
90}
91
92#define Cause_tm27_intr() \
93{ \
94    *(volatile rtems_unsigned16 *)SH7750_IPRB |= 0xf000; \
95    *(volatile rtems_unsigned16 *)SH7750_WTCSR = SH7750_WTCSR_KEY; \
96    *(volatile rtems_unsigned16 *)SH7750_WTCNT = SH7750_WTCNT_KEY | 0xfe; \
97    *(volatile rtems_unsigned16 *)SH7750_WTCSR = \
98                            SH7750_WTCSR_KEY | SH7750_WTCSR_TME; \
99}
100
101#define Clear_tm27_intr() \
102{ \
103    *(volatile rtems_unsigned16 *)SH7750_WTCSR = SH7750_WTCSR_KEY; \
104}
105
106#define Lower_tm27_intr() \
107{ \
108    sh_set_interrupt_level((SH7750_IPRB & 0xf000) << SH4_SR_IMASK_S); \
109}
110
111/* Constants */
112
113/*
114 *  Simple spin delay in microsecond units for device drivers.
115 *  This is very dependent on the clock speed of the target.
116 */
117
118#define delay( microseconds ) CPU_delay(microseconds)
119#define sh_delay( microseconds ) CPU_delay( microseconds )
120
121
122/*
123 * Defined in the linker script 'linkcmds'
124 */
125
126extern unsigned32       HeapStart ;
127extern unsigned32       HeapEnd ;
128extern unsigned32       WorkSpaceStart ;
129extern unsigned32       WorkSpaceEnd ;
130
131extern void *CPU_Interrupt_stack_low ;
132extern void *CPU_Interrupt_stack_high ;
133
134/*
135 * This variable is nesessary for console driver.
136 */
137extern rtems_unsigned32 SH4_CPU_HZ_Frequency;
138
139/*
140 * Defined in start.S
141 */
142extern unsigned32 boot_mode;
143#define SH4_BOOT_MODE_FLASH 0
144#define SH4_BOOT_MODE_IPL   1
145 
146/* miscellaneous stuff assumed to exist */
147
148extern rtems_configuration_table BSP_Configuration;
149
150extern void bsp_cleanup( void );
151
152
153/*
154 *  Device Driver Table Entries
155 */
156
157/*
158 * We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
159 */
160#undef CONSOLE_DRIVER_TABLE_ENTRY
161#define CONSOLE_DRIVER_TABLE_ENTRY \
162  { console_initialize, console_open, console_close, \
163      console_read, console_write, console_control }
164 
165/*
166 * NOTE: Use the standard Clock driver entry
167 */
168
169#ifdef __cplusplus
170}
171#endif
172
173#endif
174/* end of include file */
Note: See TracBrowser for help on using the repository browser.