From f0ef873cca7d6cc07ad7b81a1459d64fae18c723 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 May 2001 13:12:23 +0000 Subject: 2001-05-09 Ralf Corsepius * scitab/.cvsignore: Add. * configure.in: Add --enable-console, CPU_CLOCK_RATE_HZ, autoheader bspopt.h. * include/bsp.h: Complete rewrite based on the AMOS-BSP. * README: Update. * bsp_specs: copy from gensh1 --- c/src/lib/libbsp/sh/shsim/ChangeLog | 9 +++ c/src/lib/libbsp/sh/shsim/README | 18 ++++-- c/src/lib/libbsp/sh/shsim/bsp_specs | 15 +++-- c/src/lib/libbsp/sh/shsim/configure.in | 54 +++++++++++++++++ c/src/lib/libbsp/sh/shsim/include/bsp.h | 92 +++++++++++++++++++++-------- c/src/lib/libbsp/sh/shsim/scitab/.cvsignore | 2 + 6 files changed, 154 insertions(+), 36 deletions(-) create mode 100644 c/src/lib/libbsp/sh/shsim/scitab/.cvsignore (limited to 'c/src/lib/libbsp/sh/shsim') diff --git a/c/src/lib/libbsp/sh/shsim/ChangeLog b/c/src/lib/libbsp/sh/shsim/ChangeLog index 3604cceb78..51dd0081d3 100644 --- a/c/src/lib/libbsp/sh/shsim/ChangeLog +++ b/c/src/lib/libbsp/sh/shsim/ChangeLog @@ -1,3 +1,12 @@ +2001-05-09 Ralf Corsepius + + * scitab/.cvsignore: Add. + * configure.in: Add --enable-console, CPU_CLOCK_RATE_HZ, autoheader + bspopt.h. + * include/bsp.h: Complete rewrite based on the AMOS-BSP. + * README: Update. + * bsp_specs: copy from gensh1 + 2001-01-29 Ralf Corsepius * Makefile.am: Add scitab, gdbsci to SUBDIRS. diff --git a/c/src/lib/libbsp/sh/shsim/README b/c/src/lib/libbsp/sh/shsim/README index 217db75fac..ffe63489ab 100644 --- a/c/src/lib/libbsp/sh/shsim/README +++ b/c/src/lib/libbsp/sh/shsim/README @@ -23,8 +23,8 @@ simulator better use gdb versions > 5.0. * gdb's simulator is not able to correctly emulate memory areas esp. shadowing and non-consecutive memory. I.e. access to memory areas besides area 0 will (bogusly) generate SIGBUS exceptions. This includes access to area 5 -(On-chip peripherials) and prevents simulation of configuration of -accesses to on-chip peripherials. +(On-chip peripherials) and prevents simulation of configuration and access +to on-chip peripherials. * Due to limitations of the simulator you will only be able to run applications which do not try to access any SH control registers. @@ -32,5 +32,15 @@ applications which do not try to access any SH control registers. Currently, this excludes all applications, which apply timers and serial devices, i.e. almost any real world application. -* The simulator currently uses gdb's trap34 interface for console I/O. This -could be replaced with polled sci1 I/O for SHes > SH1. +* This BSP supports 3 different console devices (cf. configure --help): +- trap34, an interface base on gdb's trap34 emulation. Known to work with + gdb-5.0. +- gdbsci1, a stripped down sci device driver adapted to apply gdb's sci1 +emulation. This is known to fail with gdb-5.0, because of a bug in gdb-5.0's +sh-sim, a patch is submitted, but .. ~== +- devnull, redirection of console io to /dev/null. Try to single step this, +if you want to understand the details on how SH-RTEMS console redirection +works. + +NOTE: the trap34 interface is incomplete and is temporarily disabled +inside of configure.in. diff --git a/c/src/lib/libbsp/sh/shsim/bsp_specs b/c/src/lib/libbsp/sh/shsim/bsp_specs index eecf37c5a0..90ab779f9e 100644 --- a/c/src/lib/libbsp/sh/shsim/bsp_specs +++ b/c/src/lib/libbsp/sh/shsim/bsp_specs @@ -8,16 +8,15 @@ %(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded) *lib: -%{!qrtems: %(old_lib)} %{qrtems: --start-group \ -%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \ --lc -lgcc --end-group \ -%{!qnolinkcmds: -T linkcmds%s}} +%{!qrtems: %(old_lib)} \ +%{qrtems: --start-group %{!qrtems_debug: -lrtemsall } %{qrtems_debug: -lrtemsall_g} \ + -lc -lgcc --end-group \ + %{!qnolinkcmds: -T linkcmds%s}} *startfile: -%{!qrtems: %(old_startfile)} %{qrtems: \ -%{!qrtems_debug: start.o%s} \ -%{qrtems_debug: start_g.o%s}} +%{!qrtems: %(old_startfile)} \ +%{qrtems: %{qrtems_debug: start_g.o%s} %{!qrtems_debug: start.o%s}} *link: -%(old_link) %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start} +%(old_link) %{qrtems: -dc -dp -N -e _start} diff --git a/c/src/lib/libbsp/sh/shsim/configure.in b/c/src/lib/libbsp/sh/shsim/configure.in index e537f6d331..b1bee213ce 100644 --- a/c/src/lib/libbsp/sh/shsim/configure.in +++ b/c/src/lib/libbsp/sh/shsim/configure.in @@ -19,6 +19,58 @@ RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) RTEMS_CHECK_BSP_CACHE(RTEMS_BSP) RTEMS_CANONICAL_HOST +RTEMS_BSP_ARG_ENABLE([console], +[ --enable-console=[[null|gdbsci1]]],[ + case $enable_console in + null) + BSP_CONSOLE_DEVNAME=\"/dev/null\" + BSP_CONSOLE_DRIVER_TABLE_ENTRY=DEVNULL_DRIVER_TABLE_ENTRY + ;; +# Not yet +# trap34) +# BSP_CONSOLE_DEVNAME=\"/dev/trap34\" +# BSP_CONSOLE_DRIVER_TABLE_ENTRY=DEVTRAP34_DRIVER_TABLE_ENTRY +# ;; + yes|gdbsci1) + BSP_CONSOLE_DEVNAME=\"/dev/gdbsci1\" + BSP_CONSOLE_DRIVER_TABLE_ENTRY=DEVGDBSCI_DRIVER_TABLE_ENTRY + ;; + *) AC_MSG_WARN([bad value $enable_console for --enable-console=]) + ;; + esac],[ + BSP_CONSOLE_DEVNAME=\"/dev/gdbsci1\" + BSP_CONSOLE_DRIVER_TABLE_ENTRY=DEVGDBSCI_DRIVER_TABLE_ENTRY +]) +AC_DEFINE_UNQUOTED( + [BSP_CONSOLE_DEVNAME], + [${BSP_CONSOLE_DEVNAME}], + [device name to redirect the console to]) +AC_DEFINE_UNQUOTED( + [BSP_CONSOLE_DRIVER_TABLE_ENTRY], + [${BSP_CONSOLE_DRIVER_TABLE_ENTRY}], + [Driver table entry for the console device]) + +## +RTEMS_BSP_ARG_ENABLE([iomem-patch], +[ --enable-iomem-patch=[[yes|no]]]) +if test x"$enable_iomem_patch" = x"yes"; then +AC_DEFINE_UNQUOTED( + [HAVE_SHSIM_IOMEM_PATCH], + [1], + [whether support for functional IOMEM in shsim/gdb shall be enabled]) +fi + +## setup environment variable +CPU_CLOCK_RATE_HZ=${CPU_CLOCK_RATE_HZ-20000000} +AC_SUBST(CPU_CLOCK_RATE_HZ) +## Propagate option to config header +AC_DEFINE_UNQUOTED( + [CPU_CLOCK_RATE_HZ], + [$CPU_CLOCK_RATE_HZ], + [cpu clock rate in HZ]) + +AM_CONFIG_HEADER(include/bspopts.h) + RTEMS_PROJECT_ROOT # Explicitly list all Makefiles here @@ -27,6 +79,8 @@ Makefile clock/Makefile console/Makefile include/Makefile +scitab/Makefile +gdbsci/Makefile start/Makefile startup/Makefile wrapup/Makefile) diff --git a/c/src/lib/libbsp/sh/shsim/include/bsp.h b/c/src/lib/libbsp/sh/shsim/include/bsp.h index e2e9c0fb57..ae72550213 100644 --- a/c/src/lib/libbsp/sh/shsim/include/bsp.h +++ b/c/src/lib/libbsp/sh/shsim/include/bsp.h @@ -1,29 +1,53 @@ -/* bsp.h +/* + * This include file contains all board IO definitions. + * + * SH-gdb simulator BSP * - * This include file contains some definitions specific to the - * JMR3904 simulator in gdb. + * Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de) * - * COPYRIGHT (c) 1989-2000. + * COPYRIGHT (c) 2001, Ralf Corsepius, Ulm, Germany + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * COPYRIGHT (c) 2001. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.OARcorp.com/rtems/license.html. * - * $Id$ + * $Id$ */ -#ifndef __JMR3904_h -#define __JMR3904_h +#ifndef __bsp_h +#define __bsp_h #ifdef __cplusplus extern "C" { #endif #include -#include -#include #include +#include + +/* + * confdefs.h overrides for this BSP: + * - number of termios serial ports (defaults to 1) + * - Interrupt stack space is not minimum if defined. + */ + +#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 0 +#define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024) + +#include + +/* + * FIXME: One of these would be enough. + */ +#include +#include /* * Define the time limits for RTEMS Test Suite test durations. @@ -31,52 +55,72 @@ extern "C" { * values are in seconds and need to be converted to ticks for the * application. * + * FIXME: This should not be here. */ #define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ #define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ /* - * Define the interrupt mechanism for Time Test 27 - * - * NOTE: Following are for XXX and are board independent + * Stuff for Time Test 27 * + * FIXME: This should not be here. */ #define MUST_WAIT_FOR_INTERRUPT 0 -#define Install_tm27_vector( handler ) +#define Install_tm27_vector( handler ) +#define Cause_tm27_intr() +#define Clear_tm27_intr() + +/* Constants */ -#define Cause_tm27_intr() +/* + * Simple spin delay in microsecond units for device drivers. + * This is very dependent on the clock speed of the target. + * + * FIXME: Not applicable with gdb's simulator + * Kept for sourcecode compatibility with other sh-BSPs + */ +#define delay( microseconds ) CPU_delay(microseconds) +#define sh_delay( microseconds ) CPU_delay(microseconds) -#define Clear_tm27_intr() +/* + * Defined in the linker script 'linkcmds' + */ -#define Lower_tm27_intr() +extern unsigned32 HeapStart ; +extern unsigned32 HeapEnd ; +extern unsigned32 WorkSpaceStart ; +extern unsigned32 WorkSpaceEnd ; -/* Constants */ +extern void *CPU_Interrupt_stack_low ; +extern void *CPU_Interrupt_stack_high ; + /* miscellaneous stuff assumed to exist */ extern rtems_configuration_table BSP_Configuration; +extern void bsp_cleanup( void ); + /* * Device Driver Table Entries */ /* - * NOTE: Use the standard Console driver entry + * Redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console */ +#undef CONSOLE_DRIVER_TABLE_ENTRY +#define CONSOLE_DRIVER_TABLE_ENTRY \ + BSP_CONSOLE_DRIVER_TABLE_ENTRY, \ + { console_initialize, console_open, console_close, \ + console_read, console_write, console_control } /* * NOTE: Use the standard Clock driver entry */ -/* functions */ - -void bsp_cleanup( void ); - -/* i960_isr_entry set_vector( rtems_isr_entry, unsigned int, unsigned int ); */ - #ifdef __cplusplus } #endif diff --git a/c/src/lib/libbsp/sh/shsim/scitab/.cvsignore b/c/src/lib/libbsp/sh/shsim/scitab/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/lib/libbsp/sh/shsim/scitab/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in -- cgit v1.2.3