Message ID | 20230603200243.243878-18-varshini.rajendran@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1840755vqr; Sat, 3 Jun 2023 13:55:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yQmWr4HUptLN9sbbxT3Sv52fAJ3vG1FZdk7xq1VRL6to/nAaycTIYumnEMIw9YOjqzi37 X-Received: by 2002:a05:6808:185:b0:398:596d:69da with SMTP id w5-20020a056808018500b00398596d69damr3547287oic.22.1685825713822; Sat, 03 Jun 2023 13:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685825713; cv=none; d=google.com; s=arc-20160816; b=hyoHRsZTd59yFCjXj+jAdunm7/AiQug8zh/u8lcMJgepqOQZzXXPeuOFuKXhx+Fm4A KJLM+W9IYRFdOkePgy3WBOjTuB7CPirY9N1XyFtWrUXulEf4FNetttpZDl1VDG8qWH5P XWk3i+sZ7FxUA1wDK3v9ihwllOcQpLv/d6fQMX/IiEkdJ77irpxQq07eYiqpb8FYXoS7 68CgM2LXL2U31781owXgPMwP7BMo211MO6E2KXiRoZ2npQ3gVnNl7wDiZPL1cUu5lYxQ MKSpxei+rzzvRUowIEEwWFoDETN6i5lyvFpctnPSO5pkxCeNsrWsZDLaWz80trjmnQN2 5vyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=24YhhMLHXfxx86xtm+4ZrHbzhkmTlgdDOpps2vZDAvI=; b=b1L4RJe4crJMrGUBIZduEUyjY/lsQyvQSrenPJPYc1qj3nxG6lJmBqbcFAkmBt4kUH JbTLC+IVjgPN71Jirg0yrJ+ODZoXc2DEE4M+rQfbE67jBlEe/7LbHkJ9jJvRRKg4svhi N0HUkAXlTNQKZTjKVdYjZfHfEAvPnh+HNCXe+MyrILRqwfYmCV0ApkhNKuu8ow5HBqEL yO7lr0N89bfHxzmT/wXN96bEOQKq3eaGf9ld/y6yqQLje7m0kWUpRXe7FVTHNIb91a8M +EZTs0x+KxkkprxclhHbqZc6CWxYbgTg98AINmdpehs+EubbFV2JqWTTJ4ZxUhCumzG/ ef3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=rejHNRNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a17090a2e1000b00258d8f6eabdsi3428373pjd.66.2023.06.03.13.55.01; Sat, 03 Jun 2023 13:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=rejHNRNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232019AbjFCUJO (ORCPT <rfc822;stefanalexe802@gmail.com> + 99 others); Sat, 3 Jun 2023 16:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbjFCUIq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 3 Jun 2023 16:08:46 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 209A5E72; Sat, 3 Jun 2023 13:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1685822876; x=1717358876; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I/f1jUObFYFCHIeGN6WM/0hia6nhdguPMCI/ZjYAFVo=; b=rejHNRNuFgMzZpl1+RRg417UgHmrftDhw5UdMN6tH6xPUKXWVb5LMmhL QBTeHEGQvi74/z1qT3tVfkTg1OTrpyOQECSUKfZ0rVpY4sObOxhOp7SrA y+nMPqViIqTgwckNiEgz+oDsYhGOsrMEx9jvuP9gmt5EuqW6YRIIEycZp ILhEt1kiZpaKHGSIdUwnPFwQW+po7oXHFamNh6XNPZ8Spdc+ZJH+ZAL7H jZ6tB5Y97INhrP/mfqEzvLKNx2GiXyJKP4A+sGANdThrm5TEP16XhCrdP iqYgr9iHgU6ZgOwaoA5TKTrbGnxNiKqAwN38KqNpYbgB5K8xT5MrYJecs g==; X-IronPort-AV: E=Sophos;i="6.00,216,1681196400"; d="scan'208";a="155388408" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Jun 2023 13:06:48 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sat, 3 Jun 2023 13:06:48 -0700 Received: from che-lt-i67070.amer.actel.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Sat, 3 Jun 2023 13:06:36 -0700 From: Varshini Rajendran <varshini.rajendran@microchip.com> To: <tglx@linutronix.de>, <maz@kernel.org>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <nicolas.ferre@microchip.com>, <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>, <varshini.rajendran@microchip.com>, <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> CC: <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: [PATCH 17/21] power: reset: at91-poweroff: lookup for proper pmc dt node for sam9x7 Date: Sun, 4 Jun 2023 01:32:39 +0530 Message-ID: <20230603200243.243878-18-varshini.rajendran@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230603200243.243878-1-varshini.rajendran@microchip.com> References: <20230603200243.243878-1-varshini.rajendran@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767716384015213565?= X-GMAIL-MSGID: =?utf-8?q?1767716384015213565?= |
Series |
Add support for sam9x7 SoC family
|
|
Commit Message
Varshini Rajendran
June 3, 2023, 8:02 p.m. UTC
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(+)
Comments
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? Best regards, Krzysztof
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. Best regards, Nicolas
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. Cheers, Conor.
On 05/06/2023 15:04, 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. ??? How does it answer to my question at all? What is exactly specific which warrants new entry? Best regards, Krzysztof
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.
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" }, { /* Sentinel. */ } };