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

Last change on this file since 71c5552f was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

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: 5.6 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/**
31 * \file
32 *
33 * \section Purpose
34 *
35 * Interface for configuration the Enhanced Embedded Flash Controller (EEFC)
36 * peripheral.
37 *
38 * \section Usage
39 *
40 * -# Enable/disable %flash ready interrupt sources using EFC_EnableFrdyIt()
41 *    and EFC_DisableFrdyIt().
42 * -# Translates the given address into which EEFC, page and offset values
43 *    for difference density %flash memory using EFC_TranslateAddress().
44 * -# Computes the address of a %flash access given the EFC, page and offset
45 *    for difference density %flash memory using EFC_ComputeAddress().
46 * -# Start the executing command with EFC_PerformCommand()
47 * -# Retrieve the current status of the EFC using EFC_GetStatus().
48 * -# Retrieve the result of the last executed command with EFC_GetResult().
49 */
50
51#ifndef _EEFC_
52#define _EEFC_
53
54/*----------------------------------------------------------------------------
55 *        Headers
56 *----------------------------------------------------------------------------*/
57#include "chip.h"
58
59#include <stdint.h>
60
61/*----------------------------------------------------------------------------
62 *        Definitions
63 *----------------------------------------------------------------------------*/
64/* TODO: Temporary definition for missing symbol in header file */
65#define IFLASH_SECTOR_SIZE      65536u
66
67
68/* EFC command */
69#define EFC_FCMD_GETD    0x00 /* Get Flash Descriptor */
70#define EFC_FCMD_WP      0x01 /* Write page */
71#define EFC_FCMD_WPL     0x02 /* Write page and lock */
72#define EFC_FCMD_EWP     0x03 /* Erase page and write page */
73#define EFC_FCMD_EWPL    0x04 /* Erase page and write page then lock */
74#define EFC_FCMD_EA      0x05 /* Erase all */
75#define EFC_FCMD_EPA     0x07 /* Erase pages */
76#define EFC_FCMD_SLB     0x08 /* Set Lock Bit */
77#define EFC_FCMD_CLB     0x09 /* Clear Lock Bit */
78#define EFC_FCMD_GLB     0x0A /* Get Lock Bit */
79#define EFC_FCMD_SFB     0x0B /* Set GPNVM Bit */
80#define EFC_FCMD_CFB     0x0C /* Clear GPNVM Bit */
81#define EFC_FCMD_GFB     0x0D /* Get GPNVM Bit */
82#define EFC_FCMD_STUI    0x0E /* Start unique ID */
83#define EFC_FCMD_SPUI    0x0F /* Stop unique ID */
84#define EFC_FCMD_GCALB   0x10 /* Get CALIB Bit */
85#define EFC_FCMD_ES      0x11 /* Erase Sector */
86#define EFC_FCMD_WUS     0x12 /* Write User Signature */
87#define EFC_FCMD_EUS     0x13 /* Erase User Signature */
88#define EFC_FCMD_STUS    0x14 /* Start Read User Signature */
89#define EFC_FCMD_SPUS    0x15 /* Stop Read User Signature */
90
91/* The IAP function entry address */
92#define CHIP_FLASH_IAP_ADDRESS  (0x00800008)
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97
98/*----------------------------------------------------------------------------
99 *        Exported functions
100 *----------------------------------------------------------------------------*/
101
102extern void EFC_EnableFrdyIt(Efc *efc);
103
104extern void EFC_DisableFrdyIt(Efc *efc);
105
106extern void EFC_SetWaitState(Efc *efc, uint8_t cycles);
107
108extern void EFC_TranslateAddress(Efc **pEfc, uint32_t dwAddress,
109                                                                  uint16_t *pwPage, uint16_t *pwOffset);
110
111extern void EFC_ComputeAddress(Efc *efc, uint16_t wPage, uint16_t wOffset,
112                                                                uint32_t *pdwAddress);
113
114extern uint32_t EFC_PerformCommand(Efc *efc, uint32_t dwCommand,
115                                                                        uint32_t dwArgument, uint32_t dwUseIAP);
116
117extern uint32_t EFC_GetStatus(Efc *efc);
118
119extern uint32_t EFC_GetResult(Efc *efc);
120
121extern void EFC_SetFlashAccessMode(Efc *efc, uint32_t dwMode);
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif /* #ifndef _EEFC_ */
128
Note: See TracBrowser for help on using the repository browser.