Skip to contentSkip to conversation

Add the driver for Intel Keem Bay SoC timer block

PATCH Superseded [email protected] 3 participants 9 messages May 27, 2021 – Jun 8, 2021

Subsystems (2)

v3 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add the driver for Intel Keem Bay SoC timer block

From: Shruthi Sanil <[email protected]>

The timer block supports 1 64-bit free running counter and 8 32-bit general purpose timers.

Patch 1 holds the device tree binding documentation. Patch 2 holds the device driver.

This driver is tested on the Keem Bay evaluation module board.

I would like to inform that, I would be taking the ownership of this patch series from this version.

Changes since v2:
- Add multi timer support.
- Update in the device tree binding to support multi timers.
- Code optimization.

Changes since v1:
- Add support for KEEMBAY_TIMER to get selected through Kconfig.platforms.
- Add CLOCK_EVT_FEAT_DYNIRQ as part of clockevent feature.
- Avoid overlapping reg regions across 2 device nodes.
- Simplify 2 device nodes as 1 because both are from same IP block.
- Adapt the driver code according to the new simplified devicetree.

Shruthi Sanil (2):
dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
clocksource: Add Intel Keem Bay timer support

 .../bindings/timer/intel,keembay-timer.yaml   | 180 +++++++++++++
 MAINTAINERS                                   |   5 +
 drivers/clocksource/Kconfig                   |  11 +
 drivers/clocksource/Makefile                  |   1 +
 drivers/clocksource/timer-keembay.c           | 255 ++++++++++++++++++
 5 files changed, 452 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
 create mode 100644 drivers/clocksource/timer-keembay.c

base-commit: ad9f25d338605d26acedcaf3ba5fab5ca26f1c10

Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/2 dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

From: Shruthi Sanil <[email protected]>

Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.

---
 .../bindings/timer/intel,keembay-timer.yaml   | 180 ++++++++++++++++++
 1 file changed, 180 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +180 -0
new file mode 100644
index 000000000000..e0152e19208f
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Keem Bay SoC Timers
+
+maintainers:
+  - Shruthi Sanil <[email protected]>
+
+description: |
+  The Intel Keem Bay timer driver supports clocksource and clockevent
+  features for the timer IP used in Intel Keembay SoC.
+  The timer block supports 1 free running counter and 8 timers.
+  The free running counter can be used as a clocksouce and
+  the timers can be used as clockevent. Each timer is capable of
+  generating inividual interrupt.
+  Both the features are enabled through the timer general config register.
+
+  The parent node represents the common general configuration details and
+  the child nodes represents the counter and timers.
+
+properties:
+  reg:
+    description: General configuration register address and length.
+    maxItems: 1
+
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+patternProperties:
+  "^counter@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay counter
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-counter
+
+      reg:
+        maxItems: 1
+
+      clocks:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - clocks
+
+  "^timer@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay timer
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-timer
+
+      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>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define KEEM_BAY_A53_TIM
+
+    soc {
+        #address-cells = <0x2>;
+        #size-cells = <0x2>;
+
+        gpt@20331000 {
+            reg = <0x0 0x20331000 0x0 0xc>;
+            #address-cells = <0x2>;
+            #size-cells = <0x2>;
+            ranges;
+
+            counter@203300e8 {
+                compatible = "intel,keembay-counter";
+                reg = <0x0 0x203300e8 0x0 0x8>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330010 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330010 0x0 0xc>;
+                interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330020 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330020 0x0 0xc>;
+                interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330030 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330030 0x0 0xc>;
+                interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330040 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330040 0x0 0xc>;
+                interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330050 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330050 0x0 0xc>;
+                interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330060 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330060 0x0 0xc>;
+                interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330070 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330070 0x0 0xc>;
+                interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330080 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330080 0x0 0xc>;
+                interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+        };
+    };
+
+...
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Quoted 32 lines · On Thu, May 27, 2021 at 12:09:05PM +0530, [email protected] wrote:

From: Shruthi Sanil <[email protected]>

Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.

---
 .../bindings/timer/intel,keembay-timer.yaml   | 180 ++++++++++++++++++
 1 file changed, 180 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +14 -0
new file mode 100644
index 000000000000..e0152e19208f
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Keem Bay SoC Timers
+
+maintainers:
+  - Shruthi Sanil <[email protected]>
+
+description: |
+  The Intel Keem Bay timer driver supports clocksource and clockevent
+  features for the timer IP used in Intel Keembay SoC.

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +10 -0
+  The timer block supports 1 free running counter and 8 timers.
+  The free running counter can be used as a clocksouce and
+  the timers can be used as clockevent. Each timer is capable of
+  generating inividual interrupt.
+  Both the features are enabled through the timer general config register.
+
+  The parent node represents the common general configuration details and
+  the child nodes represents the counter and timers.
+
+properties:

There's no compatible, so this schema will never be applied. You need a compatible to identify what the block is.

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 33

Quoted 9 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +9 -0
+  reg:
+    description: General configuration register address and length.
+    maxItems: 1
+
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2

Not really any reason for 64-bits of address space in the child nodes. Use a non-empty ranges.

Quoted 68 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +68 -0
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+patternProperties:
+  "^counter@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay counter
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-counter
+
+      reg:
+        maxItems: 1
+
+      clocks:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - clocks
+
+  "^timer@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay timer
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-timer
+
+      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>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define KEEM_BAY_A53_TIM
+
+    soc {
+        #address-cells = <0x2>;
+        #size-cells = <0x2>;
+
+        gpt@20331000 {

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 111

Quoted 10 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +10 -0
+            reg = <0x0 0x20331000 0x0 0xc>;
+            #address-cells = <0x2>;
+            #size-cells = <0x2>;
+            ranges;
+
+            counter@203300e8 {
+                compatible = "intel,keembay-counter";
+                reg = <0x0 0x203300e8 0x0 0x8>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";

Don't show status in examples.

Quoted 71 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +69 -0
+            };
+
+            timer@20330010 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330010 0x0 0xc>;
+                interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330020 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330020 0x0 0xc>;
+                interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330030 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330030 0x0 0xc>;
+                interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330040 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330040 0x0 0xc>;
+                interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330050 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330050 0x0 0xc>;
+                interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330060 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330060 0x0 0xc>;
+                interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330070 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330070 0x0 0xc>;
+                interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330080 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330080 0x0 0xc>;
+                interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+        };
+    };
+
+...
Signature · 1 line
2.17.1
#3 lore raw

RE: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Hi Rob,

Quoted 54 lines

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Thursday, June 3, 2021 12:52 AM
To: Sanil, Shruthi <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Documentation/devicetree/bindings/timer/intel,keembay-

Quoted 20 lines · On Thu, May 27, 2021 at 12:09:05PM +0530, [email protected] wrote:

From: Shruthi Sanil <[email protected]>

Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.

---
 .../bindings/timer/intel,keembay-timer.yaml   | 180 ++++++++++++++++++
 1 file changed, 180 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml

diff --git a/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml b/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file mode 100644
index 000000000000..e0152e19208f

Documentation/devicetree/bindings/timer/intel,keembay- new file +0 -0

timer.yaml

Quoted 19 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +18 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Keem Bay SoC Timers
+
+maintainers:
+  - Shruthi Sanil <[email protected]>
+
+description: |
+  The Intel Keem Bay timer driver supports clocksource and clockevent
+  features for the timer IP used in Intel Keembay SoC.
+  The timer block supports 1 free running counter and 8 timers.
+  The free running counter can be used as a clocksouce and
+  the timers can be used as clockevent. Each timer is capable of
+  generating inividual interrupt.
+  Both the features are enabled through the timer general config register.
Quoted 9 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 23

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+
+  The parent node represents the common general configuration details
+ and  the child nodes represents the counter and timers.
+
+properties:

There's no compatible, so this schema will never be applied. You need a compatible to identify what the block is.

This is a parent block that has the common configuration register address defined which we would need during the initialization of the child nodes. This block in itself is not doing anything. We have this because, we have a common register that is required to be accessed during all the timers and counter initialization. The child nodes have the compatible string.
I have validated this on the HW and see that the timer probes are being called and the timers are functional as expected.
Please suggest if there is a better way to handle this scenario.

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +4 -0
+  reg:
+    description: General configuration register address and length.
+    maxItems: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 32

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2

Not really any reason for 64-bits of address space in the child nodes. Use a non-empty ranges.

OK, I'll remove it.

Quoted 73 lines
Quoted 73 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +72 -0
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+patternProperties:
+  "^counter@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay counter
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-counter
+
+      reg:
+        maxItems: 1
+
+      clocks:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - clocks
+
+  "^timer@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay timer
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-timer
+
+      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>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define KEEM_BAY_A53_TIM
+
+    soc {
+        #address-cells = <0x2>;
+        #size-cells = <0x2>;
+
+        gpt@20331000 {
+            reg = <0x0 0x20331000 0x0 0xc>;
+            #address-cells = <0x2>;
+            #size-cells = <0x2>;
+            ranges;
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 110

Quoted 6 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +6 -0
+
+            counter@203300e8 {
+                compatible = "intel,keembay-counter";
+                reg = <0x0 0x203300e8 0x0 0x8>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";

Don't show status in examples.

OK, I'll remove it.

Thanks!
Shruthi

Quoted 72 lines
Quoted 72 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +69 -1
+            };
+
+            timer@20330010 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330010 0x0 0xc>;
+                interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330020 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330020 0x0 0xc>;
+                interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330030 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330030 0x0 0xc>;
+                interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330040 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330040 0x0 0xc>;
+                interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330050 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330050 0x0 0xc>;
+                interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330060 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330060 0x0 0xc>;
+                interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330070 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330070 0x0 0xc>;
+                interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330080 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330080 0x0 0xc>;
+                interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+        };
+    };
+
+...
--

2.17.1

#4 lore raw

RE: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Hi Rob,

Could you please confirm if the existing approach is OK. This has been validated on Keem Bay evaluation HW and its working as expected. Also please suggest if we have a better way to handle this.

Regards,
Shruthi

Quoted 268 lines

-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, June 3, 2021 5:02 PM
To: 'Rob Herring' <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Hi Rob,

Quoted 15 lines

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Thursday, June 3, 2021 12:52 AM
To: Sanil, Shruthi <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

On Thu, May 27, 2021 at 12:09:05PM +0530, [email protected]

Quoted 9 lines · wrote:
Quoted 9 lines

From: Shruthi Sanil <[email protected]>

Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.

---
 .../bindings/timer/intel,keembay-timer.yaml   | 180

++++++++++++++++++

Quoted 24 lines

Documentation/devicetree/bindings/timer/intel,keembay-

Quoted 11 lines
 1 file changed, 180 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml

diff --git a/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml b/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file mode 100644
index 000000000000..e0152e19208f

Documentation/devicetree/bindings/timer/intel,keembay- new file +0 -0

timer.yaml

Quoted 12 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +11 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Keem Bay SoC Timers
+
+maintainers:
+  - Shruthi Sanil <[email protected]>
+
+description: |
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 19

Quoted 8 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +8 -0
+  The Intel Keem Bay timer driver supports clocksource and
+clockevent
+  features for the timer IP used in Intel Keembay SoC.
+  The timer block supports 1 free running counter and 8 timers.
+  The free running counter can be used as a clocksouce and
+  the timers can be used as clockevent. Each timer is capable of
+  generating inividual interrupt.
+  Both the features are enabled through the timer general config

register.

Quoted 9 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 24

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+
+  The parent node represents the common general configuration
+ details and  the child nodes represents the counter and timers.
+
+properties:

There's no compatible, so this schema will never be applied. You need a compatible to identify what the block is.

This is a parent block that has the common configuration register address defined which we would need during the initialization of the child nodes. This block in itself is not doing anything. We have this because, we have a common register that is required to be accessed during all the timers and counter initialization.
The child nodes have the compatible string.
I have validated this on the HW and see that the timer probes are being called and the timers are functional as expected.
Please suggest if there is a better way to handle this scenario.

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +4 -0
+  reg:
+    description: General configuration register address and length.
+    maxItems: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 33

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2

Not really any reason for 64-bits of address space in the child nodes. Use a non-empty ranges.

OK, I'll remove it.

Quoted 73 lines
Quoted 73 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +72 -0
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+patternProperties:
+  "^counter@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay counter
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-counter
+
+      reg:
+        maxItems: 1
+
+      clocks:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - clocks
+
+  "^timer@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay timer
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-timer
+
+      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>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define KEEM_BAY_A53_TIM
+
+    soc {
+        #address-cells = <0x2>;
+        #size-cells = <0x2>;
+
+        gpt@20331000 {
+            reg = <0x0 0x20331000 0x0 0xc>;
+            #address-cells = <0x2>;
+            #size-cells = <0x2>;
+            ranges;
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 111

Quoted 6 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +6 -0
+
+            counter@203300e8 {
+                compatible = "intel,keembay-counter";
+                reg = <0x0 0x203300e8 0x0 0x8>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";

Don't show status in examples.

OK, I'll remove it.

Thanks!
Shruthi

Quoted 72 lines
Quoted 72 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +69 -1
+            };
+
+            timer@20330010 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330010 0x0 0xc>;
+                interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330020 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330020 0x0 0xc>;
+                interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330030 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330030 0x0 0xc>;
+                interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330040 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330040 0x0 0xc>;
+                interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330050 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330050 0x0 0xc>;
+                interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330060 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330060 0x0 0xc>;
+                interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330070 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330070 0x0 0xc>;
+                interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330080 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330080 0x0 0xc>;
+                interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+        };
+    };
+
+...
--

2.17.1

#5 lore raw

RE: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

In reply to Sanil, Shruthi
Quoted 84 lines

-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, June 3, 2021 5:02 PM
To: 'Rob Herring' <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

Hi Rob,

Quoted 15 lines

-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Thursday, June 3, 2021 12:52 AM
To: Sanil, Shruthi <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>;
Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v3 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer

On Thu, May 27, 2021 at 12:09:05PM +0530, [email protected]

Quoted 9 lines · wrote:
Quoted 9 lines

From: Shruthi Sanil <[email protected]>

Add Device Tree bindings for the Timer IP, which can be used as clocksource and clockevent device in the Intel Keem Bay SoC.

---
 .../bindings/timer/intel,keembay-timer.yaml   | 180

++++++++++++++++++

Quoted 24 lines

Documentation/devicetree/bindings/timer/intel,keembay-

Quoted 11 lines
 1 file changed, 180 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml

diff --git a/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml b/Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file mode 100644
index 000000000000..e0152e19208f

Documentation/devicetree/bindings/timer/intel,keembay- new file +0 -0

timer.yaml

Quoted 12 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +11 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/intel,keembay-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel Keem Bay SoC Timers
+
+maintainers:
+  - Shruthi Sanil <[email protected]>
+
+description: |
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 19

Quoted 8 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +8 -0
+  The Intel Keem Bay timer driver supports clocksource and
+clockevent
+  features for the timer IP used in Intel Keembay SoC.
+  The timer block supports 1 free running counter and 8 timers.
+  The free running counter can be used as a clocksouce and
+  the timers can be used as clockevent. Each timer is capable of
+  generating inividual interrupt.
+  Both the features are enabled through the timer general config

register.

Quoted 9 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 24

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+
+  The parent node represents the common general configuration
+ details and  the child nodes represents the counter and timers.
+
+properties:

There's no compatible, so this schema will never be applied. You need a compatible to identify what the block is.

Quoted 10 lines

This is a parent block that has the common configuration register address defined which we would need during the initialization of the child nodes. This block in itself is not doing anything. We have this because, we have a common register that is required to be accessed during all the timers and counter initialization.
The child nodes have the compatible string.
I have validated this on the HW and see that the timer probes are being called and the timers are functional as expected.
Please suggest if there is a better way to handle this scenario.

Could you please confirm if the existing approach is OK. This has been validated on Keem Bay evaluation HW and its working as expected. Also please suggest if we have a better way to handle this.

Thanks & Regards,
Shruthi

Quoted 174 lines
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +4 -0
+  reg:
+    description: General configuration register address and length.
+    maxItems: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 33

Quoted 5 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +5 -0
+  "#address-cells":
+    const: 2
+
+  "#size-cells":
+    const: 2

Not really any reason for 64-bits of address space in the child nodes. Use a non-empty ranges.

OK, I'll remove it.

Quoted 73 lines
Quoted 73 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +72 -0
+
+  ranges: true
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
+
+patternProperties:
+  "^counter@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay counter
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-counter
+
+      reg:
+        maxItems: 1
+
+      clocks:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - clocks
+
+  "^timer@[0-9a-f]+$":
+    type: object
+    description: Properties for Intel Keem Bay timer
+
+    properties:
+      compatible:
+        enum:
+          - intel,keembay-timer
+
+      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>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #define KEEM_BAY_A53_TIM
+
+    soc {
+        #address-cells = <0x2>;
+        #size-cells = <0x2>;
+
+        gpt@20331000 {
+            reg = <0x0 0x20331000 0x0 0xc>;
+            #address-cells = <0x2>;
+            #size-cells = <0x2>;
+            ranges;
Quoted 8 lines

Documentation/devicetree/bindings/timer/intel,keembay- line 111

Quoted 6 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +6 -0
+
+            counter@203300e8 {
+                compatible = "intel,keembay-counter";
+                reg = <0x0 0x203300e8 0x0 0x8>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";

Don't show status in examples.

OK, I'll remove it.

Thanks!
Shruthi

Quoted 72 lines
Quoted 72 lines
Documentation/devicetree/bindings/timer/intel,keembay- new file +69 -1
+            };
+
+            timer@20330010 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330010 0x0 0xc>;
+                interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330020 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330020 0x0 0xc>;
+                interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330030 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330030 0x0 0xc>;
+                interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330040 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330040 0x0 0xc>;
+                interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330050 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330050 0x0 0xc>;
+                interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330060 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330060 0x0 0xc>;
+                interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330070 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330070 0x0 0xc>;
+                interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+
+            timer@20330080 {
+                compatible = "intel,keembay-timer";
+                reg = <0x0 0x20330080 0x0 0xc>;
+                interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&scmi_clk KEEM_BAY_A53_TIM>;
+                status = "okay";
+            };
+        };
+    };
+
+...
--

2.17.1

#6 lore raw

PATCH v3 2/2 clocksource: Add Intel Keem Bay timer support

In reply to [email protected]

From: Shruthi Sanil <[email protected]>

The Intel Keem Bay timer driver supports clocksource and clockevent features for the timer IP used in Intel Keem Bay SoC.
The timer block supports 1 free running counter and 8 timers. The free running counter can be used as a clocksource and the timers can be used as clockevent. Each timer is capable of generating individual interrupt.
Both the features are enabled through the timer general config register.

---
 MAINTAINERS                         |   5 +
 drivers/clocksource/Kconfig         |  11 ++
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-keembay.c | 255 ++++++++++++++++++++++++++++
 4 files changed, 272 insertions(+)
 create mode 100644 drivers/clocksource/timer-keembay.c
MAINTAINERS +5 -0
index 04babfa8fc76..73543ed60e84 100644
@@ -9278,6 +9278,11 @@ F:	drivers/crypto/keembay/keembay-ocs-hcu-core.c
 F:	drivers/crypto/keembay/ocs-hcu.c
 F:	drivers/crypto/keembay/ocs-hcu.h
 
+INTEL KEEM BAY TIMER SUPPORT
+M:	Shruthi Sanil <[email protected]>
+S:	Maintained
+F:	drivers/clocksource/timer-keembay.c
+
 INTEL MANAGEMENT ENGINE (mei)
 M:	Tomas Winkler <[email protected]>
 L:	[email protected]
drivers/clocksource/Kconfig +11 -0
index 39aa21d01e05..08f491cf7f61 100644
@@ -693,4 +693,15 @@ config MICROCHIP_PIT64B
 	  modes and high resolution. It is used as a clocksource
 	  and a clockevent.
 
+config KEEMBAY_TIMER
+	bool "Intel Keem Bay timer"
+	depends on ARCH_KEEMBAY
+	select TIMER_OF
+	help
+	  This option enables the support for the Intel Keem Bay
+	  general purpose timer and free running counter driver.
+	  Each timer can generate an individual interrupt and
+	  supports oneshot and periodic modes.
+	  The 64-bit counter can be used as a clock source.
+
 endmenu
drivers/clocksource/Makefile +1 -0
index c17ee32a7151..ea319063ba47 100644
@@ -88,3 +88,4 @@ obj-$(CONFIG_CSKY_MP_TIMER)		+= timer-mp-csky.o
 obj-$(CONFIG_GX6605S_TIMER)		+= timer-gx6605s.o
 obj-$(CONFIG_HYPERV_TIMER)		+= hyperv_timer.o
 obj-$(CONFIG_MICROCHIP_PIT64B)		+= timer-microchip-pit64b.o
+obj-$(CONFIG_KEEMBAY_TIMER)		+= timer-keembay.o
drivers/clocksource/timer-keembay.c new file +255 -0

255 lines not on this page · raw message

Signature · 1 line
2.17.1
#7 lore raw

Re: [PATCH v3 2/2] clocksource: Add Intel Keem Bay timer support

Quoted 41 lines · On 27/05/2021 08:39, [email protected] wrote:

From: Shruthi Sanil <[email protected]>

The Intel Keem Bay timer driver supports clocksource and clockevent features for the timer IP used in Intel Keem Bay SoC.
The timer block supports 1 free running counter and 8 timers. The free running counter can be used as a clocksource and the timers can be used as clockevent. Each timer is capable of generating individual interrupt.
Both the features are enabled through the timer general config register.

---
 MAINTAINERS                         |   5 +
 drivers/clocksource/Kconfig         |  11 ++
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-keembay.c | 255 ++++++++++++++++++++++++++++
 4 files changed, 272 insertions(+)
 create mode 100644 drivers/clocksource/timer-keembay.c
MAINTAINERS +5 -0
index 04babfa8fc76..73543ed60e84 100644
@@ -9278,6 +9278,11 @@ F:	drivers/crypto/keembay/keembay-ocs-hcu-core.c
 F:	drivers/crypto/keembay/ocs-hcu.c
 F:	drivers/crypto/keembay/ocs-hcu.h
 
+INTEL KEEM BAY TIMER SUPPORT
+M:	Shruthi Sanil <[email protected]>
+S:	Maintained
+F:	drivers/clocksource/timer-keembay.c
+
 INTEL MANAGEMENT ENGINE (mei)
 M:	Tomas Winkler <[email protected]>
 L:	[email protected]
drivers/clocksource/Kconfig +0 -0
index 39aa21d01e05..08f491cf7f61 100644

drivers/clocksource/Kconfig config MICROCHIP_PIT64B · line 699

Quoted 7 lines
drivers/clocksource/Kconfig +4 -0
@@ -693,4 +693,15 @@ config MICROCHIP_PIT64B
 	  modes and high resolution. It is used as a clocksource
 	  and a clockevent.
 
+config KEEMBAY_TIMER
+	bool "Intel Keem Bay timer"
+	depends on ARCH_KEEMBAY
+	select TIMER_OF

Please refer to the other timer option to see how we create silent option. We want the Kconfig's platform to select the timer, not the user except for compilation coverage or expert mode.

drivers/clocksource/Kconfig config MICROCHIP_PIT64B · line 707

Quoted 8 lines
drivers/clocksource/Kconfig +7 -0
+	help
+	  This option enables the support for the Intel Keem Bay
+	  general purpose timer and free running counter driver.
+	  Each timer can generate an individual interrupt and
+	  supports oneshot and periodic modes.
+	  The 64-bit counter can be used as a clock source.
+
 endmenu

Other than that, LGTM.

Thanks
-- Daniel

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
#8 lore raw

RE: [PATCH v3 2/2] clocksource: Add Intel Keem Bay timer support

Hi Daniel,

Quoted 59 lines

-----Original Message-----
From: Daniel Lezcano <[email protected]>
Sent: Friday, June 4, 2021 1:37 PM
To: Sanil, Shruthi <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v3 2/2] clocksource: Add Intel Keem Bay timer support

MAINTAINERS F: drivers/crypto/keembay/keembay-ocs-hcu-

Quoted 26 lines · On 27/05/2021 08:39, [email protected] wrote:

From: Shruthi Sanil <[email protected]>

The Intel Keem Bay timer driver supports clocksource and clockevent features for the timer IP used in Intel Keem Bay SoC.
The timer block supports 1 free running counter and 8 timers. The free running counter can be used as a clocksource and the timers can be used as clockevent. Each timer is capable of generating individual interrupt.
Both the features are enabled through the timer general config register.

---
 MAINTAINERS                         |   5 +
 drivers/clocksource/Kconfig         |  11 ++
 drivers/clocksource/Makefile        |   1 +
 drivers/clocksource/timer-keembay.c | 255
++++++++++++++++++++++++++++
 4 files changed, 272 insertions(+)
 create mode 100644 drivers/clocksource/timer-keembay.c
MAINTAINERS index renamed from MAINTAINERS +0 -0

04babfa8fc76..73543ed60e84 100644

MAINTAINERS +0 -0
@@ -9278,6 +9278,11 @@ F:	drivers/crypto/keembay/keembay-ocs-hcu-

core.c

Quoted 19 lines
MAINTAINERS +5 -0
 F:	drivers/crypto/keembay/ocs-hcu.c
 F:	drivers/crypto/keembay/ocs-hcu.h
 
+INTEL KEEM BAY TIMER SUPPORT
+M:	Shruthi Sanil <[email protected]>
+S:	Maintained
+F:	drivers/clocksource/timer-keembay.c
+
 INTEL MANAGEMENT ENGINE (mei)
 M:	Tomas Winkler <[email protected]>
 L:	[email protected]
drivers/clocksource/Kconfig +0 -0
index 39aa21d01e05..08f491cf7f61 100644
@@ -693,4 +693,15 @@ config MICROCHIP_PIT64B
 	  modes and high resolution. It is used as a clocksource
 	  and a clockevent.
 
Quoted 8 lines

drivers/clocksource/Kconfig config MICROCHIP_PIT64B · line 699

Quoted 4 lines
drivers/clocksource/Kconfig +4 -0
+config KEEMBAY_TIMER
+	bool "Intel Keem Bay timer"
+	depends on ARCH_KEEMBAY
+	select TIMER_OF

Please refer to the other timer option to see how we create silent option. We want the Kconfig's platform to select the timer, not the user except for compilation coverage or expert mode.

OK, I'll check and update accordingly.

Thanks,
Shruthi

Quoted 22 lines

drivers/clocksource/Kconfig config MICROCHIP_PIT64B · line 707

Quoted 9 lines
drivers/clocksource/Kconfig +7 -0
+	help
+	  This option enables the support for the Intel Keem Bay
+	  general purpose timer and free running counter driver.
+	  Each timer can generate an individual interrupt and
+	  supports oneshot and periodic modes.
+	  The 64-bit counter can be used as a clock source.
+
 endmenu

Other than that, LGTM.

Thanks
-- Daniel

--
<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