source: rtems/bsps/m68k/include/mcf5206/mcfmbus.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: 3.9 KB
Line 
1/*
2 * MCF5206e MBUS module (I2C bus) driver header file
3 *
4 *  Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
5 *  Author: Victor V. Vengerov <vvv@oktet.ru>
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.org/license/LICENSE.
10 */
11
12#ifndef __MCFBSP_MCFMBUS_H__
13#define __MCFBSP_MCFMBUS_H__
14
15#include "mcf5206e.h"
16#include "i2c.h"
17
18/* States of I2C machine */
19typedef enum mcfmbus_i2c_state {
20    STATE_IDLE,
21    STATE_ADDR_7,
22    STATE_ADDR_1_W,
23    STATE_ADDR_1_R,
24    STATE_SENDING,
25    STATE_RECEIVING
26} mcfmbus_i2c_state;
27
28typedef struct mcfmbus {
29    uint32_t         base; /* ColdFire internal peripherial base
30                                    address */
31    enum mcfmbus_i2c_state state;/* State of I2C machine */
32    i2c_message           *msg;  /* Pointer to the first message in transfer */
33    int                    nmsg; /* Number of messages in transfer */
34    i2c_message           *cmsg; /* Current message */
35    int                    byte; /* Byte number in current message */
36    rtems_isr_entry        oldisr; /* Old interrupt handler */
37    rtems_id               sema; /* MBUS semaphore */
38    i2c_transfer_done      done; /* Transfer done function */
39    uintptr_t      done_arg_ptr; /* Done function argument ptr */
40} mcfmbus;
41
42/* mcfmbus_initialize --
43 *     Initialize ColdFire MBUS I2C bus controller.
44 *
45 * PARAMETERS:
46 *     i2c_bus - pointer to the bus descriptor structure
47 *     base    - ColdFire internal peripherial base address
48 *
49 * RETURNS:
50 *     RTEMS_SUCCESSFUL, or RTEMS error code when initialization failed.
51 */
52rtems_status_code
53mcfmbus_initialize(mcfmbus *i2c_bus, uint32_t   base);
54
55/* mcfmbus_select_clock_divider --
56 *     Select divider for system clock which is used for I2C bus clock
57 *     generation. Not each divider can be selected for I2C bus; this
58 *     function select nearest larger or equal divider, or maximum
59 *     possible divider, if passed value greater.
60 *
61 * PARAMETERS:
62 *     i2c_bus - pointer to the bus descriptor structure
63 *     divider - system frequency divider for I2C serial clock.
64 *
65 * RETURNS:
66 *     RTEMS_SUCCESSFUL, if operation performed successfully, or
67 *     RTEMS error code when failed.
68 */
69rtems_status_code
70mcfmbus_select_clock_divider(mcfmbus *i2c_bus, int divider);
71
72/* mcfmbus_i2c_transfer --
73 *     Initiate multiple-messages transfer over I2C bus via ColdFire MBUS
74 *     controller.
75 *
76 * PARAMETERS:
77 *     bus - pointer to MBUS controller descriptor
78 *     nmsg - number of messages
79 *     msg - pointer to messages array
80 *     done - function which is called when transfer is finished
81 *     done_arg_ptr - arbitrary argument ptr passed to done funciton
82 *
83 * RETURNS:
84 *     RTEMS_SUCCESSFUL if transfer initiated successfully, or error
85 *     code when failed.
86 */
87rtems_status_code
88mcfmbus_i2c_transfer(mcfmbus *bus, int nmsg, i2c_message *msg,
89                     i2c_transfer_done done, void *done_arg_ptr);
90
91/* mcfmbus_i2c_done --
92 *     Close ColdFire MBUS I2C bus controller and release all resources.
93 *
94 * PARAMETERS:
95 *     bus - pointer to MBUS controller descriptor
96 *
97 * RETURNS:
98 *     RTEMS_SUCCESSFUL, if transfer initiated successfully, or error
99 *     code when failed.
100 */
101rtems_status_code
102mcfmbus_i2c_done(mcfmbus *i2c_bus);
103
104/* mcfmbus_i2c_interrupt_handler --
105 *     ColdFire MBUS I2C bus controller interrupt handler. This function
106 *     called from real interrupt handler, and pointer to MBUS descriptor
107 *     structure passed to this function.
108 *
109 * PARAMETERS:
110 *     bus - pointert to the bus descriptor structure
111 *
112 * RETURNS:
113 *     none
114 */
115void mcfmbus_i2c_interrupt_handler(mcfmbus *bus);
116
117/* mcfmbus_poll --
118 *     MBUS module poll routine; used to poll events when I2C driver
119 *     operates in poll-driven mode.
120 *
121 * PARAMETERS:
122 *     none
123 *
124 * RETURNS:
125 *     none
126 */
127void mcfmbus_poll(mcfmbus *bus);
128
129#endif /* __MCFBSP_MCFMBUS_H__ */
Note: See TracBrowser for help on using the repository browser.