[rtems commit] PR 1962/bsps - MVME162 Console Corrections and Improvements

Joel Sherrill joel at rtems.org
Thu Feb 2 20:10:32 UTC 2012


Module:    rtems
Branch:    4.10
Commit:    43a26e8a020dc8d80cbc82542b9453c061e9c05f
Changeset: http://git.rtems.org/rtems/commit/?id=43a26e8a020dc8d80cbc82542b9453c061e9c05f

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Thu Feb  2 14:08:36 2012 -0600

PR 1962/bsps - MVME162 Console Corrections and Improvements

	* console/console.c: char_ready() was never returning true so console
	never processed input data
	* console/console.c: added printk() support to default device
	* include/bsp.h: Added #define for MOT_162BUG_VEC_ADDRESS
	* startup/bspclean.c: Modified to use MOT_162BUG_VEC_ADDRESS
	* startup/bspstart.c: Modified to use MOT_162BUG_VEC_ADDRESS
	* make/custom/mvme162.cfg: Modified to use "RTEMS_CPU_MODEL=68lc040"
	and "CPU_CFLAGS = -mcpu=68040 -msoft-float" so BSP will always
	work with all board variations.
	* README: Added notes on user required configuration changes and
	information about board models and variants
	* README.models: New file that contains a detailed list of MVME162
	models and variants.

Signed-off-by: Vic Hoover <victor.hoover.ctr at navy.mil>

---

 c/src/lib/libbsp/m68k/mvme162/README               |   32 +++-
 c/src/lib/libbsp/m68k/mvme162/README.models        |  233 ++++++++++++++++++++
 c/src/lib/libbsp/m68k/mvme162/console/console.c    |   48 ++++-
 c/src/lib/libbsp/m68k/mvme162/include/bsp.h        |   22 ++
 .../libbsp/m68k/mvme162/make/custom/mvme162.cfg    |    4 +-
 c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c   |    8 +-
 c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c   |   12 +-
 7 files changed, 336 insertions(+), 23 deletions(-)

diff --git a/c/src/lib/libbsp/m68k/mvme162/README b/c/src/lib/libbsp/m68k/mvme162/README
index 8d55f46..c2b3d4a 100644
--- a/c/src/lib/libbsp/m68k/mvme162/README
+++ b/c/src/lib/libbsp/m68k/mvme162/README
@@ -11,14 +11,40 @@
 --  $Id$
 --
 
+
 MVME162 Models
 --------------
 
-MVME162 model uses 68040.
+There are three different models of the MVME162 board.  There are many
+variations within each model.
+
+  Model        Variants
+  ---------    --------------------------------------------------
+  MVME162      MVME162-0xx
+  MVME162FX    MVME162-4xx, MVME162-5xx
+  MVME162LX    MVME162-2xx, MVME162-3xx, MVME162-7xx, MVME162-8xx
+
+All models use either an MC68040 or MC68LC040 (no FPU) processors.  The
+processor used varies by variant as does the speed, the amount and type
+of memory and the I/O devices (serial, ethernet, SCSI and VME).  See the
+README.models file for details.
+
+
+Configuring the BSP
+-------------------
+The BSP needs to be configured for your specific board.  The following
+files need to be modified.
+
+include/bsp.h
+Change the MOT_162BUG_VEC_ADDRESS define to start of memory for your
+board
+
+make/custom/mvme162.cfg
+If your board has an MC68040 processor
+- change the value of RTEMS_CPU_MODEL
+- remove the -msoft-float flag from CPU_CFLAGS
 
-MVME162FX model uses XXX.
 
-MVME162LX model uses 68LC040.
 
 MVME162FX and DMA on the IP bus
 -------------------------------
diff --git a/c/src/lib/libbsp/m68k/mvme162/README.models b/c/src/lib/libbsp/m68k/mvme162/README.models
new file mode 100644
index 0000000..1803b57
--- /dev/null
+++ b/c/src/lib/libbsp/m68k/mvme162/README.models
@@ -0,0 +1,233 @@
+MVME162 Models
+==============
+
+There are three different models of the MVME162 board with many variations
+within each model.
+
+  Model        Variants
+  ---------    --------------------------------------------------
+  MVME162      MVME162-0xx
+  MVME162FX    MVME162-4xx, MVME162-5xx
+  MVME162LX    MVME162-2xx, MVME162-3xx, MVME162-7xx, MVME162-8xx
+
+All models use either an MC68040 or MC68LC040 (no FPU) processors.  The
+processor used varies by variant as does the speed, the amount and type
+of memory and the I/O devices (serial, ethernet, SCSI and VME).  See the
+following tables for details.
+
+
+
+MVME162 Variants
+================
+
+Source
+------
+o  MVME162 Embedded Controller User's Manual (MVME162/D2)
+
+
+Common Configuration
+--------------------
+o  One EPROM socket
+o  8Kx8 NVRAM/TOD clock
+o  Two serial ports
+o  1MB Flash memory
+o  Four MVIP Industry Pack interfaces
+o  One or two DRAM/SRAM mezzanine memory boards
+
+
+Model  Processor  Speed  DRAM  SRAM   Other
+-----  ---------  -----  ----  -----  ------------------
+ 001   MC68LC040  25MHz   1MB  512KB
+ 002   MC68040    25MHz   1MB  512KB
+ 003   MC68LC040  25MHz   1MB  512KB  No VMEbus
+ 010   MC68LC040  25MHz   4MB  512KB
+ 011   MC68LC040  25MHz   4MB  512KB  SCSI
+ 012   MC68LC040  25MHz   4MB  512KB  Ethernet
+ 013   MC68LC040  25MHz   4MB  512KB  Ethernet, SCSI
+ 014   MC68LC040  25MHz   4MB    -    Ethernet, No VMEbus
+ 020   MC68040    25MHz   4MB  512KB
+ 021   MC68040    25MHz   4MB  512KB  SCSI
+ 022   MC68040    25MHz   4MB  512KB  Ethernet
+ 023   MC68040    25MHz   4MB  512KB  Ethernet, SCSI
+ 026   MC68040    25MHz   4MB    -    Ethernet, No VMEbus
+ 030   MC68LC040  25MHz   8MB  512KB
+ 031   MC68LC040  25MHz   8MB  512KB  SCSI
+ 032   MC68LC040  25MHz   8MB  512KB  Ethernet
+ 033   MC68LC040  25MHz   8MB  512KB  Ethernet, SCSI
+ 040   MC68040    25MHz   8MB  512KB
+ 041   MC68040    25MHz   8MB  512KB  SCSI
+ 042   MC68040    25MHz   8MB  512KB  Ethernet
+ 043   MC68040    25MHz   8MB  512KB  Ethernet, SCSI
+
+
+Serial Interface Modules
+------------------------
+SIM05  01-W3846B  EIA-232-D  DTE
+SIM06  01-W3865B  EIA-232-D  DCE
+SIM07  01-W3868B  EIA-530    DTE
+SIM08  01-W3867B  EIA-530    DCE
+
+
+DRAM/SRAM Expansion Memory Boards
+---------------------------------
+?
+
+
+
+MVME162FX Variants
+==================
+
+Source
+------
+o  MVME162FX Data Sheet
+o  MVME162FX Embedded Controller Installation and Use (V162FXA/IH3)
+o  MVME162FX Embedded Controller Programmer's Reference Guide (V162FXA/PG1)
+o  MVME162FX 400/500-Series VME Embedded Controller Installation and Use
+     (V162FXA/IH4) Edition of March 2000\Uffffffff
+o  V162FXA/LT2, November 1995
+
+
+Common Configuration
+--------------------
+o  One EPROM socket
+o  8Kx8 NVRAM/TOD clock
+o  Two serial ports
+o  1MB Flash memory with 162Bug installed
+o  512KB SRAM with battery backup
+o  Four IndustryPack interfaces
+o  One or two DRAM/SRAM mezzanine memory boards
+
+
+Uses MC2 Chip, IP2 Chip, 4MB or 12MB mezzanine DRAM board
+
+Model  Processor  Speed  DRAM  Other
+-----  ---------  -----  ----  ------------------
+ 403
+ 410   MC68LC040  25Mhz   4MB
+ 411   MC68LC040  25Mhz   4MB  SCSI
+ 412   MC68LC040  25Mhz   4MB  Ethernet
+ 413   MC68LC040  25Mhz   4MB  Ethernet, SCSI
+ 420   ?
+ 421   ?
+ 422   ?
+ 423   ?
+ 430   MC68LC040  25Mhz   8MB
+ 431   MC68LC040  25Mhz   8MB  SCSI
+ 432   MC68LC040  25Mhz   8MB  Ethernet
+ 433   MC68LC040  25Mhz   8MB  Ethernet, SCSI
+ 440   ?
+ 441   ?
+ 442   ?
+ 443   ?
+ 450   ?
+ 451   ?
+ 452   ?
+ 453   MC68LC040  25Mhz  16MB  Ethernet, SCSI
+ 460   ?
+ 461   ?
+ 462   ?
+ 463   ?
+ 510   MC68040    32MHz   4MB
+ 511   MC68040    32MHz   4MB  SCSI
+ 512   MC68040    32MHz   4MB  Ethernet
+ 513   MC68040    32MHz   4MB  Ethernet, SCSI
+ 520   MC68040    32MHz   8MB
+ 521   MC68040    32MHz   8MB  SCSI
+ 522   MC68040    32MHz   8MB  Ethernet
+ 523   MC68040    32MHz   8MB  Ethernet, SCSI
+ 530   MC68040    32MHz  16MB
+ 531   MC68040    32MHz  16MB  SCSI
+ 532   MC68040    32MHz  16MB  Ethernet
+ 533   MC68040    32MHz  16MB  Ethernet, SCSI
+
+
+Serial Interface Modules
+------------------------
+SIM05  01-W3846B  EIA-232-D    DTE
+SIM06  01-W3865B  EIA-232-D    DCE
+SIM07  01-W3868B  EIA-530      DTE
+SIM08  01-W3867B  EIA-530      DCE
+SIM09  01-W3002F  EIA-485/422  DTE/DCE
+
+
+DRAM/SRAM Expansion Memory Boards
+---------------------------------
+MVME162-502   4MB DRAM
+MVME162-503  12MB DRAM
+?             2MB SRAM
+
+
+
+MVME162LX Variants
+==================
+
+Source
+------
+o  Supplement to MVME162LX Embedded Controller Installation Guide
+    (MVME162LXIG/D1A1) February 1995
+o  MVME162LX Embedded Controller Data Sheet
+o  MVME162LX 200/300 Series Embedded Controller Programmer's Reference
+     Guide (V162LX2-3A/PG2)
+o  MVME162LX 200/300 Series Embedded Controller Installation and Use
+     (V162LX2-3A/IH3)
+o  MVME162LX 700/800 Series Embedded Controller Installation and Use
+     (V162-7A/IH1)
+o  MVME162LX 700/800 Series Embedded Controller Installation and Use
+     (V162-7A/IH2)
+
+
+Common Configuration
+--------------------
+o  One EPROM socket
+o  8Kx8 NVRAM/TOD clock
+o  4 serial ports EIA-232-D DTE (unless otherwise noted)
+o  1MB Flash
+o  2 IP sites (unless otherwise noted)
+
+
+Model  Processor  Speed  DRAM      Other
+-----  ---------  -----  --------  ------------------
+ 200   MC68LC040  25MHz   1MB      No serial(?)
+ 201   MC68LC040  25MHz   1MB
+ 202   MC68LC040  25MHz   1MB
+ 210   MC68LC040  25MHz   4MB
+ 211   MC68LC040  25MHz   4MB      SCSI
+ 212   MC68LC040  25MHz   4MB      Ethernet
+ 213   MC68LC040  25MHz   4MB      Ethernet, SCSI
+ 216   MC68LC040  25MHz   4MB      Ethernet, No VMEbus, No serial(?)
+ 220   MC68040    25MHz   4MB
+ 222   MC68040    25MHz   4MB      Ethernet
+ 223   MC68040    25MHz   4MB      Ethernet, SCSI
+ 233   MC68LC040  25MHz   4MB ECC
+ 233   MC68LC040  25MHz   4MB ECC  Ethernet, SCSI
+ 243   MC68040    25MHz   4MB ECC  Ethernet, SCSI
+ 253   MC68LC040  25MHz  16MB ECC  Ethernet, SCSI
+ 253   MC68LC040  25MHz  16MB ECC  Ethernet, SCSI
+ 262   MC68040    25MHz  16MB ECC  Ethernet
+ 263   MC68040    25MHz  16MB ECC  Ethernet, SCSI
+ 322   MC68LC040  25MHz   8MB ECC  Ethernet
+ 323   MC68LC040  25MHz   8MB ECC  Ethernet, SCSI
+ 333   MC68040    25MHz   8MB ECC  Ethernet, SCSI, No IP sites(?)
+ 353   MC68040    25MHz  32MB ECC  Ethernet, SCSI, 4 IP sites
+ 723   MC68040    32MHz   4MB      Ethernet, SCSI
+ 743   MC68040    32MHz   4MB ECC  Ethernet, SCSI
+ 763   MC68040    32MHz  16MB ECC  Ethernet, SCSI
+ 813   MC68040    32MHz   8MB      Ethernet, SCSI
+ 833   MC68040    32MHz   8MB ECC  Ethernet, SCSI
+ 853   MC68040    32MHz  32MB ECC  Ethernet, SCSI
+ 863   MC68040    32MHz  16MB ECC  Ethernet, SCSI
+
+
+DRAM Expansion Memory Boards
+------------------------------------
+MVME162-202   4MB     (non-stacking)
+MVME162-203  16MB ECC (non-stacking)
+MVME162-204  16MB ECC (stacking)
+MVME162-207   4MB ECC (non-stakcing)
+MVME162-208   4MB ECC (stacking)
+MVME162-209   8MB ECC (non-stacking)
+MVME162-210   8MB ECC (stacking)
+MVME162-211  32MB ECC (non-stacking)
+MVME162-212  32MB ECC (stacking)
+
+
diff --git a/c/src/lib/libbsp/m68k/mvme162/console/console.c b/c/src/lib/libbsp/m68k/mvme162/console/console.c
index 6ace676..c5ce00c 100644
--- a/c/src/lib/libbsp/m68k/mvme162/console/console.c
+++ b/c/src/lib/libbsp/m68k/mvme162/console/console.c
@@ -26,6 +26,14 @@
 
 Ring_buffer_t  Console_Buffer[2];
 
+static bool    Console_Is_Initialized = false;
+
+/* Printk function */
+static void _162Bug_output_char( char c );
+static void _BSP_output_char( char c );
+BSP_output_char_function_type BSP_output_char = _BSP_output_char;
+
+
 /*
  *  Interrupt handler for receiver interrupts
  */
@@ -49,6 +57,44 @@ rtems_isr C_Receive_ISR(rtems_vector_number vector)
   }
 }
 
+
+/*
+ *  _162Bug_output_char
+ *
+ *  Output a single character using the 162Bug functions.  The character
+ *  will be written to the default output port.
+ */
+
+void _162Bug_output_char( char c )
+{
+  asm volatile( "moveb  %0, -(%%sp)\n\t"   /* char to output */
+                "trap   #15\n\t"           /* Trap to 162Bug */
+                ".short 0x20"              /* Code for .OUTCHR */
+    :: "d" (c) );
+}
+
+
+/*
+ *  _BSP_output_char
+ *
+ *  printk() function prototyped in bspIo.h. Does not use termios.
+ *
+ *  If we have initialized the console device then use it, otherwise
+ *  use the 162Bug routines to send it to the default output port.
+ */
+
+void _BSP_output_char(char c)
+{
+  if (Console_Is_Initialized)
+    putchar(c);
+  else
+    _162Bug_output_char(c);
+
+  if ('\n' == c)
+    _BSP_output_char('\r');
+}
+
+
 rtems_device_driver console_initialize(
   rtems_device_major_number  major,
   rtems_device_minor_number  minor,
@@ -117,7 +163,7 @@ bool char_ready(int port, char *ch)
 
   Ring_buffer_Remove_character( &Console_Buffer[port], *ch );
 
-  return false;
+  return true;
 }
 
 /*
diff --git a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h
index 054937a..b043c2c 100644
--- a/c/src/lib/libbsp/m68k/mvme162/include/bsp.h
+++ b/c/src/lib/libbsp/m68k/mvme162/include/bsp.h
@@ -163,6 +163,28 @@ typedef volatile struct {
 #define EXTERN extern
 #endif
 
+
+/*
+ *  This value is the default address location of the 162Bug vector table
+ *  and is also the default start address of the boards DRAM.  This value
+ *  may be different for your specific board based on a number of factors:
+ *
+ *     Default DRAM address:   0x00000000
+ *     Default SRAM address:   0xFFE00000
+ *
+ *  o  If no DRAM can be found by the 162Bug program, it will use SRAM.
+ *  o  The default SRAM address may be different if SRAM mezzanine boards
+ *     are installed on the main board.
+ *  o  Both the DRAM and SRAM addresses can be modified by changing the
+ *     appropriate values in NVRAM using the ENV command at the 162Bug
+ *     prompt.
+ *
+ *  If your board has different values than the defaults, change the value
+ *  of the following define.
+ *
+ */
+#define MOT_162BUG_VEC_ADDRESS  0x00000000
+
 extern m68k_isr_entry M68Kvec[];   /* vector table address */
 
 /* functions */
diff --git a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
index 329c3d5..a754945 100644
--- a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
+++ b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg
@@ -9,13 +9,13 @@ include $(RTEMS_ROOT)/make/custom/default.cfg
 RTEMS_CPU=m68k
 
 RTEMS_MVME162_MODEL=mvme162
-RTEMS_CPU_MODEL=m68040
+RTEMS_CPU_MODEL=m68lc040
 
 #  This contains the compiler options necessary to select the CPU model
 #  and (hopefully) optimize for it. 
 #
 
-CPU_CFLAGS = -mcpu=68040
+CPU_CFLAGS = -mcpu=68040 -msoft-float
 
 # optimize flag: typically -O2
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c
index c7f0807..9a89bba 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c
@@ -29,12 +29,8 @@ void bsp_return_to_monitor_trap(void)
 {
   page_table_teardown();
 
-  lcsr->intr_ena = 0;               /* disable interrupts */
-#if defined(mvme162lx)
-  m68k_set_vbr(0x00000000);         /* restore 162Bug vectors */
-#else
-  m68k_set_vbr(0xFFE00000);         /* restore 162Bug vectors */
-#endif
+  lcsr->intr_ena = 0;                    /* disable interrupts */
+  m68k_set_vbr(MOT_162BUG_VEC_ADDRESS);  /* restore 162Bug vectors */
 
   asm volatile( "trap   #15"  );    /* trap to 162Bug */
   asm volatile( ".short 0x63" );    /* return to 162Bug (.RETURN) */
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
index a5c980a..7e23b53 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
@@ -34,17 +34,7 @@ void bsp_start( void )
   m68k_isr_entry       *monitors_vector_table;
   int                   index;
 
-  /*
-   *  162Bug Vectors are at 0xFFE00000
-   *  162Bug Vectors on LX are at 0x00000000
-   */
-
-#if defined(mvme162lx)
-  monitors_vector_table = (m68k_isr_entry *)0x00000000;
-#else
-  monitors_vector_table = (m68k_isr_entry *)0xFFE00000;
-#endif
-
+  monitors_vector_table = (m68k_isr_entry *)MOT_162BUG_VEC_ADDRESS;
   m68k_set_vbr( monitors_vector_table );
 
   for ( index=2 ; index<=255 ; index++ )




More information about the vc mailing list