Add the driver for Intel Keem Bay SoC timer block
Subsystems (2)
v4 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.
Changes since v3:
- Update in KConfig file to support COMPILE_TEST for Keem Bay timer.
- Update in device tree bindings to remove status field.
- Update in device tree bindings to remove 64-bit address space for the child nodes by using non-empty ranges.
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 | 170 ++++++++++++ MAINTAINERS | 5 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 255 ++++++++++++++++++ 5 files changed, 442 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml create mode 100644 drivers/clocksource/timer-keembay.c
base-commit: 62fb9874f5da54fdb243003b386128037319b219
Signature · 1 line
2.17.1
PATCH v4 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 | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +170 -0
@@ -0,0 +1,170 @@ +# 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 + + ranges: true + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + +required: + - reg + - ranges + - "#address-cells" + - "#size-cells" + +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>; + ranges = <0x0 0x0 0x20330000 0xF0>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + counter@203300e8 { + compatible = "intel,keembay-counter"; + reg = <0xe8 0x8>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330010 { + compatible = "intel,keembay-timer"; + reg = <0x10 0xc>; + interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330020 { + compatible = "intel,keembay-timer"; + reg = <0x20 0xc>; + interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330030 { + compatible = "intel,keembay-timer"; + reg = <0x30 0xc>; + interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330040 { + compatible = "intel,keembay-timer"; + reg = <0x40 0xc>; + interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330050 { + compatible = "intel,keembay-timer"; + reg = <0x50 0xc>; + interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330060 { + compatible = "intel,keembay-timer"; + reg = <0x60 0xc>; + interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330070 { + compatible = "intel,keembay-timer"; + reg = <0x70 0xc>; + interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330080 { + compatible = "intel,keembay-timer"; + reg = <0x80 0xc>; + interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + }; + }; + +...
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 26 lines · On Mon, Jun 28, 2021 at 11:44:09AM +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.
Reviewed-by Andy Shevchenko <[email protected]>Signed-off-by Shruthi Sanil <[email protected]>--- .../bindings/timer/intel,keembay-timer.yaml | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yamlDocumentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +8
-0@@ -0,0 +1,170 @@ +# 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 +
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 18
Quoted 10 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +10
-0+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.
clockevent and clocksource are Linuxisms. Don't use them in bindings.
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 22
Quoted 4 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +4
-0+ 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.
I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
Quoted 74 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +74
-0+ +properties: + reg: + description: General configuration register address and length. + maxItems: 1 + + ranges: true + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + +required: + - reg + - ranges + - "#address-cells" + - "#size-cells" + +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 {
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 106
Quoted 10 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +10
-0+ #address-cells = <0x2>; + #size-cells = <0x2>; + + gpt@20331000 { + reg = <0x0 0x20331000 0x0 0xc>; + ranges = <0x0 0x0 0x20330000 0xF0>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + counter@203300e8 {
The unit address here is wrong. Should be 'e8'.
Quoted 68 lines
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +64
-0+ compatible = "intel,keembay-counter"; + reg = <0xe8 0x8>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330010 { + compatible = "intel,keembay-timer"; + reg = <0x10 0xc>; + interrupts = <GIC_SPI 0x3 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330020 { + compatible = "intel,keembay-timer"; + reg = <0x20 0xc>; + interrupts = <GIC_SPI 0x4 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330030 { + compatible = "intel,keembay-timer"; + reg = <0x30 0xc>; + interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330040 { + compatible = "intel,keembay-timer"; + reg = <0x40 0xc>; + interrupts = <GIC_SPI 0x6 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330050 { + compatible = "intel,keembay-timer"; + reg = <0x50 0xc>; + interrupts = <GIC_SPI 0x7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330060 { + compatible = "intel,keembay-timer"; + reg = <0x60 0xc>; + interrupts = <GIC_SPI 0x8 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330070 { + compatible = "intel,keembay-timer"; + reg = <0x70 0xc>; + interrupts = <GIC_SPI 0x9 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@20330080 { + compatible = "intel,keembay-timer"; + reg = <0x80 0xc>; + interrupts = <GIC_SPI 0xa IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + }; + }; + +...Signature · 1 line
2.17.1
Re: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 8 lines · Rob Herring
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 22
Quoted 2 lines · On Mon, Jun 28, 2021 at 11:44:09AM +0530, [email protected] wrote:
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +2
-0+ The parent node represents the common general configuration details and + the child nodes represents the counter and timers.I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
If you may notice the children may have different properties that can't be known ahead, such as IRQ line. On some platforms it may be this mapping, on another it maybe different.
With all respect for the simplification I think we can't do it here.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Rob Herring
maintainerRe: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 7 lines · Andy Shevchenko
Quoted 5 lines · Rob Herring
Quoted 2 lines · On Mon, Jun 28, 2021 at 11:44:09AM +0530, [email protected] wrote:
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +2
-0+ The parent node represents the common general configuration details and + the child nodes represents the counter and timers.
Quoted 7 lines
Quoted 3 lines
I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
If you may notice the children may have different properties that can't be known ahead, such as IRQ line. On some platforms it may be this mapping, on another it maybe different.
What I noticed is it's all the same clock and 1 interrupt for each timer can be just a single 'interrupts' property with 8 entries.
Is there a platform that's different or that's a hypothetical? Because hypothetically, every aspect of every IP could change. But we don't try to parameterize everything in DT. It's a judgement call between implying things from compatible and explicit DT properties.
Quoted 1 line
With all respect for the simplification I think we can't do it here.
You can. Any data in DT could be in the kernel. It's a question of balance, not can or can't.
Rob
Re: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 12 lines · Rob Herring
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Rob Herring
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml line 22
Quoted 2 lines · On Mon, Jun 28, 2021 at 11:44:09AM +0530, [email protected] wrote:
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +2
-0+ The parent node represents the common general configuration details and + the child nodes represents the counter and timers.I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
Quoted 6 lines
Quoted 3 lines
If you may notice the children may have different properties that can't be known ahead, such as IRQ line. On some platforms it may be this mapping, on another it maybe different.
What I noticed is it's all the same clock and 1 interrupt for each timer can be just a single 'interrupts' property with 8 entries.
This may work.
Quoted 9 lines
Is there a platform that's different or that's a hypothetical? Because hypothetically, every aspect of every IP could change. But we don't try to parameterize everything in DT. It's a judgement call between implying things from compatible and explicit DT properties.
Quoted 1 line
With all respect for the simplification I think we can't do it here.
You can. Any data in DT could be in the kernel. It's a question of balance, not can or can't.
Not only, it's also matters of what exactly hardware is: 8 timers or timer with 8 channels. If it's the former one, I prefer to have DT exactly like originally suggested, otherwise I will agree on your proposal.
Signature · 2 lines
With Best Regards, Andy Shevchenko
RE: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 42 lines
-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Wednesday, July 14, 2021 7:51 PM
To: Rob Herring <[email protected]>
Cc: Sanil, Shruthi <[email protected]>; Daniel Lezcano <[email protected]>; Thomas Gleixner <[email protected]>; linux- [email protected]; [email protected]; [email protected]; Mark Gross <[email protected]>; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC TimerQuoted 4 lines · Rob Herring
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Rob Herring
On Mon, Jun 28, 2021 at 11:44:09AM +0530, [email protected]
Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
+ The parent node represents the common general configuration
+ details and the child nodes represents the counter and timers.I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
Quoted 6 lines
Quoted 3 lines
If you may notice the children may have different properties that can't be known ahead, such as IRQ line. On some platforms it may be this mapping, on another it maybe different.
What I noticed is it's all the same clock and 1 interrupt for each timer can be just a single 'interrupts' property with 8 entries.
This may work.
Quoted 5 lines
Is there a platform that's different or that's a hypothetical? Because hypothetically, every aspect of every IP could change. But we don't try to parameterize everything in DT. It's a judgement call between implying things from compatible and explicit DT properties.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
With all respect for the simplification I think we can't do it here.
You can. Any data in DT could be in the kernel. It's a question of balance, not can or can't.
Not only, it's also matters of what exactly hardware is: 8 timers or timer with 8 channels. If it's the former one, I prefer to have DT exactly like originally suggested, otherwise I will agree on your proposal.
Yes Andy, its correct, we have 8 timers in the hardware which are independent.
Also the timer framework provides option to parse all the device tree details. In this case we would pass the timer node to the framework and get the base, IRQ and clock. If we go for a single node approach then all these need to be handled in the driver, hence making it complicated.
Regards,
Shruthi
Quoted 5 lines
--
With Best Regards,
Andy Shevchenko
RE: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 67 lines
-----Original Message-----
From: Sanil, Shruthi
Sent: Thursday, July 15, 2021 1:32 PM
To: Andy Shevchenko <[email protected]>; Rob Herring <[email protected]>
Cc: Daniel Lezcano <[email protected]>; Thomas Gleixner <[email protected]>; [email protected]; [email protected]; [email protected]; Mark Gross <[email protected]>; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: RE: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC TimerQuoted 45 lines
-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Wednesday, July 14, 2021 7:51 PM
To: Rob Herring <[email protected]>
Cc: Sanil, Shruthi <[email protected]>; Daniel Lezcano <[email protected]>; Thomas Gleixner <[email protected]>; linux- [email protected]; [email protected]; [email protected]; Mark Gross <[email protected]>; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>
Subject: Re: [PATCH v4 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC TimerQuoted 5 lines · Rob Herring
Quoted 3 lines · Andy Shevchenko
Quoted 2 lines · Rob Herring
On Mon, Jun 28, 2021 at 11:44:09AM +0530,
[email protected]Quoted 8 lines · wrote:
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
+ The parent node represents the common general configuration
+ details and the child nodes represents the counter and timers.I don't think all the child nodes are necessary. Are the counters and timers configurable (say on another SoC)? If not, then a single node here would suffice.
Quoted 6 lines
Quoted 3 lines
If you may notice the children may have different properties that can't be known ahead, such as IRQ line. On some platforms it may be this mapping, on another it maybe different.
What I noticed is it's all the same clock and 1 interrupt for each timer can be just a single 'interrupts' property with 8 entries.
This may work.
Quoted 7 lines
Is there a platform that's different or that's a hypothetical? Because hypothetically, every aspect of every IP could change. But we don't try to parameterize everything in DT. It's a judgement call between implying things from compatible and explicit DT properties.
Quoted 1 line
With all respect for the simplification I think we can't do it here.
Quoted 7 lines
Quoted 2 lines
You can. Any data in DT could be in the kernel. It's a question of balance, not can or can't.
Not only, it's also matters of what exactly hardware is: 8 timers or timer with
8 channels. If it's the former one, I prefer to have DT exactly like originally suggested, otherwise I will agree on your proposal.
Quoted 7 lines
Yes Andy, its correct, we have 8 timers in the hardware which are independent.
Also the timer framework provides option to parse all the device tree details. In this case we would pass the timer node to the framework and get the base, IRQ and clock. If we go for a single node approach then all these need to be handled in the driver, hence making it complicated.
Hi Rob,
Yes, the counter and timers are configurable on another SoC. Do you give a nod on the current design?
Shall I proceed with submitting the next version addressing the other 2 comments of yours regarding the description and the unit address update?
Quoted 8 lines
Regards,
ShruthiQuoted 5 lines
--
With Best Regards,
Andy Shevchenko
PATCH v4 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
@@ -9286,6 +9286,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
@@ -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 || COMPILE_TEST + 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
@@ -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
Gentle Reminder!
Regards,
Shruthi
Quoted 59 lines
-----Original Message-----
From: Sanil, Shruthi <[email protected]>
Sent: Monday, June 28, 2021 11:44 AM
To: [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]>; Sanil, Shruthi <[email protected]>
Subject: [PATCH v4 0/2] Add the driver for Intel Keem Bay SoC timer blockFrom: 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.
Changes since v3:
- Update in KConfig file to supportCOMPILE_TESTfor Keem Bay timer.
- Update in device tree bindings to remove status field.
- Update in device tree bindings to remove 64-bit address space for the child nodes by using non-empty ranges.Changes since v2:
- Add multi timer support.
- Update in the device tree binding to support multi timers.
- Code optimization.Changes since v1:
- Add support forKEEMBAY_TIMERto get selected throughKconfig.platforms.
- AddCLOCK_EVT_FEAT_DYNIRQas 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 | 170 ++++++++++++ MAINTAINERS | 5 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 255 ++++++++++++++++++ 5 files changed, 442 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml create mode 100644 drivers/clocksource/timer-keembay.cbase-commit:
62fb9874f5da54fdb243003b386128037319b219--
2.17.1