source: rtems/bsps/m68k/uC5282/include/bsp.h @ d7d66d7

5
Last change on this file since d7d66d7 was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 5.3 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.org/license/LICENSE.
12 */
13
14#ifndef LIBBSP_M68K_UC5282_BSP_H
15#define LIBBSP_M68K_UC5282_BSP_H
16
17#include <bspopts.h>
18#include <bsp/default-initial-extension.h>
19
20#include <rtems.h>
21#include <rtems/bspIo.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/***************************************************************************/
28/**  BSP Configuration                                                    **/
29/*
30 * Uncomment to use instruction/data cache
31 * Leave commented to use instruction-only cache
32 */
33#define RTEMS_MCF5282_BSP_ENABLE_DATA_CACHE
34
35/***************************************************************************/
36/**  Hardware data structure headers                                      **/
37#include <mcf5282/mcf5282.h>   /* internal MCF5282 modules */
38
39/***************************************************************************/
40/**  Network driver configuration                                         **/
41struct rtems_bsdnet_ifconfig;
42extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching );
43#define RTEMS_BSP_NETWORK_DRIVER_NAME     "fs1"
44#define RTEMS_BSP_NETWORK_DRIVER_ATTACH   rtems_fec_driver_attach
45
46/***************************************************************************/
47/**  User Definable configuration                                         **/
48
49/* define which port the console should use - all other ports are then defined as general purpose */
50#define CONSOLE_PORT        0
51
52/* functions */
53
54typedef struct {
55    unsigned int l;
56    void        *v;
57} bsp_mnode_t;
58
59#define RTEMS_BSP_PGM_ERASE_FIRST   0x1
60#define RTEMS_BSP_PGM_RESET_AFTER   0x2
61#define RTEMS_BSP_PGM_EXEC_AFTER    0x4
62#define RTEMS_BSP_PGM_HALT_AFTER    0x8
63
64uint32_t bsp_get_CPU_clock_speed(void);
65rtems_status_code bsp_allocate_interrupt(int level, int priority);
66int bsp_sysReset(int flags);
67int bsp_program(bsp_mnode_t *chain, int flags);
68unsigned const char *bsp_gethwaddr(int a);
69const char *bsp_getbenv(const char *a);
70int bsp_flash_erase_range(volatile unsigned short *flashptr, int start, int end);
71int bsp_flash_write_range(volatile unsigned short *flashptr, bsp_mnode_t *chain, int offset);
72
73rtems_isr_entry set_vector(
74  rtems_isr_entry     handler,
75  rtems_vector_number vector,
76  int                 type
77);
78
79/*
80 * Interrupt assignments
81 *  Highest-priority listed first
82 */
83#define FEC_IRQ_LEVEL       4
84#define FEC_IRQ_RX_PRIORITY 7
85#define FEC_IRQ_TX_PRIORITY 6
86
87#define PIT3_IRQ_LEVEL      4
88#define PIT3_IRQ_PRIORITY   0
89
90#define UART0_IRQ_LEVEL     3
91#define UART0_IRQ_PRIORITY  7
92#define UART1_IRQ_LEVEL     3
93#define UART1_IRQ_PRIORITY  6
94#define UART2_IRQ_LEVEL     3
95#define UART2_IRQ_PRIORITY  5
96
97/*
98 * Fake VME support
99 * This makes it easier to use EPICS driver support on this BSP.
100 */
101#define VME_AM_STD_SUP_ASCENDING   0x3f
102#define VME_AM_STD_SUP_PGM         0x3e
103#define VME_AM_STD_USR_ASCENDING   0x3b
104#define VME_AM_STD_USR_PGM         0x3a
105#define VME_AM_STD_SUP_DATA        0x3d
106#define VME_AM_STD_USR_DATA        0x39
107#define VME_AM_EXT_SUP_ASCENDING   0x0f
108#define VME_AM_EXT_SUP_PGM         0x0e
109#define VME_AM_EXT_USR_ASCENDING   0x0b
110#define VME_AM_EXT_USR_PGM         0x0a
111#define VME_AM_EXT_SUP_DATA        0x0d
112#define VME_AM_EXT_USR_DATA        0x09
113#define VME_AM_SUP_SHORT_IO        0x2d
114#define VME_AM_USR_SHORT_IO        0x29
115
116/*
117 * 'Extended' BSP support
118 */
119rtems_status_code bspExtInit(void);
120typedef void (*BSP_VME_ISR_t)(void *usrArg, unsigned long vector);
121BSP_VME_ISR_t BSP_getVME_isr(unsigned long vector, void **parg);
122int BSP_installVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
123int BSP_removeVME_isr(unsigned long vector, BSP_VME_ISR_t handler, void *usrArg);
124int BSP_enableVME_int_lvl(unsigned int level);
125int BSP_disableVME_int_lvl(unsigned int level);
126int BSP_vme2local_adrs(unsigned am, unsigned long vmeaddr, unsigned long *plocaladdr);
127
128/*
129 *  This BSP provides its own IDLE task to override the RTEMS one.
130 *  So we prototype it and define the constant confdefs.h expects
131 *  to configure a BSP specific one.
132 */
133void *bsp_idle_thread( uintptr_t ignored );
134#define BSP_IDLE_TASK_BODY bsp_idle_thread
135
136/*
137 *  The custom IDLE task keeps some idle statistics.
138 */
139int bsp_cpu_load_percentage(void);
140
141/*
142 *  This is a helper method to determine the cause of a reset.
143 */
144void bsp_reset_cause(char *buf, size_t capacity);
145
146/*
147 * SRAM. The BSP uses SRAM for maintaining some clock-driver data
148 *       and for ethernet descriptors (and the initial stack during
149 *       early boot).
150 */
151
152typedef struct mcf5282BufferDescriptor_ {
153    volatile uint16_t   status;
154    uint16_t                    length;
155    volatile void      *buffer;
156} mcf5282BufferDescriptor_t;
157
158extern struct {
159        uint32_t                  idle_counter;
160        uint32_t                  filtered_idle;
161        uint32_t                  max_idle_count;
162        uint32_t                  pitc_per_tick;
163        uint32_t                  nsec_per_pitc;
164        uint32_t                  pad[3]; /* align to 16-bytes for descriptors */
165        mcf5282BufferDescriptor_t fec_descriptors[];
166        /* buffer descriptors are allocated from here */
167
168    /* initial stack is at top of SRAM (start.S)  */
169} __SRAMBASE;
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif
Note: See TracBrowser for help on using the repository browser.