RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
mips
malta
include
bsp.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
10
11
/*
12
* COPYRIGHT (c) 1989-2012.
13
* On-Line Applications Research Corporation (OAR).
14
*
15
* Redistribution and use in source and binary forms, with or without
16
* modification, are permitted provided that the following conditions
17
* are met:
18
* 1. Redistributions of source code must retain the above copyright
19
* notice, this list of conditions and the following disclaimer.
20
* 2. Redistributions in binary form must reproduce the above copyright
21
* notice, this list of conditions and the following disclaimer in the
22
* documentation and/or other materials provided with the distribution.
23
*
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*/
36
37
#ifndef LIBBSP_MIPS_MALTA_BSP_H
38
#define LIBBSP_MIPS_MALTA_BSP_H
39
49
50
#ifndef ASM
51
52
#include <bspopts.h>
53
#include <
bsp/default-initial-extension.h
>
54
55
#include <
rtems.h
>
56
57
#ifdef __cplusplus
58
extern
"C"
{
59
#endif
60
61
#define BSP_FEATURE_IRQ_EXTENSION
62
#define BSP_SHARED_HANDLER_SUPPORT 1
63
64
#define REVISION_REGISTER_ADDRESS 0x1fc00010
65
#define PRORV_MASK 0x0000000f
/* 4 bit Product Revision */
66
#define PROID_MASK 0x000000f0
/* 4 bit Product ID */
67
#define CORRV_MASK 0x00000300
/* 2 bit Core Board Revision */
68
#define CORID_MASK 0x0000fc00
/* 6 bit Core Board ID */
69
#define FPGRV_MASK 0x00ff0000
/* 8 bit CBUS FPGA Revision */
70
#define BSP_8259_BASE_ADDRESS (0x18000000UL | 0xa0000000UL)
71
#define BSP_PCI_BASE_ADDRESS (0x1be00000UL | 0xa0000000UL)
72
#define BSP_NIC_IO_BASE (0x10000000UL | 0xa0000000UL)
73
#define PCI0_IO_BASE (0x18000000UL | 0xa0000000UL)
74
#define BSP_NIC_MEM_BASE (0x00000000UL | 0xa0000000UL)
75
76
/* functions */
77
#define WRITE_PROTECTED_UINT8( _addr, _value ) \
78
do { \
79
volatile uint8_t *_ptr = _addr | 0x80000000; \
80
*_ptr = _value; \
81
}
82
#define WRITE_PROTECTED_UINT16( _addr, _value ) \
83
do { \
84
volatile uint16_t *_ptr = _addr | 0x80000000; \
85
*_ptr = _value; \
86
}
87
#define WRITE_PROTECTED_UINT32( _addr, _value ) \
88
do { \
89
volatile uint32_t *_ptr = _addr | 0x80000000; \
90
*_ptr = _value; \
91
}
92
#define READ_PROTECTED_UINT8( _addr, _value ) \
93
do { \
94
volatile uint8_t *_ptr = _addr | 0x80000000; \
95
_value = *_ptr; \
96
}
97
#define READ_PROTECTED_UINT16( _addr, _value ) \
98
do { \
99
volatile uint16_t *_ptr = _addr | 0x80000000; \
100
_value = *_ptr; \
101
}
102
#define READ_PROTECTED_UINT32( _addr, _value ) \
103
do { \
104
volatile uint32_t *_ptr = _addr | 0x80000000; \
105
_value = *_ptr; \
106
}
107
108
#define READ_UINT8( _register_, _value_ ) \
109
((_value_) = *((volatile unsigned char *)(_register_)))
110
111
#define WRITE_UINT8( _register_, _value_ ) \
112
(*((volatile unsigned char *)(_register_)) = (_value_))
113
114
#define READ_UINT16( _register_, _value_ ) \
115
((_value_) = *((volatile unsigned short *)(_register_)))
116
117
#define WRITE_UINT16( _register_, _value_ ) \
118
(*((volatile unsigned short *)(_register_)) = (_value_))
119
120
void
simple_out_32(uint32_t base, uint32_t addr, uint32_t val);
121
void
simple_out_le32(uint32_t base, uint32_t addr, uint32_t val);
122
uint8_t simple_in_8( uint32_t base, uint32_t addr );
123
void
simple_out_8( uint32_t base, uint32_t addr, uint8_t val );
124
int16_t simple_in_le16( uint32_t base, uint32_t addr );
125
int16_t simple_in_16( uint32_t base, uint32_t addr );
126
uint32_t simple_in_le32( uint32_t base, uint32_t addr );
127
uint32_t simple_in_32( uint32_t base, uint32_t addr );
128
void
simple_out_le16( uint32_t base, uint32_t addr, uint16_t val );
129
void
simple_out_16( uint32_t base, uint32_t addr, uint16_t val );
130
131
/*
132
* Prototypes for methods called from .S for dependency tracking
133
*/
134
void
init_tlb(
void
);
135
void
resettlb(
int
i);
136
137
#ifdef __cplusplus
138
}
139
#endif
140
141
#endif
/* !ASM */
142
144
145
#endif
default-initial-extension.h
This header file provides the default definition of BSP_INITIAL_EXTENSION.
rtems.h
This header file defines the RTEMS Classic API.
Generated by
1.18.0