source: rtems/bsps/arm/atsam/include/libchip/include/mcid.h @ 71c5552f

5
Last change on this file since 71c5552f 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.1 KB
Line 
1/* ---------------------------------------------------------------------------- */
2/*                  Atmel Microcontroller Software Support                      */
3/*                       SAM Software Package License                           */
4/* ---------------------------------------------------------------------------- */
5/* Copyright (c) 2015, Atmel Corporation                                        */
6/*                                                                              */
7/* All rights reserved.                                                         */
8/*                                                                              */
9/* Redistribution and use in source and binary forms, with or without           */
10/* modification, are permitted provided that the following condition is met:    */
11/*                                                                              */
12/* - Redistributions of source code must retain the above copyright notice,     */
13/* this list of conditions and the disclaimer below.                            */
14/*                                                                              */
15/* Atmel's name may not be used to endorse or promote products derived from     */
16/* this software without specific prior written permission.                     */
17/*                                                                              */
18/* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR   */
19/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
21/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,      */
22/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
24/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
25/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
26/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
28/* ---------------------------------------------------------------------------- */
29
30/** \file */
31
32/**
33 * \ingroup sdmmc_hal
34 * \addtogroup mcid_module MCI Driver (HAL for SD/MMC Lib)
35 *
36 * \section Purpose
37 *
38 * This driver implements SD(IO)/MMC command operations and MCI configuration
39 * routines to perform SD(IO)/MMC access. It's used for upper layer
40 * (\ref libsdmmc_module "SD/MMC driver") to perform SD/MMC operations.
41 *
42 * \section Usage
43 *
44 * -# MCID_Init(): Initializes a MCI driver instance and the underlying
45 *                 peripheral.
46 * -# MCID_SendCmd(): Starts a MCI transfer which described by
47 *                    \ref sSdmmcCommand.
48 * -# MCID_CancelCmd(): Cancel a pending command.
49 * -# MCID_IsCmdCompleted(): Check if MCI transfer is finished.
50 * -# MCID_Handler(): Interrupt handler which is called by ISR handler.
51 * -# MCID_IOCtrl(): IO control function to report HW attributes to upper
52 *                   layer driver and modify HW settings (such as clock
53 *                   frequency, High-speed support, etc. See
54 *                   \ref sdmmc_ioctrls).
55 *
56 * \sa \ref dmad_module "DMA Driver", \ref hsmci_module "HSMCI",
57 *     \ref libsdmmc_module "SD/MMC Library"
58 *
59 * Related files:\n
60 * \ref mcid.h\n
61 * \ref mcid_dma.c.\n
62 */
63
64#ifndef MCID_H
65#define MCID_H
66/** \addtogroup mcid_module
67 *@{
68 */
69
70/*----------------------------------------------------------------------------
71 *         Headers
72 *----------------------------------------------------------------------------*/
73
74#include "chip.h"
75
76#include <stdint.h>
77#include <stdio.h>
78
79/** \addtogroup mcid_defines MCI Driver Defines
80 *      @{*/
81
82/*----------------------------------------------------------------------------
83 *         Constants
84 *----------------------------------------------------------------------------*/
85
86/** MCI States */
87#define MCID_IDLE   0       /**< Idle */
88#define MCID_LOCKED 1       /**< Locked for specific slot */
89#define MCID_CMD    2       /**< Processing the command */
90#define MCID_ERROR  3       /**< Command error */
91
92/** MCI Initialize clock 400K Hz */
93#define MCI_INITIAL_SPEED   400000
94
95/**     @}*/
96
97/*----------------------------------------------------------------------------
98 *         Types
99 *----------------------------------------------------------------------------*/
100/** \addtogroup mcid_structs MCI Driver Data Structs
101 *      @{
102 */
103#ifdef __cplusplus
104extern "C" {
105#endif
106
107/**
108 *  \brief MCI Driver
109 */
110typedef struct _Mcid {
111        /** Pointer to a MCI peripheral. */
112        Hsmci         *pMciHw;
113        /** Pointer to a DMA driver */
114        sXdmad         *pXdmad;
115        /** Pointer to currently executing command. */
116        void          *pCmd;
117        /** MCK source, Hz */
118        uint32_t       dwMck;
119        /** DMA transfer channel */
120        uint32_t       dwDmaCh;
121        /** DMA transferred data index (bytes) */
122        uint32_t       dwXfrNdx;
123        /** DMA transfer size (bytes) */
124        uint32_t       dwXSize;
125        /** MCI peripheral identifier. */
126        uint8_t        bID;
127        /** Polling mode */
128        uint8_t        bPolling;
129        /** Reserved */
130        uint8_t        reserved;
131        /** state. */
132        volatile uint8_t bState;
133} sMcid;
134
135/**     @}*/
136/*----------------------------------------------------------------------------
137 *         Exported functions
138 *----------------------------------------------------------------------------*/
139/** \addtogroup mcid_functions MCI Driver Functions
140        @{*/
141extern void MCID_Init(sMcid *pMcid,
142                                          Hsmci *pMci, uint8_t bID, uint32_t dwMck,
143                                          sXdmad *pXdmad,
144                                          uint8_t bPolling);
145
146extern void MCID_Reset(sMcid *pMcid);
147
148extern void MCID_SetSlot(Hsmci *pMci, uint8_t slot);
149
150extern uint32_t MCID_Lock(sMcid *pMcid, uint8_t bSlot);
151
152extern uint32_t MCID_Release(sMcid *pMcid);
153
154extern void MCID_Handler(sMcid *pMcid);
155
156extern uint32_t MCID_SendCmd(sMcid *pMcid, void *pCmd);
157
158extern uint32_t MCID_CancelCmd(sMcid *pMcid);
159
160extern uint32_t MCID_IsCmdCompleted(sMcid *pMcid);
161
162extern uint32_t MCID_IOCtrl(sMcid *pMcid, uint32_t bCtl, uint32_t param);
163
164#ifdef __cplusplus
165}
166#endif
167/**     @}*/
168/**@}*/
169#endif //#ifndef HSMCID_H
170
Note: See TracBrowser for help on using the repository browser.