Message ID | 20230615091757.24686-3-zhuyinbo@loongson.cn |
---|---|
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 k13csp501311vqr; Thu, 15 Jun 2023 02:29:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PXu/NWoutehiT7I1nu0GMjgfI7GJd6XwKfXc3Xgx9tO/qkpKgkTCZaEoaxnD6IeCQT9CB X-Received: by 2002:a05:6a20:8e07:b0:10e:f1e3:8217 with SMTP id y7-20020a056a208e0700b0010ef1e38217mr4156405pzj.17.1686821365897; Thu, 15 Jun 2023 02:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686821365; cv=none; d=google.com; s=arc-20160816; b=vz5pWqiQaRB4DZRU9e6Nlb1BzJwh6UQzJdiT1kymsstrxPj9v0CL3gDNt0NqzPz6bc XTJggPwvx1NzY5DZViWPPAWl5NURtNeaqR1+0PHe9Wut5WizmpcVZN+OmzzuECUhJp7O ngU3oQA0IIxoqA22xnprIAiegutDLUkkYM0ZB8m19uThpR5DvIXGfs6tcJqRcYrisEps zluU8dszsX85heFh7/FbdA4IGHmxiBwrk7ETZD1U/H2pivjeu934O9CSzJqJd+iZwGCL J4LRYiNexxpSW6d6yCU15XqW5gZ82yUwBFWo6cuBeJHm/f/80xRkF0/pq2Cj1cspDkgz 2cQg== 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; bh=723AZ0EXAwi0zqTlYbr4E4ZOZWf0CwSFrsIe5gxthxU=; b=F/0FnG5a92gn9nO0bGrwy2qnSNn5CQlDoi3/CZ1kKOiIpKT1PWF61Q9GJfe17XNbo1 Xc7bAUV6PSIfWMpnqQgVii3eD5RrIYwUFz4APq9BqruAZ2oCytpsFrvqhCholzOGKu2R Sufu23wzoZronL8mi15y8iZbI0v2Rd8l86TvK7ss92Eask6CZihxU0BDpyKkPwTKcEW3 NJZyzRpJcSQQlxw1il2mU8gwVNjZyQKe1piNCXTHoX1L2SMWNwiyaMA9qASLC6ZB/R+d LaWGAYiDGlV7f3BZDYEIfHK43oX0sg1Im2JEA4N6aqa08KLUcXK+kBvWrQKKucuytggY xTpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iy9-20020a170903130900b001ae6b1c3fb6si11987364plb.470.2023.06.15.02.29.10; Thu, 15 Jun 2023 02:29:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245432AbjFOJSU (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Thu, 15 Jun 2023 05:18:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241335AbjFOJSQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 15 Jun 2023 05:18:16 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F2E21BEC; Thu, 15 Jun 2023 02:18:14 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.35]) by gateway (Coremail) with SMTP id _____8DxCepU14pkVYAFAA--.11780S3; Thu, 15 Jun 2023 17:18:12 +0800 (CST) Received: from user-pc.202.106.0.20 (unknown [10.20.42.35]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxVeRH14pkxssbAA--.13716S4; Thu, 15 Jun 2023 17:18:04 +0800 (CST) From: Yinbo Zhu <zhuyinbo@loongson.cn> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, "Rafael J . Wysocki" <rafael@kernel.org>, Pavel Machek <pavel@ucw.cz>, Marc Zyngier <maz@kernel.org>, Arnd Bergmann <arnd@arndb.de>, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev Cc: Jianmin Lv <lvjianmin@loongson.cn>, wanghongliang@loongson.cn, Liu Peibao <liupeibao@loongson.cn>, loongson-kernel@lists.loongnix.cn, Yinbo Zhu <zhuyinbo@loongson.cn> Subject: [PATCH v3 2/3] soc: dt-bindings: add loongson-2 pm Date: Thu, 15 Jun 2023 17:17:56 +0800 Message-Id: <20230615091757.24686-3-zhuyinbo@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230615091757.24686-1-zhuyinbo@loongson.cn> References: <20230615091757.24686-1-zhuyinbo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8DxVeRH14pkxssbAA--.13716S4 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768760400444641402?= X-GMAIL-MSGID: =?utf-8?q?1768760400444641402?= |
Series |
soc: loongson2_pm: add power management support
|
|
Commit Message
Yinbo Zhu
June 15, 2023, 9:17 a.m. UTC
Add the Loongson-2 SoC Power Management Controller binding with DT
schema format using json-schema.
Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn>
---
.../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++
MAINTAINERS | 6 +++
2 files changed, 59 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
Comments
Hey, Rob, could you take a look at this please? On v2 while you were away I was kinda struggling w/ suspend-address & whether it made sense. The v2 & v1 are here: https://lore.kernel.org/all/20230522093156.7108-3-zhuyinbo@loongson.cn/ https://lore.kernel.org/all/20230517073149.31980-3-zhuyinbo@loongson.cn/ On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: > Add the Loongson-2 SoC Power Management Controller binding with DT > schema format using json-schema. > > Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> > --- > .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ > MAINTAINERS | 6 +++ > 2 files changed, 59 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > new file mode 100644 > index 000000000000..32499bd10f8c > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml The filename should ideally match one of the compatibles. > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson-2 Power Manager controller > + > +maintainers: > + - Yinbo Zhu <zhuyinbo@loongson.cn> > + > +properties: > + compatible: > + oneOf: > + - items: > + - enum: > + - loongson,ls2k1000-pmc > + - loongson,ls2k0500-pmc I notice the driver only supports one of these two. Is there a reason for that? > + - const: syscon > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + suspend-address: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: > + The "suspend-address" is a deep sleep state (Suspend To RAM) > + firmware entry address which was jumped from kernel and it's > + value was dependent on specific platform firmware code. In > + addition, the PM need according to it to indicate that current > + SoC whether support Suspend To RAM. > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + pmc: pm@1fe27000 { ^^^ nit: this label isn't used, so you can drop it. Cheers, Conor.
在 2023/6/16 下午2:58, Conor Dooley 写道: > Hey, > > Rob, could you take a look at this please? On v2 while you were away I > was kinda struggling w/ suspend-address & whether it made sense. > > The v2 & v1 are here: > https://lore.kernel.org/all/20230522093156.7108-3-zhuyinbo@loongson.cn/ > https://lore.kernel.org/all/20230517073149.31980-3-zhuyinbo@loongson.cn/ > > On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: >> Add the Loongson-2 SoC Power Management Controller binding with DT >> schema format using json-schema. >> >> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >> --- >> .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ >> MAINTAINERS | 6 +++ >> 2 files changed, 59 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> >> diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> new file mode 100644 >> index 000000000000..32499bd10f8c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > The filename should ideally match one of the compatibles. I learn about that yaml file name need match this compatible, but here using a specific compatible as the name of the yaml file seems a bit inappropriate . After all, this yaml file needs to cover lots of ls2k series SoC rather than a specific SoC, and the yaml file naming in kernel drivers is basically the same that use cover a series SoC's way. > >> @@ -0,0 +1,53 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Loongson-2 Power Manager controller >> + >> +maintainers: >> + - Yinbo Zhu <zhuyinbo@loongson.cn> >> + >> +properties: >> + compatible: >> + oneOf: >> + - items: >> + - enum: >> + - loongson,ls2k1000-pmc >> + - loongson,ls2k0500-pmc > > I notice the driver only supports one of these two. Is there a reason > for that? The driver can support both of the above, and I will add another. > >> + - const: syscon >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> + suspend-address: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + The "suspend-address" is a deep sleep state (Suspend To RAM) >> + firmware entry address which was jumped from kernel and it's >> + value was dependent on specific platform firmware code. In >> + addition, the PM need according to it to indicate that current >> + SoC whether support Suspend To RAM. >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/interrupt-controller/irq.h> >> + >> + pmc: pm@1fe27000 { > ^^^ > > nit: this label isn't used, so you can drop it. This lable need to be used by poweroff and reboot node but I don't add these node that reference pmc here. Thanks, Yinbo
On Fri, Jun 16, 2023 at 03:53:38PM +0800, zhuyinbo wrote: > 在 2023/6/16 下午2:58, Conor Dooley 写道: > > > > Rob, could you take a look at this please? On v2 while you were away I > > was kinda struggling w/ suspend-address & whether it made sense. > > > > The v2 & v1 are here: > > https://lore.kernel.org/all/20230522093156.7108-3-zhuyinbo@loongson.cn/ > > https://lore.kernel.org/all/20230517073149.31980-3-zhuyinbo@loongson.cn/ > > > > On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: > > > Add the Loongson-2 SoC Power Management Controller binding with DT > > > schema format using json-schema. > > > > > > Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> > > > --- > > > .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ > > > MAINTAINERS | 6 +++ > > > 2 files changed, 59 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > > new file mode 100644 > > > index 000000000000..32499bd10f8c > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > > > The filename should ideally match one of the compatibles. > > > I learn about that yaml file name need match this compatible, but here > using a specific compatible as the name of the yaml file seems a bit > inappropriate . After all, this yaml file needs to cover lots of ls2k > series SoC rather than a specific SoC, and the yaml file naming in > kernel drivers is basically the same that use cover a series SoC's way. > > > > > > @@ -0,0 +1,53 @@ > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: Loongson-2 Power Manager controller > > > + > > > +maintainers: > > > + - Yinbo Zhu <zhuyinbo@loongson.cn> > > > + > > > +properties: > > > + compatible: > > > + oneOf: > > > + - items: > > > + - enum: > > > + - loongson,ls2k1000-pmc > > > + - loongson,ls2k0500-pmc > > > > I notice the driver only supports one of these two. Is there a reason > > for that? > > > The driver can support both of the above, and I will add another. The driver only contains static const struct of_device_id loongson2_pm_match[] = { { .compatible = "loongson,ls2k1000-pmc", }, {}, }; so it only supports the 2k1000 right now. Are the 2k1000 and 2k0500 compatible with eachother? > > > + - const: syscon > > > + > > > + reg: > > > + maxItems: 1 > > > + > > > + interrupts: > > > + maxItems: 1 > > > + > > > + suspend-address: > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + description: > > > + The "suspend-address" is a deep sleep state (Suspend To RAM) > > > + firmware entry address which was jumped from kernel and it's > > > + value was dependent on specific platform firmware code. In > > > + addition, the PM need according to it to indicate that current > > > + SoC whether support Suspend To RAM. > > > + > > > +required: > > > + - compatible > > > + - reg > > > + - interrupts > > > + > > > +additionalProperties: false > > > + > > > +examples: > > > + - | > > > + #include <dt-bindings/interrupt-controller/irq.h> > > > + > > > + pmc: pm@1fe27000 { > > ^^^ > > > > nit: this label isn't used, so you can drop it. > > > This lable need to be used by poweroff and reboot node but I don't add > these node that reference pmc here. Right, in the dts it might need those, but not in the example in the binding. Cheers, Conor.
On 15/06/2023 11:17, Yinbo Zhu wrote: > Add the Loongson-2 SoC Power Management Controller binding with DT > schema format using json-schema. > > Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> > --- > .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ > MAINTAINERS | 6 +++ > 2 files changed, 59 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > new file mode 100644 > index 000000000000..32499bd10f8c > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson-2 Power Manager controller > + > +maintainers: > + - Yinbo Zhu <zhuyinbo@loongson.cn> > + > +properties: > + compatible: > + oneOf: Drop oneOf, you don't have here many choices. > + - items: > + - enum: > + - loongson,ls2k1000-pmc > + - loongson,ls2k0500-pmc > + - const: syscon > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + suspend-address: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: > + The "suspend-address" is a deep sleep state (Suspend To RAM) > + firmware entry address which was jumped from kernel and it's > + value was dependent on specific platform firmware code. In > + addition, the PM need according to it to indicate that current > + SoC whether support Suspend To RAM. > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + pmc: pm@1fe27000 { Node name: system-controller or power-pamanagement With these two: Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
在 2023/6/16 下午4:03, Conor Dooley 写道: > On Fri, Jun 16, 2023 at 03:53:38PM +0800, zhuyinbo wrote: >> 在 2023/6/16 下午2:58, Conor Dooley 写道: >>> >>> Rob, could you take a look at this please? On v2 while you were away I >>> was kinda struggling w/ suspend-address & whether it made sense. >>> >>> The v2 & v1 are here: >>> https://lore.kernel.org/all/20230522093156.7108-3-zhuyinbo@loongson.cn/ >>> https://lore.kernel.org/all/20230517073149.31980-3-zhuyinbo@loongson.cn/ >>> >>> On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: >>>> Add the Loongson-2 SoC Power Management Controller binding with DT >>>> schema format using json-schema. >>>> >>>> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >>>> --- >>>> .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ >>>> MAINTAINERS | 6 +++ >>>> 2 files changed, 59 insertions(+) >>>> create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >>>> >>>> diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >>>> new file mode 100644 >>>> index 000000000000..32499bd10f8c >>>> --- /dev/null >>>> +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >>> >>> The filename should ideally match one of the compatibles. >> >> >> I learn about that yaml file name need match this compatible, but here >> using a specific compatible as the name of the yaml file seems a bit >> inappropriate . After all, this yaml file needs to cover lots of ls2k >> series SoC rather than a specific SoC, and the yaml file naming in >> kernel drivers is basically the same that use cover a series SoC's way. >> >>> >>>> @@ -0,0 +1,53 @@ >>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>>> +%YAML 1.2 >>>> +--- >>>> +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# >>>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>>> + >>>> +title: Loongson-2 Power Manager controller >>>> + >>>> +maintainers: >>>> + - Yinbo Zhu <zhuyinbo@loongson.cn> >>>> + >>>> +properties: >>>> + compatible: >>>> + oneOf: >>>> + - items: >>>> + - enum: >>>> + - loongson,ls2k1000-pmc >>>> + - loongson,ls2k0500-pmc >>> >>> I notice the driver only supports one of these two. Is there a reason >>> for that? >> >> >> The driver can support both of the above, and I will add another. > > The driver only contains > static const struct of_device_id loongson2_pm_match[] = { > { .compatible = "loongson,ls2k1000-pmc", }, > {}, > }; > so it only supports the 2k1000 right now. Are the 2k1000 and 2k0500 > compatible with eachother? They are not completely compatible, 2k500 may still require some work to be done, but I can confirm this driver was can compatible 2k0500 and 2k1000. for match yaml file, and I can add 2k0500 compatible in driver. > >>>> + - const: syscon >>>> + >>>> + reg: >>>> + maxItems: 1 >>>> + >>>> + interrupts: >>>> + maxItems: 1 >>>> + >>>> + suspend-address: >>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>> + description: >>>> + The "suspend-address" is a deep sleep state (Suspend To RAM) >>>> + firmware entry address which was jumped from kernel and it's >>>> + value was dependent on specific platform firmware code. In >>>> + addition, the PM need according to it to indicate that current >>>> + SoC whether support Suspend To RAM. >>>> + >>>> +required: >>>> + - compatible >>>> + - reg >>>> + - interrupts >>>> + >>>> +additionalProperties: false >>>> + >>>> +examples: >>>> + - | >>>> + #include <dt-bindings/interrupt-controller/irq.h> >>>> + >>>> + pmc: pm@1fe27000 { >>> ^^^ >>> >>> nit: this label isn't used, so you can drop it. >> >> >> This lable need to be used by poweroff and reboot node but I don't add >> these node that reference pmc here. > > Right, in the dts it might need those, but not in the example in the > binding. okay, I got it. Thanks, Yinbo
在 2023/6/16 下午4:03, Krzysztof Kozlowski 写道: > On 15/06/2023 11:17, Yinbo Zhu wrote: >> Add the Loongson-2 SoC Power Management Controller binding with DT >> schema format using json-schema. >> >> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >> --- >> .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ >> MAINTAINERS | 6 +++ >> 2 files changed, 59 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> >> diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> new file mode 100644 >> index 000000000000..32499bd10f8c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> @@ -0,0 +1,53 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Loongson-2 Power Manager controller >> + >> +maintainers: >> + - Yinbo Zhu <zhuyinbo@loongson.cn> >> + >> +properties: >> + compatible: >> + oneOf: > > Drop oneOf, you don't have here many choices. okay, I got it. > >> + - items: >> + - enum: >> + - loongson,ls2k1000-pmc >> + - loongson,ls2k0500-pmc >> + - const: syscon >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> + suspend-address: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + The "suspend-address" is a deep sleep state (Suspend To RAM) >> + firmware entry address which was jumped from kernel and it's >> + value was dependent on specific platform firmware code. In >> + addition, the PM need according to it to indicate that current >> + SoC whether support Suspend To RAM. >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/interrupt-controller/irq.h> >> + >> + pmc: pm@1fe27000 { > > Node name: system-controller or power-pamanagement > > With these two: > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> okay, I will do it. Thanks, Yinbo
On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: > Add the Loongson-2 SoC Power Management Controller binding with DT > schema format using json-schema. > > Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> > --- > .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ > MAINTAINERS | 6 +++ > 2 files changed, 59 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > > diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > new file mode 100644 > index 000000000000..32499bd10f8c > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Loongson-2 Power Manager controller > + > +maintainers: > + - Yinbo Zhu <zhuyinbo@loongson.cn> > + > +properties: > + compatible: > + oneOf: > + - items: > + - enum: > + - loongson,ls2k1000-pmc > + - loongson,ls2k0500-pmc > + - const: syscon > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + suspend-address: loongson,suspend-address > + $ref: /schemas/types.yaml#/definitions/uint32 Isn't this a 64-bit platform? Probably better if this is a 64-bit value in case that's needed in the future. > + description: > + The "suspend-address" is a deep sleep state (Suspend To RAM) > + firmware entry address which was jumped from kernel and it's > + value was dependent on specific platform firmware code. In > + addition, the PM need according to it to indicate that current > + SoC whether support Suspend To RAM. > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + pmc: pm@1fe27000 { > + compatible = "loongson,ls2k1000-pmc", "syscon"; > + reg = <0x1fe27000 0x58>; > + interrupt-parent = <&liointc1>; > + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; > + suspend-address = <0x1c000500>; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index 7a91f14cad2e..bcd05f1fa5c1 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -12190,6 +12190,12 @@ S: Maintained > F: Documentation/devicetree/bindings/hwinfo/loongson,ls2k-chipid.yaml > F: drivers/soc/loongson/loongson2_guts.c > > +LOONGSON-2 SOC SERIES PM DRIVER > +M: Yinbo Zhu <zhuyinbo@loongson.cn> > +L: linux-pm@vger.kernel.org > +S: Maintained > +F: Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml > + > LOONGSON-2 SOC SERIES PINCTRL DRIVER > M: zhanghongchen <zhanghongchen@loongson.cn> > M: Yinbo Zhu <zhuyinbo@loongson.cn> > -- > 2.20.1 >
在 2023/6/16 下午11:17, Rob Herring 写道: > On Thu, Jun 15, 2023 at 05:17:56PM +0800, Yinbo Zhu wrote: >> Add the Loongson-2 SoC Power Management Controller binding with DT >> schema format using json-schema. >> >> Signed-off-by: Yinbo Zhu <zhuyinbo@loongson.cn> >> --- >> .../soc/loongson/loongson,ls2k-pmc.yaml | 53 +++++++++++++++++++ >> MAINTAINERS | 6 +++ >> 2 files changed, 59 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> >> diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> new file mode 100644 >> index 000000000000..32499bd10f8c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml >> @@ -0,0 +1,53 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Loongson-2 Power Manager controller >> + >> +maintainers: >> + - Yinbo Zhu <zhuyinbo@loongson.cn> >> + >> +properties: >> + compatible: >> + oneOf: >> + - items: >> + - enum: >> + - loongson,ls2k1000-pmc >> + - loongson,ls2k0500-pmc >> + - const: syscon >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> + suspend-address: > > loongson,suspend-address okay, I will use it. > >> + $ref: /schemas/types.yaml#/definitions/uint32 > > Isn't this a 64-bit platform? Probably better if this is a 64-bit value > in case that's needed in the future. okay, I got it. Thanks, Yinbo
diff --git a/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml new file mode 100644 index 000000000000..32499bd10f8c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/loongson/loongson,ls2k-pmc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Loongson-2 Power Manager controller + +maintainers: + - Yinbo Zhu <zhuyinbo@loongson.cn> + +properties: + compatible: + oneOf: + - items: + - enum: + - loongson,ls2k1000-pmc + - loongson,ls2k0500-pmc + - const: syscon + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + suspend-address: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The "suspend-address" is a deep sleep state (Suspend To RAM) + firmware entry address which was jumped from kernel and it's + value was dependent on specific platform firmware code. In + addition, the PM need according to it to indicate that current + SoC whether support Suspend To RAM. + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + pmc: pm@1fe27000 { + compatible = "loongson,ls2k1000-pmc", "syscon"; + reg = <0x1fe27000 0x58>; + interrupt-parent = <&liointc1>; + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; + suspend-address = <0x1c000500>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 7a91f14cad2e..bcd05f1fa5c1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12190,6 +12190,12 @@ S: Maintained F: Documentation/devicetree/bindings/hwinfo/loongson,ls2k-chipid.yaml F: drivers/soc/loongson/loongson2_guts.c +LOONGSON-2 SOC SERIES PM DRIVER +M: Yinbo Zhu <zhuyinbo@loongson.cn> +L: linux-pm@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml + LOONGSON-2 SOC SERIES PINCTRL DRIVER M: zhanghongchen <zhanghongchen@loongson.cn> M: Yinbo Zhu <zhuyinbo@loongson.cn>