[Linux-stm32] [PATCH v3 4/6] bus: stm32_sys_bus: add support for STM32MP15 and STM32MP13 system bus

Antonio Borneo antonio.borneo at foss.st.com
Sat Jan 28 16:23:27 UTC 2023


-----Original Message-----
From: Gatien Chevallier <gatien.chevallier at foss.st.com>

< snip >

+static const struct stm32_sys_bus_match_data stm32mp15_sys_bus_data = {
+       .max_entries = STM32MP15_ETZPC_ENTRIES,
+};
+
+static const struct stm32_sys_bus_match_data stm32mp13_sys_bus_data = {
+       .max_entries = STM32MP13_ETZPC_ENTRIES,
+};
+
+static const struct of_device_id stm32_sys_bus_of_match[] = {
+       { .compatible = "st,stm32mp15-sys-bus", .data = &stm32mp15_sys_bus_data },
+       { .compatible = "st,stm32mp13-sys-bus", .data = &stm32mp13_sys_bus_data },
+       {}
+};

Gatien,

As I already said, there is no reason to use two compatibles (and later adding more for every new SoC) for selecting 'max_entries'.
The value 'max_entries' can be easily extracted during driver's probe from NUM_PER_SEC field in ETZPC_HWCFGR[15:8].
No need to hardcode it in the driver

The generic compatible can even be 'st,stm32-etzpc-sys-bus' or simply 'st,stm32-etzpc'.

Antonio



More information about the Linux-stm32 mailing list