* [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps
2021-02-01 15:12 [PATCH v3 0/4] clk: clk-axiclgen: add support for ZynqMP Alexandru Ardelean
@ 2021-02-01 15:12 ` Alexandru Ardelean
2021-02-01 15:15 ` Michal Simek
` (2 more replies)
2021-02-01 15:12 ` [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits Alexandru Ardelean
` (2 subsequent siblings)
3 siblings, 3 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2021-02-01 15:12 UTC (permalink / raw)
To: linux-clk, devicetree, linux-kernel
Cc: mturquette, sboyd, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean, Dragos Bogdan
The intent is to be able to run this driver to access the IP core in setups
where FPGA board is also connected via a PCIe bus. In such cases the number
of combinations explodes, where the host system can be an x86 with Xilinx
Zynq/ZynqMP/Microblaze board connected via PCIe.
Or even a ZynqMP board with a ZynqMP/Zynq/Microblaze connected via PCIe.
To accommodate for these cases, this change removes the limitation for this
driver to be compilable only on Zynq/Microblaze architectures.
And adds dependencies on the mechanisms required by the driver to work (OF
and HAS_IOMEM).
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
drivers/clk/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 85856cff506c..cee1d4e657bc 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -247,7 +247,8 @@ config CLK_TWL6040
config COMMON_CLK_AXI_CLKGEN
tristate "AXI clkgen driver"
- depends on ARCH_ZYNQ || MICROBLAZE || COMPILE_TEST
+ depends on HAS_IOMEM || COMPILE_TEST
+ depends on OF
help
Support for the Analog Devices axi-clkgen pcore clock generator for Xilinx
FPGAs. It is commonly used in Analog Devices' reference designs.
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps
2021-02-01 15:12 ` [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps Alexandru Ardelean
@ 2021-02-01 15:15 ` Michal Simek
2021-02-02 4:21 ` Moritz Fischer
2021-02-09 2:28 ` Stephen Boyd
2 siblings, 0 replies; 12+ messages in thread
From: Michal Simek @ 2021-02-01 15:15 UTC (permalink / raw)
To: Alexandru Ardelean, linux-clk, devicetree, linux-kernel
Cc: mturquette, sboyd, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Dragos Bogdan
On 2/1/21 4:12 PM, Alexandru Ardelean wrote:
> The intent is to be able to run this driver to access the IP core in setups
> where FPGA board is also connected via a PCIe bus. In such cases the number
> of combinations explodes, where the host system can be an x86 with Xilinx
> Zynq/ZynqMP/Microblaze board connected via PCIe.
> Or even a ZynqMP board with a ZynqMP/Zynq/Microblaze connected via PCIe.
>
> To accommodate for these cases, this change removes the limitation for this
> driver to be compilable only on Zynq/Microblaze architectures.
> And adds dependencies on the mechanisms required by the driver to work (OF
> and HAS_IOMEM).
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
> drivers/clk/Kconfig | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 85856cff506c..cee1d4e657bc 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -247,7 +247,8 @@ config CLK_TWL6040
>
> config COMMON_CLK_AXI_CLKGEN
> tristate "AXI clkgen driver"
> - depends on ARCH_ZYNQ || MICROBLAZE || COMPILE_TEST
> + depends on HAS_IOMEM || COMPILE_TEST
> + depends on OF
> help
> Support for the Analog Devices axi-clkgen pcore clock generator for Xilinx
> FPGAs. It is commonly used in Analog Devices' reference designs.
>
Make sense.
Acked-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps
2021-02-01 15:12 ` [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps Alexandru Ardelean
2021-02-01 15:15 ` Michal Simek
@ 2021-02-02 4:21 ` Moritz Fischer
2021-02-09 2:28 ` Stephen Boyd
2 siblings, 0 replies; 12+ messages in thread
From: Moritz Fischer @ 2021-02-02 4:21 UTC (permalink / raw)
To: Alexandru Ardelean
Cc: linux-clk, devicetree, linux-kernel, mturquette, sboyd, robh+dt,
lars, linux-fpga, mdf, ardeleanalex, Dragos Bogdan
On Mon, Feb 01, 2021 at 05:12:42PM +0200, Alexandru Ardelean wrote:
> The intent is to be able to run this driver to access the IP core in setups
> where FPGA board is also connected via a PCIe bus. In such cases the number
> of combinations explodes, where the host system can be an x86 with Xilinx
> Zynq/ZynqMP/Microblaze board connected via PCIe.
> Or even a ZynqMP board with a ZynqMP/Zynq/Microblaze connected via PCIe.
>
> To accommodate for these cases, this change removes the limitation for this
> driver to be compilable only on Zynq/Microblaze architectures.
> And adds dependencies on the mechanisms required by the driver to work (OF
> and HAS_IOMEM).
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
> ---
> drivers/clk/Kconfig | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 85856cff506c..cee1d4e657bc 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -247,7 +247,8 @@ config CLK_TWL6040
>
> config COMMON_CLK_AXI_CLKGEN
> tristate "AXI clkgen driver"
> - depends on ARCH_ZYNQ || MICROBLAZE || COMPILE_TEST
> + depends on HAS_IOMEM || COMPILE_TEST
> + depends on OF
> help
> Support for the Analog Devices axi-clkgen pcore clock generator for Xilinx
> FPGAs. It is commonly used in Analog Devices' reference designs.
> --
> 2.17.1
>
Thanks,
Moritz
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps
2021-02-01 15:12 ` [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps Alexandru Ardelean
2021-02-01 15:15 ` Michal Simek
2021-02-02 4:21 ` Moritz Fischer
@ 2021-02-09 2:28 ` Stephen Boyd
2 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2021-02-09 2:28 UTC (permalink / raw)
To: Alexandru Ardelean, devicetree, linux-clk, linux-kernel
Cc: mturquette, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean, Dragos Bogdan
Quoting Alexandru Ardelean (2021-02-01 07:12:42)
> The intent is to be able to run this driver to access the IP core in setups
> where FPGA board is also connected via a PCIe bus. In such cases the number
> of combinations explodes, where the host system can be an x86 with Xilinx
> Zynq/ZynqMP/Microblaze board connected via PCIe.
> Or even a ZynqMP board with a ZynqMP/Zynq/Microblaze connected via PCIe.
>
> To accommodate for these cases, this change removes the limitation for this
> driver to be compilable only on Zynq/Microblaze architectures.
> And adds dependencies on the mechanisms required by the driver to work (OF
> and HAS_IOMEM).
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits
2021-02-01 15:12 [PATCH v3 0/4] clk: clk-axiclgen: add support for ZynqMP Alexandru Ardelean
2021-02-01 15:12 ` [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps Alexandru Ardelean
@ 2021-02-01 15:12 ` Alexandru Ardelean
2021-02-02 4:22 ` Moritz Fischer
2021-02-09 2:29 ` Stephen Boyd
2021-02-01 15:12 ` [PATCH v3 3/4] dt-bindings: clock: adi,axi-clkgen: add compatible string for ZynqMP support Alexandru Ardelean
2021-02-01 15:12 ` [PATCH v3 4/4] clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand Alexandru Ardelean
3 siblings, 2 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2021-02-01 15:12 UTC (permalink / raw)
To: linux-clk, devicetree, linux-kernel
Cc: mturquette, sboyd, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean, Dragos Bogdan, Mathias Tausen
For ZynqMP (Ultrascale) the PFD and VCO limits are different. In order to
support these, this change adds a compatible string (i.e.
'adi,zynqmp-axi-clkgen-2.00.a') which will take into account for these
limits and apply them.
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Mathias Tausen <mta@gomspace.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
drivers/clk/clk-axi-clkgen.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/clk/clk-axi-clkgen.c b/drivers/clk/clk-axi-clkgen.c
index ad86e031ba3e..9d1b0fc56c73 100644
--- a/drivers/clk/clk-axi-clkgen.c
+++ b/drivers/clk/clk-axi-clkgen.c
@@ -108,6 +108,13 @@ static uint32_t axi_clkgen_lookup_lock(unsigned int m)
return 0x1f1f00fa;
}
+static const struct axi_clkgen_limits axi_clkgen_zynqmp_default_limits = {
+ .fpfd_min = 10000,
+ .fpfd_max = 450000,
+ .fvco_min = 800000,
+ .fvco_max = 1600000,
+};
+
static const struct axi_clkgen_limits axi_clkgen_zynq_default_limits = {
.fpfd_min = 10000,
.fpfd_max = 300000,
@@ -560,6 +567,10 @@ static int axi_clkgen_remove(struct platform_device *pdev)
}
static const struct of_device_id axi_clkgen_ids[] = {
+ {
+ .compatible = "adi,zynqmp-axi-clkgen-2.00.a",
+ .data = &axi_clkgen_zynqmp_default_limits,
+ },
{
.compatible = "adi,axi-clkgen-2.00.a",
.data = &axi_clkgen_zynq_default_limits,
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits
2021-02-01 15:12 ` [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits Alexandru Ardelean
@ 2021-02-02 4:22 ` Moritz Fischer
2021-02-09 2:29 ` Stephen Boyd
1 sibling, 0 replies; 12+ messages in thread
From: Moritz Fischer @ 2021-02-02 4:22 UTC (permalink / raw)
To: Alexandru Ardelean
Cc: linux-clk, devicetree, linux-kernel, mturquette, sboyd, robh+dt,
lars, linux-fpga, mdf, ardeleanalex, Dragos Bogdan,
Mathias Tausen
On Mon, Feb 01, 2021 at 05:12:43PM +0200, Alexandru Ardelean wrote:
> For ZynqMP (Ultrascale) the PFD and VCO limits are different. In order to
> support these, this change adds a compatible string (i.e.
> 'adi,zynqmp-axi-clkgen-2.00.a') which will take into account for these
> limits and apply them.
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Mathias Tausen <mta@gomspace.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Acked-by: Moritz Fischer <mdf@kernel.org>
> ---
> drivers/clk/clk-axi-clkgen.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/clk/clk-axi-clkgen.c b/drivers/clk/clk-axi-clkgen.c
> index ad86e031ba3e..9d1b0fc56c73 100644
> --- a/drivers/clk/clk-axi-clkgen.c
> +++ b/drivers/clk/clk-axi-clkgen.c
> @@ -108,6 +108,13 @@ static uint32_t axi_clkgen_lookup_lock(unsigned int m)
> return 0x1f1f00fa;
> }
>
> +static const struct axi_clkgen_limits axi_clkgen_zynqmp_default_limits = {
> + .fpfd_min = 10000,
> + .fpfd_max = 450000,
> + .fvco_min = 800000,
> + .fvco_max = 1600000,
> +};
> +
> static const struct axi_clkgen_limits axi_clkgen_zynq_default_limits = {
> .fpfd_min = 10000,
> .fpfd_max = 300000,
> @@ -560,6 +567,10 @@ static int axi_clkgen_remove(struct platform_device *pdev)
> }
>
> static const struct of_device_id axi_clkgen_ids[] = {
> + {
> + .compatible = "adi,zynqmp-axi-clkgen-2.00.a",
> + .data = &axi_clkgen_zynqmp_default_limits,
> + },
> {
> .compatible = "adi,axi-clkgen-2.00.a",
> .data = &axi_clkgen_zynq_default_limits,
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits
2021-02-01 15:12 ` [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits Alexandru Ardelean
2021-02-02 4:22 ` Moritz Fischer
@ 2021-02-09 2:29 ` Stephen Boyd
1 sibling, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2021-02-09 2:29 UTC (permalink / raw)
To: Alexandru Ardelean, devicetree, linux-clk, linux-kernel
Cc: mturquette, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean, Dragos Bogdan, Mathias Tausen
Quoting Alexandru Ardelean (2021-02-01 07:12:43)
> For ZynqMP (Ultrascale) the PFD and VCO limits are different. In order to
> support these, this change adds a compatible string (i.e.
> 'adi,zynqmp-axi-clkgen-2.00.a') which will take into account for these
> limits and apply them.
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Mathias Tausen <mta@gomspace.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 3/4] dt-bindings: clock: adi,axi-clkgen: add compatible string for ZynqMP support
2021-02-01 15:12 [PATCH v3 0/4] clk: clk-axiclgen: add support for ZynqMP Alexandru Ardelean
2021-02-01 15:12 ` [PATCH v3 1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps Alexandru Ardelean
2021-02-01 15:12 ` [PATCH v3 2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits Alexandru Ardelean
@ 2021-02-01 15:12 ` Alexandru Ardelean
2021-02-09 2:29 ` Stephen Boyd
2021-02-01 15:12 ` [PATCH v3 4/4] clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand Alexandru Ardelean
3 siblings, 1 reply; 12+ messages in thread
From: Alexandru Ardelean @ 2021-02-01 15:12 UTC (permalink / raw)
To: linux-clk, devicetree, linux-kernel
Cc: mturquette, sboyd, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean
The axi-clkgen driver now supports ZynqMP (UltraScale) as well, however the
driver needs to use different PFD & VCO limits.
For ZynqMP, these needs to be selected by using the
'adi,zynqmp-axi-clkgen-2.00.a' string.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml b/Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml
index 0d06387184d6..983033fe5b17 100644
--- a/Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml
+++ b/Documentation/devicetree/bindings/clock/adi,axi-clkgen.yaml
@@ -20,6 +20,7 @@ properties:
compatible:
enum:
- adi,axi-clkgen-2.00.a
+ - adi,zynqmp-axi-clkgen-2.00.a
clocks:
description:
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 3/4] dt-bindings: clock: adi,axi-clkgen: add compatible string for ZynqMP support
2021-02-01 15:12 ` [PATCH v3 3/4] dt-bindings: clock: adi,axi-clkgen: add compatible string for ZynqMP support Alexandru Ardelean
@ 2021-02-09 2:29 ` Stephen Boyd
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2021-02-09 2:29 UTC (permalink / raw)
To: Alexandru Ardelean, devicetree, linux-clk, linux-kernel
Cc: mturquette, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean
Quoting Alexandru Ardelean (2021-02-01 07:12:44)
> The axi-clkgen driver now supports ZynqMP (UltraScale) as well, however the
> driver needs to use different PFD & VCO limits.
>
> For ZynqMP, these needs to be selected by using the
> 'adi,zynqmp-axi-clkgen-2.00.a' string.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 4/4] clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand
2021-02-01 15:12 [PATCH v3 0/4] clk: clk-axiclgen: add support for ZynqMP Alexandru Ardelean
` (2 preceding siblings ...)
2021-02-01 15:12 ` [PATCH v3 3/4] dt-bindings: clock: adi,axi-clkgen: add compatible string for ZynqMP support Alexandru Ardelean
@ 2021-02-01 15:12 ` Alexandru Ardelean
2021-02-09 2:29 ` Stephen Boyd
3 siblings, 1 reply; 12+ messages in thread
From: Alexandru Ardelean @ 2021-02-01 15:12 UTC (permalink / raw)
To: linux-clk, devicetree, linux-kernel
Cc: mturquette, sboyd, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean
No major functional change. Noticed while checking the driver code that
this could be used.
Saves two lines.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
drivers/clk/clk-axi-clkgen.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/clk-axi-clkgen.c b/drivers/clk/clk-axi-clkgen.c
index 9d1b0fc56c73..ac6ff736ac8f 100644
--- a/drivers/clk/clk-axi-clkgen.c
+++ b/drivers/clk/clk-axi-clkgen.c
@@ -510,7 +510,6 @@ static int axi_clkgen_probe(struct platform_device *pdev)
struct clk_init_data init;
const char *parent_names[2];
const char *clk_name;
- struct resource *mem;
unsigned int i;
int ret;
@@ -522,8 +521,7 @@ static int axi_clkgen_probe(struct platform_device *pdev)
if (!axi_clkgen)
return -ENOMEM;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- axi_clkgen->base = devm_ioremap_resource(&pdev->dev, mem);
+ axi_clkgen->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(axi_clkgen->base))
return PTR_ERR(axi_clkgen->base);
--
2.17.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 4/4] clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand
2021-02-01 15:12 ` [PATCH v3 4/4] clk: axi-clkgen: use devm_platform_ioremap_resource() short-hand Alexandru Ardelean
@ 2021-02-09 2:29 ` Stephen Boyd
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2021-02-09 2:29 UTC (permalink / raw)
To: Alexandru Ardelean, devicetree, linux-clk, linux-kernel
Cc: mturquette, robh+dt, lars, linux-fpga, mdf, ardeleanalex,
Alexandru Ardelean
Quoting Alexandru Ardelean (2021-02-01 07:12:45)
> No major functional change. Noticed while checking the driver code that
> this could be used.
> Saves two lines.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 12+ messages in thread