source: rtems/bsps/sparc/include/drvmgr/ambapp_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: 6.3 KB
Line 
1/*  General part of a AMBA Plug & Play bus driver.
2 *
3 *  COPYRIGHT (c) 2008.
4 *  Cobham Gaisler AB.
5 *
6 *  This is the general part of the different AMBA Plug & Play
7 *  drivers. The drivers are wrappers around this driver, making
8 *  the code size smaller for systems with multiple AMBA Plug &
9 *  Play buses.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifndef __AMBAPP_BUS_H__
17#define __AMBAPP_BUS_H__
18
19#include <drvmgr/drvmgr.h>
20#include <ambapp.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* GRLIB AMBA Plug&Play Driver ID generation */
27#define DRIVER_AMBAPP_ID(vendor, device) \
28        DRIVER_ID(DRVMGR_BUS_TYPE_AMBAPP, ((((vendor) & 0xff) << 16) | ((device) & 0xfff)))
29
30/*** Gaisler Hardware Device Driver IDs ***/
31#define DRIVER_AMBAPP_GAISLER_AHBSTAT_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_AHBSTAT)
32#define DRIVER_AMBAPP_GAISLER_APBUART_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_APBUART)
33#define DRIVER_AMBAPP_GAISLER_B1553BRM_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_B1553BRM)
34#define DRIVER_AMBAPP_GAISLER_B1553RT_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_B1553RT)
35#define DRIVER_AMBAPP_GAISLER_GPTIMER_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GPTIMER)
36#define DRIVER_AMBAPP_GAISLER_GR1553B_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GR1553B)
37#define DRIVER_AMBAPP_GAISLER_GRADCDAC_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRADCDAC)
38#define DRIVER_AMBAPP_GAISLER_GRAES_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRAESDMA)
39#define DRIVER_AMBAPP_GAISLER_GRCAN_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRCAN)
40#define DRIVER_AMBAPP_GAISLER_GRCTM_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRCTM)
41#define DRIVER_AMBAPP_GAISLER_GRETH_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_ETHMAC)
42#define DRIVER_AMBAPP_GAISLER_GRGPIO_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GPIO)
43#define DRIVER_AMBAPP_GAISLER_GRPCI2_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRPCI2)
44#define DRIVER_AMBAPP_GAISLER_GRIOMMU_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRIOMMU)
45#define DRIVER_AMBAPP_GAISLER_GRPCI_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_PCIFBRG)
46#define DRIVER_AMBAPP_GAISLER_GRPWM_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRPWM)
47#define DRIVER_AMBAPP_GAISLER_GRPWRX_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_PW2APB)
48#define DRIVER_AMBAPP_GAISLER_GRSPW_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_SPW)
49#define DRIVER_AMBAPP_GAISLER_GRSPW2_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_SPW2)
50#define DRIVER_AMBAPP_GAISLER_GRTC_ID           DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRTC)
51#define DRIVER_AMBAPP_GAISLER_GRTM_ID           DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_GRTM)
52#define DRIVER_AMBAPP_GAISLER_I2CMST_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_I2CMST)
53#define DRIVER_AMBAPP_GAISLER_OCCAN_ID          DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_CANAHB)
54#define DRIVER_AMBAPP_GAISLER_PCIF_ID           DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_PCIF)
55#define DRIVER_AMBAPP_GAISLER_PCITRACE_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_PCITRACE)
56#define DRIVER_AMBAPP_GAISLER_SPICTRL_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_SPICTRL)
57#define DRIVER_AMBAPP_GAISLER_SPWCUC_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_SPWCUC)
58#define DRIVER_AMBAPP_GAISLER_SPW_ROUTER_ID     DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_SPW_ROUTER)
59#define DRIVER_AMBAPP_GAISLER_L2CACHE_ID        DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_L2CACHE)
60#define DRIVER_AMBAPP_GAISLER_MEMSCRUB_ID       DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_MEMSCRUB)
61#define DRIVER_AMBAPP_GAISLER_L4STAT_ID         DRIVER_AMBAPP_ID(VENDOR_GAISLER, GAISLER_L4STAT)
62
63/*** ESA Hardware Device Driver IDs ***/
64#define DRIVER_AMBAPP_ESA_MCTRL_ID              DRIVER_AMBAPP_ID(VENDOR_ESA, ESA_MCTRL)
65#define DRIVER_AMBAPP_MCTRL_ID                  DRIVER_AMBAPP_ESA_MCTRL_ID
66
67struct amba_dev_id {
68        unsigned short          vendor;
69        unsigned short          device;
70        /* Version ? */
71};
72
73struct amba_drv_info {
74        struct drvmgr_drv       general;        /* General bus info */
75        /* AMBA specific bus information */
76        struct amba_dev_id              *ids;           /* Supported hardware */
77};
78
79struct amba_dev_info {
80        struct amba_dev_id      id;
81        struct ambapp_core      info;
82};
83
84struct ambapp_ops {
85        int     (*int_register)
86                (struct drvmgr_dev *dev, int index, const char *info, drvmgr_isr isr, void *arg);
87        int     (*int_unregister)
88                (struct drvmgr_dev *dev, int index, drvmgr_isr isr, void *arg);
89        int     (*int_clear)(struct drvmgr_dev *dev, int index);
90        int     (*int_mask)(struct drvmgr_dev *dev, int index);
91        int     (*int_unmask)(struct drvmgr_dev *dev, int index);
92#ifdef RTEMS_SMP
93        int     (*int_set_affinity)(struct drvmgr_dev *dev, int index,
94                                const Processor_mask *cpus);
95#endif
96        int     (*get_params)
97                (struct drvmgr_dev *, struct drvmgr_bus_params *);
98};
99
100struct ambapp_config {
101        struct ambapp_bus               *abus;          /* Prescanned AMBA PnP bus */
102        struct ambapp_ops               *ops;           /* AMBA bus operations */
103        struct drvmgr_map_entry         *maps_up;       /* Bus memory map up-stream towards CPU */
104        struct drvmgr_map_entry         *maps_down;     /* Bus memory map down-stream towards HW */
105        struct drvmgr_bus_res           *resources;     /* Driver Resources */
106        int                             bus_type;       /* Set DRVMGR_BUS_TYPE_AMBAPP_DIST if distributed AMBA Bus */
107        struct drvmgr_func              *funcs;         /* Custom functions */
108};
109
110/*** Bus operations with READ/WRITE access operations ***
111 *
112 * The functions are implemented using the standard drvmgr RW interface
113 */
114#define AMBAPP_R8        DRVMGR_RWFUNC(RW_SIZE_1|RW_READ|RW_REG)
115#define AMBAPP_R16       DRVMGR_RWFUNC(RW_SIZE_2|RW_READ|RW_REG)
116#define AMBAPP_R32       DRVMGR_RWFUNC(RW_SIZE_4|RW_READ|RW_REG)
117#define AMBAPP_R64       DRVMGR_RWFUNC(RW_SIZE_8|RW_READ|RW_REG)
118#define AMBAPP_W8        DRVMGR_RWFUNC(RW_SIZE_1|RW_WRITE|RW_REG)
119#define AMBAPP_W16       DRVMGR_RWFUNC(RW_SIZE_2|RW_WRITE|RW_REG)
120#define AMBAPP_W32       DRVMGR_RWFUNC(RW_SIZE_4|RW_WRITE|RW_REG)
121#define AMBAPP_W64       DRVMGR_RWFUNC(RW_SIZE_8|RW_WRITE|RW_REG)
122#define AMBAPP_RMEM      DRVMGR_RWFUNC(RW_SIZE_ANY|RW_READ|RW_MEM)
123#define AMBAPP_WMEM      DRVMGR_RWFUNC(RW_SIZE_ANY|RW_WRITE|RW_MEM)
124#define AMBAPP_MEMSET    DRVMGR_RWFUNC(RW_SIZE_ANY|RW_SET|RW_MEM)
125#define AMBAPP_RW_ARG    DRVMGR_RWFUNC(RW_ARG)
126
127/* Register an ambapp bus on-top of a device */
128extern int ambapp_bus_register(
129        struct drvmgr_dev *dev,
130        struct ambapp_config *config
131        );
132
133extern void ambapp_bus_freq_register(
134        struct drvmgr_dev *dev,
135        int amba_interface,
136        unsigned int freq_hz);
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
Note: See TracBrowser for help on using the repository browser.