source: rtems/bsps/powerpc/include/bsp/vpd.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: 4.5 KB
Line 
1#ifndef PPC_MOTLOAD_VPD_H
2#define PPC_MOTLOAD_VPD_H
3
4/* MotLoad VPD format */
5
6/* Till Straumann, 2005; see copyright notice at the end of this file */
7
8#ifdef __cplusplus
9  extern "C" {
10#endif
11
12/*
13VPD = "MOTOROLA" , { field }
14
15field = type_byte, length_byte, { data }
16*/
17
18/* Known fields so far */
19typedef enum {
20        ProductIdent    = 0x01, /* String */
21        AssemblyNumber  = 0x02, /* String */
22        SerialNumber    = 0x03, /* String */
23        CpuClockHz              = 0x05, /* binary (5bytes), 0x01 byte appended to unsigned int */
24        BusClockHz              = 0x06, /* binary (5bytes), 0x01 byte appended to unsigned int */
25        EthernetAddr    = 0x08, /* binary (7bytes), 0x00 byte appended, 2nd has 0x01 appended */
26        CpuType                 = 0x09, /* String */
27        EEpromCrc               = 0x0a, /* binary (4bytes) */
28        FlashConfig             = 0x0b, /* binary */
29        L2CacheConfig   = 0x0e, /* binary */
30        VPDRevision             = 0x0f, /* binary (4bytes) */
31        L3CacheConfig   = 0x19, /* binary */
32        End                             = 0xff
33} VpdKey;
34
35typedef struct {
36        VpdKey  key;            /* key for the data item to be read into 'buf' */
37        char    instance;       /* instance # (starting with 0) - some keys are present more than one time */
38        void    *buf;           /* pointer to area where the data item is to be stored */
39        int             buflen;         /* available space in the buffer */
40        char    found;          /* set by BSP_vpdRetrieveFields() to the original length as found in the PROM */
41} VpdBufRec, *VpdBuf;
42
43
44#define VPD_END { key:End, }
45
46
47/* Scan the VPD EEPROM for a number of fields
48 *
49 * Pass an array of VpdBufRec items. The routine
50 * fills the 'buf'fers for all keys that are found
51 * and sets the 'found' field to the original length
52 * of the data (i.e., as found in the PROM) so that
53 * the routine could be called again with a larger
54 * buffer.
55 *
56 * NOTE: - the array must be terminated by a VPD_END record!
57 *       - no CRC check is performed.
58 *       - INTERRUPT MANAGEMENT MUST BE FUNCTIONAL
59 *
60 * RETURNS: 0 on success, -1 if any read errors were
61 *          encountered or if the "MOTOROLA" header
62 *                      was not found.
63 */
64int
65BSP_vpdRetrieveFields(VpdBuf data);
66
67/* Example:
68 *      Read 2nd ethernet address:
69 *
70 *              char enet_addr_2[6];
71 *
72 *              VpdBufRec enetVpd [] = {
73 *                      { key: EthernetAddr, instance: 1, buf: enet_addr_2, buflen: 2},
74 *                      VPD_END
75 *              };
76 *
77 *              if ( BSP_vpdRetrieveFields(enetVpd) ) {
78 *                      error("ethernet address couldn't be read\n");
79 *              } else if ( enetVpd[0].found < 6 ) {
80 *                      error("2nd ethernet address not found in VPD\n");
81 *              } else {
82 *                      use_it(enet_addr_2);
83 *              }
84 */
85
86
87/* Simple wrapper if only one field is needed
88 *
89 * RETURNS: original length if key is found, -1 on error or if key is not found
90 */
91int
92BSP_vpdRetrieveKey(VpdKey k, void *buf, int buflen, int instance);
93
94#ifdef __cplusplus
95  }
96#endif
97
98/*
99 * Authorship
100 * ----------
101 * This software ('beatnik' RTEMS BSP for MVME6100 and MVME5500) was
102 *     created by Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
103 *         Stanford Linear Accelerator Center, Stanford University.
104 *
105 * Acknowledgement of sponsorship
106 * ------------------------------
107 * The 'beatnik' BSP was produced by
108 *     the Stanford Linear Accelerator Center, Stanford University,
109 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
110 *
111 * Government disclaimer of liability
112 * ----------------------------------
113 * Neither the United States nor the United States Department of Energy,
114 * nor any of their employees, makes any warranty, express or implied, or
115 * assumes any legal liability or responsibility for the accuracy,
116 * completeness, or usefulness of any data, apparatus, product, or process
117 * disclosed, or represents that its use would not infringe privately owned
118 * rights.
119 *
120 * Stanford disclaimer of liability
121 * --------------------------------
122 * Stanford University makes no representations or warranties, express or
123 * implied, nor assumes any liability for the use of this software.
124 *
125 * Stanford disclaimer of copyright
126 * --------------------------------
127 * Stanford University, owner of the copyright, hereby disclaims its
128 * copyright and all other rights in this software.  Hence, anyone may
129 * freely use it for any purpose without restriction.
130 *
131 * Maintenance of notices
132 * ----------------------
133 * In the interest of clarity regarding the origin and status of this
134 * SLAC software, this and all the preceding Stanford University notices
135 * are to remain affixed to any copy or derivative of this software made
136 * or distributed by the recipient and are to be affixed to any copy of
137 * software made or distributed by the recipient that contains a copy or
138 * derivative of this software.
139 *
140 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
141 */
142
143#endif
Note: See TracBrowser for help on using the repository browser.