clk: clocking-wizard: Driver updates
Subsystems (4)
v14 cover clk: clocking-wizard: Driver updates
The patch does the following
Update the versions of the clocking wizard ip.
Move from staging to clk directory.
Update the bindings.
v12:
No change.
Rebased
v13:
Update the clocking compatible
Add the change removing the driver from staging
v14:
Moved to the xilinx folder
Shubhrajyoti Datta (5):
dt-bindings: add documentation of xilinx clocking wizard
clk: clocking-wizard: Add the clockwizard to clk directory
clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
clk: clocking-wizard: Fix the reconfig for 5.2
clk: clocking-wizard: Update the compatible
.../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++
drivers/clk/xilinx/Kconfig | 11 +++
drivers/clk/xilinx/Makefile | 1 +
.../xilinx}/clk-xlnx-clock-wizard.c | 19 +++--
drivers/staging/Kconfig | 2 -
drivers/staging/Makefile | 1 -
drivers/staging/clocking-wizard/Kconfig | 10 ---
drivers/staging/clocking-wizard/Makefile | 2 -
drivers/staging/clocking-wizard/TODO | 13 ----
.../staging/clocking-wizard/dt-binding.txt | 30 --------
10 files changed, 103 insertions(+), 63 deletions(-)
create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml
rename drivers/{staging/clocking-wizard => clk/xilinx}/clk-xlnx-clock-wizard.c (96%)
delete mode 100644 drivers/staging/clocking-wizard/Kconfig
delete mode 100644 drivers/staging/clocking-wizard/Makefile
delete mode 100644 drivers/staging/clocking-wizard/TODO
delete mode 100644 drivers/staging/clocking-wizard/dt-binding.txtSignature · 1 line
2.17.1
PATCH v14 1/5 dt-bindings: add documentation of xilinx clocking wizard
Add the devicetree binding for the xilinx clocking wizard.
--- .../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml
Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml new file +77 -0
@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/clock/xlnx,clocking-wizard.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Xilinx clocking wizard + +maintainers: + - Shubhrajyoti Datta <[email protected]> + +description: + The clocking wizard is a soft ip clocking block of Xilinx versal. It + reads required input clock frequencies from the devicetree and acts as clock + clock output. + +properties: + compatible: + enum: + - xlnx,clocking-wizard + - xlnx,clocking-wizard-v5.2 + - xlnx,clocking-wizard-v6.0 + + + reg: + maxItems: 1 + + "#clock-cells": + const: 1 + + clocks: + items: + - description: clock input + - description: axi clock + + clock-names: + items: + - const: clk_in1 + - const: s_axi_aclk + + + xlnx,speed-grade: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [1, 2, 3] + description: + Speed grade of the device. Higher the speed grade faster is the FPGA device. + + xlnx,nr-outputs: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 8 + description: + Number of outputs. + +required: + - compatible + - reg + - "#clock-cells" + - clocks + - clock-names + - xlnx,speed-grade + - xlnx,nr-outputs + +additionalProperties: false + +examples: + - | + clock-controller@b0000000 { + compatible = "xlnx,clocking-wizard"; + reg = <0xb0000000 0x10000>; + #clock-cells = <1>; + xlnx,speed-grade = <1>; + xlnx,nr-outputs = <6>; + clock-names = "clk_in1", "s_axi_aclk"; + clocks = <&clkc 15>, <&clkc 15>; + }; +...
Signature · 1 line
2.17.1
Re: [PATCH v14 1/5] dt-bindings: add documentation of xilinx clocking wizard
Quoted 8 lines · Shubhrajyoti Datta
Add the devicetree binding for the xilinx clocking wizard.
Signed-off-by Shubhrajyoti Datta <[email protected]>--- .../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml
Re: [PATCH v14 1/5] dt-bindings: add documentation of xilinx clocking wizard
In reply to Shubhrajyoti DattaQuoting Shubhrajyoti Datta (2022-04-11 03:04:39)
Quoted 4 lines
Add the devicetree binding for the xilinx clocking wizard.
Signed-off-by Shubhrajyoti Datta <[email protected]>---
Applied to clk-next
PATCH v14 2/5 clk: clocking-wizard: Move clocking-wizard out
In reply to Shubhrajyoti DattaAdd clocking wizard driver to clk.
And delete the driver from the staging as it is in drivers/clk.
---
drivers/clk/xilinx/Kconfig | 11 +++++++
drivers/clk/xilinx/Makefile | 1 +
.../xilinx}/clk-xlnx-clock-wizard.c | 3 +-
drivers/staging/Kconfig | 2 --
drivers/staging/Makefile | 1 -
drivers/staging/clocking-wizard/Kconfig | 10 -------
drivers/staging/clocking-wizard/Makefile | 2 --
drivers/staging/clocking-wizard/TODO | 13 --------
.../staging/clocking-wizard/dt-binding.txt | 30 -------------------
9 files changed, 14 insertions(+), 59 deletions(-)
rename drivers/{staging/clocking-wizard => clk/xilinx}/clk-xlnx-clock-wizard.c (99%)
delete mode 100644 drivers/staging/clocking-wizard/Kconfig
delete mode 100644 drivers/staging/clocking-wizard/Makefile
delete mode 100644 drivers/staging/clocking-wizard/TODO
delete mode 100644 drivers/staging/clocking-wizard/dt-binding.txtdrivers/clk/xilinx/Kconfig +11 -0
@@ -17,3 +17,14 @@ config XILINX_VCU To compile this driver as a module, choose M here: the module will be called xlnx_vcu. +config COMMON_CLK_XLNX_CLKWZRD + tristate "Xilinx Clocking Wizard" + depends on COMMON_CLK && OF + help + Support for the Xilinx Clocking Wizard IP core clock generator. + Adds support for clocking wizard and compatible. + This driver supports the Xilinx clocking wizard programmable clock + synthesizer. The number of output is configurable in the design. + + If unsure, say N. +
drivers/clk/xilinx/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_XILINX_VCU) += xlnx_vcu.o +obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clk-xlnx-clock-wizard.o
drivers/clk/xilinx/clk-xlnx-clock-wizard.c renamed from drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c +2 -1
@@ -2,9 +2,10 @@/* * Xilinx 'Clocking Wizard' driver * -* Copyright (C) 2013 - 2014 Xilinx +* Copyright (C) 2013 - 2021 Xilinx * * Sören Brinkmann <[email protected]> +* */ #include <linux/platform_device.h>
drivers/staging/Kconfig +0 -2
@@ -66,8 +66,6 @@ source "drivers/staging/fwserial/Kconfig" source "drivers/staging/unisys/Kconfig" -source "drivers/staging/clocking-wizard/Kconfig" - source "drivers/staging/fbtft/Kconfig" source "drivers/staging/most/Kconfig"
drivers/staging/Makefile +0 -1
@@ -23,7 +23,6 @@ obj-$(CONFIG_STAGING_BOARD) += board/ obj-$(CONFIG_LTE_GDM724X) += gdm724x/ obj-$(CONFIG_FIREWIRE_SERIAL) += fwserial/ obj-$(CONFIG_UNISYSSPAR) += unisys/ -obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ obj-$(CONFIG_FB_TFT) += fbtft/ obj-$(CONFIG_MOST) += most/ obj-$(CONFIG_KS7010) += ks7010/
drivers/staging/clocking-wizard/Kconfig deleted +0 -10
@@ -1,10 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Xilinx Clocking Wizard Driver -# - -config COMMON_CLK_XLNX_CLKWZRD - tristate "Xilinx Clocking Wizard" - depends on COMMON_CLK && OF && HAS_IOMEM - help - Support for the Xilinx Clocking Wizard IP core clock generator.
drivers/staging/clocking-wizard/Makefile deleted +0 -2
@@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clk-xlnx-clock-wizard.o
drivers/staging/clocking-wizard/TODO deleted +0 -13
@@ -1,13 +0,0 @@ -TODO: - - support for fractional multiplier - - support for fractional divider (output 0 only) - - support for set_rate() operations (may benefit from Stephen Boyd's - refactoring of the clk primitives: - https://lore.kernel.org/lkml/[email protected]) - - review arithmetic - - overflow after multiplication? - - maximize accuracy before divisions - -Patches to: - Greg Kroah-Hartman <[email protected]> - Sören Brinkmann <[email protected]>
drivers/staging/clocking-wizard/dt-binding.txt deleted +0 -30
@@ -1,30 +0,0 @@ -Binding for Xilinx Clocking Wizard IP Core - -This binding uses the common clock binding[1]. Details about the devices can be -found in the product guide[2]. - -[1] Documentation/devicetree/bindings/clock/clock-bindings.txt -[2] Clocking Wizard Product Guide -https://www.xilinx.com/support/documentation/ip_documentation/clk_wiz/v5_1/pg065-clk-wiz.pdf - -Required properties: - - compatible: Must be 'xlnx,clocking-wizard' - - reg: Base and size of the cores register space - - clocks: Handle to input clock - - clock-names: Tuple containing 'clk_in1' and 's_axi_aclk' - - clock-output-names: Names for the output clocks - -Optional properties: - - speed-grade: Speed grade of the device (valid values are 1..3) - -Example: - clock-generator@40040000 { - reg = <0x40040000 0x1000>; - compatible = "xlnx,clocking-wizard"; - speed-grade = <1>; - clock-names = "clk_in1", "s_axi_aclk"; - clocks = <&clkc 15>, <&clkc 15>; - clock-output-names = "clk_out0", "clk_out1", "clk_out2", - "clk_out3", "clk_out4", "clk_out5", - "clk_out6", "clk_out7"; - };
Signature · 1 line
2.17.1
Re: [PATCH v14 2/5] clk: clocking-wizard: Move clocking-wizard out
Quoting Shubhrajyoti Datta (2022-04-11 03:04:40)
Quoted 5 lines
Add clocking wizard driver to clk.
And delete the driver from the staging as it is indrivers/clk.Signed-off-by Shubhrajyoti Datta <[email protected]>---
Applied to clk-next
PATCH v14 3/5 clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
In reply to Shubhrajyoti DattaRename nr-outputs to xlnx,output.
--- drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/xilinx/clk-xlnx-clock-wizard.c +1 -1
@@ -480,7 +480,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) goto err_disable_clk; } - ret =of_property_read_u32 (np,"nr-outputs" , &nr_outputs); + ret =of_property_read_u32 (np,"xlnx,nr-outputs" , &nr_outputs);if (ret || nr_outputs >WZRD_NUM_OUTPUTS ) { ret = -EINVAL ; goto err_disable_clk;
Signature · 1 line
2.17.1
Re: [PATCH v14 3/5] clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
Quoting Shubhrajyoti Datta (2022-04-11 03:04:41)
Quoted 4 lines
Rename nr-outputs to xlnx,output.
Signed-off-by Shubhrajyoti Datta <[email protected]>---
Applied to clk-next
PATCH v14 4/5 clk: clocking-wizard: Fix the reconfig for 5.2
In reply to Shubhrajyoti DattaThe 5.2 the reconfig is triggered by writing 7 followed by 2 to the reconfig reg. Add the same. Also 6.0 is backward compatible so it should be fine.
--- drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/clk/xilinx/clk-xlnx-clock-wizard.c +9 -3
@@ -44,6 +44,8 @@#define WZRD_DR_INIT_REG_OFFSET 0x25C#define WZRD_DR_DIV_TO_PHASE_OFFSET 4#define WZRD_DR_BEGIN_DYNA_RECONF 0x03 +#define WZRD_DR_BEGIN_DYNA_RECONF_5_2 0x07 +#define WZRD_DR_BEGIN_DYNA_RECONF1_5_2 0x02#define WZRD_USEC_POLL 10#define WZRD_TIMEOUT_POLL 1000
@@ -165,7 +167,9 @@ static int clk_wzrd_dynamic_reconfig(struct clk_hw *hw, unsigned long rate, goto err_reconfig;/* Initiate reconfiguration */ -writel (WZRD_DR_BEGIN_DYNA_RECONF , +writel (WZRD_DR_BEGIN_DYNA_RECONF_5_2 , + divider->base +WZRD_DR_INIT_REG_OFFSET ); +writel (WZRD_DR_BEGIN_DYNA_RECONF1_5_2 , divider->base +WZRD_DR_INIT_REG_OFFSET );/* Check status register */
@@ -224,7 +228,7 @@ static int clk_wzrd_dynamic_reconfig_f(struct clk_hw *hw, unsigned long rate,struct clk_wzrd_divider *divider =to_clk_wzrd_divider (hw);void __iomem *div_addr = divider->base + divider->offset; - rate_div = ((parent_rate *1000 ) / rate); + rate_div =DIV_ROUND_DOWN_ULL (parent_rate *1000 , rate); clockout0_div = rate_div /1000 ; pre =DIV_ROUND_CLOSEST ((parent_rate *1000 ), rate);
@@ -246,7 +250,9 @@ static int clk_wzrd_dynamic_reconfig_f(struct clk_hw *hw, unsigned long rate,return err;/* Initiate reconfiguration */ -writel (WZRD_DR_BEGIN_DYNA_RECONF , +writel (WZRD_DR_BEGIN_DYNA_RECONF_5_2 , + divider->base +WZRD_DR_INIT_REG_OFFSET ); +writel (WZRD_DR_BEGIN_DYNA_RECONF1_5_2 , divider->base +WZRD_DR_INIT_REG_OFFSET );/* Check status register */
Signature · 1 line
2.17.1
Re: [PATCH v14 4/5] clk: clocking-wizard: Fix the reconfig for 5.2
Quoting Shubhrajyoti Datta (2022-04-11 03:04:42)
Quoted 6 lines
The 5.2 the reconfig is triggered by writing 7 followed by 2 to the reconfig reg. Add the same. Also 6.0 is backward compatible so it should be fine.
Signed-off-by Shubhrajyoti Datta <[email protected]>---
Applied to clk-next
PATCH v14 5/5 clk: clocking-wizard: Update the compatible
In reply to Shubhrajyoti DattaUpdate the compatible to indicate support for both 5.2 and 6.0
--- drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/xilinx/clk-xlnx-clock-wizard.c +2 -0
@@ -621,6 +621,8 @@ static int clk_wzrd_remove(struct platform_device *pdev)static const struct of_device_id clk_wzrd_ids[] = { { .compatible ="xlnx,clocking-wizard" }, + { .compatible ="xlnx,clocking-wizard-v5.2" }, + { .compatible ="xlnx,clocking-wizard-v6.0" }, { }, };MODULE_DEVICE_TABLE (of, clk_wzrd_ids);
Signature · 1 line
2.17.1
Re: [PATCH v14 5/5] clk: clocking-wizard: Update the compatible
Quoting Shubhrajyoti Datta (2022-04-11 03:04:43)
Quoted 4 lines
Update the compatible to indicate support for both 5.2 and 6.0
Signed-off-by Shubhrajyoti Datta <[email protected]>---
Applied to clk-next
[AMD Official Use Only - General]
Gentle ping.
-----Original Message-----
From: Shubhrajyoti Datta <[email protected]>
Sent: Monday, April 11, 2022 3:35 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Shubhrajyoti Datta <[email protected]>
Subject: [PATCH v14 0/5] clk: clocking-wizard: Driver updates
The patch does the following
Update the versions of the clocking wizard ip.
Move from staging to clk directory.
Update the bindings.
v12:
No change.
Rebased
v13:
Update the clocking compatible
Add the change removing the driver from staging
v14:
Moved to the xilinx folder
Shubhrajyoti Datta (5):
dt-bindings: add documentation of xilinx clocking wizard
clk: clocking-wizard: Add the clockwizard to clk directory
clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
clk: clocking-wizard: Fix the reconfig for 5.2
clk: clocking-wizard: Update the compatible
.../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++
drivers/clk/xilinx/Kconfig | 11 +++
drivers/clk/xilinx/Makefile | 1 +
.../xilinx}/clk-xlnx-clock-wizard.c | 19 +++--
drivers/staging/Kconfig | 2 -
drivers/staging/Makefile | 1 -
drivers/staging/clocking-wizard/Kconfig | 10 ---
drivers/staging/clocking-wizard/Makefile | 2 -
drivers/staging/clocking-wizard/TODO | 13 ----
.../staging/clocking-wizard/dt-binding.txt | 30 --------
10 files changed, 103 insertions(+), 63 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yaml
rename drivers/{staging/clocking-wizard => clk/xilinx}/clk-xlnx-clock-wizard.c (96%) delete mode 100644 drivers/staging/clocking-wizard/Kconfig
delete mode 100644 drivers/staging/clocking-wizard/Makefile
delete mode 100644 drivers/staging/clocking-wizard/TODO
delete mode 100644 drivers/staging/clocking-wizard/dt-binding.txt--
2.17.1
Michal Simek
maintainerHi Stephen and Michael,
Quoted 32 lines · Shubhrajyoti Datta
The patch does the following
Update the versions of the clocking wizard ip.
Move from staging to clk directory.
Update the bindings.v12:
No change.
Rebased
v13:
Update the clocking compatible
Add the change removing the driver from staging
v14:
Moved to the xilinx folderShubhrajyoti Datta (5):
dt-bindings: add documentation of xilinx clocking wizard
clk: clocking-wizard: Add the clockwizard to clk directory
clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
clk: clocking-wizard: Fix the reconfig for 5.2
clk: clocking-wizard: Update the compatible.../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++ drivers/clk/xilinx/Kconfig | 11 +++ drivers/clk/xilinx/Makefile | 1 + .../xilinx}/clk-xlnx-clock-wizard.c | 19 +++-- drivers/staging/Kconfig | 2 - drivers/staging/Makefile | 1 - drivers/staging/clocking-wizard/Kconfig | 10 --- drivers/staging/clocking-wizard/Makefile | 2 - drivers/staging/clocking-wizard/TODO | 13 ---- .../staging/clocking-wizard/dt-binding.txt | 30 -------- 10 files changed, 103 insertions(+), 63 deletions(-)
Quoted 7 lines
create mode 100644
Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yamlrenamedrivers/{staging/clocking-wizard=>clk/xilinx}/clk-xlnx-clock-wizard.c(96%) delete mode 100644drivers/staging/clocking-wizard/Kconfig
delete mode 100644drivers/staging/clocking-wizard/Makefile
delete mode 100644drivers/staging/clocking-wizard/TODO
delete mode 100644drivers/staging/clocking-wizard/dt-binding.txt
I was looking at comment in v13 and moving to xilinx folder was done in v14.
v13: https://lore.kernel.org/r/[email protected]
dt binding is also reviewed by Rob already.
You asked there to get confirmation from Greg that it can be moved out of staging. I didn't see any reply from Greg about it but not sure if this is really required to get.
Greg: Can you please ACK it or comment?
And in your v13 reply you said that you will pick it up
https://lore.kernel.org/all/[email protected]/#t
but I can't see this patch in your linux clk tree yet.
I have also see that some people are sending you pull requests to merge it to clock tree. If this is something what you prefer I have really not a problem to do it.
Thanks,
Michal
Quoted 46 lines · Michal Simek
Hi Stephen and Michael,
Quoted 32 lines · Shubhrajyoti Datta
The patch does the following
Update the versions of the clocking wizard ip.
Move from staging to clk directory.
Update the bindings.v12:
No change.
Rebased
v13:
Update the clocking compatible
Add the change removing the driver from staging
v14:
Moved to the xilinx folderShubhrajyoti Datta (5):
dt-bindings: add documentation of xilinx clocking wizard
clk: clocking-wizard: Add the clockwizard to clk directory
clk: clocking-wizard: Rename nr-outputs to xlnx,nr-outputs
clk: clocking-wizard: Fix the reconfig for 5.2
clk: clocking-wizard: Update the compatible.../bindings/clock/xlnx,clocking-wizard.yaml | 77 +++++++++++++++++++ drivers/clk/xilinx/Kconfig | 11 +++ drivers/clk/xilinx/Makefile | 1 + .../xilinx}/clk-xlnx-clock-wizard.c | 19 +++-- drivers/staging/Kconfig | 2 - drivers/staging/Makefile | 1 - drivers/staging/clocking-wizard/Kconfig | 10 --- drivers/staging/clocking-wizard/Makefile | 2 - drivers/staging/clocking-wizard/TODO | 13 ---- .../staging/clocking-wizard/dt-binding.txt | 30 -------- 10 files changed, 103 insertions(+), 63 deletions(-)Quoted 7 lines
create mode 100644
Documentation/devicetree/bindings/clock/xlnx,clocking-wizard.yamlrenamedrivers/{staging/clocking-wizard=>clk/xilinx}/clk-xlnx-clock-wizard.c(96%) delete mode 100644drivers/staging/clocking-wizard/Kconfig
delete mode 100644drivers/staging/clocking-wizard/Makefile
delete mode 100644drivers/staging/clocking-wizard/TODO
delete mode 100644drivers/staging/clocking-wizard/dt-binding.txtI was looking at comment in v13 and moving to xilinx folder was done in v14.
v13: https://lore.kernel.org/r/[email protected]
Quoted 6 lines
dt binding is also reviewed by Rob already.
You asked there to get confirmation from Greg that it can be moved out of staging. I didn't see any reply from Greg about it but not sure if this is really required to get.
Greg: Can you please ACK it or comment?
No objection from me if others want to maintainer it in their portion of the kernel tree: