source: rtems/c/src/lib/libbsp/nios2/nios2_iss/include/bsp.h @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all board IO definitions.
4 *
5 *  XXX : put yours in here
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.com/license/LICENSE.
13 */
14
15#ifndef _BSP_H
16#define _BSP_H
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#include <stdint.h>
23#include <bspopts.h>
24
25#include <rtems.h>
26#include <rtems/console.h>
27#include <rtems/clockdrv.h>
28
29
30/*
31 *  Simple spin delay in microsecond units for device drivers.
32 *  This is very dependent on the clock speed of the target.
33 */
34
35#define rtems_bsp_delay( microseconds ) \
36  { \
37  }
38
39/* ============================================ */
40
41/* SOPC-specific Constants */
42
43#define SYSTEM_BUS_WIDTH 32
44
45#define JTAG_UART_BASE 0x08000000
46#define JTAG_UART_IRQ 2
47
48#define CLOCK_BASE 0x08001000
49#define CLOCK_FREQ 50000000
50#define CLOCK_VECTOR 1
51
52#define TIMER_BASE 0x08002000
53#define TIMER_FREQ 50000000
54#define TIMER_VECTOR 3
55
56/* ============================================ */
57
58#define NIOS2_BYPASS_CACHE ((uint32_t)0x80000000ul)
59#define NIOS2_IO_BASE(x) ( (void*) ((uint32_t)x | NIOS2_BYPASS_CACHE ) )
60#define NIOS2_IENABLE(x) do{ __builtin_wrctl(3,__builtin_rdctl(3)|x);}while(0)
61#define NIOS2_IRQ_ENABLE(x) do {__builtin_wrctl(3,__builtin_rdctl(3)|x);} while(0)
62
63/* ============================================ */
64/* TODO: Put this in an external header file */
65
66#ifndef SYSTEM_BUS_WIDTH
67#error SYSTEM_BUS_WIDTH is undefined
68#endif
69
70#if SYSTEM_BUS_WIDTH != 32
71#error Only SYSTEM_BUS_WIDTH 32 is supported
72#endif
73
74typedef struct
75{
76  volatile uint32_t status;
77  volatile uint32_t control;
78  volatile uint32_t period_lo;
79  volatile uint32_t period_hi;
80  volatile uint32_t snap_lo;
81  volatile uint32_t snap_hi;
82}
83altera_avalon_timer_regs;
84
85#define ALTERA_AVALON_TIMER_STATUS_TO_MSK             (0x1)
86#define ALTERA_AVALON_TIMER_STATUS_TO_OFST            (0)
87#define ALTERA_AVALON_TIMER_STATUS_RUN_MSK            (0x2)
88#define ALTERA_AVALON_TIMER_STATUS_RUN_OFST           (1)
89
90#define ALTERA_AVALON_TIMER_CONTROL_ITO_MSK           (0x1)
91#define ALTERA_AVALON_TIMER_CONTROL_ITO_OFST          (0)
92#define ALTERA_AVALON_TIMER_CONTROL_CONT_MSK          (0x2)
93#define ALTERA_AVALON_TIMER_CONTROL_CONT_OFST         (1)
94#define ALTERA_AVALON_TIMER_CONTROL_START_MSK         (0x4)
95#define ALTERA_AVALON_TIMER_CONTROL_START_OFST        (2)
96#define ALTERA_AVALON_TIMER_CONTROL_STOP_MSK          (0x8)
97#define ALTERA_AVALON_TIMER_CONTROL_STOP_OFST         (3)
98
99typedef struct
100{
101  volatile uint32_t data;
102  volatile uint32_t control;
103}
104altera_avalon_jtag_uart_regs;
105
106#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK             (0x000000FFu)
107#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST            (0)
108#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK           (0x00008000u)
109#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST          (15)
110#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK           (0xFFFF0000u)
111#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST          (16)
112
113#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK            (0x00000001u)
114#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST           (0)
115#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK            (0x00000002u)
116#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST           (1)
117#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK            (0x00000100u)
118#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST           (8)
119#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK            (0x00000200u)
120#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST           (9)
121#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK            (0x00000400u)
122#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST           (10)
123#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK        (0xFFFF0000u)
124#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST       (16)
125
126/* ============================================ */
127
128/* functions */
129
130rtems_isr_entry set_vector(                     /* returns old vector */
131  rtems_isr_entry     handler,                  /* isr routine        */
132  rtems_vector_number vector,                   /* vector number      */
133  int                 type                      /* RTEMS or RAW intr  */
134);
135
136#ifdef __cplusplus
137}
138#endif
139
140#endif
141/* end of include file */
Note: See TracBrowser for help on using the repository browser.