Changeset c75430c in rtems


Ignore:
Timestamp:
Feb 2, 2012, 8:08:08 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
6d1a1d3
Parents:
ce3caf87
git-author:
Joel Sherrill <joel.sherrill@…> (02/02/12 20:08:08)
git-committer:
Joel Sherrill <joel.sherrill@…> (02/02/12 20:19:11)
Message:

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@…>

Location:
c/src/lib/libbsp/m68k/mvme162
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mvme162/README

    rce3caf87 rc75430c  
    1212--
    1313
     14
    1415MVME162 Models
    1516--------------
    1617
    17 MVME162 model uses 68040.
     18There are three different models of the MVME162 board.  There are many
     19variations within each model.
    1820
    19 MVME162FX model uses XXX.
     21  Model        Variants
     22  ---------    --------------------------------------------------
     23  MVME162      MVME162-0xx
     24  MVME162FX    MVME162-4xx, MVME162-5xx
     25  MVME162LX    MVME162-2xx, MVME162-3xx, MVME162-7xx, MVME162-8xx
    2026
    21 MVME162LX model uses 68LC040.
     27All models use either an MC68040 or MC68LC040 (no FPU) processors.  The
     28processor used varies by variant as does the speed, the amount and type
     29of memory and the I/O devices (serial, ethernet, SCSI and VME).  See the
     30README.models file for details.
     31
     32
     33Configuring the BSP
     34-------------------
     35The BSP needs to be configured for your specific board.  The following
     36files need to be modified.
     37
     38include/bsp.h
     39Change the MOT_162BUG_VEC_ADDRESS define to start of memory for your
     40board
     41
     42make/custom/mvme162.cfg
     43If your board has an MC68040 processor
     44- change the value of RTEMS_CPU_MODEL
     45- remove the -msoft-float flag from CPU_CFLAGS
     46
     47
    2248
    2349MVME162FX and DMA on the IP bus
  • c/src/lib/libbsp/m68k/mvme162/console/console.c

    rce3caf87 rc75430c  
    2727Ring_buffer_t  Console_Buffer[2];
    2828
     29static bool    Console_Is_Initialized = false;
     30
     31/* Printk function */
     32static void _162Bug_output_char( char c );
     33static void _BSP_output_char( char c );
     34BSP_output_char_function_type BSP_output_char = _BSP_output_char;
     35
     36
    2937/*
    3038 *  Interrupt handler for receiver interrupts
     
    4957  }
    5058}
     59
     60
     61/*
     62 *  _162Bug_output_char
     63 *
     64 *  Output a single character using the 162Bug functions.  The character
     65 *  will be written to the default output port.
     66 */
     67
     68void _162Bug_output_char( char c )
     69{
     70  asm volatile( "moveb  %0, -(%%sp)\n\t"   /* char to output */
     71                "trap   #15\n\t"           /* Trap to 162Bug */
     72                ".short 0x20"              /* Code for .OUTCHR */
     73    :: "d" (c) );
     74}
     75
     76
     77/*
     78 *  _BSP_output_char
     79 *
     80 *  printk() function prototyped in bspIo.h. Does not use termios.
     81 *
     82 *  If we have initialized the console device then use it, otherwise
     83 *  use the 162Bug routines to send it to the default output port.
     84 */
     85
     86void _BSP_output_char(char c)
     87{
     88  if (Console_Is_Initialized)
     89    putchar(c);
     90  else
     91    _162Bug_output_char(c);
     92
     93  if ('\n' == c)
     94    _BSP_output_char('\r');
     95}
     96
    5197
    5298rtems_device_driver console_initialize(
     
    118164  Ring_buffer_Remove_character( &Console_Buffer[port], *ch );
    119165
    120   return false;
     166  return true;
    121167}
    122168
  • c/src/lib/libbsp/m68k/mvme162/include/bsp.h

    rce3caf87 rc75430c  
    164164#endif
    165165
     166
     167/*
     168 *  This value is the default address location of the 162Bug vector table
     169 *  and is also the default start address of the boards DRAM.  This value
     170 *  may be different for your specific board based on a number of factors:
     171 *
     172 *     Default DRAM address:   0x00000000
     173 *     Default SRAM address:   0xFFE00000
     174 *
     175 *  o  If no DRAM can be found by the 162Bug program, it will use SRAM.
     176 *  o  The default SRAM address may be different if SRAM mezzanine boards
     177 *     are installed on the main board.
     178 *  o  Both the DRAM and SRAM addresses can be modified by changing the
     179 *     appropriate values in NVRAM using the ENV command at the 162Bug
     180 *     prompt.
     181 *
     182 *  If your board has different values than the defaults, change the value
     183 *  of the following define.
     184 *
     185 */
     186#define MOT_162BUG_VEC_ADDRESS  0x00000000
     187
    166188extern m68k_isr_entry M68Kvec[];   /* vector table address */
    167189
  • c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg

    rce3caf87 rc75430c  
    1010
    1111RTEMS_MVME162_MODEL=mvme162
    12 RTEMS_CPU_MODEL=m68040
     12RTEMS_CPU_MODEL=m68lc040
    1313
    1414#  This contains the compiler options necessary to select the CPU model
     
    1616#
    1717
    18 CPU_CFLAGS = -mcpu=68040
     18CPU_CFLAGS = -mcpu=68040 -msoft-float
    1919
    2020# optimize flag: typically -O2
  • c/src/lib/libbsp/m68k/mvme162/startup/bspclean.c

    rce3caf87 rc75430c  
    3030  page_table_teardown();
    3131
    32   lcsr->intr_ena = 0;               /* disable interrupts */
    33 #if defined(mvme162lx)
    34   m68k_set_vbr(0x00000000);         /* restore 162Bug vectors */
    35 #else
    36   m68k_set_vbr(0xFFE00000);         /* restore 162Bug vectors */
    37 #endif
     32  lcsr->intr_ena = 0;                    /* disable interrupts */
     33  m68k_set_vbr(MOT_162BUG_VEC_ADDRESS);  /* restore 162Bug vectors */
    3834
    3935  __asm__ volatile( "trap   #15"  );    /* trap to 162Bug */
  • c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c

    rce3caf87 rc75430c  
    3535  int                   index;
    3636
    37   /*
    38    *  162Bug Vectors are at 0xFFE00000
    39    *  162Bug Vectors on LX are at 0x00000000
    40    */
    41 
    42 #if defined(mvme162lx)
    43   monitors_vector_table = (m68k_isr_entry *)0x00000000;
    44 #else
    45   monitors_vector_table = (m68k_isr_entry *)0xFFE00000;
    46 #endif
    47 
     37  monitors_vector_table = (m68k_isr_entry *)MOT_162BUG_VEC_ADDRESS;
    4838  m68k_set_vbr( monitors_vector_table );
    4939
Note: See TracChangeset for help on using the changeset viewer.