gpio: stm32 use dts extracted information to populate gpio instances.

The information extracted from the device tree is now used to initialize
GPIO device instances. Up until now the GPIO device driver made no use
of this information. Actual instance creation is still controlled using
the Kconfig method. Missing GPIO device tree nodes were added in the
process for STM32L073, STM32F413 and STM32F373.

The information for gpio instance initialization has already been
present for supported STM32 SoCs but remained unused. Changes in the
device tree had no effect on GPIO functionality and was essentially
redundant. Using the device tree for hardware description seems
plausible and less painful than a myriad of defines in some SoC
description header.

The change was implemented under the assumption that current device
trees provide a correct description of the SoCs. Base register addresses
and RCC register bits were not explicitly checked for each device.

Manual tests were executed on:
	- NUCLEO-F103RB
	- STM32F429I-DISCO
	- STM32F746G-DISCO
	- NUCLEO-F767ZI

Manual tests consisted of blinky on different GPIOs and pins on each
board.

sanitycheck was executed for all STM32 based boards

Fixes: #10629

Signed-off-by: Martin Bertsche <martin72216@googlemail.com>
This commit is contained in:
Martin Bertsche 2018-10-28 22:34:49 +01:00 committed by Kumar Gala
commit 9892f40204
12 changed files with 631 additions and 12 deletions

View file

@ -2,6 +2,105 @@
#define CONFIG_NUM_IRQ_PRIO_BITS ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define CONFIG_GPIO_STM32_GPIOA_BASE_ADDRESS ST_STM32_GPIO_40020000_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOA_CLOCK_BITS_0 ST_STM32_GPIO_40020000_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOA_CLOCK_BUS_0 ST_STM32_GPIO_40020000_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOA_CLOCK_CONTROLLER ST_STM32_GPIO_40020000_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOA_LABEL ST_STM32_GPIO_40020000_LABEL
#define CONFIG_GPIO_STM32_GPIOA_SIZE ST_STM32_GPIO_40020000_SIZE
#define CONFIG_GPIO_STM32_GPIOA_CLOCK_BITS ST_STM32_GPIO_40020000_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOA_CLOCK_BUS ST_STM32_GPIO_40020000_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOB_BASE_ADDRESS ST_STM32_GPIO_40020400_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOB_CLOCK_BITS_0 ST_STM32_GPIO_40020400_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOB_CLOCK_BUS_0 ST_STM32_GPIO_40020400_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOB_CLOCK_CONTROLLER ST_STM32_GPIO_40020400_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOB_LABEL ST_STM32_GPIO_40020400_LABEL
#define CONFIG_GPIO_STM32_GPIOB_SIZE ST_STM32_GPIO_40020400_SIZE
#define CONFIG_GPIO_STM32_GPIOB_CLOCK_BITS ST_STM32_GPIO_40020400_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOB_CLOCK_BUS ST_STM32_GPIO_40020400_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOC_BASE_ADDRESS ST_STM32_GPIO_40020800_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOC_CLOCK_BITS_0 ST_STM32_GPIO_40020800_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOC_CLOCK_BUS_0 ST_STM32_GPIO_40020800_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOC_CLOCK_CONTROLLER ST_STM32_GPIO_40020800_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOC_LABEL ST_STM32_GPIO_40020800_LABEL
#define CONFIG_GPIO_STM32_GPIOC_SIZE ST_STM32_GPIO_40020800_SIZE
#define CONFIG_GPIO_STM32_GPIOC_CLOCK_BITS ST_STM32_GPIO_40020800_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOC_CLOCK_BUS ST_STM32_GPIO_40020800_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOD_BASE_ADDRESS ST_STM32_GPIO_40020C00_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOD_CLOCK_BITS_0 ST_STM32_GPIO_40020C00_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOD_CLOCK_BUS_0 ST_STM32_GPIO_40020C00_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOD_CLOCK_CONTROLLER ST_STM32_GPIO_40020C00_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOD_LABEL ST_STM32_GPIO_40020C00_LABEL
#define CONFIG_GPIO_STM32_GPIOD_SIZE ST_STM32_GPIO_40020C00_SIZE
#define CONFIG_GPIO_STM32_GPIOD_CLOCK_BITS ST_STM32_GPIO_40020C00_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOD_CLOCK_BUS ST_STM32_GPIO_40020C00_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOE_BASE_ADDRESS ST_STM32_GPIO_40021000_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOE_CLOCK_BITS_0 ST_STM32_GPIO_40021000_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOE_CLOCK_BUS_0 ST_STM32_GPIO_40021000_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOE_CLOCK_CONTROLLER ST_STM32_GPIO_40021000_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOE_LABEL ST_STM32_GPIO_40021000_LABEL
#define CONFIG_GPIO_STM32_GPIOE_SIZE ST_STM32_GPIO_40021000_SIZE
#define CONFIG_GPIO_STM32_GPIOE_CLOCK_BITS ST_STM32_GPIO_40021000_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOE_CLOCK_BUS ST_STM32_GPIO_40021000_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOF_BASE_ADDRESS ST_STM32_GPIO_40021400_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOF_CLOCK_BITS_0 ST_STM32_GPIO_40021400_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOF_CLOCK_BUS_0 ST_STM32_GPIO_40021400_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOF_CLOCK_CONTROLLER ST_STM32_GPIO_40021400_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOF_LABEL ST_STM32_GPIO_40021400_LABEL
#define CONFIG_GPIO_STM32_GPIOF_SIZE ST_STM32_GPIO_40021400_SIZE
#define CONFIG_GPIO_STM32_GPIOF_CLOCK_BITS ST_STM32_GPIO_40021400_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOF_CLOCK_BUS ST_STM32_GPIO_40021400_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOG_BASE_ADDRESS ST_STM32_GPIO_40021800_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOG_CLOCK_BITS_0 ST_STM32_GPIO_40021800_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOG_CLOCK_BUS_0 ST_STM32_GPIO_40021800_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOG_CLOCK_CONTROLLER ST_STM32_GPIO_40021800_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOG_LABEL ST_STM32_GPIO_40021800_LABEL
#define CONFIG_GPIO_STM32_GPIOG_SIZE ST_STM32_GPIO_40021800_SIZE
#define CONFIG_GPIO_STM32_GPIOG_CLOCK_BITS ST_STM32_GPIO_40021800_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOG_CLOCK_BUS ST_STM32_GPIO_40021800_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOH_BASE_ADDRESS ST_STM32_GPIO_40021C00_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOH_CLOCK_BITS_0 ST_STM32_GPIO_40021C00_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOH_CLOCK_BUS_0 ST_STM32_GPIO_40021C00_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOH_CLOCK_CONTROLLER ST_STM32_GPIO_40021C00_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOH_LABEL ST_STM32_GPIO_40021C00_LABEL
#define CONFIG_GPIO_STM32_GPIOH_SIZE ST_STM32_GPIO_40021C00_SIZE
#define CONFIG_GPIO_STM32_GPIOH_CLOCK_BITS ST_STM32_GPIO_40021C00_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOH_CLOCK_BUS ST_STM32_GPIO_40021C00_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOI_BASE_ADDRESS ST_STM32_GPIO_40022000_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOI_CLOCK_BITS_0 ST_STM32_GPIO_40022000_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOI_CLOCK_BUS_0 ST_STM32_GPIO_40022000_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOI_CLOCK_CONTROLLER ST_STM32_GPIO_40022000_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOI_LABEL ST_STM32_GPIO_40022000_LABEL
#define CONFIG_GPIO_STM32_GPIOI_SIZE ST_STM32_GPIO_40022000_SIZE
#define CONFIG_GPIO_STM32_GPIOI_CLOCK_BITS ST_STM32_GPIO_40022000_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOI_CLOCK_BUS ST_STM32_GPIO_40022000_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOJ_BASE_ADDRESS ST_STM32_GPIO_40022400_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOJ_CLOCK_BITS_0 ST_STM32_GPIO_40022400_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOJ_CLOCK_BUS_0 ST_STM32_GPIO_40022400_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOJ_CLOCK_CONTROLLER ST_STM32_GPIO_40022400_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOJ_LABEL ST_STM32_GPIO_40022400_LABEL
#define CONFIG_GPIO_STM32_GPIOJ_SIZE ST_STM32_GPIO_40022400_SIZE
#define CONFIG_GPIO_STM32_GPIOJ_CLOCK_BITS ST_STM32_GPIO_40022400_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOJ_CLOCK_BUS ST_STM32_GPIO_40022400_CLOCK_BUS
#define CONFIG_GPIO_STM32_GPIOK_BASE_ADDRESS ST_STM32_GPIO_40022800_BASE_ADDRESS
#define CONFIG_GPIO_STM32_GPIOK_CLOCK_BITS_0 ST_STM32_GPIO_40022800_CLOCK_BITS_0
#define CONFIG_GPIO_STM32_GPIOK_CLOCK_BUS_0 ST_STM32_GPIO_40022800_CLOCK_BUS_0
#define CONFIG_GPIO_STM32_GPIOK_CLOCK_CONTROLLER ST_STM32_GPIO_40022800_CLOCK_CONTROLLER
#define CONFIG_GPIO_STM32_GPIOK_LABEL ST_STM32_GPIO_40022800_LABEL
#define CONFIG_GPIO_STM32_GPIOK_SIZE ST_STM32_GPIO_40022800_SIZE
#define CONFIG_GPIO_STM32_GPIOK_CLOCK_BITS ST_STM32_GPIO_40022800_CLOCK_BITS
#define CONFIG_GPIO_STM32_GPIOK_CLOCK_BUS ST_STM32_GPIO_40022800_CLOCK_BUS
#define CONFIG_UART_STM32_USART_1_BASE_ADDRESS ST_STM32_USART_40011000_BASE_ADDRESS
#define CONFIG_UART_STM32_USART_1_BAUD_RATE ST_STM32_USART_40011000_CURRENT_SPEED
#define CONFIG_UART_STM32_USART_1_IRQ_PRI ST_STM32_USART_40011000_IRQ_0_PRIORITY