Changeset df49c60 in rtems for c/src/lib/libbsp/sh


Ignore:
Timestamp:
Jun 12, 2000, 3:00:15 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
edeed26
Parents:
0ab65474
Message:

Merged from 4.5.0-beta3a

Location:
c/src/lib/libbsp/sh
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sh/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh1/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh1/bsp_specs

    r0ab65474 rdf49c60  
    1919
    2020*link:
    21 %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start}
     21%(old_link) %{qrtems: -dc -dp -N -e _start}
    2222
  • c/src/lib/libbsp/sh/gensh1/console/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
     
    2424        $(make-rel)
    2525
    26 # the .rel file built here will be put into libbsp.a by 
     26# the .rel file built here will be put into libbsp.a by
    2727#       ../wrapup/Makefile
    2828
  • c/src/lib/libbsp/sh/gensh1/include/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh1/include/bsp.h

    r0ab65474 rdf49c60  
    3434#include <clockdrv.h>
    3535#include <console.h>
     36
     37/*
     38 *  confdefs.h overrides for this BSP:
     39 *   - number of termios serial ports (defaults to 1)
     40 *   - Interrupt stack space is not minimum if defined.
     41 */
     42
     43/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
     44#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
    3645
    3746/* EDIT: To activate the sci driver, change the define below */
  • c/src/lib/libbsp/sh/gensh1/scitab/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh1/start/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh1/startup/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
     7VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
     8
    79PGM = $(ARCH)/startup.rel
    810
    9 VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
    10    
    1111C_FILES = bsplibc.c bsppost.c bspstart.c bspclean.c sbrk.c bootcard.c main.c \
    1212    gnatinstallhandler.c
  • c/src/lib/libbsp/sh/gensh1/startup/bspstart.c

    r0ab65474 rdf49c60  
    118118  _CPU_Interrupt_stack_high = &CPU_Interrupt_stack_high ;
    119119
    120   /* This isn't used anywhere */
    121120  Cpu_table.interrupt_stack_size =
    122121    (unsigned32) (&CPU_Interrupt_stack_high) -
     
    129128 
    130129#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
    131   Cpu_table.interrupt_stack_size = 4096;
     130  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
    132131#endif
    133132  Cpu_table.clicks_per_second = HZ ;
  • c/src/lib/libbsp/sh/gensh1/wrapup/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44## build and install libbsp
    5 ## 
     5##
    66
    77AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/README

    r0ab65474 rdf49c60  
    5050    Driver for the on-chip serial devices (sci) will be available soon.
    5151
    52 (2) The present 'hw_init.c' file is incomplete and does not set all
    53     registers required for serial I/O. The effect is that the sci devices
    54     are 'muted' and do not successfully transmit characters to the respective
    55     I/O lines on the SH7045F.  If these ports have been properly initialized,
    56     they are not disabled by the current code. A two-part initialization will
    57     be available soon.
     52(2) The present 'hw_init.c' file provides 'early_hw_init'(void) which
     53    is normally called from 'start.S' to provide such minimal HW setup
     54    as is conveniently written in 'C' and can make use of global
     55    symbols for 7045F processor elements. It also provides
     56    'void bsp_hw_init (void)' normally called from 'bspstart.c', shortly
     57    before RTEMS itself is started.
     58
     59    These are both minimal functions intended to support the RTEMS test
     60    suites.
  • c/src/lib/libbsp/sh/gensh2/bsp_specs

    r0ab65474 rdf49c60  
    1919
    2020*link:
    21 %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _start}
     21%(old_link) %{qrtems: -dc -dp -N -e _start}
    2222
  • c/src/lib/libbsp/sh/gensh2/console/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
     
    2424        $(make-rel)
    2525
    26 # the .rel file built here will be put into libbsp.a by 
     26# the .rel file built here will be put into libbsp.a by
    2727#       ../wrapup/Makefile
    2828
  • c/src/lib/libbsp/sh/gensh2/include/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/include/bsp.h

    r0ab65474 rdf49c60  
    4545#include <clockdrv.h>
    4646#include <console.h>
     47
     48/*
     49 *  confdefs.h overrides for this BSP:
     50 *   - number of termios serial ports (defaults to 1)
     51 *   - Interrupt stack space is not minimum if defined.
     52 */
     53
     54/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
     55#define CONFIGURE_INTERRUPT_STACK_MEMORY  (4 * 1024)
    4756
    4857#if 0
  • c/src/lib/libbsp/sh/gensh2/scitab/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/start/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/start/start.S

    r0ab65474 rdf49c60  
    4545        mov.l   hw_init_k, r0
    4646        jsr @r0
    47         nop             !debug dead-slot target
     47        nop             !dead slot
    4848#endif /* START_HW_INIT */
    4949
     
    5757        cmp/ge  r0,r1
    5858        bt      0b
    59         nop             !debug dead-slot target
    6059
    6160        ! copy the vector table from rom to ram
     
    7170        cmp/hi  r3,r2
    7271        bf      1b
    73         nop             !debug dead-slot target
    7472
     73#ifndef STANDALONE_EVB
    7574        ! overlay monitor vectors onto RTEMS table template
    7675        ! code adapted  from Hitachi EDK7045F User Manual: "Copyvect.s"
     
    136135        mov.l   vects_k,r0      ! point vbr to vectab
    137136        ldc     r0,vbr
     137#endif  ! STANDALONE_EVB
    138138
    139139        ! call the mainline     
    140140        mov #0,r4               ! argc
    141         mov #0,r5               ! argv - can place in dead slot
    142141        mov.l main_k,r0
    143142        jsr @r0
    144         nop             !debug dead-slot target
     143        mov #0,r5               ! argv - can place in dead slot
    145144
    146145        ! call exit
    147146        mov     r0,r4
    148147        mov.l   exit_k,r0
     148        jsr     @r0
    149149        or      r0,r0
    150         jsr     @r0
    151         nop             !debug dead-slot target
    152150
    153151        mov.l   vbrtemp_k,r0    ! restore original vbr
     
    172170#ifdef  START_HW_INIT   /* from $RTEMS_BSP.cfg */
    173171hw_init_k:
    174         .long   SYM(hw_initialize)
     172        .long   SYM(early_hw_init)
    175173#endif /* START_HW_INIT */
    176174vbrtemp_k:
  • c/src/lib/libbsp/sh/gensh2/startup/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/gensh2/startup/bspstart.c

    r0ab65474 rdf49c60  
    3838 */
    3939
    40 extern void hw_initialize(void);
     40extern void bsp_hw_init(void);
    4141
    4242extern rtems_configuration_table Configuration;
     
    9595#ifndef START_HW_INIT
    9696  /* board hardware setup here, or from 'start.S' */
    97   hw_initialize();
     97  bsp_hw_init();
    9898#endif
    9999
     
    136136
    137137#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
    138   Cpu_table.interrupt_stack_size = 4096;
     138  Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
    139139#endif
    140140
  • c/src/lib/libbsp/sh/gensh2/startup/hw_init.c

    r0ab65474 rdf49c60  
    44 *             target is Hitachi SH7045F EVB ("lcevb")
    55 *
     6 *             Provides two initialization routines:
     7 *             A. 'void early_hw_init(void)' for 'start.S'
     8 *                sets up hw needed for early RTEMS boot, and
     9 *             B. 'void bsp_hw_init(void)' for 'bspstart.c'
     10 *                sets up hardware used by this BSP.
     11 *
    612 *  Author: John M. Mills (jmills@tga.com)
    7  *  COPYRIGHT(c) 1999, TGA Technologies, Inc
     13 *  COPYRIGHT(c) 2000, TGA Technologies, Inc
    814 *                     Norcross, GA 30071 U.S.A
    915 *
     
    4147#include <rtems/score/iosh7045.h>
    4248
    43 /* exported entry */
    44 extern void hw_initialize (void);
     49/* exported entries */
     50extern void bsp_hw_init (void);
     51extern void early_hw_init (void);
    4552
    46 /* STANDALONE_EVB sets up bus, DRAM, PFC, and SCI0 */
    47 /* no STANDALONE_EVB accepts defaults, adds RESET, SCI1, WDT */
     53/*  called from 'start.S' on "#ifdef START_HW_INIT" */
     54void early_hw_init (void)
     55{
     56#ifdef STANDALONE_EVB
     57  /* STANDALONE_EVB minimally sets up bus and DRAM here */
     58  /* no STANDALONE_EVB accepts defaults from debug monitor */
    4859
    49 /***************************************************/
    50 /*      Inline function to access CPU features     */
    51 /*      from C.  This makes use of GNU extensions. */
    52 /***************************************************/
     60  /* FIXME: replace 'magic numbers' with logical names */
    5361
    54 __inline__ void set_interrupt_mask(unsigned char mask)
     62  write16(0x2020, BSC_BCR1);  /* Bus width access - 32-bit on CS1 */
     63  write16(0xF3DD, BSC_BCR2);  /* Idle cycles CS3-CS0 - 0 idle cycles*/
     64  write16(0xFF3F, BSC_WCR1);  /* Waits for CS3-CS0 - 3 waits on CS1 */
     65  write16(0x000F, BSC_WCR2);  /* Waits for DRAM/DMA access - default */
     66  write16(0x0000, BSC_DCR);   /* DRAM control - default */
     67  write16(0x0000, BSC_RTCSR); /* DRAM refresh - default */
     68  write16(0x0000, BSC_RTCNT); /* DRAM refresh counter - default*/
     69  write16(0x0000, BSC_RTCOR); /* DRAM refresh compare match - default */
     70#endif
     71
     72  /*  add early-init functions here */
     73
     74};
     75
     76/*  to be called from 'bspstart.c' */
     77void bsp_hw_init (void)
    5578{
    56   asm("mov.l r0,@-r15");
    57   asm("mov %0,r0"::"r"(mask)); 
    58   asm("and #0xF,r0");
    59   asm("rotl r0");
    60   asm("rotl r0");
    61   asm("rotl r0");
    62   asm("rotl r0");
    63   asm("ldc r0,sr");
    64   asm("mov.l @r15+,r0");
    65 }
    66 
    67 void hw_initialize (void)
    68 {
    69         int a;
    70         unsigned8 temp8;
    71         unsigned16 temp16;
     79  int a;
     80  unsigned8 temp8;
     81  unsigned16 temp16;
    7282
    7383#ifdef STANDALONE_EVB
    74         /* FIXME: replace 'magic numbers' */
     84  /* STANDALONE_EVB: sets up PFC */
     85  /* no STANDALONE_EVB: accepts defaults, adds RESET */
    7586
    76         write16(0x2020, BSC_BCR1);  /* Bus width access - 32-bit on CS1 */
    77         write16(0xF3DD, BSC_BCR2);  /* Idle cycles CS3-CS0 - 0 idle cycles*/
    78         write16(0xFF3F, BSC_WCR1);  /* Waits for CS3-CS0 - 3 waits on CS1 */
    79         write16(0x000F, BSC_WCR2);  /* Waits for DRAM/DMA access - default */
    80         write16(0x0000, BSC_DCR);   /* DRAM control - default */
    81         write16(0x0000, BSC_RTCSR); /* DRAM refresh - default */
    82         write16(0x0000, BSC_RTCNT); /* DRAM refresh counter - default*/
    83         write16(0x0000, BSC_RTCOR); /* DRAM refresh compare match - default */
     87  /* FIXME: replace 'magic numbers' */
    8488       
    85         write16(0x5000, PFC_PACRH); /* Pin function controller - WRHH, WRHL */
    86         write16(0x1550, PFC_PACRL1); /* Pin fun. controller - WRH,WRL,RD,CS1 */
    87         write16(0x0000, PFC_PBCR1); /* Pin function controller - default */
    88         write16(0x2005, PFC_PBCR2); /* Pin function controller - A18,A17,A16 */
    89         write16(0xFFFF, PFC_PCCR);  /* Pin function controller - A15-A0  */
    90         write16(0x5555, PFC_PDCRH1; /* Pin function controller - D31-D24 */
    91         write16(0x5555, PFC_PDCRH2); /* Pin function controller - D23-D16 */
    92         write16(0xFFFF, PFC_PDCRL); /* Pin function controller - D15-D0  */
    93         write16(0x0000, PFC_IFCR);  /* Pin function controller - default */
    94         write16(0x0005, PFC_PACRL2); /* Pin function controller - Tx0, Rx0 */
    95 
    96         write16(0x00, PFC_PACRL2); /* default disconnects all I/O */
    97                                    /* pins; connected by DEVICE_open() */
     89  write16(0x5000, PFC_PACRH);  /* Pin function controller - WRHH, WRHL */
     90  write16(0x1550, PFC_PACRL1); /* Pin fun. controller - WRH,WRL,RD,CS1 */
     91  write16(0x0000, PFC_PBCR1);  /* Pin function controller - default */
     92  write16(0x2005, PFC_PBCR2);  /* Pin fcn. controller - A18,A17,A16 */
     93  write16(0xFFFF, PFC_PCCR);   /* Pin function controller - A15-A0  */
     94  write16(0x5555, PFC_PDCRH1); /* Pin function controller - D31-D24 */
     95  write16(0x5555, PFC_PDCRH2); /* Pin function controller - D23-D16 */
     96  write16(0xFFFF, PFC_PDCRL);  /* Pin function controller - D15-D0  */
     97  write16(0x0000, PFC_IFCR);   /* Pin function controller - default */
     98  write16(0x0000, PFC_PACRL2); /* default disconnects all I/O pins;*/
     99                               /*  [re-connected by DEVICE_open()] */
    98100#endif
    99101
    100         /* default hardware setup for SH7045F EVB */
     102  /* default hardware setup for SH7045F EVB */
    101103
    102         /* PFC: General I/O except pin 13 (reset): */
    103         temp16 = read16(PFC_PECR1) | 0x0800;
    104         write16(temp16, PFC_PECR1);
     104  /* PFC: General I/O except pin 13 (reset): */
     105  temp16 = read16(PFC_PECR1);
     106  temp16 |= 0x0800;
     107  write16(temp16, PFC_PECR1);
    105108
    106         /* All I/O lines bits 7-0: */
    107         write16(0x00, PFC_PECR2);
     109  /* All I/O lines bits 7-0: */
     110  write16(0x00, PFC_PECR2);
    108111
    109         /* P5 (LED) out, all other pins in: */
    110         temp16 = read16(PFC_PEIOR) | 0x0020;
    111         write16(temp16, PFC_PEIOR);
     112  /* P5 (LED) out, all other pins in: */
     113  temp16 = read16(PFC_PEIOR);
     114  temp16 |= 0x0020;
     115  write16(temp16, PFC_PEIOR);
    112116
    113117}
  • c/src/lib/libbsp/sh/gensh2/wrapup/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44## build and install libbsp
    5 ## 
     5##
    66
    77AUTOMAKE_OPTIONS = foreign 1.4
  • c/src/lib/libbsp/sh/shared/Makefile.am

    r0ab65474 rdf49c60  
    1 ## 
     1##
    22## $Id$
    3 ## 
     3##
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
Note: See TracChangeset for help on using the changeset viewer.