mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, thomas.fossati@linaro.org,
	Larisa.Grigore@nxp.com, ghennadi.procopciuc@nxp.com,
	krzysztof.kozlowski@linaro.org, S32@nxp.com
Subject: [PATCH v3 0/2] Add the System Timer Module for the NXP S32 architecture
Date: Wed,  2 Apr 2025 00:46:40 +0200	[thread overview]
Message-ID: <20250401224644.3389181-1-daniel.lezcano@linaro.org> (raw)

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:

 - 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           | 496 ++++++++++++++++++
 4 files changed, 560 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/nxp,s32g2-stm.yaml
 create mode 100644 drivers/clocksource/timer-nxp-stm.c

-- 
2.43.0


             reply	other threads:[~2025-04-01 22:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 22:46 Daniel Lezcano [this message]
2025-04-01 22:46 ` [PATCH v3 1/2] dt-bindings: timer: Add NXP System Timer Module Daniel Lezcano
2025-04-02  7:02   ` Krzysztof Kozlowski
2025-04-01 22:46 ` [PATCH v3 2/2] clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms Daniel Lezcano
2025-04-02  7:05   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250401224644.3389181-1-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=Larisa.Grigore@nxp.com \
    --cc=S32@nxp.com \
    --cc=ghennadi.procopciuc@nxp.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.fossati@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®