summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sh/gensh1
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/sh/gensh1')
-rw-r--r--c/src/lib/libbsp/sh/gensh1/Makefile.in2
-rw-r--r--c/src/lib/libbsp/sh/gensh1/README8
-rw-r--r--c/src/lib/libbsp/sh/gensh1/include/bsp.h63
-rw-r--r--c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in2
-rw-r--r--c/src/lib/libbsp/sh/gensh1/startup/bspstart.c4
-rw-r--r--c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in10
6 files changed, 31 insertions, 58 deletions
diff --git a/c/src/lib/libbsp/sh/gensh1/Makefile.in b/c/src/lib/libbsp/sh/gensh1/Makefile.in
index 69aaa0d548..c495ae5306 100644
--- a/c/src/lib/libbsp/sh/gensh1/Makefile.in
+++ b/c/src/lib/libbsp/sh/gensh1/Makefile.in
@@ -20,7 +20,7 @@ INSTALL_CHANGE = @INSTALL_CHANGE@
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
-SUB_DIRS = include start startup scitab wrapup
+SUB_DIRS = include start startup scitab console wrapup
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
diff --git a/c/src/lib/libbsp/sh/gensh1/README b/c/src/lib/libbsp/sh/gensh1/README
index c75ad9927e..ce465b16a2 100644
--- a/c/src/lib/libbsp/sh/gensh1/README
+++ b/c/src/lib/libbsp/sh/gensh1/README
@@ -45,6 +45,10 @@ STOP BITS: n/a
NOTES
=====
-(1) Only stub console driver available at the moment.
- Driver for the on-chip serial devices (sci) will be available soon.
+(1) The stub console driver (null) is enabled by default.
+(2) The driver for the on-chip serial devices (sci) is still in its infancy
+ and not fully tested. It may even be non-functional and therefore is
+ disabled by default. Please let us know any problems you encounter with
+ it.
+ To activate it edit libbsp/sh/gensh1/include/bsp.h
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
diff --git a/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in b/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in
index 1593251658..9919c0ec7e 100644
--- a/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in
+++ b/c/src/lib/libbsp/sh/gensh1/scitab/Makefile.in
@@ -64,7 +64,7 @@ $(PGM): $(SRCS) ${OBJS}
all: ${ARCH} $(SRCS) $(PGM)
scitab.c: $(SHGEN)
- $(SHGEN) -M $(MHZ) sci > $@
+ $(SHGEN) -H $(HZ) sci > $@
# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
install: all
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c
index 08aaf8d905..7f0d7f8436 100644
--- a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c
+++ b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c
@@ -126,9 +126,9 @@ void bsp_start(void)
Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
Cpu_table.postdriver_hook = bsp_postdriver_hook;
-
+
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
Cpu_table.interrupt_stack_size = 4096;
#endif
-
+ Cpu_table.clicks_per_second = HZ ;
}
diff --git a/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in b/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in
index c879e6a870..231bef4fa5 100644
--- a/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in
+++ b/c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.in
@@ -15,11 +15,11 @@ PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@
-BSP_PIECES = startup scitab
+BSP_PIECES = startup scitab console
GENERIC_PIECES =
# pieces to pick up out of libcpu/sh
-CPU_PIECES = sh7032/null sh7032/clock sh7032/console sh7032/timer
+CPU_PIECES = sh7032/null sh7032/clock sh7032/timer sh7032/sci sh7032/delay
# bummer; have to use $foreach since % pattern subst rules only replace 1x
OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
@@ -61,8 +61,10 @@ CLOBBER_ADDITIONS +=
$(LIB): ${OBJS}
$(make-library)
-all: ${ARCH} $(SRCS) $(LIB)
- $(INSTALL_VARIANT) -m 644 $(LIB) $(PROJECT_RELEASE)/lib
+$(PROJECT_RELEASE)/lib/libbsp$(LIBSUFFIX_VA): $(LIB)
+ $(INSTALL_DATA) $^ $@
+
+all: ${ARCH} $(SRCS) $(PROJECT_RELEASE)/lib/libbsp$(LIBSUFFIX_VA)
install: all