Message ID | 20230517073149.31980-3-zhuyinbo@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp945390vqo; Wed, 17 May 2023 00:36:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JYmgJc4MONqHmUHugxiGDVsPCXl3HvICeuRn+JbF1XJHRSUgxFIvxluz80sSmRTvRiNrJ X-Received: by 2002:a05:6a20:7492:b0:103:aa74:2b6f with SMTP id p18-20020a056a20749200b00103aa742b6fmr25262333pzd.7.1684308970689; Wed, 17 May 2023 00:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684308970; cv=none; d=google.com; s=arc-20160816; b=ThTHSFokwdzZk76EyOkVt4H8kKylqmH+RCtxMhofrGUAeZA7WhHt59XFu+HCYvi7gR /LZ1pnW21wMX4ITn6aTVTRM+Ve0Wcz1CMfOKxQhDEggaiEvg1YtoJyETGxYtWR2fSxmg BR4Ac3TicxvJ7x4JLWdmoOFUk1uIzMTtmuY/586mdA3zjehOFLQjFIhSTz5fj2Rc1hZs 2mpWPgIitaCN5IHc7JHcORe5b/q3BzRu38sBhMWGGh6WbfanJsRU62hiB6SrZYlTWuOH 1bYTYTrFmbqupSpbzoaf2HPM/BAn/toITKqQx1lvVpIEopbcYp7ICyBG/gpnFKTshy/s xILw== 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=eqHxGNKiROawdE2wymPNM0esXKwJBrp+3SftDgSa7aw=; b=J88Aoz/0kLZnqZQeaTe20Wi4jX6A+jjpF7LdJnxO5gCufe2+CzBlJZgmJaoExlCTn4 SQlfdWQES/6oHjHgGhL/ZC21ZGVtrvHG0qODSuOwGsmdWu2ursEVRIFKU4rgapVLuzrd pzz8K0fx0ob8uH/MfunCO5KsEO2qQ2OnyOAeE/gBWxU9oSj/YjIg3i2Z75Kzz+wAbd1A 75iXrOrRrXYGPVwZzGvNWwMZJRlBRqtNcKwYhqysb6WKXRFolfi0gh49Ej60hpB1T00p HPSEI/CW4fjuDm0BUXC3feaiHvfRPtUZCQCPWxjPTkRX9D9/Tw/Ng1EFZbNhHqy1cxk7 OKHw== 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 b15-20020a63340f000000b005303b3da2d1si21572738pga.173.2023.05.17.00.35.55; Wed, 17 May 2023 00:36:10 -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 S230073AbjEQHc1 (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Wed, 17 May 2023 03:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjEQHcC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 17 May 2023 03:32:02 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E8D3519B0; Wed, 17 May 2023 00:31:59 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.35]) by gateway (Coremail) with SMTP id _____8Cx_erugmRkQGoJAA--.16200S3; Wed, 17 May 2023 15:31:58 +0800 (CST) Received: from user-pc.202.106.0.20 (unknown [10.20.42.35]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axmr3lgmRk_1plAA--.41619S4; Wed, 17 May 2023 15:31:56 +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>, Tiezhu Yang <yangtiezhu@loongson.cn>, Marc Zyngier <maz@kernel.org>, Youling Tang <tangyouling@loongson.cn>, Baoqi Zhang <zhangbaoqi@loongson.cn>, Arnd Bergmann <arnd@arndb.de>, Yun Liu <liuyun@loongson.cn>, 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 v1 2/3] dt-bindings: soc: add loongson-2 pm Date: Wed, 17 May 2023 15:31:48 +0800 Message-Id: <20230517073149.31980-3-zhuyinbo@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230517073149.31980-1-zhuyinbo@loongson.cn> References: <20230517073149.31980-1-zhuyinbo@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Axmr3lgmRk_1plAA--.41619S4 X-CM-SenderInfo: 52kx5xhqerqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7ArW7tFy3KryxJrykJFyrZwb_yoW8KFy3p3 ZxCas3KF40qF17Zws5KFy8C3W5ZF95C3ZrXFsrJw17Kr9rJ3WYvw43K3WDZF43Cry8JFW7 uF92krWjgFyUJw7anT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bfkFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUXVWUAwA2ocxC64 kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28E F7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAaw2AFwI0_JF0_Jw1le2I262IYc4CY 6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrV C2j2WlYx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE 7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWUtVW8ZwCF04k20xvY0x 0EwIxGrwCF04k20xvE74AGY7Cv6cx26rWl4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xF xVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWw C2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Xr0_ Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJV WUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIY CTnIWIevJa73UjIFyTuYvjxU2iFxUUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,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?1766125963409311005?= X-GMAIL-MSGID: =?utf-8?q?1766125963409311005?= |
Series |
soc: loongson2_pm: add power management support
|
|
Commit Message
Yinbo Zhu
May 17, 2023, 7:31 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 | 47 +++++++++++++++++++
MAINTAINERS | 6 +++
2 files changed, 53 insertions(+)
create mode 100644 Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml
Comments
On 17/05/2023 09:31, 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> ... > +properties: > + compatible: > + items: > + - enum: > + - loongson,ls2k-pmc > + - const: syscon > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + suspend-address: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: > + This option indicate this PM suspend address. This tells me nothing. Drop "This option indicate this" and rephrase everything to actually describe this property. Why would the address differ on given, specific SoC? It looks like you just miss compatibles. Anyway this needs much more explanation so we can judge whether it fits DT. > + > +required: > + - compatible > + - reg > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/irq.h> > + > + pmc: pm@1fe27000 { > + compatible = "loongson,ls2k-pmc", "syscon"; > + reg = <0x1fe27000 0x58>; > + interrupt-parent = <&liointc1>; > + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; > + suspend-address = <0x1c000500>; Best regards, Krzysztof
在 2023/5/17 下午11:00, Krzysztof Kozlowski 写道: > On 17/05/2023 09:31, 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> > > ... > >> +properties: >> + compatible: >> + items: >> + - enum: >> + - loongson,ls2k-pmc >> + - const: syscon >> + >> + reg: >> + maxItems: 1 >> + >> + interrupts: >> + maxItems: 1 >> + >> + suspend-address: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: >> + This option indicate this PM suspend address. > > This tells me nothing. Drop "This option indicate this" and rephrase > everything to actually describe this property. Why would the address > differ on given, specific SoC? It looks like you just miss compatibles. > Anyway this needs much more explanation so we can judge whether it fits DT. Hi Krzysztof, I will add following description about "suspend-address", please review. The "suspend-address" is a ACPI S3 (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 driver need according to it to indicate that current SoC whether support ACPI S3. Thanks. > >> + >> +required: >> + - compatible >> + - reg >> + - interrupts >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/interrupt-controller/irq.h> >> + >> + pmc: pm@1fe27000 { >> + compatible = "loongson,ls2k-pmc", "syscon"; >> + reg = <0x1fe27000 0x58>; >> + interrupt-parent = <&liointc1>; >> + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; >> + suspend-address = <0x1c000500>; > > > Best regards, > Krzysztof >
On 18/05/2023 05:23, zhuyinbo wrote: > > > 在 2023/5/17 下午11:00, Krzysztof Kozlowski 写道: >> On 17/05/2023 09:31, 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> >> >> ... >> >>> +properties: >>> + compatible: >>> + items: >>> + - enum: >>> + - loongson,ls2k-pmc >>> + - const: syscon >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + suspend-address: >>> + $ref: /schemas/types.yaml#/definitions/uint32 >>> + description: >>> + This option indicate this PM suspend address. >> >> This tells me nothing. Drop "This option indicate this" and rephrase >> everything to actually describe this property. Why would the address >> differ on given, specific SoC? It looks like you just miss compatibles. >> Anyway this needs much more explanation so we can judge whether it fits DT. > > Hi Krzysztof, > > I will add following description about "suspend-address", please review. Thanks. > > The "suspend-address" is a ACPI S3 (Suspend To RAM) firmware entry Why do we add properties for ACPI? This does not seem right. Please reword to skip ACPI stuff, e.g. deep sleep states (Suspend to RAM). > address which was jumped from kernel and it's value was dependent on > specific platform firmware code. "entry address which was jumped" <- the address cannot jump. Please explain who is jumping here - boot CPU? each suspended CPU? I guess the first as CPUs are offlined, right? > In addition, the PM driver need > according to it to indicate that current SoC whether support ACPI S3. Skip references to driver. > Best regards, Krzysztof
在 2023/5/18 下午3:15, Krzysztof Kozlowski 写道: > On 18/05/2023 05:23, zhuyinbo wrote: >> >> >> 在 2023/5/17 下午11:00, Krzysztof Kozlowski 写道: >>> On 17/05/2023 09:31, 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> >>> >>> ... >>> >>>> +properties: >>>> + compatible: >>>> + items: >>>> + - enum: >>>> + - loongson,ls2k-pmc >>>> + - const: syscon >>>> + >>>> + reg: >>>> + maxItems: 1 >>>> + >>>> + interrupts: >>>> + maxItems: 1 >>>> + >>>> + suspend-address: >>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>> + description: >>>> + This option indicate this PM suspend address. >>> >>> This tells me nothing. Drop "This option indicate this" and rephrase >>> everything to actually describe this property. Why would the address >>> differ on given, specific SoC? It looks like you just miss compatibles. >>> Anyway this needs much more explanation so we can judge whether it fits DT. >> >> Hi Krzysztof, >> >> I will add following description about "suspend-address", please review. > > Thanks. > >> >> The "suspend-address" is a ACPI S3 (Suspend To RAM) firmware entry > > Why do we add properties for ACPI? This does not seem right. 1. The suspend-address value was dependent on specific platform firmware code and it tends to be confiurable. if it is a fixed value that seems not friendly or the ACPI S3 will not work. 2. the PM driver need according to it to indicate that current SoC whether support ACPI S3, because some Loongson-2 SoC doesn't support ACPI S3 but support other ACPI mode, so the PM driver need has a check. if no this check and other ACPI mode will not work. Base on the above two points, this property was necessary. Using this property "suspend-address" can make the firmware entry address configurable, and then the kernel can also indicate whether the current SoC supports S3 In addition, from kernel code perspective, the property "suspend-address" was to initialize "loongarch_suspend_addr" S3 call flow: enter_state -> loongson_suspend_enter -> bios's loongarch_suspend_addr SYM_FUNC_START(loongson_suspend_enter) SETUP_SLEEP bl __flush_cache_all /* Pass RA and SP to BIOS */ addi.d a1, sp, 0 la.pcrel a0, loongson_wakeup_start la.pcrel t0, loongarch_suspend_addr ld.d t0, t0, 0 jirl a0, t0, 0 /* Call BIOS's STR sleep routine */ Please > reword to skip ACPI stuff, e.g. deep sleep states (Suspend to RAM). Sorry, I don't got your point. > > >> address which was jumped from kernel and it's value was dependent on >> specific platform firmware code. > > "entry address which was jumped" <- the address cannot jump. Please > explain who is jumping here - boot CPU? each suspended CPU? I guess the > first as CPUs are offlined, right? The boot CPU was jumping to firmware and finish remaining process in firmware that was what ACPI S3 required and other CPUs (No-boot CPU) have been offline before entering firmware. > >> In addition, the PM driver need >> according to it to indicate that current SoC whether support ACPI S3. > > Skip references to driver. Sorry, I don't got your point. Could you elaborate on it? Thanks Yinbo.
On 18/05/2023 14:15, zhuyinbo wrote: > > > 在 2023/5/18 下午3:15, Krzysztof Kozlowski 写道: >> On 18/05/2023 05:23, zhuyinbo wrote: >>> >>> >>> 在 2023/5/17 下午11:00, Krzysztof Kozlowski 写道: >>>> On 17/05/2023 09:31, 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> >>>> >>>> ... >>>> >>>>> +properties: >>>>> + compatible: >>>>> + items: >>>>> + - enum: >>>>> + - loongson,ls2k-pmc >>>>> + - const: syscon >>>>> + >>>>> + reg: >>>>> + maxItems: 1 >>>>> + >>>>> + interrupts: >>>>> + maxItems: 1 >>>>> + >>>>> + suspend-address: >>>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>>> + description: >>>>> + This option indicate this PM suspend address. >>>> >>>> This tells me nothing. Drop "This option indicate this" and rephrase >>>> everything to actually describe this property. Why would the address >>>> differ on given, specific SoC? It looks like you just miss compatibles. >>>> Anyway this needs much more explanation so we can judge whether it fits DT. >>> >>> Hi Krzysztof, >>> >>> I will add following description about "suspend-address", please review. >> >> Thanks. >> >>> >>> The "suspend-address" is a ACPI S3 (Suspend To RAM) firmware entry >> >> Why do we add properties for ACPI? This does not seem right. > > > 1. The suspend-address value was dependent on specific platform > firmware code and it tends to be confiurable. if it is a fixed value > that seems not friendly or the ACPI S3 will not work. > 2. the PM driver need according to it to indicate that current SoC > whether support ACPI S3, because some Loongson-2 SoC doesn't support For this you have dedicated compatibles. Which points to the fact that you missed them here. > ACPI S3 but support other ACPI mode, so the PM driver need has a > check. if no this check and other ACPI mode will not work. Sure, but it is not really relevant to the bindings... or rather: should not be relevant. Bindings are for hardware or in this case also for firmware, but not for driver. > > Base on the above two points, this property was necessary. I did not object in my last response... > Using this property "suspend-address" can make the firmware entry > address configurable, and then the kernel can also indicate whether > the current SoC supports S3 > > In addition, from kernel code perspective, the property > "suspend-address" was to initialize "loongarch_suspend_addr" Again, how does it matter what kernel does? > > S3 call flow: > enter_state -> loongson_suspend_enter -> bios's loongarch_suspend_addr > > SYM_FUNC_START(loongson_suspend_enter) > SETUP_SLEEP > bl __flush_cache_all > > /* Pass RA and SP to BIOS */ > addi.d a1, sp, 0 > la.pcrel a0, loongson_wakeup_start > la.pcrel t0, loongarch_suspend_addr > ld.d t0, t0, 0 > jirl a0, t0, 0 /* Call BIOS's STR sleep routine */ > > > Please >> reword to skip ACPI stuff, e.g. deep sleep states (Suspend to RAM). > > > Sorry, I don't got your point. You have DT platform, so why do you use it with ACPI in the first place? If you have ACPI, then please drop all this and make your life easier. If this is booted without ACPI, which would justify DT, drop the references to ACPI. I gave you example what to use instead. If you don't like it, no problem, reword in different way. > >> >> >>> address which was jumped from kernel and it's value was dependent on >>> specific platform firmware code. >> >> "entry address which was jumped" <- the address cannot jump. Please >> explain who is jumping here - boot CPU? each suspended CPU? I guess the >> first as CPUs are offlined, right? > > The boot CPU was jumping to firmware and finish remaining process in > firmware that was what ACPI S3 required and other CPUs (No-boot CPU) > have been offline before entering firmware. Then fix the description. > >> >>> In addition, the PM driver need >>> according to it to indicate that current SoC whether support ACPI S3. >> >> Skip references to driver. > > > Sorry, I don't got your point. Could you elaborate on it? If you change driver, you change bindings? No. Bindings are for hardware, not for driver. Whatever your driver is doing usually does not matter for the bindings and should not be included. Best regards, Krzysztof
在 2023/5/18 下午10:15, Krzysztof Kozlowski 写道: > On 18/05/2023 14:15, zhuyinbo wrote: >> >> >> 在 2023/5/18 下午3:15, Krzysztof Kozlowski 写道: >>> On 18/05/2023 05:23, zhuyinbo wrote: >>>> >>>> >>>> 在 2023/5/17 下午11:00, Krzysztof Kozlowski 写道: >>>>> On 17/05/2023 09:31, 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> >>>>> >>>>> ... >>>>> >>>>>> +properties: >>>>>> + compatible: >>>>>> + items: >>>>>> + - enum: >>>>>> + - loongson,ls2k-pmc >>>>>> + - const: syscon >>>>>> + >>>>>> + reg: >>>>>> + maxItems: 1 >>>>>> + >>>>>> + interrupts: >>>>>> + maxItems: 1 >>>>>> + >>>>>> + suspend-address: >>>>>> + $ref: /schemas/types.yaml#/definitions/uint32 >>>>>> + description: >>>>>> + This option indicate this PM suspend address. >>>>> >>>>> This tells me nothing. Drop "This option indicate this" and rephrase >>>>> everything to actually describe this property. Why would the address >>>>> differ on given, specific SoC? It looks like you just miss compatibles. >>>>> Anyway this needs much more explanation so we can judge whether it fits DT. >>>> >>>> Hi Krzysztof, >>>> >>>> I will add following description about "suspend-address", please review. >>> >>> Thanks. >>> >>>> >>>> The "suspend-address" is a ACPI S3 (Suspend To RAM) firmware entry >>> >>> Why do we add properties for ACPI? This does not seem right. >> >> >> 1. The suspend-address value was dependent on specific platform >> firmware code and it tends to be confiurable. if it is a fixed value >> that seems not friendly or the ACPI S3 will not work. > >> 2. the PM driver need according to it to indicate that current SoC >> whether support ACPI S3, because some Loongson-2 SoC doesn't support > > For this you have dedicated compatibles. Which points to the fact that > you missed them here. Sorry, I may not have explained it clearly before. In fact, this is a consideration for the future, and currently all SoC supports s3. Add corresponding compatibles as needed in the future. > >> ACPI S3 but support other ACPI mode, so the PM driver need has a >> check. if no this check and other ACPI mode will not work. > > Sure, but it is not really relevant to the bindings... or rather: should > not be relevant. Bindings are for hardware or in this case also for > firmware, but not for driver. okay, I got it. > >> >> Base on the above two points, this property was necessary. > > I did not object in my last response... Yes, but I misunderstood your meaning before. > >> Using this property "suspend-address" can make the firmware entry >> address configurable, and then the kernel can also indicate whether >> the current SoC supports S3 >> >> In addition, from kernel code perspective, the property >> "suspend-address" was to initialize "loongarch_suspend_addr" > > Again, how does it matter what kernel does? okay, I got it. > >> >> S3 call flow: >> enter_state -> loongson_suspend_enter -> bios's loongarch_suspend_addr >> >> SYM_FUNC_START(loongson_suspend_enter) >> SETUP_SLEEP >> bl __flush_cache_all >> >> /* Pass RA and SP to BIOS */ >> addi.d a1, sp, 0 >> la.pcrel a0, loongson_wakeup_start >> la.pcrel t0, loongarch_suspend_addr >> ld.d t0, t0, 0 >> jirl a0, t0, 0 /* Call BIOS's STR sleep routine */ >> >> >> Please >>> reword to skip ACPI stuff, e.g. deep sleep states (Suspend to RAM). >> >> >> Sorry, I don't got your point. > > You have DT platform, so why do you use it with ACPI in the first place? > If you have ACPI, then please drop all this and make your life easier. okay, I got it, I will reword to skip ACPI stuff in bindings for "suspend-address" property description. > > If this is booted without ACPI, which would justify DT, drop the > references to ACPI. I gave you example what to use instead. If you don't > like it, no problem, reword in different way. okay, I got it. > >> >>> >>> >>>> address which was jumped from kernel and it's value was dependent on >>>> specific platform firmware code. >>> >>> "entry address which was jumped" <- the address cannot jump. Please >>> explain who is jumping here - boot CPU? each suspended CPU? I guess the >>> first as CPUs are offlined, right? >> >> The boot CPU was jumping to firmware and finish remaining process in >> firmware that was what ACPI S3 required and other CPUs (No-boot CPU) >> have been offline before entering firmware. > > Then fix the description. okay, I got it. > >> >>> >>>> In addition, the PM driver need >>>> according to it to indicate that current SoC whether support ACPI S3. >>> >>> Skip references to driver. >> >> >> Sorry, I don't got your point. Could you elaborate on it? > > If you change driver, you change bindings? No. > > Bindings are for hardware, not for driver. Whatever your driver is doing > usually does not matter for the bindings and should not be included. okay, I got it. I will skip references to driver in bindings for "suspend-address" property description. Thanks.
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..a52bfa5e3eb6 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/loongson/loongson,ls2k-pmc.yaml @@ -0,0 +1,47 @@ +# 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: + items: + - enum: + - loongson,ls2k-pmc + - const: syscon + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + suspend-address: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + This option indicate this PM suspend address. + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + pmc: pm@1fe27000 { + compatible = "loongson,ls2k-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>