[PATCH 05/11] drivers: bus: add the stm32 debug bus driver

Jens Wiklander jens.wiklander at linaro.org
Tue Jan 13 06:45:40 PST 2026


Hi,

On Fri, Jan 9, 2026 at 11:57 AM Gatien Chevallier
<gatien.chevallier at foss.st.com> wrote:
>
> Add the stm32 debug bus driver that is responsible of checking the
> debug subsystem accessibility before probing the related peripheral
> drivers.
>
> This driver is OP-TEE dependent and relies on the STM32 debug access
> PTA.
>
> Signed-off-by: Gatien Chevallier <gatien.chevallier at foss.st.com>
> ---
>  MAINTAINERS                 |   1 +
>  drivers/bus/Kconfig         |  10 ++
>  drivers/bus/Makefile        |   1 +
>  drivers/bus/stm32_dbg_bus.c | 285 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 297 insertions(+)
>

[snip]

> +
> +static const struct tee_client_device_id optee_dbg_bus_id_table[] = {
> +       {UUID_INIT(0xdd05bc8b, 0x9f3b, 0x49f0,
> +                  0xb6, 0x49, 0x01, 0xaa, 0x10, 0xc1, 0xc2, 0x10)},
> +       {}
> +};
> +
> +static struct tee_client_driver stm32_optee_dbg_bus_driver = {
> +       .id_table = optee_dbg_bus_id_table,
> +       .driver = {
> +               .name = "optee_dbg_bus",
> +               .bus = &tee_bus_type,
> +               .probe = stm32_dbg_bus_probe,
> +               .remove = stm32_dbg_bus_remove,
> +       },
> +};

Just a heads up. With
https://lore.kernel.org/op-tee/cover.1765791463.git.u.kleine-koenig@baylibre.com/
we're switching to use bus methods instead of device_driver callbacks.
That plan is to merge that patch set in the next merge window.

Cheers,
Jens

> +
> +static int __init optee_dbg_bus_mod_init(void)
> +{
> +       int ret;
> +
> +       ret = driver_register(&stm32_optee_dbg_bus_driver.driver);
> +       if (ret)
> +               return ret;
> +
> +       ret = platform_driver_register(&stm32_dbg_bus_driver);
> +       if (ret)
> +               driver_unregister(&stm32_optee_dbg_bus_driver.driver);
> +
> +       return ret;
> +}
> +
> +static void __exit optee_dbg_bus_mod_exit(void)
> +{
> +       platform_driver_unregister(&stm32_dbg_bus_driver);
> +       driver_unregister(&stm32_optee_dbg_bus_driver.driver);
> +}
> +
> +module_init(optee_dbg_bus_mod_init);
> +module_exit(optee_dbg_bus_mod_exit);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Gatien Chevallier <gatien.chevallier at foss.st.com>");
> +MODULE_DESCRIPTION("OP-TEE based STM32 debug access bus driver");
>
> --
> 2.43.0
>
>



More information about the linux-arm-kernel mailing list