Add the driver for Intel Keem Bay SoC timer block
Subsystems (2)
v10 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 v9:
- Updated the error message with the macro FW_BUG wherever applicable.
Changes since v8:
- The clockevent stucture has been declared as a global static variable, rather than allocating memory using kzalloc during probing.
- Updated the print statement indicating the configuration missing as the FW Bug.
- Updated the comments in the function keembay_timer_isr().
- Updated the dt-binding to remove 'oneOf' as there is only 1 entry.
- Updated the dt-binding description clearly indicating that
the descrption is about the undelying HW.
Changes since v7:
- Added back the compatible string "intel,keembay-gpt-creg" as an enum to the mfd device node in the device tree bindings.
- As the timer is used as a broadcast timer during CPU idle, only one timer is needed. Hence updated the driver accordingly incorporating the review comments.
Changes since v6:
- Removed the unused compatible string from the mfd device node to fix the error thrown by the make dt-binding command.
Changes since v5:
- Created a MFD device for the common configuration register in the device tree bindings.
- Updated the timer driver with the MFD framework to access the common configuration register.
Changes since v4:
- Updated the description in the device tree bindings.
- Updated the unit address of all the timers and counter in the device tree binding.
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 | 125 ++++++++++ MAINTAINERS | 6 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 226 ++++++++++++++++++ 5 files changed, 369 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml create mode 100644 drivers/clocksource/timer-keembay.c
base-commit: ffb217a13a2eaf6d5bd974fc83036a53ca69f1e2
Signature · 1 line
2.17.1
PATCH v10 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 | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml
Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +125 -0
@@ -0,0 +1,125 @@ +# 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 IP supports 1 free running counter and 8 timers. + 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: + compatible: + items: + - enum: + - intel,keembay-gpt-creg + - const: simple-mfd + + reg: + description: General configuration register address and length. + maxItems: 1 + + ranges: true + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +required: + - compatible + - reg + - ranges + - "#address-cells" + - "#size-cells" + +patternProperties: + "^counter@[0-9a-f]+$": + description: Properties for Intel Keem Bay counter. + type: object + properties: + compatible: + items: + - enum: + - intel,keembay-counter + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + required: + - compatible + - reg + - clocks + + "^timer@[0-9a-f]+$": + description: Properties for Intel Keem Bay timer + type: object + properties: + compatible: + items: + - 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 { + compatible = "intel,keembay-gpt-creg", "simple-mfd"; + reg = <0x0 0x20331000 0x0 0xc>; + ranges = <0x0 0x0 0x20330000 0xF0>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + counter@e8 { + compatible = "intel,keembay-counter"; + reg = <0xe8 0x8>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@30 { + compatible = "intel,keembay-timer"; + reg = <0x30 0xc>; + interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + }; + }; + +...
Signature · 1 line
2.17.1
Re: [PATCH v10 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 7 lines · On 22/03/2022 14:00, [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]>
In order to pick this binding I need an ack from Rob or Krzysztof (added to the recipients)
Quoted 136 lines
--- .../bindings/timer/intel,keembay-timer.yaml | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+)create mode 100644
Documentation/devicetree/bindings/timer/intel,keembay-timer.yamlDocumentation/devicetree/bindings/timer/intel,keembay-timer.yaml new file +125
-0@@ -0,0 +1,125 @@ +# 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 IP supports 1 free running counter and 8 timers. + 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: + compatible: + items: + - enum: + - intel,keembay-gpt-creg + - const: simple-mfd + + reg: + description: General configuration register address and length. + maxItems: 1 + + ranges: true + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +required: + - compatible + - reg + - ranges + - "#address-cells" + - "#size-cells" + +patternProperties: + "^counter@[0-9a-f]+$": + description: Properties for Intel Keem Bay counter. + type: object + properties: + compatible: + items: + - enum: + - intel,keembay-counter + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + required: + - compatible + - reg + - clocks + + "^timer@[0-9a-f]+$": + description: Properties for Intel Keem Bay timer + type: object + properties: + compatible: + items: + - 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 { + compatible = "intel,keembay-gpt-creg", "simple-mfd"; + reg = <0x0 0x20331000 0x0 0xc>; + ranges = <0x0 0x0 0x20330000 0xF0>; + #address-cells = <0x1>; + #size-cells = <0x1>; + + counter@e8 { + compatible = "intel,keembay-counter"; + reg = <0xe8 0x8>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + + timer@30 { + compatible = "intel,keembay-timer"; + reg = <0x30 0xc>; + interrupts = <GIC_SPI 0x5 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&scmi_clk KEEM_BAY_A53_TIM>; + }; + }; + }; + +...
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 v10 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 6 lines · Daniel Lezcano
Quoted 5 lines · On 22/03/2022 14:00, [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.
Quoted 6 lines
Quoted 2 lines
Reviewed-by Andy Shevchenko <[email protected]>Signed-off-by Shruthi Sanil <[email protected]>In order to pick this binding I need an ack from Rob or Krzysztof (added to the recipients)
Rob was looking into this and there were some comments around v8, so I will leave it to him.
Best regards,
Krzysztof
Re: [PATCH v10 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Hi Rob,
Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Daniel Lezcano
Quoted 7 lines · On 22/03/2022 14:00, [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]>
Quoted 5 lines
Quoted 2 lines
In order to pick this binding I need an ack from Rob or Krzysztof (added to the recipients)
Rob was looking into this and there were some comments around v8, so I will leave it to him.
whenever possible could you review this patch, so I can merge the series which has been a long on the mailing list ?
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
Rob Herring
maintainerRe: [PATCH v10 1/2] dt-bindings: timer: Add bindings for Intel Keem Bay SoC Timer
Quoted 15 lines · Daniel Lezcano
Hi Rob,
Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Daniel Lezcano
Quoted 7 lines · On 22/03/2022 14:00, [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]>
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
In order to pick this binding I need an ack from Rob or Krzysztof (added to the recipients)
Rob was looking into this and there were some comments around v8, so I will leave it to him.
whenever possible could you review this patch, so I can merge the series which has been a long on the mailing list ?
I did... Multiple times.
I don't see any need for 1 node per counter. I don't find 'it might be synthesized with a different number of counters' a convincing argument.
Rob
PATCH v10 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 | 6 + drivers/clocksource/Kconfig | 11 ++ drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 226 ++++++++++++++++++++++++++++ 4 files changed, 244 insertions(+) create mode 100644 drivers/clocksource/timer-keembay.c
MAINTAINERS +6 -0
@@ -9791,6 +9791,12 @@ 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 DRIVER +M: Shruthi Sanil <[email protected]> +S: Maintained +F: Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml +F: drivers/clocksource/timer-keembay.c + INTEL THUNDER BAY EMMC PHY DRIVER M: Nandhini Srikandan <[email protected]> M: Rashmi A <[email protected]>
drivers/clocksource/Kconfig +11 -0
@@ -721,4 +721,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
@@ -89,3 +89,4 @@ obj-$(CONFIG_GX6605S_TIMER) += timer-gx6605s.o obj-$(CONFIG_HYPERV_TIMER) += hyperv_timer.o obj-$(CONFIG_MICROCHIP_PIT64B) += timer-microchip-pit64b.o obj-$(CONFIG_MSC313E_TIMER) += timer-msc313e.o +obj-$(CONFIG_KEEMBAY_TIMER) += timer-keembay.o
drivers/clocksource/timer-keembay.c new file +226 -0
226 lines not on this page · raw message
Signature · 1 line
2.17.1
Gentle Reminder!
Regards,
Shruthi
Quoted 94 lines
-----Original Message-----
From: Sanil, Shruthi <[email protected]>
Sent: Tuesday, March 22, 2022 6:30 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Thokala, Srikanth <[email protected]>; Raja Subramanian, Lakshmi Bai <[email protected]>; Sangannavar, Mallikarjunappa <[email protected]>; Sanil, Shruthi <[email protected]>
Subject: [PATCH v10 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 v9:
- Updated the error message with the macroFW_BUGwherever applicable.Changes since v8:
- The clockevent stucture has been declared as a global static variable, rather than allocating memory using kzalloc during probing.
- Updated the print statement indicating the configuration missing as the FW Bug.
- Updated the comments in the functionkeembay_timer_isr().
- Updated the dt-binding to remove 'oneOf' as there is only 1 entry.
- Updated the dt-binding description clearly indicating that
the descrption is about the undelying HW.Changes since v7:
- Added back the compatible string "intel,keembay-gpt-creg" as an enum to the mfd device node in the device tree bindings.
- As the timer is used as a broadcast timer during CPU idle, only one timer is needed. Hence updated the driver accordingly incorporating the review comments.Changes since v6:
- Removed the unused compatible string from the mfd device node to fix the error thrown by the make dt-binding command.Changes since v5:
- Created a MFD device for the common configuration register in the device tree bindings.
- Updated the timer driver with the MFD framework to access the common configuration register.Changes since v4:
- Updated the description in the device tree bindings.
- Updated the unit address of all the timers and counter in the device tree binding.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 | 125 ++++++++++ MAINTAINERS | 6 + drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-keembay.c | 226 ++++++++++++++++++ 5 files changed, 369 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/intel,keembay-timer.yaml create mode 100644 drivers/clocksource/timer-keembay.cbase-commit:
ffb217a13a2eaf6d5bd974fc83036a53ca69f1e2--
2.17.1
Quoted 1 line · Shruthi
Gentle Reminder!
It's a merge window time. Be patient!
Also, please avoid top-posting.
Quoted 2 lines
Quoted 2 lines
From: Sanil, Shruthi <[email protected]>
Sent: Tuesday, March 22, 2022 6:30 PM
Signature · 2 lines
With Best Regards, Andy Shevchenko