source: rtems/bsps/arm/lpc32xx/include/bsp/emc.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.7 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup lpc32xx_emc
5 *
6 * @brief EMC support API.
7 */
8
9/*
10 * Copyright (c) 2010-2011 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Obere Lagerstr. 30
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef LIBBSP_ARM_LPC32XX_EMC_H
24#define LIBBSP_ARM_LPC32XX_EMC_H
25
26#include <rtems.h>
27
28#include <bsp/lpc-emc.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif /* __cplusplus */
33
34/**
35 * @addtogroup lpc_emc
36 *
37 * @brief EMC Support
38 *
39 * @{
40 */
41
42/**
43 * @name SDRAM Clock Control Register (SDRAMCLK_CTRL)
44 *
45 * @{
46 */
47
48#define SDRAMCLK_CLOCKS_DIS BSP_BIT32(0)
49#define SDRAMCLK_DDR_MODE BSP_BIT32(1)
50#define SDRAMCLK_DDR_DQSIN_DELAY(val) BSP_FLD32(val, 2, 6)
51#define SDRAMCLK_RTC_TICK_EN BSP_BIT32(7)
52#define SDRAMCLK_SW_DDR_CAL BSP_BIT32(8)
53#define SDRAMCLK_CAL_DELAY BSP_BIT32(9)
54#define SDRAMCLK_SENSITIVITY_FACTOR(val) BSP_FLD32(val, 10, 12)
55#define SDRAMCLK_DCA_STATUS BSP_BIT32(13)
56#define SDRAMCLK_COMMAND_DELAY(val) BSP_FLD32(val, 14, 18)
57#define SDRAMCLK_SW_DDR_RESET BSP_BIT32(19)
58#define SDRAMCLK_PIN_1_FAST BSP_BIT32(20)
59#define SDRAMCLK_PIN_2_FAST BSP_BIT32(21)
60#define SDRAMCLK_PIN_3_FAST BSP_BIT32(22)
61
62/** @} */
63
64/**
65 * @name EMC AHB Control Register (EMCAHBControl)
66 *
67 * @{
68 */
69
70#define EMC_AHB_PORT_BUFF_EN BSP_BIT32(0)
71
72/** @} */
73
74/**
75 * @name EMC AHB Timeout Register (EMCAHBTimeOut)
76 *
77 * @{
78 */
79
80#define EMC_AHB_TIMEOUT(val) BSP_FLD32(val, 0, 9)
81
82/** @} */
83
84/**
85 * @name SDRAM Mode and Extended Mode Registers
86 *
87 * @{
88 */
89
90#define SDRAM_ADDR_ROW_16MB(val) ((uint32_t) (val) << 10)
91#define SDRAM_ADDR_ROW_32MB(val) ((uint32_t) (val) << 11)
92#define SDRAM_ADDR_ROW_64MB(val) ((uint32_t) (val) << 11)
93
94#define SDRAM_ADDR_BANK_16MB(ba1, ba0) \
95  (((uint32_t) (ba1) << 23) | ((uint32_t) (ba0) << 22))
96#define SDRAM_ADDR_BANK_32MB(ba1, ba0) \
97  (((uint32_t) (ba1) << 23) | ((uint32_t) (ba0) << 24))
98#define SDRAM_ADDR_BANK_64MB(ba1, ba0) \
99  (((uint32_t) (ba1) << 25) | ((uint32_t) (ba0) << 24))
100
101#define SDRAM_MODE_16MB(mode) \
102  (SDRAM_ADDR_BANK_16MB(0, 0) | SDRAM_ADDR_ROW_16MB(mode))
103#define SDRAM_MODE_32MB(mode) \
104  (SDRAM_ADDR_BANK_32MB(0, 0) | SDRAM_ADDR_ROW_32MB(mode))
105#define SDRAM_MODE_64MB(mode) \
106  (SDRAM_ADDR_BANK_64MB(0, 0) | SDRAM_ADDR_ROW_64MB(mode))
107
108#define SDRAM_EXTMODE_16MB(mode) \
109  (SDRAM_ADDR_BANK_16MB(1, 0) | SDRAM_ADDR_ROW_16MB(mode))
110#define SDRAM_EXTMODE_32MB(mode) \
111  (SDRAM_ADDR_BANK_32MB(1, 0) | SDRAM_ADDR_ROW_32MB(mode))
112#define SDRAM_EXTMODE_64MB(mode) \
113  (SDRAM_ADDR_BANK_64MB(1, 0) | SDRAM_ADDR_ROW_64MB(mode))
114
115#define SDRAM_MODE_BURST_LENGTH(val) BSP_FLD32(val, 0, 2)
116#define SDRAM_MODE_BURST_INTERLEAVE BSP_BIT32(3)
117#define SDRAM_MODE_CAS(val) BSP_FLD32(val, 4, 6)
118#define SDRAM_MODE_TEST_MODE(val) BSP_FLD32(val, 7, 8)
119#define SDRAM_MODE_WRITE_BURST_SINGLE_BIT BSP_BIT32(9)
120
121#define SDRAM_EXTMODE_PASR(val) BSP_FLD32(val, 0, 2)
122#define SDRAM_EXTMODE_DRIVER_STRENGTH(val) BSP_FLD32(val, 5, 6)
123
124/** @} */
125
126typedef struct {
127  uint32_t size;
128  uint32_t config;
129  uint32_t rascas;
130  uint32_t mode;
131  uint32_t extmode;
132} lpc32xx_emc_dynamic_chip_config;
133
134typedef struct {
135  uint32_t sdramclk_ctrl;
136  uint32_t nop_time_in_us;
137  uint32_t control;
138  uint32_t refresh;
139  uint32_t readconfig;
140  uint32_t trp;
141  uint32_t tras;
142  uint32_t tsrex;
143  uint32_t twr;
144  uint32_t trc;
145  uint32_t trfc;
146  uint32_t txsr;
147  uint32_t trrd;
148  uint32_t tmrd;
149  uint32_t tcdlr;
150  lpc32xx_emc_dynamic_chip_config chip [EMC_DYN_CHIP_COUNT];
151} lpc32xx_emc_dynamic_config;
152
153void lpc32xx_emc_init(const lpc32xx_emc_dynamic_config *dyn_cfg);
154
155/** @} */
156
157#ifdef __cplusplus
158}
159#endif /* __cplusplus */
160
161#endif /* LIBBSP_ARM_LPC32XX_EMC_H */
Note: See TracBrowser for help on using the repository browser.