diff mbox series

[v3,2/4] clk: clk-axiclkgen: add ZynqMP PFD and VCO limits

Message ID 20210201151245.21845-3-alexandru.ardelean@analog.com
State New
Headers show
Series [v3,1/4] clk: axi-clkgen: replace ARCH dependencies with driver deps | expand

Commit Message

Alexandru Ardelean Feb. 1, 2021, 3:12 p.m. UTC
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(+)

Comments

Moritz Fischer Feb. 2, 2021, 4:22 a.m. UTC | #1
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

>
Stephen Boyd Feb. 9, 2021, 2:29 a.m. UTC | #2
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
diff mbox series

Patch

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,