source: rtems/bsps/arm/stm32f4/include/bsp/rcc.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: 6.4 KB
Line 
1/**
2 * @file
3 * @ingroup stm32f4_rcc
4 * @brief RCC support.
5 */
6
7/*
8 * Copyright (c) 2012 Sebastian Huber.  All rights reserved.
9 *
10 *  embedded brains GmbH
11 *  Obere Lagerstr. 30
12 *  82178 Puchheim
13 *  Germany
14 *  <rtems@embedded-brains.de>
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef LIBBSP_ARM_STM32F4_RCC_H
22#define LIBBSP_ARM_STM32F4_RCC_H
23
24#include <stdbool.h>
25#include <bspopts.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
31/**
32 * @defgroup stm32f4_rcc RCC Support
33 * @ingroup arm_stm32f4
34 * @brief RCC Support
35 * @{
36 */
37
38#define STM32F4_RCC_INDEX(reg, idx) (((reg) << 5) | (idx))
39
40typedef enum {
41#ifdef STM32F4_FAMILY_F4XXXX
42
43  /**
44   * @name Family F4XXXX
45   * @{
46   */
47
48  STM32F4_RCC_OTGHS = STM32F4_RCC_INDEX(0, 29),
49  STM32F4_RCC_ETHMAC = STM32F4_RCC_INDEX(0, 25),
50  STM32F4_RCC_DMA2 = STM32F4_RCC_INDEX(0, 22),
51  STM32F4_RCC_DMA1 = STM32F4_RCC_INDEX(0, 21),
52  STM32F4_RCC_CRC = STM32F4_RCC_INDEX(0, 12),
53  STM32F4_RCC_GPIOI = STM32F4_RCC_INDEX(0, 8),
54  STM32F4_RCC_GPIOH = STM32F4_RCC_INDEX(0, 7),
55  STM32F4_RCC_GPIOG = STM32F4_RCC_INDEX(0, 6),
56  STM32F4_RCC_GPIOF = STM32F4_RCC_INDEX(0, 5),
57  STM32F4_RCC_GPIOE = STM32F4_RCC_INDEX(0, 4),
58  STM32F4_RCC_GPIOD = STM32F4_RCC_INDEX(0, 3),
59  STM32F4_RCC_GPIOC = STM32F4_RCC_INDEX(0, 2),
60  STM32F4_RCC_GPIOB = STM32F4_RCC_INDEX(0, 1),
61  STM32F4_RCC_GPIOA = STM32F4_RCC_INDEX(0, 0),
62
63  STM32F4_RCC_OTGFS = STM32F4_RCC_INDEX(1, 7),
64  STM32F4_RCC_RNG = STM32F4_RCC_INDEX(1, 6),
65  STM32F4_RCC_HASH = STM32F4_RCC_INDEX(1, 5),
66  STM32F4_RCC_CRYP = STM32F4_RCC_INDEX(1, 4),
67  STM32F4_RCC_DCMI = STM32F4_RCC_INDEX(1, 0),
68
69  STM32F4_RCC_FSMCR = STM32F4_RCC_INDEX(2, 0),
70
71  STM32F4_RCC_DAC = STM32F4_RCC_INDEX(4, 29),
72  STM32F4_RCC_PWR = STM32F4_RCC_INDEX(4, 28),
73  STM32F4_RCC_CAN2 = STM32F4_RCC_INDEX(4, 26),
74  STM32F4_RCC_CAN1 = STM32F4_RCC_INDEX(4, 25),
75  STM32F4_RCC_I2C3 = STM32F4_RCC_INDEX(4, 23),
76  STM32F4_RCC_I2C2 = STM32F4_RCC_INDEX(4, 22),
77  STM32F4_RCC_I2C1 = STM32F4_RCC_INDEX(4, 21),
78  STM32F4_RCC_UART5 = STM32F4_RCC_INDEX(4, 20),
79  STM32F4_RCC_UART4 = STM32F4_RCC_INDEX(4, 19),
80  STM32F4_RCC_USART3 = STM32F4_RCC_INDEX(4, 18),
81  STM32F4_RCC_USART2 = STM32F4_RCC_INDEX(4, 17),
82  STM32F4_RCC_SPI3 = STM32F4_RCC_INDEX(4, 15),
83  STM32F4_RCC_SPI2 = STM32F4_RCC_INDEX(4, 14),
84  STM32F4_RCC_WWDG = STM32F4_RCC_INDEX(4, 11),
85  STM32F4_RCC_TIM14 = STM32F4_RCC_INDEX(4, 8),
86  STM32F4_RCC_TIM13 = STM32F4_RCC_INDEX(4, 7),
87  STM32F4_RCC_TIM12 = STM32F4_RCC_INDEX(4, 6),
88  STM32F4_RCC_TIM7 = STM32F4_RCC_INDEX(4, 5),
89  STM32F4_RCC_TIM6 = STM32F4_RCC_INDEX(4, 4),
90  STM32F4_RCC_TIM5 = STM32F4_RCC_INDEX(4, 3),
91  STM32F4_RCC_TIM4 = STM32F4_RCC_INDEX(4, 2),
92  STM32F4_RCC_TIM3 = STM32F4_RCC_INDEX(4, 1),
93  STM32F4_RCC_TIM2 = STM32F4_RCC_INDEX(4, 0),
94
95  STM32F4_RCC_TIM11 = STM32F4_RCC_INDEX(5, 18),
96  STM32F4_RCC_TIM10 = STM32F4_RCC_INDEX(5, 17),
97  STM32F4_RCC_TIM9 = STM32F4_RCC_INDEX(5, 16),
98  STM32F4_RCC_SYSCFG = STM32F4_RCC_INDEX(5, 14),
99  STM32F4_RCC_SPI1 = STM32F4_RCC_INDEX(5, 12),
100  STM32F4_RCC_SDIO = STM32F4_RCC_INDEX(5, 11),
101  STM32F4_RCC_ADC3 = STM32F4_RCC_INDEX(5, 10),
102  STM32F4_RCC_ADC2 = STM32F4_RCC_INDEX(5, 9),
103  STM32F4_RCC_ADC1 = STM32F4_RCC_INDEX(5, 8),
104  STM32F4_RCC_USART6 = STM32F4_RCC_INDEX(5, 5),
105  STM32F4_RCC_USART1 = STM32F4_RCC_INDEX(5, 4),
106  STM32F4_RCC_TIM8 = STM32F4_RCC_INDEX(5, 1),
107  STM32F4_RCC_TIM1 = STM32F4_RCC_INDEX(5, 0),
108
109  /** @} */
110
111#endif /* STM32F4_FAMILY_F4XXXX */
112#ifdef STM32F4_FAMILY_F10XXX
113
114  /**
115   * @name Family F10
116   * @{
117   */
118
119  STM32F4_RCC_DMA1 = STM32F4_RCC_INDEX(0, 0),
120  STM32F4_RCC_DMA2 = STM32F4_RCC_INDEX(0, 1),
121  STM32F4_RCC_SRAM = STM32F4_RCC_INDEX(0, 2),
122  STM32F4_RCC_FLITF = STM32F4_RCC_INDEX(0, 4),
123  STM32F4_RCC_CRCEN = STM32F4_RCC_INDEX(0, 6),
124  STM32F4_RCC_FSMC = STM32F4_RCC_INDEX(0, 8),
125  STM32F4_RCC_SDIO = STM32F4_RCC_INDEX(0, 10),
126  STM32F4_RCC_OTGFS = STM32F4_RCC_INDEX(0, 12),
127  STM32F4_RCC_ETHMAC = STM32F4_RCC_INDEX(0, 14),
128  STM32F4_RCC_ETHMACTX = STM32F4_RCC_INDEX(0, 15),
129  STM32F4_RCC_ETHMACRX = STM32F4_RCC_INDEX(0, 16),
130
131  STM32F4_RCC_AFIO = STM32F4_RCC_INDEX(1, 0),
132  STM32F4_RCC_GPIOA = STM32F4_RCC_INDEX(1, 2),
133  STM32F4_RCC_GPIOB = STM32F4_RCC_INDEX(1, 3),
134  STM32F4_RCC_GPIOC = STM32F4_RCC_INDEX(1, 4),
135  STM32F4_RCC_GPIOD = STM32F4_RCC_INDEX(1, 5),
136  STM32F4_RCC_GPIOE = STM32F4_RCC_INDEX(1, 6),
137  STM32F4_RCC_GPIOF = STM32F4_RCC_INDEX(1, 7),
138  STM32F4_RCC_GPIOG = STM32F4_RCC_INDEX(1, 8),
139  STM32F4_RCC_ADC1 = STM32F4_RCC_INDEX(1, 9),
140  STM32F4_RCC_ADC2 = STM32F4_RCC_INDEX(1, 10),
141  STM32F4_RCC_TIM1 = STM32F4_RCC_INDEX(1, 11),
142  STM32F4_RCC_SPI1 = STM32F4_RCC_INDEX(1, 12),
143  STM32F4_RCC_TIM8 = STM32F4_RCC_INDEX(1, 13),
144  STM32F4_RCC_USART1 = STM32F4_RCC_INDEX(1, 14),
145  STM32F4_RCC_ADC3 = STM32F4_RCC_INDEX(1, 15),
146  STM32F4_RCC_TIM9 = STM32F4_RCC_INDEX(1, 19),
147  STM32F4_RCC_TIM10 = STM32F4_RCC_INDEX(1, 20),
148  STM32F4_RCC_TIM11 = STM32F4_RCC_INDEX(1, 21),
149
150  STM32F4_RCC_TIM2 = STM32F4_RCC_INDEX(2, 0),
151  STM32F4_RCC_TIM3 = STM32F4_RCC_INDEX(2, 1),
152  STM32F4_RCC_TIM4 = STM32F4_RCC_INDEX(2, 2),
153  STM32F4_RCC_TIM5 = STM32F4_RCC_INDEX(2, 3),
154  STM32F4_RCC_TIM6 = STM32F4_RCC_INDEX(2, 4),
155  STM32F4_RCC_TIM7 = STM32F4_RCC_INDEX(2, 5),
156  STM32F4_RCC_TIM12 = STM32F4_RCC_INDEX(2, 6),
157  STM32F4_RCC_TIM13 = STM32F4_RCC_INDEX(2, 7),
158  STM32F4_RCC_TIM14 = STM32F4_RCC_INDEX(2, 8),
159  STM32F4_RCC_WWDG = STM32F4_RCC_INDEX(2, 11),
160  STM32F4_RCC_SPI2 = STM32F4_RCC_INDEX(2, 14),
161  STM32F4_RCC_SPI3 = STM32F4_RCC_INDEX(2, 15),
162  STM32F4_RCC_USART2 = STM32F4_RCC_INDEX(2, 17),
163  STM32F4_RCC_USART3 = STM32F4_RCC_INDEX(2, 18),
164  STM32F4_RCC_UART4 = STM32F4_RCC_INDEX(2, 19),
165  STM32F4_RCC_UART5 = STM32F4_RCC_INDEX(2, 20),
166  STM32F4_RCC_I2C1 = STM32F4_RCC_INDEX(2, 21),
167  STM32F4_RCC_I2C2 = STM32F4_RCC_INDEX(2, 22),
168  STM32F4_RCC_USB = STM32F4_RCC_INDEX(2, 23),
169  STM32F4_RCC_CAN1 = STM32F4_RCC_INDEX(2, 24),
170  STM32F4_RCC_CAN2 = STM32F4_RCC_INDEX(2, 25),
171  STM32F4_RCC_BKP = STM32F4_RCC_INDEX(2, 27),
172  STM32F4_RCC_PWR = STM32F4_RCC_INDEX(2, 28),
173  STM32F4_RCC_DAC = STM32F4_RCC_INDEX(2, 29),
174
175  /** @} */
176
177#endif /* STM32F4_FAMILY_F10XXX */
178} stm32f4_rcc_index;
179
180void stm32f4_rcc_reset(stm32f4_rcc_index index);
181
182void stm32f4_rcc_set_reset(stm32f4_rcc_index index, bool set);
183
184void stm32f4_rcc_set_clock(stm32f4_rcc_index index, bool set);
185
186#ifdef STM32F4_FAMILY_F4XXXX
187void stm32f4_rcc_set_low_power_clock(stm32f4_rcc_index index, bool set);
188#endif /* STM32F4_FAMILY_F4XXXX */
189
190/** @} */
191
192#ifdef __cplusplus
193}
194#endif /* __cplusplus */
195
196#endif /* LIBBSP_ARM_STM32F4_RCC_H */
Note: See TracBrowser for help on using the repository browser.