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>
This commit is contained in:
parent
d4a17b4085
commit
20202902f2
304 changed files with 5118 additions and 5118 deletions
|
@ -266,9 +266,9 @@ static const struct spi_driver_api spi_mcux_driver_api = {
|
|||
static void spi_mcux_config_func_0(struct device *dev);
|
||||
|
||||
static const struct spi_mcux_config spi_mcux_config_0 = {
|
||||
.base = (SPI_Type *) CONFIG_SPI_0_BASE_ADDRESS,
|
||||
.clock_name = CONFIG_SPI_0_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) CONFIG_SPI_0_CLOCK_SUBSYS,
|
||||
.base = (SPI_Type *) DT_SPI_0_BASE_ADDRESS,
|
||||
.clock_name = DT_SPI_0_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) DT_SPI_0_CLOCK_SUBSYS,
|
||||
.irq_config_func = spi_mcux_config_func_0,
|
||||
};
|
||||
|
||||
|
@ -284,10 +284,10 @@ DEVICE_AND_API_INIT(spi_mcux_0, CONFIG_SPI_0_NAME, &spi_mcux_init,
|
|||
|
||||
static void spi_mcux_config_func_0(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(CONFIG_SPI_0_IRQ, CONFIG_SPI_0_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_SPI_0_IRQ, CONFIG_SPI_0_IRQ_PRI,
|
||||
spi_mcux_isr, DEVICE_GET(spi_mcux_0), 0);
|
||||
|
||||
irq_enable(CONFIG_SPI_0_IRQ);
|
||||
irq_enable(DT_SPI_0_IRQ);
|
||||
}
|
||||
#endif /* CONFIG_SPI_0 */
|
||||
|
||||
|
@ -295,9 +295,9 @@ static void spi_mcux_config_func_0(struct device *dev)
|
|||
static void spi_mcux_config_func_1(struct device *dev);
|
||||
|
||||
static const struct spi_mcux_config spi_mcux_config_1 = {
|
||||
.base = (SPI_Type *) CONFIG_SPI_1_BASE_ADDRESS,
|
||||
.clock_name = CONFIG_SPI_1_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) CONFIG_SPI_1_CLOCK_SUBSYS,
|
||||
.base = (SPI_Type *) DT_SPI_1_BASE_ADDRESS,
|
||||
.clock_name = DT_SPI_1_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) DT_SPI_1_CLOCK_SUBSYS,
|
||||
.irq_config_func = spi_mcux_config_func_1,
|
||||
};
|
||||
|
||||
|
@ -313,10 +313,10 @@ DEVICE_AND_API_INIT(spi_mcux_1, CONFIG_SPI_1_NAME, &spi_mcux_init,
|
|||
|
||||
static void spi_mcux_config_func_1(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(CONFIG_SPI_1_IRQ, CONFIG_SPI_1_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_SPI_1_IRQ, CONFIG_SPI_1_IRQ_PRI,
|
||||
spi_mcux_isr, DEVICE_GET(spi_mcux_1), 0);
|
||||
|
||||
irq_enable(CONFIG_SPI_1_IRQ);
|
||||
irq_enable(DT_SPI_1_IRQ);
|
||||
}
|
||||
#endif /* CONFIG_SPI_1 */
|
||||
|
||||
|
@ -324,9 +324,9 @@ static void spi_mcux_config_func_1(struct device *dev)
|
|||
static void spi_mcux_config_func_2(struct device *dev);
|
||||
|
||||
static const struct spi_mcux_config spi_mcux_config_2 = {
|
||||
.base = (SPI_Type *) CONFIG_SPI_2_BASE_ADDRESS,
|
||||
.clock_name = CONFIG_SPI_2_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) CONFIG_SPI_2_CLOCK_SUBSYS,
|
||||
.base = (SPI_Type *) DT_SPI_2_BASE_ADDRESS,
|
||||
.clock_name = DT_SPI_2_CLOCK_NAME,
|
||||
.clock_subsys = (clock_control_subsys_t) DT_SPI_2_CLOCK_SUBSYS,
|
||||
.irq_config_func = spi_mcux_config_func_2,
|
||||
};
|
||||
|
||||
|
@ -342,9 +342,9 @@ DEVICE_AND_API_INIT(spi_mcux_2, CONFIG_SPI_2_NAME, &spi_mcux_init,
|
|||
|
||||
static void spi_mcux_config_func_2(struct device *dev)
|
||||
{
|
||||
IRQ_CONNECT(CONFIG_SPI_2_IRQ, CONFIG_SPI_2_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_SPI_2_IRQ, CONFIG_SPI_2_IRQ_PRI,
|
||||
spi_mcux_isr, DEVICE_GET(spi_mcux_2), 0);
|
||||
|
||||
irq_enable(CONFIG_SPI_2_IRQ);
|
||||
irq_enable(DT_SPI_2_IRQ);
|
||||
}
|
||||
#endif /* CONFIG_SPI_2 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue