diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-18 21:22:58 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-18 21:22:58 +0000 |
commit | 4a238002e71ec018723229f8669363a5ffb7302e (patch) | |
tree | fc5a57faf9a30225bd1f3fa2d713b85815cb77ef /c/src/lib/libbsp/sh/gensh1/include | |
parent | Corrected to include extra arguments for simulators on sparc (diff) | |
download | rtems-4a238002e71ec018723229f8669363a5ffb7302e.tar.bz2 |
Patch from "John M. Mills" <jmills@tga.com> with subsequent cleanup from
Ralf Corsepius <corsepiu@faw.uni-ulm.de> that adds initial Hitachi SH-2
support to RTEMS. Ralf's comments are:
Changes:
------
1. SH-Port:
* Many files renamed.
* CONSOLE_DEVNAME and MHZ defines removed from libcpu.
* console.c moved to libbsp/sh/shared, build in libbsp/sh/<BSP>/console
applying VPATH.
* CONSOLE_DEVNAME made BSP-specific, replacement is defined in bsp.h
* MHZ define replaced with HZ (extendent resolution) in custom/*.cfg
* -DHZ=HZ used in bspstart.c, only
* Makefile variable HZ used in bsp-dependent directories only.
2. SH1-Port
* clock-driver rewritten to provide better resolution for odd CPU
frequencies. This driver is only partially tested on hardware, ie.
sightly experimental, but I don't expect severe problems with it.
* Polling SCI-driver added. This driver is experimental and completly
untested yet. Therefore it is not yet used for the console (/dev/console
is still pointing to /dev/null, cf. gensh1/bsp.h).
* minor changes to the timer driver
* SH1 specific delay()/CPU_delay() now is implemented as a function
3. SH2-Port
* Merged
* IMO, the code is still in its infancy. Therefore I have interspersed
comments (FIXME) it for items which I think John should look after.
* sci and console drivers partially rewritten and extended (John, I hope
you don't mind).
* Copyright notices are not yet adapted
Diffstat (limited to 'c/src/lib/libbsp/sh/gensh1/include')
-rw-r--r-- | c/src/lib/libbsp/sh/gensh1/include/bsp.h | 63 |
1 files changed, 15 insertions, 48 deletions
diff --git a/c/src/lib/libbsp/sh/gensh1/include/bsp.h b/c/src/lib/libbsp/sh/gensh1/include/bsp.h index 8ac21df14e..f02abe156d 100644 --- a/c/src/lib/libbsp/sh/gensh1/include/bsp.h +++ b/c/src/lib/libbsp/sh/gensh1/include/bsp.h @@ -30,14 +30,22 @@ extern "C" { #endif -#define CPU_CONSOLE_DEVNAME "/dev/null" - - #include <rtems.h> #include <clockdrv.h> -#include <sh/null.h> #include <console.h> +/* EDIT: To activate the sci driver, change the define below */ +#if 1 +#include <sh/null.h> +#define BSP_CONSOLE_DEVNAME "/dev/null" +#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVNULL_DRIVER_TABLE_ENTRY +#else +#include <sh/sci.h> +#define BSP_CONSOLE_DEVNAME "/dev/sci0" +#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVSCI_DRIVER_TABLE_ENTRY +#endif + + /* * Define the time limits for RTEMS Test Suite test durations. * Long test and short test duration limits are provided. These @@ -68,39 +76,14 @@ extern "C" { #define Lower_tm27_intr() /* Constants */ -#ifndef MHZ -#error Missing MHZ -#endif /* * Simple spin delay in microsecond units for device drivers. * This is very dependent on the clock speed of the target. - * - * Since we don't have a real time clock, this is a very rough - * approximation, assuming that each cycle of the delay loop takes - * approx. 4 machine cycles. - * - * e.g.: MHZ = 20 => 5e-8 secs per instruction - * => 4 * 5e-8 secs per delay loop */ -#define delay( microseconds ) \ -{ register unsigned int _delay = (microseconds) * (MHZ / 4 ); \ - asm volatile ( \ -"0: add #-1,%0\n \ - nop\n \ - cmp/pl %0\n \ - bt 0b\ - nop" \ - :: "r" (_delay) ); \ -} - -/* - * For backward compatibility only. - * Do not rely on them being present in future - */ -#define CPU_delay( microseconds ) delay( microseconds ) -#define sh_delay( microseconds ) delay( microseconds ) +#define delay( microseconds ) CPU_delay(microseconds) +#define sh_delay( microseconds ) CPU_delay(microseconds) /* * Defined in the linker script 'linkcmds' @@ -128,13 +111,9 @@ extern void bsp_cleanup( void ); /* * We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console */ -#if defined(CONSOLE_DRIVER_TABLE_ENTRY) -#warning Overwriting CONSOLE_DRIVER_TABLE_ENTRY #undef CONSOLE_DRIVER_TABLE_ENTRY -#endif - #define CONSOLE_DRIVER_TABLE_ENTRY \ - DEVNULL_DRIVER_TABLE_ENTRY, \ + BSP_CONSOLE_DRIVER_TABLE_ENTRY, \ { console_initialize, console_open, console_close, \ console_read, console_write, console_control } @@ -142,18 +121,6 @@ extern void bsp_cleanup( void ); * NOTE: Use the standard Clock driver entry */ -/* - * FIXME: Should this go to libcpu/sh/sh7032 ? - */ -#if 0 -/* functions */ -sh_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -); -#endif - #ifdef __cplusplus } #endif |