summaryrefslogtreecommitdiffstats
path: root/bsps/m68k/csb360/include/bsp.h
blob: eceb790a08589d61a9d1922d9c77394a2b672ba6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/**
 * @file
 *
 * @ingroup m68k_csb360
 *
 * @brief Global BSP definitions.
 */

/*
 * Board Support Package for CSB360 evaluation board
 * BSP definitions
 *
 * Copyright 2004 Cogent Computer Systems
 * Author: Jay Monkman <jtm@lopingdog.com>
 *
 * Derived from mcf5206elite BSP:
 * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
 * Author: Victor V. Vengerov <vvv@oktet.ru>
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 *
 * http://www.rtems.org/license/LICENSE.
 */

#ifndef LIBBSP_M68K_CSB360_BSP_H
#define LIBBSP_M68K_CSB360_BSP_H

#include <mcf5272/mcf5272.h>

/**
 * @defgroup m68k_csb360 CSB360 Support
 *
 * @ingroup RTEMSBSPsM68k
 *
 * @brief CSB360 support.
 */


/*** Board resources allocation ***/
#define BSP_MEM_ADDR_SRAM 0x20000000
#define BSP_MEM_SIZE_SRAM 4096

/* Location and size of sdram. Note this includes space used by
 * umon.
 */
#define BSP_MEM_ADDR_SDRAM 0x00000000
#define BSP_MEM_MASK_SDRAM 0x01ffffff
#define BSP_MEM_SIZE_SDRAM (32 * 1024 * 1024)

/* Address to put SIM Modules */
#define BSP_MBAR 0x10000000

/* Address to put SRAM */
#define BSP_RAMBAR BSP_MEM_ADDR_SRAM

/* Interrupt Vectors */
#define BSP_INTVEC_INT1   65
#define BSP_INTVEC_INT2   66
#define BSP_INTVEC_INT3   67
#define BSP_INTVEC_INT4   68
#define BSP_INTVEC_TMR0   69
#define BSP_INTVEC_TMR1   70
#define BSP_INTVEC_TMR2   71
#define BSP_INTVEC_TMR3   72
#define BSP_INTVEC_UART1  73
#define BSP_INTVEC_UART2  74
#define BSP_INTVEC_PLIP   75
#define BSP_INTVEC_PLIA   76
#define BSP_INTVEC_USB0   77
#define BSP_INTVEC_USB1   78
#define BSP_INTVEC_USB2   79
#define BSP_INTVEC_USB3   80
#define BSP_INTVEC_USB4   81
#define BSP_INTVEC_USB5   82
#define BSP_INTVEC_USB6   83
#define BSP_INTVEC_USB7   84
#define BSP_INTVEC_DMA    85
#define BSP_INTVEC_ERX    86
#define BSP_INTVEC_ETX    87
#define BSP_INTVEC_ENTC   88
#define BSP_INTVEC_QSPI   89
#define BSP_INTVEC_INT5   90
#define BSP_INTVEC_INT6   91
#define BSP_INTVEC_SWTO   92

#define BSP_INTLVL_INT1   1
#define BSP_INTLVL_INT2   1
#define BSP_INTLVL_INT3   1
#define BSP_INTLVL_INT4   1
#define BSP_INTLVL_TMR0   1
#define BSP_INTLVL_TMR1   1
#define BSP_INTLVL_TMR2   1
#define BSP_INTLVL_TMR3   1
#define BSP_INTLVL_UART1  1
#define BSP_INTLVL_UART2  1
#define BSP_INTLVL_PLIP   1
#define BSP_INTLVL_PLIA   1
#define BSP_INTLVL_USB0   1
#define BSP_INTLVL_USB1   1
#define BSP_INTLVL_USB2   1
#define BSP_INTLVL_USB3   1
#define BSP_INTLVL_USB4   1
#define BSP_INTLVL_USB5   1
#define BSP_INTLVL_USB6   1
#define BSP_INTLVL_USB7   1
#define BSP_INTLVL_DMA    1
#define BSP_INTLVL_ERX    1
#define BSP_INTLVL_ETX    1
#define BSP_INTLVL_ENTC   1
#define BSP_INTLVL_QSPI   1
#define BSP_INTLVL_INT5   1
#define BSP_INTLVL_INT6   1
#define BSP_INTLVL_SWTO   1



#ifndef ASM

#include <bspopts.h>
#include <rtems.h>
#include <bsp/default-initial-extension.h>

#ifdef __cplusplus
extern "C" {
#endif

struct rtems_bsdnet_ifconfig;
extern int rtems_enet_driver_attach (struct rtems_bsdnet_ifconfig *config);
#define RTEMS_BSP_NETWORK_DRIVER_NAME	"eth0"
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH	rtems_enet_driver_attach

/* System frequency */
#define BSP_SYSTEM_FREQUENCY (66 * 1000 * 1000)

/*
 *  Simple spin delay in microsecond units for device drivers.
 *  This is very dependent on the clock speed of the target.
 */

#define rtems_bsp_delay( microseconds ) \
  { register uint32_t _delay=(microseconds); \
    register uint32_t _tmp=123; \
    __asm__ volatile( "0: \
                     nbcd      %0 ; \
                     nbcd      %0 ; \
                     dbf       %1,0b" \
                  : "=d" (_tmp), "=d" (_delay) \
                  : "0"  (_tmp), "1"  (_delay) ); \
  }

/*
 * Real-Time Clock Driver Table Entry
 * NOTE: put this entry to the device driver table AFTER I2C bus driver!
 */
#define RTC_DRIVER_TABLE_ENTRY \
    { rtc_initialize, NULL, NULL, NULL, NULL, NULL }
extern rtems_device_driver rtc_initialize(
    rtems_device_major_number major,
    rtems_device_minor_number minor,
    void *arg
);

/* miscellaneous stuff assumed to exist */

extern rtems_isr_entry M68Kvec[];   /* vector table address */

extern rtems_isr (*rtems_clock_hook)(rtems_vector_number);

/* functions */

rtems_isr_entry set_vector(
  rtems_isr_entry     handler,
  rtems_vector_number vector,
  int                 type
);

/*
 * Prototypes for BSP methods which cross file boundaries
 */
void init5272(void);

#ifdef __cplusplus
}
#endif

#endif /* ASM */

#endif