source: rtems/bsps/sparc/include/drvmgr/leon2_amba_bus.h @ 2afb22b

5
Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

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: 2.7 KB
Line 
1/*  LEON2 Hardcoded bus driver interface.
2 *
3 *  COPYRIGHT (c) 2008.
4 *  Cobham Gaisler AB.
5 *
6 *  Bus driver for a hardcoded setup. LEON2 systems have some
7 *  cores always present, here called "Standard Cores". In
8 *  addtion to the standard cores there are often extra cores
9 *  that can be defined using the "Custom Cores" mechanism.
10 *
11 *  A Core is described by assigning a base register and
12 *  IRQ0..IRQ15 using the leon2_core structure.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef __LEON2_AMBA_BUS_H__
20#define __LEON2_AMBA_BUS_H__
21
22/*** Cores location and IRQs hardcoded ***/
23
24#include <drvmgr/drvmgr.h>
25#include <ambapp.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* LEON2 AMBA Driver ID generation */
32#define DRIVER_LEON2_AMBA(id)   DRIVER_ID(DRVMGR_BUS_TYPE_LEON2_AMBA, id)
33
34/* LEON2 Cores (any unique 48-bit number will do) */
35#define LEON2_AMBA_NONE_ID              0
36#define LEON2_AMBA_TIMER_ID             1
37#define LEON2_AMBA_UART_ID              2
38#define LEON2_AMBA_GPIO_ID              3
39#define LEON2_AMBA_IRQCTRL_ID           4
40
41#define LEON2_AMBA_AT697PCI_ID          100
42#define LEON2_AMBA_AMBAPP_ID            0xfff0
43
44/* LEON2 driver IDs */
45#define DRIVER_LEON2_AMBA_TIMER         DRIVER_LEON2_AMBA(LEON2_AMBA_TIMER_ID)
46#define DRIVER_LEON2_AMBA_UART          DRIVER_LEON2_AMBA(LEON2_AMBA_UART_ID)
47#define DRIVER_LEON2_AMBA_AT697PCI      DRIVER_LEON2_AMBA(LEON2_AMBA_AT697PCI_ID)
48#define DRIVER_LEON2_AMBA_AMBAPP        DRIVER_LEON2_AMBA(LEON2_AMBA_AMBAPP_ID)
49
50struct leon2_amba_dev_id {
51        unsigned short          core_id;
52};
53
54#define EMPTY_LEON2_CORE {{LEON2_AMBA_NONE_ID}, NULL, NULL}
55struct leon2_core {
56        struct leon2_amba_dev_id        id;     /* Core ID */
57        char                            *name;  /* Name of Core */
58        struct drvmgr_key               *keys;  /* Core setup (location, IRQs) */
59};
60
61struct leon2_bus {
62        struct leon2_core               *std_cores;     /* The LEON2 standard cores */
63        struct leon2_core               *custom_cores;  /* Custom cores on the same bus */
64        struct drvmgr_map_entry         *maps_up;       /* Memory map ip-stream */
65        struct drvmgr_map_entry         *maps_down;     /* Memory map down-stream */
66};
67
68extern struct leon2_core leon2_std_cores[];
69
70/* Data structure drivers can access */
71struct leon2_amba_dev_info {
72        unsigned short          core_id;        /* Core ID */
73        unsigned int            reg_base;       /* Register base */
74        char                    irqs[16];       /* 16 irqs */
75};
76
77struct leon2_amba_drv_info {
78        struct drvmgr_drv       general;        /* General bus info */
79        /* AMBA specific bus information */
80        struct leon2_amba_dev_id        *ids;           /* Supported hardware */
81};
82
83/* Initialize LEON2 bus with a configuration
84 *  bus_config   -   What cores, their location and irqs
85 *  resources    -   Driver configuration for the cores specified bus_config
86 */
87int leon2_root_register(
88        struct leon2_bus *bus_config,
89        struct drvmgr_bus_res *resources);
90
91#ifdef __cplusplus
92}
93#endif
94
95#endif
Note: See TracBrowser for help on using the repository browser.