stm32h7:pinmap Remove GPIO_SPEED_xxx and add legacy pinmap

Pinmaps should not have contained GPIO_SPEED_xxx settings.
  This is board dependent.

  This change adds CONFIG_STM32H7_USE_LEGACY_PINMAP to allow for
  lazy migration to using pinmaps without speeds.

  The work required to do this can be aided by running tools/stm32_pinmap_tool.py.
  The tools will take a board.h file and a legacy pinmap and outut the required
  changes that one needs to make to a board.h file.

  Eventually, STM32H7_USE_LEGACY_PINMAP will be deprecated and the legacy
  pinmaps removed from NuttX.

  Any new boards added should set STM32H7_USE_LEGACY_PINMAP=n and
  fully define the pins in board.h
This commit is contained in:
David Sidrane 2023-04-10 06:03:17 -07:00 committed by Mateusz Szafoni
parent c5f7620c42
commit 14a0e08386
5 changed files with 2600 additions and 1028 deletions

View File

@ -944,6 +944,26 @@ config STM32H7_UART8
endmenu # STM32H7 U[S]ART Selection endmenu # STM32H7 U[S]ART Selection
endmenu # STM32H7 Peripheral Selection endmenu # STM32H7 Peripheral Selection
config STM32H7_USE_LEGACY_PINMAP
bool "Use the legacy pinmap with GPIO_SPEED_xxx included."
default y
---help---
In the past, pinmap files included GPIO_SPEED_xxxMhz. These speed
settings should have come from the board.h as it describes the wiring
of the SoC to the board. The speed is really slew rate control and
therefore is related to the layout and can only be properly set
in board.h.
STM32H7_USE_LEGACY_PINMAP is provided, to allow lazy migration to
using pinmaps without speeds. The work required to do this can be aided
by running tools/stm32_pinmap_tool.py. The tools will take a board.h
file and a legacy pinmap and output the required changes that one needs
to make to a board.h file.
Eventually, STM32H7_USE_LEGACY_PINMAP will be deprecated and the legacy
pinmaps removed from NuttX. Any new boards added should set
STM32H7_USE_LEGACY_PINMAP=n and fully define the pins in board.h
config STM32H7_SYSCFG_IOCOMPENSATION config STM32H7_SYSCFG_IOCOMPENSATION
bool "SYSCFG I/O Compensation" bool "SYSCFG I/O Compensation"
default n default n

View File

@ -28,14 +28,26 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include "chip.h" #include "chip.h"
#if defined(CONFIG_STM32H7_STM32H7X3XX) #if defined(CONFIG_STM32H7_USE_LEGACY_PINMAP)
# include "hardware/stm32h7x3xx_pinmap.h" # if defined(CONFIG_STM32H7_STM32H7X3XX)
#elif defined(CONFIG_STM32H7_STM32H7B3XX) # include "hardware/stm32h7x3xx_pinmap_legacy.h"
# include "hardware/stm32h7x3xx_pinmap.h" # elif defined(CONFIG_STM32H7_STM32H7B3XX)
#elif defined(CONFIG_STM32H7_STM32H7X7XX) # include "hardware/stm32h7x3xx_pinmap_legacy.h"
# include "hardware/stm32h7x3xx_pinmap.h" # elif defined(CONFIG_STM32H7_STM32H7X7XX)
# include "hardware/stm32h7x3xx_pinmap_legacy.h"
# else
# error "Unsupported STM32 H7 Pin map"
# endif
#else #else
# error "Unsupported STM32 H7 Pin map" # if defined(CONFIG_STM32H7_STM32H7X3XX)
# include "hardware/stm32h7x3xx_pinmap.h"
# elif defined(CONFIG_STM32H7_STM32H7B3XX)
# include "hardware/stm32h7x3xx_pinmap.h"
# elif defined(CONFIG_STM32H7_STM32H7X7XX)
# include "hardware/stm32h7x3xx_pinmap.h"
# else
# error "Unsupported STM32 H7 Pin map"
# endif
#endif #endif
#endif /* __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32_PINMAP_H */ #endif /* __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32_PINMAP_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -43,6 +43,10 @@
#if defined(CONFIG_STM32H7_STM32H7X3XX) || defined(CONFIG_STM32H7_STM32H7X7XX) || defined(CONFIG_STM32H7_STM32H7B3XX) #if defined(CONFIG_STM32H7_STM32H7X3XX) || defined(CONFIG_STM32H7_STM32H7X7XX) || defined(CONFIG_STM32H7_STM32H7B3XX)
#if defined(CONFIG_STM32H7_USE_LEGACY_PINMAP)
# pragma message "CONFIG_STM32H7_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
#endif
/**************************************************************************** /****************************************************************************
* Public Data * Public Data
****************************************************************************/ ****************************************************************************/