netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Varshini.Rajendran@microchip.com>
To: <conor@kernel.org>, <Nicolas.Ferre@microchip.com>
Cc: <krzysztof.kozlowski@linaro.org>, <tglx@linutronix.de>,
	<maz@kernel.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<alexandre.belloni@bootlin.com>, <Claudiu.Beznea@microchip.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <gregkh@linuxfoundation.org>,
	<linux@armlinux.org.uk>, <mturquette@baylibre.com>,
	<sboyd@kernel.org>, <sre@kernel.org>, <broonie@kernel.org>,
	<arnd@arndb.de>, <gregory.clement@bootlin.com>,
	<sudeep.holla@arm.com>, <Balamanikandan.Gunasundar@microchip.com>,
	<Mihai.Sain@microchip.com>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-pm@vger.kernel.org>, <Hari.PrasathGE@microchip.com>,
	<Cristian.Birsan@microchip.com>, <Durai.ManickamKR@microchip.com>,
	<Manikandan.M@microchip.com>, <Dharma.B@microchip.com>,
	<Nayabbasha.Sayed@microchip.com>, <Balakrishnan.S@microchip.com>
Subject: Re: [PATCH 17/21] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7
Date: Fri, 16 Jun 2023 17:32:30 +0000	[thread overview]
Message-ID: <ca473333-efde-9885-1a22-92bda28d1770@microchip.com> (raw)
In-Reply-To: <20230605-sedan-gimmick-6381f121cc0a@spud>

On 05/06/23 6:56 pm, Conor Dooley wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> Hey,
> 
> On Mon, Jun 05, 2023 at 03:04:34PM +0200, Nicolas Ferre wrote:
>> On 05/06/2023 at 08:43, Krzysztof Kozlowski wrote:
>>> On 03/06/2023 22:02, Varshini Rajendran wrote:
>>>> Use sam9x7 pmc's compatible to lookup for in the SHDWC driver
>>>>
>>>> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
>>>> ---
>>>>   drivers/power/reset/at91-sama5d2_shdwc.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
>>>> index d8ecffe72f16..d0f29b99f25e 100644
>>>> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
>>>> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
>>>> @@ -326,6 +326,7 @@ static const struct of_device_id at91_pmc_ids[] = {
>>>>        { .compatible = "atmel,sama5d2-pmc" },
>>>>        { .compatible = "microchip,sam9x60-pmc" },
>>>>        { .compatible = "microchip,sama7g5-pmc" },
>>>> +     { .compatible = "microchip,sam9x7-pmc" },
>>>
>>> Why do you need new entry if these are compatible?
>>
>> Yes, PMC is very specific to a SoC silicon. As we must look for it in the
>> shutdown controller, I think we need a new entry here.
> 
> Copy-pasting this for a wee bit of context as I have two questions.
> 
> | static const struct of_device_id at91_shdwc_of_match[] = {
> | 	{
> | 		.compatible = "atmel,sama5d2-shdwc",
> | 		.data = &sama5d2_reg_config,
> | 	},
> | 	{
> | 		.compatible = "microchip,sam9x60-shdwc",
> | 		.data = &sam9x60_reg_config,
> | 	},
> | 	{
> | 		.compatible = "microchip,sama7g5-shdwc",
> | 		.data = &sama7g5_reg_config,
> | 	}, {
> | 		/*sentinel*/
> | 	}
> | };
> | MODULE_DEVICE_TABLE(of, at91_shdwc_of_match);
> | 
> | static const struct of_device_id at91_pmc_ids[] = {
> | 	{ .compatible = "atmel,sama5d2-pmc" },
> | 	{ .compatible = "microchip,sam9x60-pmc" },
> | 	{ .compatible = "microchip,sama7g5-pmc" },
> | 	{ .compatible = "microchip,sam9x7-pmc" },
> | 	{ /* Sentinel. */ }
> | };
> 
> If there's no changes made to the code, other than adding an entry to
> the list of pmc compatibles, then either this has the same as an
> existing SoC, or there is a bug in the patch, since the behaviour of
> the driver will not have changed.
> 
> Secondly, this patch only updates the at91_pmc_ids and the dts patch
> contains:
> | shutdown_controller: shdwc@fffffe10 {
> | 	compatible = "microchip,sam9x60-shdwc";
> | 	reg = <0xfffffe10 0x10>;
> | 	clocks = <&clk32k 0>;
> | 	#address-cells = <1>;
> | 	#size-cells = <0>;
> | 	atmel,wakeup-rtc-timer;
> | 	atmel,wakeup-rtt-timer;
> | 	status = "disabled";
> | };
> 
> ...which would mean that the there's nothing different between the
> programming models for the sam9x60 and sam9x7. If that's the case, the
> dt-binding & dts should list the sam9x60 as a fallback for the sam9x7 &
> there is no change required to the driver. If it's not the case, then
> there's a bug in this patch and the dts one 😄
> 
> In general, if things are the same as previous products, there's no need
> to change the drivers at all & just add fallback compatibles to the
> bindings and dts. IFF some difference pops up in the future, then the
> sam9x7 compatible will already exist in the dts, and can then be added
> to the driver.

Yes. I totally agree with you. In this patch I have not added a 
compatible for the shutdown controller for sam9x7. I have added the 
compatible of the pmc used in sam9x7 in the list of compatibles to use 
the right pmc driver in order to control the clk disable functions for 
the right pmc. The shutdown programming is no different, so no new 
compatible for sam9x7 (like microchip,sam9x7-shdwc). But the PMC is 
totally different than the other older SoCs, hence I have added the new 
compatible microchip,sam9x7-pmc in the list as it is defined in the 
drivers/clk/at91/sam9x7.c driver. Hope this is clear.

> 
> Cheers,
> Conor.
> 

-- 
Thanks and Regards,
Varshini Rajendran.


  reply	other threads:[~2023-06-16 17:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03 20:02 [PATCH 00/21] Add support for sam9x7 SoC family Varshini Rajendran
2023-06-03 20:02 ` [PATCH 01/21] dt-bindings: microchip: atmel,at91rm9200-tcb: add sam9x60 compatible Varshini Rajendran
2023-06-05  6:35   ` Krzysztof Kozlowski
2023-06-05  7:04     ` Arnd Bergmann
2023-06-05  7:34       ` Krzysztof Kozlowski
2023-06-05 12:03       ` Nicolas Ferre
2023-06-14 19:37   ` Rob Herring
2023-06-03 20:02 ` [PATCH 02/21] dt-bindings: usb: ehci: Add atmel at91sam9g45-ehci compatible Varshini Rajendran
2023-06-14 19:38   ` Rob Herring
2023-06-03 20:02 ` [PATCH 03/21] dt-bindings: usb: generic-ehci: Document clock-names property Varshini Rajendran
2023-06-03 21:15   ` Conor Dooley
2023-06-05 12:54     ` Nicolas Ferre
2023-06-05  6:36   ` Krzysztof Kozlowski
2023-06-03 20:02 ` [PATCH 04/21] ARM: dts: at91: sam9x7: add device tree for soc Varshini Rajendran
2023-06-03 21:35   ` Conor Dooley
2023-06-05  6:39   ` Krzysztof Kozlowski
2023-06-05  6:41   ` Krzysztof Kozlowski
2023-06-09  5:35   ` Dharma.B
2023-06-15  7:36   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 05/21] ARM: configs: at91: enable config flags for sam9x7 SoC Varshini Rajendran
2023-06-03 20:02 ` [PATCH 06/21] ARM: configs: at91: add mcan support Varshini Rajendran
2023-06-05  6:40   ` Krzysztof Kozlowski
2023-06-03 20:02 ` [PATCH 07/21] ARM: configs: at91: Enable csi and isc support Varshini Rajendran
2023-06-03 20:02 ` [PATCH 08/21] ARM: at91: pm: add support for sam9x7 soc family Varshini Rajendran
2023-06-15  7:42   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 09/21] ARM: at91: pm: add sam9x7 soc init config Varshini Rajendran
2023-06-15  7:43   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 10/21] ARM: at91: Kconfig: add config flag for SAM9X7 SoC Varshini Rajendran
2023-06-15  7:46   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 11/21] ARM: at91: add support in soc driver for new sam9x7 Varshini Rajendran
2023-06-15  7:48   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 12/21] clk: at91: clk-sam9x60-pll: re-factor to support individual core freq outputs Varshini Rajendran
2023-06-15  7:54   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 13/21] clk: at91: sam9x7: add support for HW PLL freq dividers Varshini Rajendran
2023-06-15  8:00   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 14/21] clk: at91: sam9x7: add sam9x7 pmc driver Varshini Rajendran
2023-06-04 18:00   ` Simon Horman
2023-06-15  8:39   ` Claudiu.Beznea
2023-06-03 20:02 ` [PATCH 15/21] dt-bindings: irqchip/atmel-aic5: Add support for sam9x7 aic Varshini Rajendran
2023-06-03 21:19   ` Conor Dooley
2023-06-03 21:23     ` Conor Dooley
2023-06-04  9:49       ` Arnd Bergmann
2023-06-04 21:08         ` Conor Dooley
2023-06-05 12:37           ` Nicolas Ferre
2023-06-14 19:41             ` Rob Herring
2023-06-03 20:02 ` [PATCH 16/21] " Varshini Rajendran
2023-06-03 20:02 ` [PATCH 17/21] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Varshini Rajendran
2023-06-05  6:43   ` Krzysztof Kozlowski
2023-06-05 13:04     ` Nicolas Ferre
2023-06-05 13:26       ` Conor Dooley
2023-06-16 17:32         ` Varshini.Rajendran [this message]
2023-06-05 13:33       ` Krzysztof Kozlowski
2023-06-03 20:02 ` [PATCH 18/21] power: reset: at91-reset: add reset support for sam9x7 soc Varshini Rajendran
2023-06-03 20:02 ` [PATCH 19/21] power: reset: at91-reset: add sdhwc " Varshini Rajendran
2023-06-03 20:02 ` [PATCH 20/21] dt-bindings: net: cdns,macb: add documentation for sam9x7 ethernet interface Varshini Rajendran
2023-06-05  6:42   ` Krzysztof Kozlowski
2023-06-14 19:42   ` Rob Herring
2023-06-03 20:02 ` [PATCH 21/21] net: macb: add support for gmac to sam9x7 Varshini Rajendran
2023-06-05  6:42   ` Krzysztof Kozlowski
2023-06-05 12:07     ` Nicolas Ferre
2023-06-05 12:21       ` Arnd Bergmann
2023-06-05 13:34       ` 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=ca473333-efde-9885-1a22-92bda28d1770@microchip.com \
    --to=varshini.rajendran@microchip.com \
    --cc=Balakrishnan.S@microchip.com \
    --cc=Balamanikandan.Gunasundar@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Cristian.Birsan@microchip.com \
    --cc=Dharma.B@microchip.com \
    --cc=Durai.ManickamKR@microchip.com \
    --cc=Hari.PrasathGE@microchip.com \
    --cc=Manikandan.M@microchip.com \
    --cc=Mihai.Sain@microchip.com \
    --cc=Nayabbasha.Sayed@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maz@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sre@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).