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

From: Gatien CHEVALLIER

Date: Tue Jan 13 2026 - 11:10:18 EST




On 1/13/26 15:45, Jens Wiklander wrote:
Hi,

On Fri, Jan 9, 2026 at 11:57 AM Gatien Chevallier
<gatien.chevallier@xxxxxxxxxxx> 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@xxxxxxxxxxx>
---
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@xxxxxxxxxxxx/
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


Hello Jens,

Thank you for the link!
Is it fine if I push on top on your "next" branch for the review along
with the appropriate changes? I'm open to suggestions.

Thanks,
Gatien

+
+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@xxxxxxxxxxx>");
+MODULE_DESCRIPTION("OP-TEE based STM32 debug access bus driver");

--
2.43.0