source: rtems/c/src/lib/libbsp/m68k/uC5282/include/bsp.h @ ac1d1bc4

4.9
Last change on this file since ac1d1bc4 was ac1d1bc4, checked in by Eric Norum <WENorum@…>, on 07/30/09 at 15:48:52

Try enabling the data cache.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/*
2 *  uC5282 BSP header file
3 *
4 *  Author: W. Eric Norum <norume@aps.anl.gov>
5 *
6 *  COPYRIGHT (c) 2005.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 */
13 
14#ifndef _BSP_H
15#define _BSP_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#include <rtems.h>
22#include <rtems/iosupp.h>
23#include <rtems/console.h>
24#include <rtems/clockdrv.h>
25#include <rtems/iosupp.h>
26#include <rtems/bspIo.h>
27
28/***************************************************************************/
29/**  BSP Configuration                                                    **/
30/*
31 * Uncomment to use instruction/data cache
32 * Leave commented to use instruction-only cache
33 */
34#define RTEMS_MCF5282_BSP_ENABLE_DATA_CACHE
35
36/***************************************************************************/
37/**  Hardware data structure headers                                      **/
38#include <mcf5282/mcf5282.h>   /* internal MCF5282 modules */
39
40/***************************************************************************/
41/**  Network driver configuration                                         **/
42struct rtems_bsdnet_ifconfig;
43extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching );
44#define RTEMS_BSP_NETWORK_DRIVER_NAME     "fs1"
45#define RTEMS_BSP_NETWORK_DRIVER_ATTACH   rtems_fec_driver_attach
46
47/***************************************************************************/
48/**  User Definable configuration                                         **/
49
50/* define which port the console should use - all other ports are then defined as general purpose */
51#define CONSOLE_PORT        0
52
53/* externals */
54
55/* constants */
56
57/* miscellaneous stuff assumed to exist */
58
59/*
60 *  Device Driver Table Entries
61 */
62 
63/*
64 * NOTE: Use the standard Console driver entry
65 */
66 
67/*
68 * NOTE: Use the standard Clock driver entry
69 */
70
71
72/* functions */
73
74typedef struct {
75    unsigned int l;
76    void        *v;
77} bsp_mnode_t;
78
79#define RTEMS_BSP_PGM_ERASE_FIRST   0x1
80#define RTEMS_BSP_PGM_RESET_AFTER   0x2
81#define RTEMS_BSP_PGM_EXEC_AFTER    0x4
82#define RTEMS_BSP_PGM_HALT_AFTER    0x8
83
84uint32_t bsp_get_CPU_clock_speed(void);
85rtems_status_code bsp_allocate_interrupt(int level, int priority);
86int bsp_reset(int flags);
87int bsp_program(bsp_mnode_t *chain, int flags);
88unsigned const char *bsp_gethwaddr(int a);
89const char *bsp_getbenv(const char *a);
90int bsp_flash_erase_range(volatile unsigned short *flashptr, int start, int end);
91int bsp_flash_write_range(volatile unsigned short *flashptr, bsp_mnode_t *chain, int offset);
92
93void bsp_cleanup(void);
94
95m68k_isr_entry set_vector(
96  rtems_isr_entry     handler,
97  rtems_vector_number vector,
98  int                 type
99);
100
101/*
102 * Interrupt assignments
103 *  Highest-priority listed first
104 */
105#define FEC_IRQ_LEVEL       4
106#define FEC_IRQ_RX_PRIORITY 7
107#define FEC_IRQ_TX_PRIORITY 6
108
109#define PIT3_IRQ_LEVEL      4
110#define PIT3_IRQ_PRIORITY   0
111
112#define UART0_IRQ_LEVEL     3
113#define UART0_IRQ_PRIORITY  7
114#define UART1_IRQ_LEVEL     3
115#define UART1_IRQ_PRIORITY  6
116#define UART2_IRQ_LEVEL     3
117#define UART2_IRQ_PRIORITY  5
118
119/*
120 * Fake VME support
121 * This makes it easier to use EPICS driver support on this BSP.
122 */
123#define VME_AM_STD_SUP_ASCENDING   0x3f
124#define VME_AM_STD_SUP_PGM         0x3e
125#define VME_AM_STD_USR_ASCENDING   0x3b
126#define VME_AM_STD_USR_PGM         0x3a
127#define VME_AM_STD_SUP_DATA        0x3d
128#define VME_AM_STD_USR_DATA        0x39
129#define VME_AM_EXT_SUP_ASCENDING   0x0f
130#define VME_AM_EXT_SUP_PGM         0x0e
131#define VME_AM_EXT_USR_ASCENDING   0x0b
132#define VME_AM_EXT_USR_PGM         0x0a
133#define VME_AM_EXT_SUP_DATA        0x0d
134#define VME_AM_EXT_USR_DATA        0x09
135#define VME_AM_SUP_SHORT_IO        0x2d
136#define VME_AM_USR_SHORT_IO        0x29
137
138/*
139 * 'Extended' BSP support
140 */
141rtems_status_code bspExtInit(void);
142typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector);
143BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg);
144int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
145int BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
146int BSP_enableVME_int_lvl(unsigned int level);
147int BSP_disableVME_int_lvl(unsigned int level);
148int BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr);
149
150/*
151 *  This BSP provides its own IDLE task to override the RTEMS one.
152 *  So we prototype it and define the constant confdefs.h expects
153 *  to configure a BSP specific one.
154 */
155Thread _BSP_Thread_Idle_body(uint32_t);
156#define BSP_IDLE_TASK_BODY _BSP_Thread_Idle_body
157
158#ifdef __cplusplus
159}
160#endif
161
162#endif
Note: See TracBrowser for help on using the repository browser.