source: rtems/c/src/lib/libbsp/mips/malta/include/bsp.h @ 46dde0fc

4.115
Last change on this file since 46dde0fc was 46dde0fc, checked in by Sebastian Huber <sebastian.huber@…>, on 10/23/14 at 08:05:17

bsps: Move extern "C" to not cover includes

Some includes may use C++ and this conflicts if surrounded extern "C".

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/**
2 *  @file
3 *
4 *  This include file contains some definitions specific to the
5 *  MIPS Malta Board.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2012.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef _BSP_H
18#define _BSP_H
19
20#ifndef ASM
21
22#include <bspopts.h>
23#include <bsp/default-initial-extension.h>
24
25#include <rtems.h>
26#include <rtems/iosupp.h>
27#include <rtems/console.h>
28#include <rtems/clockdrv.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#define BSP_FEATURE_IRQ_EXTENSION
35#define BSP_SHARED_HANDLER_SUPPORT      1
36
37#define REVISION_REGISTER_ADDRESS  0x1fc00010
38#define PRORV_MASK       0x0000000f   /* 4 bit Product Revision */
39#define PROID_MASK       0x000000f0   /* 4 bit Product ID */
40#define CORRV_MASK       0x00000300   /* 2 bit Core Board Revision */
41#define CORID_MASK       0x0000fc00   /* 6 bit Core Board ID */
42#define FPGRV_MASK       0x00ff0000   /* 8 bit CBUS FPGA Revision */
43#define BSP_8259_BASE_ADDRESS    (0x18000000UL | 0xa0000000UL)
44#define BSP_PCI_BASE_ADDRESS     (0x1be00000UL | 0xa0000000UL)
45#define BSP_NIC_IO_BASE          (0x10000000UL | 0xa0000000UL)
46#define PCI0_IO_BASE             (0x18000000UL | 0xa0000000UL)
47#define BSP_NIC_MEM_BASE         (0x00000000UL | 0xa0000000UL)
48
49/* functions */
50#define WRITE_PROTECTED_UINT8( _addr, _value ) \
51        do { \
52          volatile uint8_t *_ptr = _addr | 0x80000000; \
53          *_ptr = _value; \
54        }
55#define WRITE_PROTECTED_UINT16( _addr, _value ) \
56        do { \
57          volatile uint16_t *_ptr = _addr | 0x80000000; \
58          *_ptr = _value; \
59        }
60#define WRITE_PROTECTED_UINT32( _addr, _value ) \
61        do { \
62          volatile uint32_t *_ptr = _addr | 0x80000000; \
63          *_ptr = _value; \
64        }
65#define READ_PROTECTED_UINT8( _addr, _value ) \
66        do { \
67          volatile uint8_t *_ptr = _addr | 0x80000000; \
68         _value = *_ptr; \
69        }
70#define READ_PROTECTED_UINT16( _addr, _value ) \
71        do { \
72          volatile uint16_t *_ptr = _addr | 0x80000000; \
73         _value = *_ptr; \
74        }
75#define READ_PROTECTED_UINT32( _addr, _value ) \
76        do { \
77          volatile uint32_t *_ptr = _addr | 0x80000000; \
78         _value = *_ptr; \
79        }
80
81#define READ_UINT8( _register_, _value_ ) \
82        ((_value_) = *((volatile unsigned char *)(_register_)))
83
84#define WRITE_UINT8( _register_, _value_ ) \
85        (*((volatile unsigned char *)(_register_)) = (_value_))
86
87#define READ_UINT16( _register_, _value_ ) \
88     ((_value_) = *((volatile unsigned short *)(_register_)))
89
90#define WRITE_UINT16( _register_, _value_ ) \
91     (*((volatile unsigned short *)(_register_)) = (_value_))
92
93void simple_out_32(uint32_t base, uint32_t addr, uint32_t val);
94void simple_out_le32(uint32_t base, uint32_t addr, uint32_t val);
95uint8_t simple_in_8( uint32_t base, uint32_t addr );
96void simple_out_8( uint32_t base, uint32_t addr, uint8_t val );
97int16_t simple_in_le16( uint32_t base, uint32_t addr );
98int16_t simple_in_16( uint32_t base, uint32_t addr );
99uint32_t simple_in_le32( uint32_t base, uint32_t addr );
100uint32_t simple_in_32( uint32_t base, uint32_t addr );
101void simple_out_le16( uint32_t base, uint32_t addr, uint16_t val );
102void simple_out_16( uint32_t base, uint32_t addr, uint16_t val );
103
104/*
105 * Prototypes for methods called from .S for dependency tracking
106 */
107void init_tlb(void);
108void resettlb(int i);
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* !ASM */
115
116#endif
Note: See TracBrowser for help on using the repository browser.