From: Harry Austen <hpausten@protonmail.com>
To: "Datta, Shubhrajyoti" <shubhrajyoti.datta@amd.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"Simek, Michal" <michal.simek@amd.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dave Ertman <david.m.ertman@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 6/9] clk: clocking-wizard: add user clock monitor support
Date: Tue, 20 Aug 2024 18:30:33 +0000 [thread overview]
Message-ID: <D3KYBAJXSWWV.3S8LKAX01TCAM@protonmail.com> (raw)
In-Reply-To: <SA1PR12MB89477EFB7053170705AB6591818C2@SA1PR12MB8947.namprd12.prod.outlook.com>
On Mon Aug 19, 2024 at 1:39 PM BST, Datta, Shubhrajyoti wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> > -----Original Message-----
...
> >
> > -static const struct versal_clk_data versal_data = {
> > - .is_versal = true,
> > +static const struct clk_wzrd_data version_6_0_data = {
> > + .is_versal = false,
> > + .supports_monitor = true,
> > };
>
> The clocking wizard monitor support is a design choice.
> This will enable it for all the designs.
But the interrupt still has to be described in devicetree for the auxiliary/UIO
device to be registered. The interrupt is only used by the core for the clock
monitor functionality, so if that functionality is not built into the hardware,
then the interrupt description should be omitted. Does that not sound sensible
to you?
>
> >
> > +static const struct clk_wzrd_data versal_data = {
> > + .is_versal = true,
> > + .supports_monitor = true,
> > +};
>
>
> Same here.
Same reasoning as above.
Thanks for the review!
Harry
>
> > +
> > +static void clk_wzrd_unregister_adev(void *_adev) {
> > + struct auxiliary_device *adev = _adev;
> > +
> > + auxiliary_device_delete(adev);
> > + auxiliary_device_uninit(adev);
> > +}
> > +
> > +static int clk_wzrd_setup_monitor(struct platform_device *pdev) {
> > + struct device *dev = &pdev->dev;
> > + const struct clk_wzrd_data *data = device_get_match_data(dev);
> > + struct clk_wzrd *clk_wzrd = dev_get_drvdata(dev);
> > + struct auxiliary_device *adev = &clk_wzrd->adev;
> > + int ret;
> > +
> > + if (!data || !data->supports_monitor)
> > + return 0;
> > +
> > + adev->name = "clk-mon";
> > + adev->dev.parent = dev;
> > + adev->dev.platform_data = (__force void *)clk_wzrd->base;
> > +
> > + ret = auxiliary_device_init(adev);
> > + if (ret)
> > + return ret;
> > +
> > + ret = auxiliary_device_add(adev);
> > + if (ret) {
> > + auxiliary_device_uninit(adev);
> > + return ret;
> > + }
> > +
> > + return devm_add_action_or_reset(dev, clk_wzrd_unregister_adev,
> > +adev); }
> > +
> > static int clk_wzrd_register_output_clocks(struct device *dev, int
> > nr_outputs) {
> > const char *clkout_name, *clk_name, *clk_mul_name;
> > struct clk_wzrd *clk_wzrd = dev_get_drvdata(dev);
> > u32 regl, regh, edge, regld, reghd, edged, div;
> > - const struct versal_clk_data *data;
> > + const struct clk_wzrd_data *data;
> > unsigned long flags = 0;
> > bool is_versal = false;
> > void __iomem *ctrl_reg;
> > @@ -1170,6 +1216,10 @@ static int clk_wzrd_probe(struct platform_device
> > *pdev)
> > return -EINVAL;
> > }
> >
> > + ret = clk_wzrd_setup_monitor(pdev);
> > + if (ret)
> > + return dev_err_probe(&pdev->dev, ret, "failed to setup
> > + monitor\n");
> > +
> > ret = clk_wzrd_register_output_clocks(&pdev->dev, nr_outputs);
> > if (ret)
> > return ret;
> > @@ -1204,7 +1254,7 @@ static const struct of_device_id clk_wzrd_ids[] = {
> > { .compatible = "xlnx,versal-clk-wizard", .data = &versal_data },
> > { .compatible = "xlnx,clocking-wizard" },
> > { .compatible = "xlnx,clocking-wizard-v5.2" },
> > - { .compatible = "xlnx,clocking-wizard-v6.0" },
> > + { .compatible = "xlnx,clocking-wizard-v6.0", .data =
> > + &version_6_0_data },
> > { },
> > };
> > MODULE_DEVICE_TABLE(of, clk_wzrd_ids);
> > --
> > 2.46.0
> >
next prev parent reply other threads:[~2024-08-20 18:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-03 10:57 [PATCH v2 0/9] clk: clocking-wizard: add user clock monitor support Harry Austen
2024-08-03 10:57 ` [PATCH v2 1/9] clk: clocking-wizard: simplify probe/remove with devres helpers Harry Austen
2024-08-03 10:57 ` [PATCH v2 2/9] clk: clocking-wizard: use newer clk_hw API Harry Austen
2024-08-04 12:27 ` Harry Austen
2024-08-03 10:58 ` [PATCH v2 3/9] clk: clocking-wizard: use devres versions of " Harry Austen
2024-08-03 10:58 ` [PATCH v2 4/9] clk: clocking-wizard: move clock registration to separate function Harry Austen
2024-08-03 10:58 ` [PATCH v2 5/9] dt-bindings: clock: xilinx: add description of user monitor interrupt Harry Austen
2024-08-04 9:04 ` Krzysztof Kozlowski
2024-08-04 12:30 ` Harry Austen
2024-08-03 10:58 ` [PATCH v2 6/9] clk: clocking-wizard: add user clock monitor support Harry Austen
2024-08-19 12:39 ` Datta, Shubhrajyoti
2024-08-20 18:30 ` Harry Austen [this message]
2024-08-03 10:58 ` [PATCH v2 7/9] uio: add Xilinx " Harry Austen
2024-08-03 10:58 ` [PATCH v2 8/9] dt-bindings: clock: xilinx: describe whether dynamic reconfig is enabled Harry Austen
2024-08-04 9:04 ` Krzysztof Kozlowski
2024-08-03 10:58 ` [PATCH v2 9/9] clk: clocking-wizard: move dynamic reconfig setup behind flag Harry Austen
2024-08-04 9:01 ` [PATCH v2 0/9] clk: clocking-wizard: add user clock monitor support Krzysztof Kozlowski
2024-08-04 12:28 ` Harry Austen
2024-08-04 13:58 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D3KYBAJXSWWV.3S8LKAX01TCAM@protonmail.com \
--to=hpausten@protonmail.com \
--cc=conor+dt@kernel.org \
--cc=david.m.ertman@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=shubhrajyoti.datta@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox