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

4.104.115
Last change on this file since 4909a30 was 4909a30, checked in by Joel Sherrill <joel.sherrill@…>, on 09/10/08 at 21:35:37

2008-09-10 Joel Sherrill <joel.sherrill@…>

  • include/bsp.h: Review of all bsp_cleanup() implementations. In this phase, all prototypes were removed from bsp.h and empty implementations were removed and made to use the shared stub.
  • 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
93m68k_isr_entry set_vector(
94  rtems_isr_entry     handler,
95  rtems_vector_number vector,
96  int                 type
97);
98
99/*
100 * Interrupt assignments
101 *  Highest-priority listed first
102 */
103#define FEC_IRQ_LEVEL       4
104#define FEC_IRQ_RX_PRIORITY 7
105#define FEC_IRQ_TX_PRIORITY 6
106
107#define PIT3_IRQ_LEVEL      4
108#define PIT3_IRQ_PRIORITY   0
109
110#define UART0_IRQ_LEVEL     3
111#define UART0_IRQ_PRIORITY  7
112#define UART1_IRQ_LEVEL     3
113#define UART1_IRQ_PRIORITY  6
114#define UART2_IRQ_LEVEL     3
115#define UART2_IRQ_PRIORITY  5
116
117/*
118 * Fake VME support
119 * This makes it easier to use EPICS driver support on this BSP.
120 */
121#define VME_AM_STD_SUP_ASCENDING   0x3f
122#define VME_AM_STD_SUP_PGM         0x3e
123#define VME_AM_STD_USR_ASCENDING   0x3b
124#define VME_AM_STD_USR_PGM         0x3a
125#define VME_AM_STD_SUP_DATA        0x3d
126#define VME_AM_STD_USR_DATA        0x39
127#define VME_AM_EXT_SUP_ASCENDING   0x0f
128#define VME_AM_EXT_SUP_PGM         0x0e
129#define VME_AM_EXT_USR_ASCENDING   0x0b
130#define VME_AM_EXT_USR_PGM         0x0a
131#define VME_AM_EXT_SUP_DATA        0x0d
132#define VME_AM_EXT_USR_DATA        0x09
133#define VME_AM_SUP_SHORT_IO        0x2d
134#define VME_AM_USR_SHORT_IO        0x29
135
136/*
137 * 'Extended' BSP support
138 */
139rtems_status_code bspExtInit(void);
140typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector);
141BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg);
142int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
143int BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
144int BSP_enableVME_int_lvl(unsigned int level);
145int BSP_disableVME_int_lvl(unsigned int level);
146int BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr);
147
148/*
149 *  This BSP provides its own IDLE task to override the RTEMS one.
150 *  So we prototype it and define the constant confdefs.h expects
151 *  to configure a BSP specific one.
152 */
153Thread _BSP_Thread_Idle_body(uint32_t);
154#define BSP_IDLE_TASK_BODY _BSP_Thread_Idle_body
155
156#ifdef __cplusplus
157}
158#endif
159
160#endif
Note: See TracBrowser for help on using the repository browser.