From patchwork Fri Jul 7 00:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao X-Patchwork-Id: 116898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2949723vqx; Thu, 6 Jul 2023 18:34:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHV8BvDGVc8wyUd5mXWg8XYlMFKDBrDooYvkalROJLZDUIhuxyEPCMXFl1254vKg8xXzesx X-Received: by 2002:a05:6808:200f:b0:3a3:7aa2:bf0d with SMTP id q15-20020a056808200f00b003a37aa2bf0dmr4051266oiw.38.1688693661659; Thu, 06 Jul 2023 18:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688693661; cv=none; d=google.com; s=arc-20160816; b=MdusvW53RbD6extF7jB5Cu5FBe2P/RDJmx+L70W81E9yrPaCgZXYj4el78cZfCjeb6 ORpDwzWgdtciEvoOH2S9rP4jv/1f0qy/oeahsR1GNYDgeYLFqd0aOErxypdsaA8vi8ft fOFoYMDQNuUdVn7Qr5zPcNM8FXXoPb/0CfM57CM+FKbmOHHrQ82mb9ORTmqv0ZHRuZT4 nWJpAPPSUF+DSib4hns5e3ETr2BtbHmFGB0FiTV4A8nowt9pNoNd1iiCcAloNGvEimPU +lxjReNSLkuw9egmYABbwx3moqwEN0whp0NSJvD2JEjkMpghsU9JLsp4gN+UiM0Hk2ts T9JA== 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=Dv2gy/Ml28++K09mtmH8tWTE8Lo2PHTAhjkAUPtBBE8=; fh=WzRG3WH3uvRbKqWQdKb+SWZNQhoyocMFA6Hw0LDjFNQ=; b=kFzhmMXRNOV1Cv6QkN42tEFBYO/nU8XgWYEcn33o320y7WX3v3UwMpoijw1zIGhYlX XmT0y0C5j7PTuDGk0gyG5xXRUion443C1NLja7QA1z891gVNxI2SDhxyNrvkHpe1Pb5m jTK9Fkup2JioOr8BnwDl1pe0rUyffmNdzITymBwcuLypNqQEcV+gp0dbrkej7zwzwTBR rko89EHT4tT6Zp9bZBmkYlfE4jNyrIF3puBi2urGpUkN68co0sOk9MQko0UNZ7niUXcN XiSna1j9cFFdZxl2LWAgz1oEkex+uKUxgqUelH41eg9JIpR1vigt61x2lrfkfC6TsEv4 /bVw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ei31-20020a056a0080df00b0067c12c99c56si2422671pfb.117.2023.07.06.18.34.04; Thu, 06 Jul 2023 18:34:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbjGGAhT (ORCPT + 99 others); Thu, 6 Jul 2023 20:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbjGGAhR (ORCPT ); Thu, 6 Jul 2023 20:37:17 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BC619BD; Thu, 6 Jul 2023 17:37:16 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Fri, 7 Jul 2023 08:37:06 +0800 From: Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH V2 1/4] soc: amlogic: use name instead of index as criterion Date: Fri, 7 Jul 2023 08:37:07 +0800 Message-ID: <20230707003710.2667989-2-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> References: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.98.11.200] 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770723644760652125?= X-GMAIL-MSGID: =?utf-8?q?1770723644760652125?= The variate 'index' could be equal to zero in some SoCs. Such as C3 SoC, PWRC_C3_NNA_ID be defined zero. Use 'name' instead of 'index' as criterion. Signed-off-by: Xianwei Zhao Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Rokosov --- V1 -> V2: add a new patch for change. --- drivers/soc/amlogic/meson-secure-pwrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c index 25b4b71df9b8..c11d65a3e3d9 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -179,7 +179,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev) for (i = 0 ; i < match->count ; ++i) { struct meson_secure_pwrc_domain *dom = &pwrc->domains[i]; - if (!match->domains[i].index) + if (!match->domains[i].name) continue; dom->pwrc = pwrc; From patchwork Fri Jul 7 00:37:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao X-Patchwork-Id: 116895 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2938881vqx; Thu, 6 Jul 2023 18:06:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSXqmZo5Ve5OBgD+TfuQ0EaSneDL7a7lHDUjOlXLF6yh9TbZDm8QtLR4VaNGbvcyGWwSJV X-Received: by 2002:a05:6870:a454:b0:19f:6950:b191 with SMTP id n20-20020a056870a45400b0019f6950b191mr4702931oal.23.1688692019703; Thu, 06 Jul 2023 18:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688692019; cv=none; d=google.com; s=arc-20160816; b=kpc4qJHYs7ZWgfh5ySj6h4uur6p5dpfBvY2x0cNmTez5ARR0HJdlH9nBaYsgLb8TvB iq+zcJtweK8zIaEIftdR3UQ35cxcvAK7JQDoEI3tbHpCATSaGgL4s6M1VF6U/IKGJzmd OcKEaDiBVoSvxhERSXz6I1W3Mp43/khwZp7DdNuurtgpGP5PEw4zGRZv3NSyzJ1E2bQV hF1qZN3hQzYbvMB9v/35prXs49knpq8CkonPXiP/Ds67DqTT8ejeOzQb4QLlnBZYY4+d VZG3uLsI9gOXCVrVXf3ziKs3oWLvDSz5NYDnvvZ7aF2y5+ngst0ZojToXOJ53sSPqPwu NSNw== 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=f9yzmH91wb+leGBzkq8J3DKKtQt/LCD5Mk52EaVXVMM=; fh=WzRG3WH3uvRbKqWQdKb+SWZNQhoyocMFA6Hw0LDjFNQ=; b=0C/1DnTHhceGSi7eV03Lf1j0fbHA1uVxbP7Zsscm1Kb/OsLFh8d0iBUaYFaYUESkHp Yxzs+k6DqvI04LehuKgGLB7oZf2s3CcfmQDFLaN8XEIDgODiKiinaOhqJhoFQHUsM/2u iFXnfManDXZ+20NGRjQFUS26Rs+XpJVw0ZURHe5CmYaQ8qfKjemU3/1g+Q4latL/a3Et NNn0oqVBnIMPm9HdXHUZoZJkejQ6RR5lio0LYyvWsi9cLEjVr+TosfTSEt/8MukKcPJi SUTfAoAKlMca97OpuT9g66dGDbjNzfoR9pf0U6n3OE3VIXvjnkoxcPVU80EoOWizUYIZ vwxw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a17090a8a8600b0024b9e5aa258si4923724pjn.0.2023.07.06.18.06.43; Thu, 06 Jul 2023 18:06:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbjGGAiA (ORCPT + 99 others); Thu, 6 Jul 2023 20:38:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbjGGAh7 (ORCPT ); Thu, 6 Jul 2023 20:37:59 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD7CE1BF8; Thu, 6 Jul 2023 17:37:17 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Fri, 7 Jul 2023 08:37:07 +0800 From: Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH V2 2/4] dt-bindings: power: add Amlogic C3 power domains Date: Fri, 7 Jul 2023 08:37:08 +0800 Message-ID: <20230707003710.2667989-3-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> References: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.98.11.200] 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770721922873645299?= X-GMAIL-MSGID: =?utf-8?q?1770721922873645299?= Add devicetree binding document and related header file for Amlogic C3 secure power domains. Signed-off-by: Xianwei Zhao Acked-by: Rob Herring --- V1 -> V2: Mofiy filename matching compatibles. Delete unnecessary blank line. --- .../power/amlogic,meson-sec-pwrc.yaml | 3 ++- include/dt-bindings/power/amlogic,c3-pwrc.h | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/power/amlogic,c3-pwrc.h diff --git a/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml b/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml index eab21bb2050a..d80bbedfe3aa 100644 --- a/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml +++ b/Documentation/devicetree/bindings/power/amlogic,meson-sec-pwrc.yaml @@ -12,7 +12,7 @@ maintainers: - Jianxin Pan description: |+ - Secure Power Domains used in Meson A1/C1/S4 SoCs, and should be the child node + Secure Power Domains used in Meson A1/C1/S4 & C3 SoCs, and should be the child node of secure-monitor. properties: @@ -20,6 +20,7 @@ properties: enum: - amlogic,meson-a1-pwrc - amlogic,meson-s4-pwrc + - amlogic,c3-pwrc "#power-domain-cells": const: 1 diff --git a/include/dt-bindings/power/amlogic,c3-pwrc.h b/include/dt-bindings/power/amlogic,c3-pwrc.h new file mode 100644 index 000000000000..1d98a25b08a4 --- /dev/null +++ b/include/dt-bindings/power/amlogic,c3-pwrc.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */ +/* + * Copyright (c) 2023 Amlogic, Inc. + * Author: hongyu chen1 + */ +#ifndef _DT_BINDINGS_AMLOGIC_C3_POWER_H +#define _DT_BINDINGS_AMLOGIC_C3_POWER_H + +#define PWRC_C3_NNA_ID 0 +#define PWRC_C3_AUDIO_ID 1 +#define PWRC_C3_RESV_SEC_ID 2 +#define PWRC_C3_SDIOA_ID 3 +#define PWRC_C3_EMMC_ID 4 +#define PWRC_C3_USB_COMB_ID 5 +#define PWRC_C3_SDCARD_ID 6 +#define PWRC_C3_ETH_ID 7 +#define PWRC_C3_RESV0_ID 8 +#define PWRC_C3_GE2D_ID 9 +#define PWRC_C3_CVE_ID 10 +#define PWRC_C3_GDC_WRAP_ID 11 +#define PWRC_C3_ISP_TOP_ID 12 +#define PWRC_C3_MIPI_ISP_WRAP_ID 13 +#define PWRC_C3_VCODEC_ID 14 + +#endif From patchwork Fri Jul 7 00:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao X-Patchwork-Id: 116893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2935869vqx; Thu, 6 Jul 2023 18:00:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlHNjrQvHIngUSFpZotxxBPzsp/LtM3Z11/rQzAoo/cOeUe216M01LEQYPHEjyfoLAEktX+D X-Received: by 2002:a05:6358:3411:b0:134:e8c6:a888 with SMTP id h17-20020a056358341100b00134e8c6a888mr3705170rwd.8.1688691654066; Thu, 06 Jul 2023 18:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688691654; cv=none; d=google.com; s=arc-20160816; b=qxnmVaJEy1S1cH/krhKXg73MVPp4ompMhe7EBQv+atiX4Vf8jasf3hqf5BZSJn7nNE YFppBXKQzaPzYZo/U17fZnOR1GBtT8npIjOhX5d8FJmGRbrvqP5ELZFHdSKfWWQZoFyl cfsdM6mB1QhLQGzKYHntEionaXp31zcgrHn9jzS3P/TGI7l3yTNV9ALEWU4STIzXTBwp sHU04fU526yOAS9ZeivJeNY78wqka45wfQPFIsdmH6qww4FGWfYIwk25y8Cuual+5EBX IkfXQtX+6v20FH08PVus+aeUt13CqHg3LFxhMwZPO3gylZdToDBLYw6AHGlwp1GqUFso l0MA== 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=gcSyovoxgIyeBH3jDhGDRPsjGL4G8r00fgIvryAEcHA=; fh=WzRG3WH3uvRbKqWQdKb+SWZNQhoyocMFA6Hw0LDjFNQ=; b=mt4ULcmH7SjEc318E2S3UfpPNLiBq4JT7u8OvcTyeBBqQ8OVwoL9CLgoYTbB6TmIlz Y1Ip5gkavImDMNk4fDbd3wLDEyhhATso0W/l7Xp3l0oGTjSLaARvBHgKZyrOS3J7lTsE skKlptRD2c+z06yvFjdAslehG/F5PM/0+ISq0eKqxX4YEb90l0fFZmrSyJIpIUKBVB9D aH80UkQ+xEVM3OTYJokIyprBkHToPz6Dw+04UjkLTTCLCPMLIbBmBj44azDsvgM5Luxp 4ia3dpNMKf5izGX6T6DefWyWKn/cDMSWNSMIbDG8f4a7F9llXAYb+5Zxfcd5vPvF2R+5 04/w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u31-20020a63471f000000b0055337508370si2458497pga.889.2023.07.06.18.00.34; Thu, 06 Jul 2023 18:00:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbjGGAiJ (ORCPT + 99 others); Thu, 6 Jul 2023 20:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231465AbjGGAiG (ORCPT ); Thu, 6 Jul 2023 20:38:06 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5942F19BD; Thu, 6 Jul 2023 17:37:19 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Fri, 7 Jul 2023 08:37:09 +0800 From: Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH V2 3/4] soc: c3: Add support for power domains controller Date: Fri, 7 Jul 2023 08:37:09 +0800 Message-ID: <20230707003710.2667989-4-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> References: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.98.11.200] 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770721539584265124?= X-GMAIL-MSGID: =?utf-8?q?1770721539584265124?= Add support for C3 Power controller. C3 power control registers are in secure domain, and should be accessed by SMC. Signed-off-by: Xianwei Zhao Reviewed-by: Neil Armstrong --- V1 -> V2: Fixed some formatting. --- drivers/soc/amlogic/meson-secure-pwrc.c | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c index c11d65a3e3d9..a1ffebf70de3 100644 --- a/drivers/soc/amlogic/meson-secure-pwrc.c +++ b/drivers/soc/amlogic/meson-secure-pwrc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = { SEC_PD(RSA, 0), }; +static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = { + SEC_PD(C3_NNA, 0), + SEC_PD(C3_AUDIO, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_SDIOA, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_EMMC, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_USB_COMB, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_SDCARD, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_ETH, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_GE2D, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_CVE, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_GDC_WRAP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_ISP_TOP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_MIPI_ISP_WRAP, GENPD_FLAG_ALWAYS_ON), + SEC_PD(C3_VCODEC, 0), +}; + static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = { SEC_PD(S4_DOS_HEVC, 0), SEC_PD(S4_DOS_VDEC, 0), @@ -202,6 +219,11 @@ static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = { .count = ARRAY_SIZE(a1_pwrc_domains), }; +static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = { + .domains = c3_pwrc_domains, + .count = ARRAY_SIZE(c3_pwrc_domains), +}; + static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = { .domains = s4_pwrc_domains, .count = ARRAY_SIZE(s4_pwrc_domains), @@ -212,6 +234,10 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = { .compatible = "amlogic,meson-a1-pwrc", .data = &meson_secure_a1_pwrc_data, }, + { + .compatible = "amlogic,c3-pwrc", + .data = &amlogic_secure_c3_pwrc_data, + }, { .compatible = "amlogic,meson-s4-pwrc", .data = &meson_secure_s4_pwrc_data, From patchwork Fri Jul 7 00:37:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianwei Zhao X-Patchwork-Id: 116892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2933316vqx; Thu, 6 Jul 2023 17:53:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGB/TV7RkGzYg+nYo/euYymigGgq+HDv+hxmYPNNznr+Ly9SM8fvWRQVo2dMGLCwY++mVwq X-Received: by 2002:a05:6870:f142:b0:1b4:55e9:99 with SMTP id l2-20020a056870f14200b001b455e90099mr307327oac.21.1688691214263; Thu, 06 Jul 2023 17:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688691214; cv=none; d=google.com; s=arc-20160816; b=U+YLQqFM++7iW0RMWOJDkoWopoY5jFkI1PW73yLDx8Y9Lag6pzpC85y0fCB+fSU/G0 pzHvGvoGUc/liaoM0DmM3GaA4ZfIQ6W6LPwoPbN54ST8f2SrFOuvShe5ZWqlPWbeiFbR lDkoJqKDARMlegzMraDmUYItUt24dWWe4pLTRfrJyS65gfzpzP3aNJJeEeyKykSoxfCG Tu67NM5AsyU8EPlmCYnY5IOgrVX9EDX5mtpoOOPHCNc3p6j/AenSZKlis/5tIPe+Po5P 5ON0fX8EizNO7go7VgdgA/uZHcRtmK3HGzaKHHbu5Ozdd0EKuVYhDRObzLXQO7rlAQLa jqBA== 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=WVIMvwVCdlBD8BaZcam/HldFWZ1n1SC/gKV/xxSDMqc=; fh=WzRG3WH3uvRbKqWQdKb+SWZNQhoyocMFA6Hw0LDjFNQ=; b=o3IW8/zViSxUJj9bdT2mFCs1U4RxfO79hY+Itfds6hbko+h7is2n57hweqORKqwe3s Rg4+tUaR3KqxbSFmedzWt03UwHks4pT2TjUW2wh7raHASUoDRkiGa5x3FipybQOCkH39 xUbGAN5X3o1GegZV6BYxr0LbNSslLbS8rfZKtpGIzXmo79y1z8FxhUKev5CF9oV6fhaQ EouAiaGbRJKrDyTieIbdPlLfo8LKwuuOf88rQIVNDWwVo4jej9a72guynaI7C6o2HeQA TTPxF5611kra3RwPvg6xJYvQTqKIn5eRFFerwlxMUDDAYYujSz6x2Gnd0pgMiqGoE/7g UUAw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a17090b070b00b002563fbb8a85si783571pjz.111.2023.07.06.17.53.19; Thu, 06 Jul 2023 17:53:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231654AbjGGAhY (ORCPT + 99 others); Thu, 6 Jul 2023 20:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbjGGAhW (ORCPT ); Thu, 6 Jul 2023 20:37:22 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D658C1BDB; Thu, 6 Jul 2023 17:37:20 -0700 (PDT) Received: from droid01-cd.amlogic.com (10.98.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Fri, 7 Jul 2023 08:37:12 +0800 From: Xianwei Zhao To: , , , CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Neil Armstrong" , Kevin Hilman , Xianwei Zhao Subject: [PATCH V2 4/4] arm64: dts: add support for C3 power domain controller Date: Fri, 7 Jul 2023 08:37:10 +0800 Message-ID: <20230707003710.2667989-5-xianwei.zhao@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> References: <20230707003710.2667989-1-xianwei.zhao@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.98.11.200] 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770721078439635710?= X-GMAIL-MSGID: =?utf-8?q?1770721078439635710?= Enable power domain controller for Amlogic C3 SoC Signed-off-by: Xianwei Zhao Reviewed-by: Neil Armstrong --- V1 -> V2: delete status,use "okay" status by default. --- arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi index 60ad4f3eef9d..f6603fd57551 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-c3.dtsi @@ -47,6 +47,15 @@ xtal: xtal-clk { #clock-cells = <0>; }; + sm: secure-monitor { + compatible = "amlogic,meson-gxbb-sm"; + + pwrc: power-controller { + compatible = "amlogic,c3-pwrc"; + #power-domain-cells = <1>; + }; + }; + soc { compatible = "simple-bus"; #address-cells = <2>;