RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1989-2012.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef LIBBSP_MIPS_MALTA_BSP_H
19#define LIBBSP_MIPS_MALTA_BSP_H
20
31#ifndef ASM
32
33#include <bspopts.h>
35
36#include <rtems.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42#define BSP_FEATURE_IRQ_EXTENSION
43#define BSP_SHARED_HANDLER_SUPPORT 1
44
45#define REVISION_REGISTER_ADDRESS 0x1fc00010
46#define PRORV_MASK 0x0000000f /* 4 bit Product Revision */
47#define PROID_MASK 0x000000f0 /* 4 bit Product ID */
48#define CORRV_MASK 0x00000300 /* 2 bit Core Board Revision */
49#define CORID_MASK 0x0000fc00 /* 6 bit Core Board ID */
50#define FPGRV_MASK 0x00ff0000 /* 8 bit CBUS FPGA Revision */
51#define BSP_8259_BASE_ADDRESS (0x18000000UL | 0xa0000000UL)
52#define BSP_PCI_BASE_ADDRESS (0x1be00000UL | 0xa0000000UL)
53#define BSP_NIC_IO_BASE (0x10000000UL | 0xa0000000UL)
54#define PCI0_IO_BASE (0x18000000UL | 0xa0000000UL)
55#define BSP_NIC_MEM_BASE (0x00000000UL | 0xa0000000UL)
56
57/* functions */
58#define WRITE_PROTECTED_UINT8( _addr, _value ) \
59 do { \
60 volatile uint8_t *_ptr = _addr | 0x80000000; \
61 *_ptr = _value; \
62 }
63#define WRITE_PROTECTED_UINT16( _addr, _value ) \
64 do { \
65 volatile uint16_t *_ptr = _addr | 0x80000000; \
66 *_ptr = _value; \
67 }
68#define WRITE_PROTECTED_UINT32( _addr, _value ) \
69 do { \
70 volatile uint32_t *_ptr = _addr | 0x80000000; \
71 *_ptr = _value; \
72 }
73#define READ_PROTECTED_UINT8( _addr, _value ) \
74 do { \
75 volatile uint8_t *_ptr = _addr | 0x80000000; \
76 _value = *_ptr; \
77 }
78#define READ_PROTECTED_UINT16( _addr, _value ) \
79 do { \
80 volatile uint16_t *_ptr = _addr | 0x80000000; \
81 _value = *_ptr; \
82 }
83#define READ_PROTECTED_UINT32( _addr, _value ) \
84 do { \
85 volatile uint32_t *_ptr = _addr | 0x80000000; \
86 _value = *_ptr; \
87 }
88
89#define READ_UINT8( _register_, _value_ ) \
90 ((_value_) = *((volatile unsigned char *)(_register_)))
91
92#define WRITE_UINT8( _register_, _value_ ) \
93 (*((volatile unsigned char *)(_register_)) = (_value_))
94
95#define READ_UINT16( _register_, _value_ ) \
96 ((_value_) = *((volatile unsigned short *)(_register_)))
97
98#define WRITE_UINT16( _register_, _value_ ) \
99 (*((volatile unsigned short *)(_register_)) = (_value_))
100
101void simple_out_32(uint32_t base, uint32_t addr, uint32_t val);
102void simple_out_le32(uint32_t base, uint32_t addr, uint32_t val);
103uint8_t simple_in_8( uint32_t base, uint32_t addr );
104void simple_out_8( uint32_t base, uint32_t addr, uint8_t val );
105int16_t simple_in_le16( uint32_t base, uint32_t addr );
106int16_t simple_in_16( uint32_t base, uint32_t addr );
107uint32_t simple_in_le32( uint32_t base, uint32_t addr );
108uint32_t simple_in_32( uint32_t base, uint32_t addr );
109void simple_out_le16( uint32_t base, uint32_t addr, uint16_t val );
110void simple_out_16( uint32_t base, uint32_t addr, uint16_t val );
111
112/*
113 * Prototypes for methods called from .S for dependency tracking
114 */
115void init_tlb(void);
116void resettlb(int i);
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif /* !ASM */
123
126#endif
DEFAULT_INITIAL_EXTENSION Support.