zephyr/soc/arm/silabs_exx32/efr32fg1p/dts_fixup.h
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00

47 lines
2.8 KiB
C

/* This file is a temporary workaround for mapping of the generated information
* to the current driver definitions. This will be removed when the drivers
* are modified to handle the generated information, or the mapping of
* generated data matches the driver definitions.
*/
/* SoC level DTS fixup file */
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_FLASH_DEV_BASE_ADDRESS DT_SILABS_GECKO_FLASH_CONTROLLER_400E0000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_SILABS_GECKO_FLASH_CONTROLLER_400E0000_LABEL
#define DT_USART_GECKO_0_BASE_ADDRESS DT_SILABS_GECKO_USART_40010000_BASE_ADDRESS
#define DT_USART_GECKO_0_CURRENT_SPEED DT_SILABS_GECKO_USART_40010000_CURRENT_SPEED
#define DT_USART_GECKO_0_IRQ_RX DT_SILABS_GECKO_USART_40010000_IRQ_0
#define DT_USART_GECKO_0_IRQ_RX_PRIORITY DT_SILABS_GECKO_USART_40010000_IRQ_0_PRIORITY
#define DT_USART_GECKO_0_IRQ_TX DT_SILABS_GECKO_USART_40010000_IRQ_1
#define DT_USART_GECKO_0_IRQ_TX_PRIORITY DT_SILABS_GECKO_USART_40010000_IRQ_1_PRIORITY
#define DT_USART_GECKO_0_LABEL DT_SILABS_GECKO_USART_40010000_LABEL
#define DT_USART_GECKO_0_LOCATION DT_SILABS_GECKO_USART_40010000_LOCATION
#define DT_USART_GECKO_0_SIZE DT_SILABS_GECKO_USART_40010000_SIZE
#define DT_USART_GECKO_1_BASE_ADDRESS DT_SILABS_GECKO_USART_40010400_BASE_ADDRESS
#define DT_USART_GECKO_1_CURRENT_SPEED DT_SILABS_GECKO_USART_40010400_CURRENT_SPEED
#define DT_USART_GECKO_1_IRQ_RX DT_SILABS_GECKO_USART_40010400_IRQ_0
#define DT_USART_GECKO_1_IRQ_RX_PRIORITY DT_SILABS_GECKO_USART_40010400_IRQ_0_PRIORITY
#define DT_USART_GECKO_1_IRQ_TX DT_SILABS_GECKO_USART_40010400_IRQ_1
#define DT_USART_GECKO_1_IRQ_TX_PRIORITY DT_SILABS_GECKO_USART_40010400_IRQ_1_PRIORITY
#define DT_USART_GECKO_1_LABEL DT_SILABS_GECKO_USART_40010400_LABEL
#define DT_USART_GECKO_1_LOCATION DT_SILABS_GECKO_USART_40010400_LOCATION
#define DT_USART_GECKO_1_SIZE DT_SILABS_GECKO_USART_40010400_SIZE
#define DT_GPIO_GECKO_COMMON_NAME DT_SILABS_EFR32XG1_GPIO_4000A400_LABEL
#define DT_GPIO_GECKO_COMMON_EVEN_IRQ DT_SILABS_EFR32XG1_GPIO_4000A400_IRQ_GPIO_EVEN
#define DT_GPIO_GECKO_COMMON_EVEN_PRI DT_SILABS_EFR32XG1_GPIO_4000A400_IRQ_GPIO_EVEN_PRIORITY
#define DT_GPIO_GECKO_COMMON_ODD_IRQ DT_SILABS_EFR32XG1_GPIO_4000A400_IRQ_GPIO_ODD
#define DT_GPIO_GECKO_COMMON_ODD_PRI DT_SILABS_EFR32XG1_GPIO_4000A400_IRQ_GPIO_ODD_PRIORITY
#define DT_GPIO_GECKO_PORTA_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A000_LABEL
#define DT_GPIO_GECKO_PORTB_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A030_LABEL
#define DT_GPIO_GECKO_PORTC_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A060_LABEL
#define DT_GPIO_GECKO_PORTD_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A090_LABEL
#define DT_GPIO_GECKO_PORTE_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A0C0_LABEL
#define DT_GPIO_GECKO_PORTF_NAME DT_SILABS_EFR32XG1_GPIO_PORT_4000A0F0_LABEL
/* End of SoC Level DTS fixup file */