[PATCH 00/13] ARM: stm32mp: add full STM32MP13 support with OP-TEE

Sascha Hauer sha at pengutronix.de
Mon Dec 4 23:35:25 PST 2023


On Mon, Nov 27, 2023 at 07:49:34AM +0100, Ahmad Fatoum wrote:
> We only had rudimentary STM32MP13 support, because proper control of the
> clocks and resets required communicating with OP-TEE as the RCC
> peripheral was restricted to the secure world on that SoC.
> 
> Back when STM32MP13 support was added, this limitation was worked around
> by defining placeholder fixed clocks and skipping resets for the MMC and
> other hardware that was known to be initialized by previous boot stages.
> 
> When the upstream kernel device tree dropped the fixed clocks in favor
> of describing the actual setup with SCMI-over-OPTEE providing access to
> the root clocks, barebox support for the STM32MP13 was broken.
> 
> This series restores barebox compatibility with the Linux device tree,
> so barebox can once again startup and Linux can be booted.
> 
> Notably missing is Ethernet support, which doesn't yet exist in the
> mainline kernel. USB on the DK also uses a STM32 MCU as Type C
> controller and I haven't investigated how much of this barebox needs to
> know about to get OTG working. USB host works fine however.
> 
> Once enabled, it's possible to use the same barebox binary for both
> STM32MP13 and STM32MP15 and only changing the BL32 device tree in the
> FIP. STM32MP13 support is not yet enabled in the device tree as setting
> CONFIG_OPTEE_SIZE to 48M as expected by the STM32MP13-DK firmware will
> take away 48M of memory from Linux, even on the STM32MP15 board.
> 
> We'll want to fix that before enabling it in the defconfig, but this
> shouldn't keep us from fixing STM32MP13 support in general.
> 
> This series depends on enabling use of OP-TEE as SCMI transport, added
> in <20231127064034.2206788-2-a.fatoum at pengutronix.de>
> 
> Ahmad Fatoum (13):
>   clk: stm32mp1: build only when STM32MP15 support is enabled
>   clk: factor out clk_hw_get_parent_index
>   include: add initial <linux/clk-provider.h>
>   clk: divider: implement CLK_DIVIDER_ALLOW_ZERO
>   clk: divider: implement divider_[ro_]round_rate_parent
>   clk: implement clk clk_hw_get_parent_by_index
>   clk: add struct clk_init_data::parent_hws
>   clk: implement clk_hw_reparent
>   clk: add STM32MP13 clock and reset drivers
>   pinctrl: stm32: match st,stm32mp135-pinctrl DT compatible
>   aiodev: stm32: add STM32MP13x support
>   ARM: stm32mp: 135-DK: enable environment, bbu handler and deep probe
>   ARM: stm32mp: remove STM32MP13 .stm32 image

Applied, thanks

Sascha

> 
>  arch/arm/boards/stm32mp13xx-dk/Makefile   |    2 +-
>  arch/arm/boards/stm32mp13xx-dk/board.c    |   25 +
>  arch/arm/boards/stm32mp13xx-dk/lowlevel.c |   19 -
>  arch/arm/dts/stm32mp135f-dk.dts           |    9 +
>  drivers/aiodev/stm32-adc.c                |   14 +
>  drivers/clk/Kconfig                       |   10 +
>  drivers/clk/Makefile                      |    3 +-
>  drivers/clk/clk-divider.c                 |   41 +-
>  drivers/clk/clk.c                         |  139 +-
>  drivers/clk/stm32/Makefile                |    1 +
>  drivers/clk/stm32/clk-stm32-core.c        |  680 ++++++++
>  drivers/clk/stm32/clk-stm32-core.h        |  188 +++
>  drivers/clk/stm32/clk-stm32mp13.c         | 1611 +++++++++++++++++++
>  drivers/clk/stm32/reset-stm32.c           |  122 ++
>  drivers/clk/stm32/reset-stm32.h           |    8 +
>  drivers/clk/stm32/stm32mp13_rcc.h         | 1748 +++++++++++++++++++++
>  drivers/pinctrl/pinctrl-stm32.c           |    1 +
>  images/Makefile.stm32mp                   |    1 -
>  include/linux/clk-provider.h              |  185 +++
>  include/linux/clk.h                       |   21 +
>  20 files changed, 4776 insertions(+), 52 deletions(-)
>  create mode 100644 arch/arm/boards/stm32mp13xx-dk/board.c
>  delete mode 100644 arch/arm/boards/stm32mp13xx-dk/lowlevel.c
>  create mode 100644 drivers/clk/stm32/Makefile
>  create mode 100644 drivers/clk/stm32/clk-stm32-core.c
>  create mode 100644 drivers/clk/stm32/clk-stm32-core.h
>  create mode 100644 drivers/clk/stm32/clk-stm32mp13.c
>  create mode 100644 drivers/clk/stm32/reset-stm32.c
>  create mode 100644 drivers/clk/stm32/reset-stm32.h
>  create mode 100644 drivers/clk/stm32/stm32mp13_rcc.h
>  create mode 100644 include/linux/clk-provider.h
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list