Add the System Timer Module for the NXP S32 architecture
Subsystems (3)
v4 cover Add the System Timer Module for the NXP S32 architecture
These couple of changes bring the System Timer Module - STM which is part of the NXP S32 architecture.
The timer module has one counter and four comparators, an interrupt line when one of the comparator matches the counter. That means the interrupt is shared across the comparator.
The number of STM is equal to the number of core available on the system. For the s32g2 variant, there are three Cortex-M3 and four Cortex-A53, consequently there are seven STM modules dedicated to those.
In addition, there is a STM variant which is read-only, so the counter can not be set because it is tied to another STM module dedicated to timestamp. These special STM modules are apart and will be handled differently as they can not be used as a clockevent. They are not part of these changes.
The choice is to have one STM instance, aka one STM description in the device tree, which initialize a clocksource and a clockevent per CPU. The latter is assigned to a CPU given the order of their description. First is CPU0, second is CPU1, etc ...
Changelog:
- v4
- Removed useless compatible string (Krzysztof Kozlowski)
- Dropped of_match_ptr() (Krzysztof Kozlowski)
- v3
- Fixed bindings, compatible description and name (Krzysztof Kozlowski)
- Fixed bindings filename to fit the compatible (Krzysztof Kozlowski)
- Fixed a couple of typos in the driver changelog (Ghennadi Procopciuc)
- Enclosed macro into parenthesis (Ghennadi Procopciuc)
- Replaced irq_of_parse_and_map() by platform_get_irq() (Ghennadi Procopciuc)
- Fixed checkpatch --script reports
- Removed debugfs as the driver is not considered complex enough (Arnd Bergmann)
- v2:
- Fixed errors reported by 'make dt_binding_check' (Rob Herring)
- Removed unneeded '|' symbol (Rob Herring)
- Removed 'clocks' description (Rob Herring)
- Removed 'clock-names' because there is only one description (Rob Herring)
- Renamed 'stm@' to 'timer@' in the DT binding example (Rob Herring)
- Fixed dt bindings patch subject (Krzysztof Kozlowski)
- Dropped 'OneOf' in the DT bindings (Krzysztof Kozlowski)
- Dropped the STM instances structure
- Use the dev_err_probe() helper (Krzysztof Kozlowski)
- Use the dev_err_probe() helper (Krzysztof Kozlowski)
- Use devm_clk_get_enabled() (Krzysztof Kozlowski)
- Removed unneeded headers (Ghennadi Procopciuc)
- Removed unused macro (Ghennadi Procopciuc)
- Replaced 'int' by 'unsigned int' (Ghennadi Procopciuc)
- Removed dev_set_drvdata() (Ghennadi Procopciuc)
- Prevent disabling the entire module and set min delta (Ghennadi Procopciuc)
- Factored out the clocksource / clockevent init routine (Ghennadi Procopciuc)
- Use devm_request_irq() (Ghennadi Procopciuc.)
- Use irq_dispose_mapping() for error rollbacking (Ghennadi Procopciuc)
- v1: initial post
Daniel Lezcano (2):
dt-bindings: timer: Add NXP System Timer Module clocksource/drivers/nxp-timer: Add the System Timer Module for the
s32gx platforms
.../bindings/timer/nxp,s32g2-stm.yaml | 53 ++ drivers/clocksource/Kconfig | 9 + drivers/clocksource/Makefile | 2 + drivers/clocksource/timer-nxp-stm.c | 495 ++++++++++++++++++ 4 files changed, 559 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml create mode 100644 drivers/clocksource/timer-nxp-stm.c
Signature · 1 line
2.43.0
PATCH v4 1/2 dt-bindings: timer: Add NXP System Timer Module
Add the System Timer Module description found on the NXP s32 platform and the compatible for the s32g2 variant.
--- .../bindings/timer/nxp,s32g2-stm.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml new file +53 -0
@@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/nxp,s32g2-stm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP System Timer Module (STM) + +maintainers: + - Daniel Lezcano <[email protected]> + +description: + The System Timer Module supports commonly required system and application + software timing functions. STM includes a 32-bit count-up timer and four + 32-bit compare channels with a separate interrupt source for each channel. + The timer is driven by the STM module clock divided by an 8-bit prescale + value. + +properties: + compatible: + oneOf: + - const: nxp,s32g2-stm + - items: + - const: nxp,s32g3-stm + - const: nxp,s32g2-stm + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + - clocks + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + timer@4011c000 { + compatible = "nxp,s32g2-stm"; + reg = <0x4011c000 0x3000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 0x3b>; + };
Signature · 1 line
2.43.0
Re: [PATCH v4 1/2] dt-bindings: timer: Add NXP System Timer Module
On 4/2/2025 12:07 PM, Daniel Lezcano wrote:
[ ... ]
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml new file +10
-0+examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + timer@4011c000 { + compatible = "nxp,s32g2-stm"; + reg = <0x4011c000 0x3000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 0x3b>; + };
The S32G reference manual specifies two clocks for the STM module: one for the registers and another for the counter itself. Shouldn't both clocks be represented in the bindings?
Signature · 2 lines
Regards, Ghennadi
Re: [PATCH v4 1/2] dt-bindings: timer: Add NXP System Timer Module
Quoted 16 lines · Ghennadi Procopciuc
On 4/2/2025 12:07 PM, Daniel Lezcano wrote:
[ ... ]Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml new file +10
-0+examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + timer@4011c000 { + compatible = "nxp,s32g2-stm"; + reg = <0x4011c000 0x3000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 0x3b>; + };The S32G reference manual specifies two clocks for the STM module: one for the registers and another for the counter itself. Shouldn't both clocks be represented in the bindings?
AFAICS, there are two clocks as described in the documentation for the s32g2 page 843, section 23.7.3 Timer modules.
The module and the register clock are fed by the XBAR_DIV3_CLK which is an system clock always-on.
page 1994, 40.5.4 Clocking, the documentation says: "This module has no clocking considerations."
From my understanding, we should not describe the XBAR_DIV3_CLK as it is a system clock.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH v4 1/2] dt-bindings: timer: Add NXP System Timer Module
Quoted 18 lines · Daniel Lezcano
Quoted 16 lines · Ghennadi Procopciuc
On 4/2/2025 12:07 PM, Daniel Lezcano wrote:
[ ... ]Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml new file +10
-0+examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + timer@4011c000 { + compatible = "nxp,s32g2-stm"; + reg = <0x4011c000 0x3000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 0x3b>; + };The S32G reference manual specifies two clocks for the STM module: one for the registers and another for the counter itself. Shouldn't both clocks be represented in the bindings?
Quoted 8 lines
AFAICS, there are two clocks as described in the documentation for the s32g2 page 843, section 23.7.3 Timer modules.
The module and the register clock are fed by the
XBAR_DIV3_CLKwhich is an system clock always-on.page 1994, 40.5.4 Clocking, the documentation says: "This module has no clocking considerations."
From my understanding, we should not describe the
XBAR_DIV3_CLKas it
is a system clock.
Can you clarify for the STM if you still want to change the binding ?
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH v4 1/2] dt-bindings: timer: Add NXP System Timer Module
Quoted 25 lines · Daniel Lezcano
Quoted 24 lines · Daniel Lezcano
Quoted 16 lines · Ghennadi Procopciuc
On 4/2/2025 12:07 PM, Daniel Lezcano wrote:
[ ... ]Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml line 53
Quoted 10 lines
Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml new file +10
-0+examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + timer@4011c000 { + compatible = "nxp,s32g2-stm"; + reg = <0x4011c000 0x3000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 0x3b>; + };The S32G reference manual specifies two clocks for the STM module: one for the registers and another for the counter itself. Shouldn't both clocks be represented in the bindings?
AFAICS, there are two clocks as described in the documentation for the s32g2 page 843, section 23.7.3 Timer modules.
The module and the register clock are fed by the
XBAR_DIV3_CLKwhich is an system clock always-on.
Quoted 8 lines
Quoted 5 lines
page 1994, 40.5.4 Clocking, the documentation says: "This module has no clocking considerations."
From my understanding, we should not describe the
XBAR_DIV3_CLKas it is a system clock.Can you clarify for the STM if you still want to change the binding ?
Yes, I still believe the suggestion is relevant.
Signature · 2 lines
Regards, Ghennadi
PATCH v4 2/2 clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms
In reply to Daniel LezcanoSTM supports commonly required system and application software timing functions. STM includes a 32-bit count-up timer and four 32-bit compare channels with a separate interrupt source for each channel. The timer is driven by the STM module clock divided by an 8-bit prescale value (1 to 256).
STM has the following features:
• One 32-bit count-up timer with an 8-bit prescaler
• Four 32-bit compare channels
• An independent interrupt source for each channel
• Ability to stop the timer in Debug mode
The s32g platform is declined into two versions, the s32g2 and the s32g3. The former has a STM block with 8 timers and the latter has 12 timers.
The platform is designed to have one usable STM instance per core on the system which is composed of 3 x Cortex-M3 + 4 Cortex-A53 for the s32g2 and 3 x Cortex-M3 + 8 Cortex-A53 for the s32g3.
There is a special STM instance called STM_TS which is dedicated to the timestamp. The 7th STM instance STM_07 is directly tied to the STM_TS which means it is not usable as a clockevent.
The driver instantiate each STM described in the device tree as a clocksource and a clockevent conforming to the reference manual even if the Linux system does not use all of the clocksource. Each clockevent will have a cpumask set for a specific CPU.
Given the counter is shared between the clocksource and the clockevent, the STM module can not be disabled by one or another so the refcounting mechanism is used to stop the counter when it reaches zero and to start it when it is one. The suspend and resume relies on the refcount to stop the module.
As the device tree will have multiple STM entries, the driver can be probed in parallel with the async option but it is not enabled yet. However, the driver code takes care of preventing a race by putting a lock to protect the number of STM instances global variable which means it is ready to support the option when enough testing will be done with the underlying time framework.
--- drivers/clocksource/Kconfig | 9 + drivers/clocksource/Makefile | 2 + drivers/clocksource/timer-nxp-stm.c | 495 ++++++++++++++++++++++++++++ 3 files changed, 506 insertions(+) create mode 100644 drivers/clocksource/timer-nxp-stm.c
drivers/clocksource/Kconfig +9 -0
@@ -763,4 +763,13 @@ config RALINK_TIMER Enables support for system tick counter present on Ralink SoCs RT3352 and MT7620. +config NXP_STM_TIMER + bool "NXP System Timer Module driver" + depends on ARCH_S32 || COMPILE_TEST + select CLKSRC_MMIO + help + Support for NXP System Timer Module. It will create, in this + order, a clocksource, a broadcast clockevent and a per cpu + clockevent. + endmenu
drivers/clocksource/Makefile +2 -0
@@ -92,3 +92,5 @@ obj-$(CONFIG_GXP_TIMER) += timer-gxp.o obj-$(CONFIG_CLKSRC_LOONGSON1_PWM) += timer-loongson1-pwm.o obj-$(CONFIG_EP93XX_TIMER) += timer-ep93xx.o obj-$(CONFIG_RALINK_TIMER) += timer-ralink.o +obj-$(CONFIG_NXP_STM_TIMER) += timer-nxp-stm.o +
drivers/clocksource/timer-nxp-stm.c new file +495 -0
495 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v4 2/2] clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms
Quoted 20 lines · Daniel Lezcano
STM supports commonly required system and application software timing functions. STM includes a 32-bit count-up timer and four 32-bit compare channels with a separate interrupt source for each channel. The timer is driven by the STM module clock divided by an 8-bit prescale value (1 to 256).
STM has the following features:
• One 32-bit count-up timer with an 8-bit prescaler
• Four 32-bit compare channels
• An independent interrupt source for each channel
• Ability to stop the timer in Debug modeThe s32g platform is declined into two versions, the s32g2 and the s32g3. The former has a STM block with 8 timers and the latter has 12 timers.
The platform is designed to have one usable STM instance per core on the system which is composed of 3 x Cortex-M3 + 4 Cortex-A53 for the s32g2 and 3 x Cortex-M3 + 8 Cortex-A53 for the s32g3.
Quoted 5 lines
There is a special STM instance called
STM_TSwhich is dedicated to the timestamp. The 7th STM instanceSTM_07is directly tied to theSTM_TSwhich means it is not usable as a clockevent.The driver instantiate each STM described in the device tree as a
nitpick: instantiate -> instantiates
Quoted 8 lines
clocksource and a clockevent conforming to the reference manual even if the Linux system does not use all of the clocksource. Each clockevent will have a cpumask set for a specific CPU.
Given the counter is shared between the clocksource and the clockevent, the STM module can not be disabled by one or another so the refcounting mechanism is used to stop the counter when it reaches zero and to start it when it is one. The suspend and resume relies on
nitpick: relies -> rely
Quoted 27 lines
the refcount to stop the module.
As the device tree will have multiple STM entries, the driver can be probed in parallel with the async option but it is not enabled yet. However, the driver code takes care of preventing a race by putting a lock to protect the number of STM instances global variable which means it is ready to support the option when enough testing will be done with the underlying time framework.
Cc Ghennadi Procopciuc <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Thomas Fossati <[email protected]>Suggested-by Ghennadi Procopciuc <[email protected]>Signed-off-by Daniel Lezcano <[email protected]>--- drivers/clocksource/Kconfig | 9 + drivers/clocksource/Makefile | 2 + drivers/clocksource/timer-nxp-stm.c | 495 ++++++++++++++++++++++++++++ 3 files changed, 506 insertions(+) create mode 100644 drivers/clocksource/timer-nxp-stm.cdrivers/clocksource/Kconfig +0
-0@@ -763,4 +763,13 @@ config RALINK_TIMER Enables support for system tick counter present on
drivers/clocksource/Kconfig config RALINK_TIMER · line 773
Quoted 10 lines
drivers/clocksource/Kconfig +8
-0Ralink SoCs RT3352 and MT7620. +config NXP_STM_TIMER + bool "NXP System Timer Module driver" + depends on ARCH_S32 || COMPILE_TEST + select CLKSRC_MMIO + help + Support for NXP System Timer Module. It will create, in this + order, a clocksource, a broadcast clockevent and a per cpu + clockevent.
Is this description accurate? Will a broadcast event be created?
[ ... ]
Quoted 16 lines
drivers/clocksource/Kconfig +16
-0+ +static int nxp_stm_clockevent_set_next_event(unsigned long delta, struct clock_event_device *ced) +{ + struct stm_timer *stm_timer = ced_to_stm(ced); + u32 val; + + nxp_stm_clockevent_disable(stm_timer); + + stm_timer->delta = delta; + + val = nxp_stm_clockevent_read_counter(stm_timer) + delta; + + writel(val, STM_CMP0(stm_timer->base)); + + /* + * The counter is shared across the channels and can not be
drivers/clocksource/Kconfig config RALINK_TIMER
Quoted 10 lines
drivers/clocksource/Kconfig +10
-0+ * stopped while we are setting the next event. If the delta + * is very small it is possible the counter increases above + * the computed 'val'. The min_delta value specified when + * registering the clockevent will prevent that. The second + * case is if the counter wraps while we compute the 'val' and + * before writing the comparator register. We read the counter, + * check if we are back in time and abort the timer with -ETIME. + */ + if (val > nxp_stm_clockevent_read_counter(stm_timer) + delta) + return -ETIME;
In my opinion, there is still a race condition between the running counter and the nxp_stm_clockevent_enable function. This means that the counter may wrap around between the 'val > nxp_stm_clockevent_read_counter(stm_timer) + delta' check and the actual instruction part of the nxp_stm_clockevent_enable that enables the interrupt. Moreover, this implementation seems to prohibit the case when the value of val results after a wrap-around of the counter, which seems like an artificial constraint to me.
In my view, the goal here is to identify the cases when the timer fires while the comparator interrupt is disabled. There would be too many cases to consider if using u32 only to store the current value of the counter and the one to be written in the comparator. Therefore, to simplify the implementation, I would work with u64. Here is the proposal (not tested):
u64 val, ctime;
nxp_stm_clockevent_disable(stm_timer);
ctime = nxp_stm_clockevent_read_counter(stm_timer);
/* Build the targeted time using u64, which is not impacted by wraps since both added values are u32 */
val = ctime + delta;
/* Ensure we have enough time to set up the interrupt without generating a false one */writel(lower_32_bits(ctime) - 1, STM_CMP0(stm_timer->base));
nxp_stm_clockevent_enable(stm_timer);
ctime = nxp_stm_clockevent_read_counter(stm_timer);
/* The delta has already passed */
if (ctime > lower_32_bits(val)) {
nxp_stm_clockevent_disable(stm_timer);
return -ETIME;
}/* Keep the 32 LSB bits of the val */ writel(lower_32_bits(val), STM_CMP0(stm_timer->base));
[ ... ]
Quoted 15 lines
drivers/clocksource/Kconfig +15
-0+static irqreturn_t nxp_stm_module_interrupt(int irq, void *dev_id) +{ + struct stm_timer *stm_timer = dev_id; + struct clock_event_device *ced = &stm_timer->ced; + u32 val; + + /* + * The interrupt is shared across the channels in the + * module. But this one is configured to run only one channel, + * consequently it is pointless to test the interrupt flags + * before and we can directly reset the channel 0 irq flag + * register. + */ + writel(STM_CIR_CIF, STM_CIR0(stm_timer->base)); +
drivers/clocksource/Kconfig
Quoted 10 lines
drivers/clocksource/Kconfig +10
-0+ /* + * Update STM_CMP value using the counter value + */ + val = nxp_stm_clockevent_read_counter(stm_timer) + stm_timer->delta; + + writel(val, STM_CMP0(stm_timer->base)); + + /* + * stm hardware doesn't support oneshot, it will generate an + * interrupt and start the counter again so software need to
nitpick: software need -> software needs
Quoted 15 lines
drivers/clocksource/Kconfig +15
-0+ * disable the timer to stop the counter loop in ONESHOT mode. + */ + if (likely(clockevent_state_oneshot(ced))) + nxp_stm_clockevent_disable(stm_timer); + + ced->event_handler(ced); + + return IRQ_HANDLED; +} + +static int __init nxp_stm_timer_probe(struct platform_device *pdev) +{ + struct stm_timer *stm_timer; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node;
drivers/clocksource/Kconfig
Quoted 10 lines
drivers/clocksource/Kconfig +10
-0+ const char *name = of_node_full_name(np); + struct clk *clk; + void __iomem *base; + int irq, ret; + + /* + * The device tree can have multiple STM nodes described, so + * it makes this driver a good candidate for the async probe. + * It is still unclear if the time framework does correctly + * handle a parallel loading of the timers but at least this
nitpick: does correctly handle a parallel loading -> correctly handles parallel loading
Quoted 39 lines
drivers/clocksource/Kconfig +39
-0+ * driver is ready to support the option. + */ + guard(stm_instances)(&stm_instances_lock); + + /* + * The S32Gx are SoCs featuring a diverse set of cores. Linux + * is expected to run on Cortex-A53 cores, while other + * software stacks will operate on Cortex-M cores. The number + * of STM instances has been sized to include at most one + * instance per core. + * + * As we need a clocksource and a clockevent per cpu, we + * simply initialize a clocksource per cpu along with the + * clockevent which makes the resulting code simpler. + * + * However if the device tree is describing more STM instances + * than the number of cores, then we ignore them. + */ + if (stm_instances >= num_possible_cpus()) + return 0; + + base = devm_of_iomap(dev, np, 0, NULL); + if (IS_ERR(base)) + return dev_err_probe(dev, PTR_ERR(base), "Failed to iomap %pOFn\n", np); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return dev_err_probe(dev, irq, "Failed to get IRQ\n"); + + clk = devm_clk_get_enabled(dev, NULL); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "Clock not found\n"); + + stm_timer = devm_kzalloc(dev, sizeof(*stm_timer), GFP_KERNEL); + if (!stm_timer) + return -ENOMEM; + + ret = devm_request_irq(dev, irq, nxp_stm_module_interrupt, + IRQF_TIMER | IRQF_NOBALANCING, name, stm_timer);
drivers/clocksource/Kconfig
Quoted 10 lines
drivers/clocksource/Kconfig +10
-0+ if (ret) + return dev_err_probe(dev, ret, "Unable to allocate interrupt line\n"); + + ret = nxp_stm_clocksource_init(dev, stm_timer, name, base, clk); + if (ret) + return ret; + + /* + * Next probed STM will be a per CPU clockevent, until + * we probe as much as we have CPUs available on the
nitpick: as much -> as many
drivers/clocksource/Kconfig
Quoted 12 lines
drivers/clocksource/Kconfig +12
-0+ * system, we do a partial initialization + */ + ret = nxp_stm_clockevent_per_cpu_init(dev, stm_timer, name, + base, irq, clk, + stm_instances); + if (ret) + return ret; + + stm_instances++; + + /* + * The number of probed STM for per CPU clockevent is
nitpick: STM -> STMs
Quoted 31 lines
drivers/clocksource/Kconfig +31
-0+ * equal to the number of available CPUs on the + * system. We install the cpu hotplug to finish the + * initialization by registering the clockevents + */ + if (stm_instances == num_possible_cpus()) { + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "STM timer:starting", + nxp_stm_clockevent_starting_cpu, NULL); + if (ret < 0) + return ret; + } + + return 0; +} + +static const struct of_device_id nxp_stm_of_match[] = { + { .compatible = "nxp,s32g2-stm" }, + { } +}; +MODULE_DEVICE_TABLE(of, nxp_stm_of_match); + +static struct platform_driver nxp_stm_probe = { + .probe = nxp_stm_timer_probe, + .driver = { + .name = "nxp-stm", + .of_match_table = nxp_stm_of_match, + }, +}; +module_platform_driver(nxp_stm_probe); + +MODULE_DESCRIPTION("NXP System Timer Module driver"); +MODULE_LICENSE("GPL");
Signature · 2 lines
Regards, Ghennadi