From patchwork Wed Apr 26 09:12:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105665vqo; Wed, 26 Apr 2023 02:13:58 -0700 (PDT) X-Google-Smtp-Source: AKy350ZeDDhXBQfJ2+I1Cwa6rSzEwJWyswZo42w/JgtRp5AmjLZuqTN619+5qGcOaz4m6CKAVADS X-Received: by 2002:a05:6a00:cc3:b0:627:ea7a:ff46 with SMTP id b3-20020a056a000cc300b00627ea7aff46mr31422506pfv.16.1682500437897; Wed, 26 Apr 2023 02:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500437; cv=none; d=google.com; s=arc-20160816; b=JfVg9oTm+sqXKWBaq4bkli/GA+ikDaMwjywUNVSyBRgzLQRBCSQp8nKZBQ9Mr5l6TN rTL/fxbfLotaAeCelpskpvSYazXefGx5NGALA8SsUpC5dKekuVZQsHGp2jAJQyK0Afzh ukq1jICjVOWzYzP26Xo4T11kKhZKDGvrH1rDVxyR1pILIcdHXvAIz51hysCdgyCjbecb 2xS14wJLVCTcJkjzhTbYCDITlTnFllB3oB09CT04+YwN5fyNitTA1n+WVZrU0de7ZBSY el1NJPx//5gPV2E3Vl4Sx3XaJYPF4N6rvAoVWIWHU3ut/rnAZ8TZ4ttWI9tiyWRQ7CgK Uquw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=X5BMOUCftBqUoS89OY1vJghk0U8zsFcVshTFWmsRm4E=; b=i1U0tTQ+gfZ4g2cCPvbwEhSwWifZgd2+AhfdoTLbrfprc0tT7i1hflnLFm7PG98nPZ Kq4UvRtCs6Byz+hSt6eivBN04L/QHej8OosBlT+TuSRvKkSrEiOuaQZW6kSyviVBe7y7 2+Jifltkm6E6qaNbvj6tYOSxTKuuWYZOsxs+sHo4uchnVZrktqnFIpZ1WrjmoWmhrfg4 eSjfEWPeZUW/Hmgo7chlnM7Id8mZxhWW2RJ5vZLvdU96aW++UvDyRQk0NxAEKdiCzFKr H9T/y36e/1ohYWaMzqlLa/9m9iYI6loXz2pufryYZ/Ybjyhd2ZgpI4EF9IktwtajEEtT p4ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cGdRaE4f; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a634954000000b0051b4f4a2032si15291958pgk.599.2023.04.26.02.13.44; Wed, 26 Apr 2023 02:13:57 -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=@mediatek.com header.s=dk header.b=cGdRaE4f; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240184AbjDZJNS (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239997AbjDZJMi (ORCPT ); Wed, 26 Apr 2023 05:12:38 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1175430CA; Wed, 26 Apr 2023 02:12:31 -0700 (PDT) X-UUID: 75e5f780e41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=X5BMOUCftBqUoS89OY1vJghk0U8zsFcVshTFWmsRm4E=; b=cGdRaE4fZAkJ9C0QfYzazZF/ynwvuk7yLlDI+uo6aoOsydawcUneSZ7IFB0XM9IVIVXXCeSQAvf5QuBH5TJ/GfMlYKfM3hWhRc4LopsuctWiDdxwBHhEF0kJt5qIQaaLlzO8ScbXh01MEnmjeepKNvGGuXW5/XruhZk+fnhB2NE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:a12ec346-2823-47fc-ae8d-b6736cea1f46,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:f6244e85-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 75e5f780e41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 276731506; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 26 Apr 2023 17:12:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:24 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 01/11] dt-bindings: remoteproc: mediatek: Improve the rpmsg subnode definition Date: Wed, 26 Apr 2023 17:12:01 +0800 Message-ID: <20230426091211.21557-2-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764229578885996539?= X-GMAIL-MSGID: =?utf-8?q?1764229578885996539?= Improve the definition of the rpmsg subnode by assigning a distinct node name and adding the definition source of node properties. Signed-off-by: Tinghan Shen Acked-by: Rob Herring --- .../bindings/remoteproc/mtk,scp.yaml | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml index 895415772d1d..271081df0e46 100644 --- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml +++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml @@ -58,6 +58,18 @@ properties: memory-region: maxItems: 1 + cros-ec-rpmsg: + $ref: /schemas/mfd/google,cros-ec.yaml + description: + This subnode represents the rpmsg device. The properties + of this node are defined by the individual bindings for + the rpmsg devices. + + required: + - mediatek,rpmsg-name + + unevaluatedProperties: false + required: - compatible - reg @@ -89,21 +101,7 @@ allOf: reg-names: maxItems: 2 -additionalProperties: - type: object - description: - Subnodes of the SCP represent rpmsg devices. The names of the devices - are not important. The properties of these nodes are defined by the - individual bindings for the rpmsg devices. - properties: - mediatek,rpmsg-name: - $ref: /schemas/types.yaml#/definitions/string-array - description: - Contains the name for the rpmsg device. Used to match - the subnode to rpmsg device announced by SCP. - - required: - - mediatek,rpmsg-name +additionalProperties: false examples: - | @@ -118,7 +116,8 @@ examples: clocks = <&infracfg CLK_INFRA_SCPSYS>; clock-names = "main"; - cros_ec { + cros-ec-rpmsg { + compatible = "google,cros-ec-rpmsg"; mediatek,rpmsg-name = "cros-ec-rpmsg"; }; }; From patchwork Wed Apr 26 09:12:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87772 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp110225vqo; Wed, 26 Apr 2023 02:25:37 -0700 (PDT) X-Google-Smtp-Source: AKy350azd95dKavqXf09q5yulFOOlGK52TizWR39ppOUmtHBzLkHMK6MaYuk4h+d2lLeXW/4Qcbd X-Received: by 2002:a17:903:245:b0:1a5:f9b:27bd with SMTP id j5-20020a170903024500b001a50f9b27bdmr22903219plh.34.1682501137250; Wed, 26 Apr 2023 02:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682501137; cv=none; d=google.com; s=arc-20160816; b=oqutsgWC+TB4wfrVgQVXGgYszMRzbwH7LG54Q6vUMYnE2m6gv6KZI8sblJsQv5oaeh j2EyhB8tU5M3QeZdN25gX64bq8ISF9AB9nFqwsOBqvnbL7Zm3X7jBL/AEsU3zOipQigE bQMDcf9LztrzYLg2W0dXK2wjGhXG9jWQGtwGBrqEGRTlmUwbLHR8u9/Fj7dNS0jzECvp UJRM0kaEEKeodg7GnpAepNzOq9itkLhl1WsWafVOfYWnJH2GrA8PtdCiwQa4/l/HMKE4 T0x7AzLeunsSHHQj7v9sjORKIjWvMrKWkF9mBKF0OT1/x0xPi3ZiJ8qBO3ZE2HpU94jU hp1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mvwHWznV1CbjQr3A3SteeGWxU/09D9mqE8X8ZN62xhE=; b=yPmIM/osAfwUtbFY0ixb/4uxmCEoyBarxy+xeum5t3snExEm/b9VLUWV02Qe4Cl3fu AfA/UK0UM4KJX0tcQ4y5hlmbTmmQ7Sa2D/NnlJFFjVOKmEzeaYtMIaMl2MYU7EJYKdLe dWEH+VJ9fbBtJRnl2jXGhl1+OAAsz1p5XL4kpEe8mUN0F+aKUaFi7fqjonA0F/Olpr48 sahcwdfWRVrAcxSnUUKmKPqArnrOtpzoPfW4HqgJxo8G9xtfD4paGsLV3x4f+udtpy+Q 0m2spiYGIfzfOFXpr+OfBJu0z9NXdWyREHxD+VCPZHQy7xaF4XUxcaYZhPwWhDe1iP14 4auw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=dbKgDrKN; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a170902ce9200b001a9975ef97bsi2664017plg.396.2023.04.26.02.25.24; Wed, 26 Apr 2023 02:25:37 -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=@mediatek.com header.s=dk header.b=dbKgDrKN; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239702AbjDZJNd (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240039AbjDZJMi (ORCPT ); Wed, 26 Apr 2023 05:12:38 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9D240E7; Wed, 26 Apr 2023 02:12:32 -0700 (PDT) X-UUID: 75fe024ee41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mvwHWznV1CbjQr3A3SteeGWxU/09D9mqE8X8ZN62xhE=; b=dbKgDrKNr22MWHDYG1KlVQTJ5fGsIHwb/VXpAHgTZhotkQv8CXfXWMsmKj+OpR7GN0NtGnUkSH+/2sjvyg78aAjQ4Bbkao1ysIuzBGz6CG1QseqA6FbRTYrkNf+c59tvCcHZCM7Cuf82iAq4/gF1ZUi5qw31CYsGg882p92EwH0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:737f56cc-9738-439c-a095-a6574ef87419,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:2ebd34ec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 75fe024ee41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1606232850; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:24 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 02/11] arm64: dts: mediatek: Update the node name of SCP rpmsg subnode Date: Wed, 26 Apr 2023 17:12:02 +0800 Message-ID: <20230426091211.21557-3-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764230312147575734?= X-GMAIL-MSGID: =?utf-8?q?1764230312147575734?= Align the node name with the definition in SCP bindings. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Acked-by: Matthias Brugger --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 2 +- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index 63952c1251df..ac4aeeded37c 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -825,7 +825,7 @@ pinctrl-names = "default"; pinctrl-0 = <&scp_pins>; - cros_ec { + cros-ec-rpmsg { compatible = "google,cros-ec-rpmsg"; mediatek,rpmsg-name = "cros-ec-rpmsg"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi index 5a440504d4f9..cd4d68f1d93b 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi @@ -1280,7 +1280,7 @@ pinctrl-names = "default"; pinctrl-0 = <&scp_pins>; - cros-ec { + cros-ec-rpmsg { compatible = "google,cros-ec-rpmsg"; mediatek,rpmsg-name = "cros-ec-rpmsg"; }; From patchwork Wed Apr 26 09:12:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105886vqo; Wed, 26 Apr 2023 02:14:32 -0700 (PDT) X-Google-Smtp-Source: AKy350b4NMTGx+zAf/B+dgr0mZSZBUlUXhBNfpd3V6TwYIPRPUrWsBj0db6/pA2B0l1X7Xb/Mk08 X-Received: by 2002:a05:6a20:3d10:b0:ef:a85b:c715 with SMTP id y16-20020a056a203d1000b000efa85bc715mr26016579pzi.1.1682500472655; Wed, 26 Apr 2023 02:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500472; cv=none; d=google.com; s=arc-20160816; b=yrMYnrDo+0OV4VNZwrunMqnOFMMfpWS30Cruh8X+HbAc4BNLer36FOMyFhtSjDHJZF dKwvUHfVoaqKdsyFiChMXgqCSj6C94rlXXP5vmaJPgqxXELl+96yxuDp7+n9iLSu0AIz DV/qRFErebaa/rM52B7GJ7bWaRG722VprpPWAAYRgM6PGql0Tz6jCuSrxuOkJHzUJcr1 cR5Ps5w+qEyfkSmQeed1PVZBoLGF7cSrDqHNAFn0BWT/Uwo2S0B/A8nZzOpiQ7prlFDQ b0mBdvUIkxaWysSekY36s543NwtRbuCbMLzV5Reyia75ZikgJ1BKZJ6eZJ3zvxPEcqAU cEvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mHZvfrM0o5UaIt01vL+X0Xi78aCQjddfdApBpcmPqT8=; b=CBTphKRj9rY7Er7cvDljmMuw/5EZicvh+bT/BxLCw+M7flTUl0w5nCPjsMkgvqdjnX HE98EeS/VL2nV8VDeS6px7Gw20sz0A4lzjFX1RIuobjlkPmeckt83KYYhNV8taeI//F0 ys2sJuY2Y8rkxdqrzc84qqW5Qz2YZ63s4BpvkW+1jYrea5UINooHlewLgm5bcK1g7Nsy GJJz1wI2gFteQuNtVaMypB2nfIamGbMo6b5s7aWOBTtSoMCAabbzG7cfxI1R6ftew2ZG Y8A9Aljs/EabYSoVxTNmRP3Q4RH8NxUkvNt+44nPNuvI3Q9P9pKU7w3hrALdqGNnqJEJ sdlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=hPrMgusP; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b005135d3abc6asi16575749pgk.90.2023.04.26.02.14.17; Wed, 26 Apr 2023 02:14:32 -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=@mediatek.com header.s=dk header.b=hPrMgusP; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239976AbjDZJNy (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240165AbjDZJMl (ORCPT ); Wed, 26 Apr 2023 05:12:41 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3AAF44A0; Wed, 26 Apr 2023 02:12:36 -0700 (PDT) X-UUID: 75cef058e41211edb6b9f13eb10bd0fe-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mHZvfrM0o5UaIt01vL+X0Xi78aCQjddfdApBpcmPqT8=; b=hPrMgusP+U2pDbu+APcNKha5/UWZyPRh70DiTtwKVOnNqDIXrk9rQcAffuLVWf+texnMFaUOwAXaaCz7UlSDCja7KOWSeaH9rIuJ4EXP2bpwmBY1QJTeuL4sj6m/glzqmqD7k0YeizOj4QjGJInW8xKZ/jfn2LJ0WBtdBkBwOco=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:572f1de0-84fe-4d58-b529-02dd4081ffb6,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:32254e85-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 75cef058e41211edb6b9f13eb10bd0fe-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1692979170; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:24 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 03/11] dt-bindings: remoteproc: mediatek: Support MT8195 dual-core SCP Date: Wed, 26 Apr 2023 17:12:03 +0800 Message-ID: <20230426091211.21557-4-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no 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?1764229615710133814?= X-GMAIL-MSGID: =?utf-8?q?1764229615710133814?= Extend the SCP binding to describe the MT8195 dual-core SCP. Under different applications, the MT8195 SCP can be used as single-core or dual-core. This change keeps the single-core definitions and adds new definitions for the dual-core use case. Signed-off-by: Tinghan Shen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno --- .../bindings/remoteproc/mtk,scp.yaml | 145 +++++++++++++++++- 1 file changed, 141 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml index 271081df0e46..09102dda4942 100644 --- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml +++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml @@ -21,6 +21,7 @@ properties: - mediatek,mt8188-scp - mediatek,mt8192-scp - mediatek,mt8195-scp + - mediatek,mt8195-scp-dual reg: description: @@ -31,10 +32,7 @@ properties: reg-names: minItems: 2 - items: - - const: sram - - const: cfg - - const: l1tcm + maxItems: 3 clocks: description: @@ -70,6 +68,81 @@ properties: unevaluatedProperties: false + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + ranges: + description: + Standard ranges definition providing address translations for + local SCP SRAM address spaces to bus addresses. + +patternProperties: + "^scp@[a-f0-9]+$": + type: object + description: + The MediaTek SCP integrated to SoC might be a multi-core version. + The other cores are represented as child nodes of the boot core. + There are some integration differences for the IP like the usage of + address translator for translating SoC bus addresses into address space + for the processor. + + Each SCP core has own cache memory. The SRAM and L1TCM are shared by + cores. The power of cache, SRAM and L1TCM power should be enabled + before booting SCP cores. The size of cache, SRAM, and L1TCM are varied + on differnt SoCs. + + The SCP cores do not use an MMU, but has a set of registers to + control the translations between 32-bit CPU addresses into system bus + addresses. Cache and memory access settings are provided through a + Memory Protection Unit (MPU), programmable only from the SCP. + + properties: + compatible: + enum: + - mediatek,scp-core + + reg: + description: The base address and size of SRAM. + maxItems: 1 + + reg-names: + const: sram + + interrupts: + maxItems: 1 + + firmware-name: + $ref: /schemas/types.yaml#/definitions/string + description: + If present, name (or relative path) of the file within the + firmware search path containing the firmware image used when + initializing sub cores of multi-core SCP. + + memory-region: + maxItems: 1 + + cros-ec-rpmsg: + $ref: /schemas/mfd/google,cros-ec.yaml + description: + This subnode represents the rpmsg device. The properties + of this node are defined by the individual bindings for + the rpmsg devices. + + required: + - mediatek,rpmsg-name + + unevaluatedProperties: false + + required: + - compatible + - reg + - reg-names + + additionalProperties: false + required: - compatible - reg @@ -99,7 +172,37 @@ allOf: reg: maxItems: 2 reg-names: + items: + - const: sram + - const: cfg + - if: + properties: + compatible: + enum: + - mediatek,mt8192-scp + - mediatek,mt8195-scp + then: + properties: + reg: + maxItems: 3 + reg-names: + items: + - const: sram + - const: cfg + - const: l1tcm + - if: + properties: + compatible: + enum: + - mediatek,mt8195-scp-dual + then: + properties: + reg: maxItems: 2 + reg-names: + items: + - const: cfg + - const: l1tcm additionalProperties: false @@ -121,3 +224,37 @@ examples: mediatek,rpmsg-name = "cros-ec-rpmsg"; }; }; + + - | + scp@10500000 { + compatible = "mediatek,mt8195-scp-dual"; + reg = <0x10720000 0xe0000>, + <0x10700000 0x8000>; + reg-names = "cfg", "l1tcm"; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x10500000 0x100000>; + + scp@0 { + compatible = "mediatek,scp-core"; + reg = <0x0 0xa0000>; + reg-names = "sram"; + + cros-ec-rpmsg { + compatible = "google,cros-ec-rpmsg"; + mediatek,rpmsg-name = "cros-ec-rpmsg"; + }; + }; + + scp@a0000 { + compatible = "mediatek,scp-core"; + reg = <0xa0000 0x20000>; + reg-names = "sram"; + + cros-ec-rpmsg { + compatible = "google,cros-ec-rpmsg"; + mediatek,rpmsg-name = "cros-ec-rpmsg"; + }; + }; + }; From patchwork Wed Apr 26 09:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp106251vqo; Wed, 26 Apr 2023 02:15:31 -0700 (PDT) X-Google-Smtp-Source: AKy350Z3V5zBueLZgphNb9lYrmiLHrPatWCZ4dNhHeZIzSyE+i+zD7QHwtL6KMIZPeP4RyDretE1 X-Received: by 2002:a05:6a20:a10c:b0:f5:7035:99fa with SMTP id q12-20020a056a20a10c00b000f5703599famr9830810pzk.57.1682500530688; Wed, 26 Apr 2023 02:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500530; cv=none; d=google.com; s=arc-20160816; b=NKbrHOgL6kzEGcYeFazpp1vNFWFA1NUpGYfSwvGB6Pyk0E45JjQ0NCkrFSU20+DO82 vytLtkL6yD37kq8mjTle5HtDu9QX2n9uL7VNsESOrAZ9OXRizgPL7Bw7v/2CoW889Bw0 5wIqRqViPGC3nMoSv+RYDDte+Mvs6WaMibjJvC4Mc/6z7npLkzsUf8iEzAZD7B82X1HN XIVChUoz4r0E7XOOzZzL9tkUxiRGV3sYJaK6RSwQwfEQjkUOvo1aaieS9bafhDTukZFj lsC9NRNPm7hsZSoe+dfHgo12RyjvRIwpPIpqcsdloL4Ol/hf/1DsSuhjudt8bud+iXSN Ylfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NAIsC42qlF4M3r1yYyjc+pdu8Kd38Gz6icCRue8kG5k=; b=J2XSes0Zng/43+kaVxC71JzJBFqzGTGBDa6AbuXRSaGycEnpZN0ZsOftog1LktdB73 hQMSBF5t2OGeqXvla1aQccsIjNB7cwpNgvLNv25fcV5MuzgORTDxuhbN8ex4w36ZkVLm SNPIEetnKKxowUOoMIVlihRNo99p4NXSsB0/PzwjY3rcd/vT9ofgdH7vuJA0HYyKT2fd cC/iTg2q+S6eBNOueGiWt6TRB77+QcAKANP3kaTmTnQE2rrMkzHU8Mc7zNZTA2WcoiSj lCcg+MDxJ8rp09t4xqs5mnTyT35kSwTQZRJJFhFjPJY4aWPs5KwMWfi9ExPR6ZIuXyQe O0uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LZmZctM+; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 83-20020a630556000000b00517a2ca5ecbsi16768938pgf.692.2023.04.26.02.15.07; Wed, 26 Apr 2023 02:15:30 -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=@mediatek.com header.s=dk header.b=LZmZctM+; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240330AbjDZJO0 (ORCPT + 99 others); Wed, 26 Apr 2023 05:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240095AbjDZJMk (ORCPT ); Wed, 26 Apr 2023 05:12:40 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71DF44229; Wed, 26 Apr 2023 02:12:35 -0700 (PDT) X-UUID: 776384a6e41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=NAIsC42qlF4M3r1yYyjc+pdu8Kd38Gz6icCRue8kG5k=; b=LZmZctM+1vjL7VmHWPZu1M7ESkygcIsAx/vpbESCP817p1o8ufbrANZ1B5zjfHpAiD+YjGByevWjRrZbP6Jw1yjPBBvOqchVPlQW3Jy766Rsh4l6AdvZC6Ch/gmpcgxb+qaNVkEhAmppQbLh7/ZVNUvEI98NX1m2otZaqHQ/EQw=; X-CID-CACHE: Type:Local,Time:202304261712+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:02d9650e-de8d-4bb1-815d-d56da095774a,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:32bd34ec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 776384a6e41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 135540494; Wed, 26 Apr 2023 17:12:28 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 26 Apr 2023 17:12:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:24 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 04/11] remoteproc: mediatek: Add MT8195 SCP core 1 operations Date: Wed, 26 Apr 2023 17:12:04 +0800 Message-ID: <20230426091211.21557-5-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764229676229097578?= X-GMAIL-MSGID: =?utf-8?q?1764229676229097578?= The SCP rproc driver has a set of chip dependent callbacks for boot sequence and IRQ handling. Implement these callbacks for MT8195 SCP core 1. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_common.h | 9 ++++++ drivers/remoteproc/mtk_scp.c | 56 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h index ea6fa1100a00..c0905aec3b4b 100644 --- a/drivers/remoteproc/mtk_common.h +++ b/drivers/remoteproc/mtk_common.h @@ -47,6 +47,7 @@ #define MT8192_SCP2SPM_IPC_CLR 0x4094 #define MT8192_GIPC_IN_SET 0x4098 #define MT8192_HOST_IPC_INT_BIT BIT(0) +#define MT8195_CORE1_HOST_IPC_INT_BIT BIT(4) #define MT8192_CORE0_SW_RSTN_CLR 0x10000 #define MT8192_CORE0_SW_RSTN_SET 0x10004 @@ -56,6 +57,14 @@ #define MT8195_L1TCM_SRAM_PDN_RESERVED_RSI_BITS GENMASK(7, 4) +#define MT8195_CPU1_SRAM_PD 0x1084 +#define MT8195_SSHUB2APMCU_IPC_SET 0x4088 +#define MT8195_SSHUB2APMCU_IPC_CLR 0x408C +#define MT8195_CORE1_SW_RSTN_CLR 0x20000 +#define MT8195_CORE1_SW_RSTN_SET 0x20004 +#define MT8195_CORE1_MEM_ATT_PREDEF 0x20008 +#define MT8195_CORE1_WDT_CFG 0x20034 + #define SCP_FW_VER_LEN 32 #define SCP_SHARE_BUFFER_SIZE 288 diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index e1d93e63d7df..2bf66b1a8d80 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -176,6 +176,16 @@ static void mt8192_scp_reset_deassert(struct mtk_scp *scp) writel(1, scp->reg_base + MT8192_CORE0_SW_RSTN_CLR); } +static void mt8195_scp_c1_reset_assert(struct mtk_scp *scp) +{ + writel(1, scp->reg_base + MT8195_CORE1_SW_RSTN_SET); +} + +static void mt8195_scp_c1_reset_deassert(struct mtk_scp *scp) +{ + writel(1, scp->reg_base + MT8195_CORE1_SW_RSTN_CLR); +} + static void mt8183_scp_irq_handler(struct mtk_scp *scp) { u32 scp_to_host; @@ -212,6 +222,18 @@ static void mt8192_scp_irq_handler(struct mtk_scp *scp) } } +static void mt8195_scp_c1_irq_handler(struct mtk_scp *scp) +{ + u32 scp_to_host; + + scp_to_host = readl(scp->reg_base + MT8195_SSHUB2APMCU_IPC_SET); + + if (scp_to_host & MT8192_SCP_IPC_INT_BIT) + scp_ipi_handler(scp); + + writel(scp_to_host, scp->reg_base + MT8195_SSHUB2APMCU_IPC_CLR); +} + static irqreturn_t scp_irq_handler(int irq, void *priv) { struct mtk_scp *scp = priv; @@ -453,6 +475,19 @@ static int mt8195_scp_before_load(struct mtk_scp *scp) return 0; } +static int mt8195_scp_c1_before_load(struct mtk_scp *scp) +{ + scp_sram_power_on(scp->reg_base + MT8195_CPU1_SRAM_PD, 0); + + /* hold SCP in reset while loading FW. */ + scp->data->scp_reset_assert(scp); + + /* enable MPU for all memory regions */ + writel(0xff, scp->reg_base + MT8195_CORE1_MEM_ATT_PREDEF); + + return 0; +} + static int scp_load(struct rproc *rproc, const struct firmware *fw) { struct mtk_scp *scp = rproc->priv; @@ -625,6 +660,15 @@ static void mt8195_scp_stop(struct mtk_scp *scp) writel(0, scp->reg_base + MT8192_CORE0_WDT_CFG); } +static void mt8195_scp_c1_stop(struct mtk_scp *scp) +{ + /* Power off CPU SRAM */ + scp_sram_power_off(scp->reg_base + MT8195_CPU1_SRAM_PD, 0); + + /* Disable SCP watchdog */ + writel(0, scp->reg_base + MT8195_CORE1_WDT_CFG); +} + static int scp_stop(struct rproc *rproc) { struct mtk_scp *scp = rproc->priv; @@ -991,6 +1035,18 @@ static const struct mtk_scp_of_data mt8195_of_data = { .host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT, }; +static const struct mtk_scp_of_data mt8195_of_data_c1 = { + .scp_clk_get = mt8195_scp_clk_get, + .scp_before_load = mt8195_scp_c1_before_load, + .scp_irq_handler = mt8195_scp_c1_irq_handler, + .scp_reset_assert = mt8195_scp_c1_reset_assert, + .scp_reset_deassert = mt8195_scp_c1_reset_deassert, + .scp_stop = mt8195_scp_c1_stop, + .scp_da_to_va = mt8192_scp_da_to_va, + .host_to_scp_reg = MT8192_GIPC_IN_SET, + .host_to_scp_int_bit = MT8195_CORE1_HOST_IPC_INT_BIT, +}; + static const struct of_device_id mtk_scp_of_match[] = { { .compatible = "mediatek,mt8183-scp", .data = &mt8183_of_data }, { .compatible = "mediatek,mt8186-scp", .data = &mt8186_of_data }, From patchwork Wed Apr 26 09:12:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105902vqo; Wed, 26 Apr 2023 02:14:35 -0700 (PDT) X-Google-Smtp-Source: AKy350bSFShqlz7p/6Rczi1VTVjkHxDvZMSifyJoKql0SRHmS2kVWdISFZ1RFW/3Zbjyj0okg8Ef X-Received: by 2002:a05:6a00:2e0c:b0:63d:4920:c101 with SMTP id fc12-20020a056a002e0c00b0063d4920c101mr27689447pfb.30.1682500474654; Wed, 26 Apr 2023 02:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500474; cv=none; d=google.com; s=arc-20160816; b=ONWVjHZVWnMsBy4ksKxWX0kvvbaS0Tu66KOfzQUjXy9KiinnuAA/HK8uOuogIAFVEN NVZgukz41YwxY8G7HpQcmvf55zUczD9tTbF5M7pxunLN4+0dyJiY1PAijpyuR381frlV fSOIeqAiBS1gG/xegOjnTqnjvnQwTR1aUXEHWM/g45NaZI7rxC7LWuvsutUkErLDeT7M 3EkgVSFNUCHMbDJwaFMPk+9lDcpFRDX2OBwjlsa0pTVesLy6ekLl7+vqS9yIugPcHroF rIOgiLA/bTMaZlNV8agUMTmW2t1FBSNwQURP4cI7R0ov9n2+9t3W+K8HvQLA1jKG8r+N /DNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SZjevMFr3hN/VIx2NgbZTpSz9vi5eily31NZvHvjAig=; b=eomWCTVtWeCoLLXfx5YX87DIP/BFJHQ3LPhfpMPALrHqpB8j1dcjxxrlG4IcATOL9N 9NI2Rx7UStlop2rHqiqTfwrbF58T+Us6840Qoq+DpX9MJy5JnP0HdjI8IfWKFP3MDmjj hf+UifYBAjakIEDUq8BqZm9ARS9+k+C6WdMiWbTjHKXrfESqiQwOVvkngOt3P4lz4Emq G7TjLsLTlGfRu06vYfom8ru32z+O8NUUFCvvMK6ktk1psJK4HsxjR+aQkwDrd59WBnor CLFImA3Oay1VTFLTF2ZDut8GqaJllEqqx6SftfRR/O0NmdY1QkCNzP+Yp6CQtSk+HtNx OGzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="d/0Molek"; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020aa79468000000b0063b7b02424fsi16023918pfq.250.2023.04.26.02.14.20; Wed, 26 Apr 2023 02:14: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; dkim=pass header.i=@mediatek.com header.s=dk header.b="d/0Molek"; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240216AbjDZJN7 (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239998AbjDZJMk (ORCPT ); Wed, 26 Apr 2023 05:12:40 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2C6E449D; Wed, 26 Apr 2023 02:12:36 -0700 (PDT) X-UUID: 75c9b99ee41211edb6b9f13eb10bd0fe-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=SZjevMFr3hN/VIx2NgbZTpSz9vi5eily31NZvHvjAig=; b=d/0MolekIkgFlmOmm5bJ2M+OSdPC9FkFyNk4pqDESxM3fzXAW3VpfN/vThpze4z6Y1vW4xCi3SRW1oRP3Pt+rqMQj0RA1q1nE/5McTeecgG9zg+WO7V9k1LMKny5P2fU7gNp03I5HP5lH1kaUCIhjZsw/enkTRS6mVG3QOkssrc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:8ff7d942-7733-4dff-9359-1927aa1ac090,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:120426c,CLOUDID:72bd34ec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 75c9b99ee41211edb6b9f13eb10bd0fe-20230426 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1083764236; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 26 Apr 2023 17:12:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:24 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 05/11] remoteproc: mediatek: Extract remoteproc initialization flow Date: Wed, 26 Apr 2023 17:12:05 +0800 Message-ID: <20230426091211.21557-6-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no 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?1764229617912471854?= X-GMAIL-MSGID: =?utf-8?q?1764229617912471854?= This is the preparation for probing multi-core SCP. The remoteproc initialization flow is similar on cores and is reused to avoid redundant code. The registers of config and l1tcm are shared for multi-core SCP. Reuse the mapped addresses for all cores. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_scp.c | 69 ++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 2bf66b1a8d80..5e4982f4d5dc 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -23,6 +23,13 @@ #define MAX_CODE_SIZE 0x500000 #define SECTION_NAME_IPI_BUFFER ".ipi_buffer" +struct mtk_scp_of_cluster { + void __iomem *reg_base; + void __iomem *l1tcm_base; + size_t l1tcm_size; + phys_addr_t l1tcm_phys; +}; + /** * scp_get() - get a reference to SCP. * @@ -855,10 +862,11 @@ static void scp_remove_rpmsg_subdev(struct mtk_scp *scp) } } -static int scp_probe(struct platform_device *pdev) +static int scp_rproc_init(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + struct mtk_scp_of_cluster *of_cluster = platform_get_drvdata(pdev); struct mtk_scp *scp; struct rproc *rproc; struct resource *res; @@ -879,6 +887,11 @@ static int scp_probe(struct platform_device *pdev) scp->data = of_device_get_match_data(dev); platform_set_drvdata(pdev, scp); + scp->reg_base = of_cluster->reg_base; + scp->l1tcm_base = of_cluster->l1tcm_base; + scp->l1tcm_size = of_cluster->l1tcm_size; + scp->l1tcm_phys = of_cluster->l1tcm_phys; + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram"); scp->sram_base = devm_ioremap_resource(dev, res); if (IS_ERR(scp->sram_base)) @@ -888,24 +901,6 @@ static int scp_probe(struct platform_device *pdev) scp->sram_size = resource_size(res); scp->sram_phys = res->start; - /* l1tcm is an optional memory region */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm"); - scp->l1tcm_base = devm_ioremap_resource(dev, res); - if (IS_ERR(scp->l1tcm_base)) { - ret = PTR_ERR(scp->l1tcm_base); - if (ret != -EINVAL) { - return dev_err_probe(dev, ret, "Failed to map l1tcm memory\n"); - } - } else { - scp->l1tcm_size = resource_size(res); - scp->l1tcm_phys = res->start; - } - - scp->reg_base = devm_platform_ioremap_resource_byname(pdev, "cfg"); - if (IS_ERR(scp->reg_base)) - return dev_err_probe(dev, PTR_ERR(scp->reg_base), - "Failed to parse and map cfg memory\n"); - ret = scp->data->scp_clk_get(scp); if (ret) return ret; @@ -957,6 +952,42 @@ static int scp_probe(struct platform_device *pdev) return ret; } +static int scp_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct mtk_scp_of_cluster *of_cluster; + struct resource *res; + int ret; + + of_cluster = devm_kzalloc(&pdev->dev, sizeof(*of_cluster), GFP_KERNEL); + if (!of_cluster) + return -ENOMEM; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); + of_cluster->reg_base = devm_ioremap_resource(dev, res); + if (IS_ERR(of_cluster->reg_base)) + return dev_err_probe(dev, PTR_ERR(of_cluster->reg_base), + "Failed to parse and map cfg memory\n"); + + /* l1tcm is an optional memory region */ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm"); + of_cluster->l1tcm_base = devm_ioremap_resource(dev, res); + if (IS_ERR(of_cluster->l1tcm_base)) { + ret = PTR_ERR(of_cluster->l1tcm_base); + if (ret != -EINVAL) + return dev_err_probe(dev, ret, "Failed to map l1tcm memory\n"); + + of_cluster->l1tcm_base = NULL; + } else { + of_cluster->l1tcm_size = resource_size(res); + of_cluster->l1tcm_phys = res->start; + } + + platform_set_drvdata(pdev, of_cluster); + + return scp_rproc_init(pdev); +} + static int scp_remove(struct platform_device *pdev) { struct mtk_scp *scp = platform_get_drvdata(pdev); From patchwork Wed Apr 26 09:12:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp109733vqo; Wed, 26 Apr 2023 02:24:23 -0700 (PDT) X-Google-Smtp-Source: AKy350a9SDt3yNnPhVfq5KLA0bl9LAHZPTkePKBKts1b0+k1cHTHWetMa1OL5v9CfJo2uOYaO4pe X-Received: by 2002:a05:6a21:998d:b0:ee:73bf:425d with SMTP id ve13-20020a056a21998d00b000ee73bf425dmr27437120pzb.39.1682501062872; Wed, 26 Apr 2023 02:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682501062; cv=none; d=google.com; s=arc-20160816; b=HWINwsXuMIiETVCE5N4s2Ju5+b7WSI8qOlF5c8ZTEUg69sf9RszmRp+FKXkaHLVCny IxWZ/6dCBj5ZkCVSqcD/eIhJyF82Tpb4QOa7vawJb5kqu6QteDsYNnsZYQnsmViUjmzb A8ZSsHNsP7cy2XEYMnwIqIrxQICriICQINUQVNcXZ8WcSazdwwrRnCk5NGto/Tai3B96 1E3+MJwHbQ4tBUaps/edGiPy2HHnkVGHQ74TcqkAdW29HzU2E9cb2E5PRtD16ofXztvj 6ywTE77UPtLg2wvxCqiCrKVqRBtfv3wMaq7two/sIUGtFo/35VjkmfyieICn8jHu3fm8 7FcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=wWf3GUFYmwSl1J62g2cxIVVBIwDNb1QbOpyYFvMvIFQ=; b=aAxZ8EQe0YFsDWrx4UMJNR531Fhz59VdSvMcIi79YAMapGsBUBOUqC3gI9KkhPZIbD qXCeN99Fc1rWYM+5Puwwx2m7+FtGQFkOPq3msrwBBPAnappdW95KiNoTYYOw+h1+f0aw gf2fo1zFT9zisTH2/Hsrv8NUKtGMUcIchnXdqnE3x7Gx+XkBe0MTOc8p5DtIxgTQTQQt 2pfluwufTAdyIHMk27pLFciL2KYYk5NS0cQcAj3HU7+e0hciFVvzAVZXSzg8Q+7QU31R FuK1+sydGrEXBF6FbCF0vef7CZdPNoGk3K+n3vvVohedhbGeqm8XpCyOxyLyBKxPFShw H0xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Az0b17l1; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a632317000000b0051a650b8f52si15778850pgj.259.2023.04.26.02.24.09; Wed, 26 Apr 2023 02:24:22 -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=@mediatek.com header.s=dk header.b=Az0b17l1; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240133AbjDZJOR (ORCPT + 99 others); Wed, 26 Apr 2023 05:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240168AbjDZJMl (ORCPT ); Wed, 26 Apr 2023 05:12:41 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3D0F44A2; Wed, 26 Apr 2023 02:12:36 -0700 (PDT) X-UUID: 75d16e46e41211edb6b9f13eb10bd0fe-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=wWf3GUFYmwSl1J62g2cxIVVBIwDNb1QbOpyYFvMvIFQ=; b=Az0b17l1mA5LcGTLSYiSLieHEN01zhC5INzIE5FMnv1ISVaml1nXF+4cNxJwaRLKS+NFf3lHXr1y5LqNnCMiGZ9m2jsjiNelNvnvM44UMRIhuUnOAfKEr0FjZjBkQtx2VZSPU3p3fQaLiBpuEJMAEHX2xnPr/H9Z2QEbUBh8SDQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:3b6fd14a-01a8-4e77-bd91-a8a6b5569a89,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:120426c,CLOUDID:34254e85-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 75d16e46e41211edb6b9f13eb10bd0fe-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 561809496; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 06/11] remoteproc: mediatek: Probe multi-core SCP Date: Wed, 26 Apr 2023 17:12:06 +0800 Message-ID: <20230426091211.21557-7-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no 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?1764230234776534752?= X-GMAIL-MSGID: =?utf-8?q?1764230234776534752?= The difference of single-core SCP and multi-core SCP device tree is the presence of child device nodes described SCP cores. The SCP driver populates the platform device and checks the child nodes to identify whether it's a single-core SCP or a multi-core SCP. Add the remoteproc instances for single-core SCP and multi-core SCP to the new added SCP cluster list. When the SCP driver is removed, it cleanup resources by walking through the cluster list. Signed-off-by: Tinghan Shen --- drivers/remoteproc/mtk_common.h | 3 + drivers/remoteproc/mtk_scp.c | 188 ++++++++++++++++++++++++++++---- 2 files changed, 172 insertions(+), 19 deletions(-) diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h index c0905aec3b4b..b73b60c22ea1 100644 --- a/drivers/remoteproc/mtk_common.h +++ b/drivers/remoteproc/mtk_common.h @@ -128,6 +128,9 @@ struct mtk_scp { size_t dram_size; struct rproc_subdev *rpmsg_subdev; + + struct list_head elem; + struct list_head *cluster; }; /** diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 5e4982f4d5dc..0b052b0acf2e 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -28,6 +28,7 @@ struct mtk_scp_of_cluster { void __iomem *l1tcm_base; size_t l1tcm_size; phys_addr_t l1tcm_phys; + struct list_head mtk_scp_cluster; }; /** @@ -862,21 +863,31 @@ static void scp_remove_rpmsg_subdev(struct mtk_scp *scp) } } -static int scp_rproc_init(struct platform_device *pdev) +static int scp_rproc_init(struct platform_device *cluster_pdev, + struct platform_device *core_pdev, + const struct mtk_scp_of_data *of_data) { - struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; - struct mtk_scp_of_cluster *of_cluster = platform_get_drvdata(pdev); + struct platform_device *pdev; + struct device *dev; + struct device_node *np; + struct mtk_scp_of_cluster *of_cluster = platform_get_drvdata(cluster_pdev); struct mtk_scp *scp; struct rproc *rproc; struct resource *res; const char *fw_name = "scp.img"; int ret, i; + if (core_pdev) + pdev = core_pdev; + else + pdev = cluster_pdev; + + dev = &pdev->dev; ret = rproc_of_parse_firmware(dev, 0, &fw_name); if (ret < 0 && ret != -EINVAL) return ret; + np = dev->of_node; rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp)); if (!rproc) return dev_err_probe(dev, -ENOMEM, "unable to allocate remoteproc\n"); @@ -884,7 +895,7 @@ static int scp_rproc_init(struct platform_device *pdev) scp = rproc->priv; scp->rproc = rproc; scp->dev = dev; - scp->data = of_device_get_match_data(dev); + scp->data = of_data; platform_set_drvdata(pdev, scp); scp->reg_base = of_cluster->reg_base; @@ -934,10 +945,6 @@ static int scp_rproc_init(struct platform_device *pdev) goto remove_subdev; } - ret = rproc_add(rproc); - if (ret) - goto remove_subdev; - return 0; remove_subdev: @@ -952,6 +959,121 @@ static int scp_rproc_init(struct platform_device *pdev) return ret; } +static void scp_rproc_free(struct mtk_scp *scp) +{ + int i; + + scp_remove_rpmsg_subdev(scp); + scp_ipi_unregister(scp, SCP_IPI_INIT); + scp_unmap_memory_region(scp); + for (i = 0; i < SCP_IPI_MAX; i++) + mutex_destroy(&scp->ipi_desc[i].lock); + mutex_destroy(&scp->send_lock); +} + +static int scp_is_single_core(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev_of_node(dev); + struct device_node *child; + + child = of_get_next_available_child(np, NULL); + if (!child) + return dev_err_probe(dev, -ENODEV, "No child node\n"); + + of_node_put(child); + return of_node_name_eq(child, "cros-ec-rpmsg"); +} + +static int scp_cluster_init(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev_of_node(dev); + struct platform_device *cpdev; + struct device_node *child; + struct mtk_scp_of_cluster *of_cluster = platform_get_drvdata(pdev); + const struct mtk_scp_of_data **cluster_of_data; + struct list_head *cluster = &of_cluster->mtk_scp_cluster; + struct mtk_scp *scp, *temp; + int core_id = 0; + int ret; + + ret = scp_is_single_core(pdev); + if (ret < 0) + return ret; + + if (ret) { + dev_dbg(dev, "single-core scp\n"); + + /* When using the SCP node phandle on exported SCP APIs, the drvdata + * is expected to be the mtk_scp object, and as a result, it is intended + * to be overwritten for single-core SCP usage. + */ + ret = scp_rproc_init(pdev, NULL, of_device_get_match_data(dev)); + if (ret) + return dev_err_probe(dev, ret, "Failed to initialize single-core scp\n"); + + scp = platform_get_drvdata(pdev); + list_add_tail(&scp->elem, cluster); + scp->cluster = cluster; + } else { + dev_dbg(dev, "multi-core scp\n"); + + cluster_of_data = (const struct mtk_scp_of_data **)of_device_get_match_data(dev); + + for_each_available_child_of_node(np, child) { + if (!cluster_of_data[core_id]) { + ret = -EINVAL; + dev_err(dev, "Not support core %d\n", core_id); + of_node_put(child); + goto init_fail; + } + + cpdev = of_find_device_by_node(child); + if (!cpdev) { + ret = -ENODEV; + dev_err(dev, "Not found platform device for core %d\n", core_id); + of_node_put(child); + goto init_fail; + } + + ret = scp_rproc_init(pdev, cpdev, cluster_of_data[core_id]); + if (ret) { + dev_err(dev, "Failed to initialize core %d rproc\n", core_id); + put_device(&cpdev->dev); + of_node_put(child); + goto init_fail; + } + scp = platform_get_drvdata(cpdev); + list_add_tail(&scp->elem, cluster); + scp->cluster = cluster; + put_device(&cpdev->dev); + + core_id++; + } + } + + list_for_each_entry_safe_reverse(scp, temp, cluster, elem) { + ret = rproc_add(scp->rproc); + if (ret) + goto add_fail; + } + + return 0; + +add_fail: + list_for_each_entry_continue(scp, cluster, elem) { + rproc_del(scp->rproc); + } +init_fail: + list_for_each_entry_safe_reverse(scp, temp, cluster, elem) { + list_del(&scp->elem); + scp_rproc_free(scp); + } + + return ret; +} + static int scp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -983,23 +1105,44 @@ static int scp_probe(struct platform_device *pdev) of_cluster->l1tcm_phys = res->start; } + INIT_LIST_HEAD(&of_cluster->mtk_scp_cluster); platform_set_drvdata(pdev, of_cluster); - return scp_rproc_init(pdev); + ret = devm_of_platform_populate(dev); + if (ret) + return dev_err_probe(dev, ret, "Failed to populate platform devices\n"); + + ret = scp_cluster_init(pdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to initialize scp cluster\n"); + + return 0; } static int scp_remove(struct platform_device *pdev) { - struct mtk_scp *scp = platform_get_drvdata(pdev); - int i; + struct mtk_scp *scp, *temp; + struct mtk_scp_of_cluster *of_cluster; + struct list_head *cluster; + int ret; - rproc_del(scp->rproc); - scp_remove_rpmsg_subdev(scp); - scp_ipi_unregister(scp, SCP_IPI_INIT); - scp_unmap_memory_region(scp); - for (i = 0; i < SCP_IPI_MAX; i++) - mutex_destroy(&scp->ipi_desc[i].lock); - mutex_destroy(&scp->send_lock); + ret = scp_is_single_core(pdev); + if (ret < 0) + return ret; + + if (ret) { + scp = platform_get_drvdata(pdev); + cluster = scp->cluster; + } else { + of_cluster = platform_get_drvdata(pdev); + cluster = &of_cluster->mtk_scp_cluster; + } + + list_for_each_entry_safe_reverse(scp, temp, cluster, elem) { + list_del(&scp->elem); + rproc_del(scp->rproc); + scp_rproc_free(scp); + } return 0; } @@ -1078,12 +1221,19 @@ static const struct mtk_scp_of_data mt8195_of_data_c1 = { .host_to_scp_int_bit = MT8195_CORE1_HOST_IPC_INT_BIT, }; +static const struct mtk_scp_of_data *mt8195_of_data_cores[] = { + &mt8195_of_data, + &mt8195_of_data_c1, + NULL +}; + static const struct of_device_id mtk_scp_of_match[] = { { .compatible = "mediatek,mt8183-scp", .data = &mt8183_of_data }, { .compatible = "mediatek,mt8186-scp", .data = &mt8186_of_data }, { .compatible = "mediatek,mt8188-scp", .data = &mt8188_of_data }, { .compatible = "mediatek,mt8192-scp", .data = &mt8192_of_data }, { .compatible = "mediatek,mt8195-scp", .data = &mt8195_of_data }, + { .compatible = "mediatek,mt8195-scp-dual", .data = &mt8195_of_data_cores }, {}, }; MODULE_DEVICE_TABLE(of, mtk_scp_of_match); From patchwork Wed Apr 26 09:12:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105711vqo; Wed, 26 Apr 2023 02:14:07 -0700 (PDT) X-Google-Smtp-Source: AKy350b0UPZQkRtRbA3LskRzhpkkNyUcY5WHqYKe2oJ+zKCEVP8p9jlaEWM44Dg9GMvbGnx6Kk8+ X-Received: by 2002:a17:90a:eb0e:b0:246:f70e:e2ff with SMTP id j14-20020a17090aeb0e00b00246f70ee2ffmr20493390pjz.0.1682500446673; Wed, 26 Apr 2023 02:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500446; cv=none; d=google.com; s=arc-20160816; b=Qn+p1oz4sRwSFSli0aZBJzaVPWSko6n9Ju9yUzEKhMg5Um1T+CCsf0fvv6qHM33i3x 7MkC29EMOcq2YxSuhX1WCXCQnYy2Z4XxuUf5f0kr5LfLYiR8WayY4DuqwqR/m8cQyPBv jEwAtIMuzeVKISCrQeijwTbLnn7A+7ZwF3ZIzC/Edj3mqzut+xEibei459caa2SxzWbi DBn0ja2qwEv8QKdqonK8ypLqVhmzJg0PtNFr1++yxR/GTICylPnuH/S0aTeSTLoUak6u 6/gvLSBax+XdtnAJhWtW9j/6knNyu9BhMVgIsIKbH4eMl0Q0ztVuYJIm+XdbuhcyIjQg Esgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=i11IgZo79qKkHh9NToFxjKigNknjUuIXFqIoGJe+41M=; b=fVzBukZqZVcGmkLBtvCCNlaCHmB1TCmOQpCcp9bfEWO6LP9UEe1bjyZdD5+ZRyWTeP VvLMmwo0b5EYqrjKsFBNSZqyI9J6hAhf3XMA+JiB6Ftj6QN0tFHYdTS/77GkbKenOEh7 uCupqRc1ul2H4/AzjVD0wBZ3BpVqsL3s/8cI39XVJkfhfNkZcG47oAgCo8M+w6YMG77B zIHRVbjRXdLW8DaNL8djBjwgNYD7zksVr1BguPVJOH1UzpUsQ64HJrLCKOBMqflX/gQR 9+sBfcq7Ij5hL9DOb1FG/fRbHHxO8QhkuhZwQ+BXXmNogy8l6UivKhpCyCsnpWK9SkN/ 7kFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=DwTbsZZz; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020aa79425000000b0063d30e5168bsi16045529pfo.38.2023.04.26.02.13.54; Wed, 26 Apr 2023 02:14:06 -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=@mediatek.com header.s=dk header.b=DwTbsZZz; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239880AbjDZJN3 (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239988AbjDZJMj (ORCPT ); Wed, 26 Apr 2023 05:12:39 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62E592D55; Wed, 26 Apr 2023 02:12:34 -0700 (PDT) X-UUID: 76027d24e41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=i11IgZo79qKkHh9NToFxjKigNknjUuIXFqIoGJe+41M=; b=DwTbsZZzl8HQ/4jnbeUKugC3O+Zx2SR0kxUWeO/NjuBfm/D2+hqAYmAHqtIDIGp0j2ULKgJRDM0mOLrctDFWiOa3yjwzG6oWBiyfIkOPz7bfeupd/WtNxZkjs+IMsJMDG7bhhrwyUUC34wZqgiFqEP3O5+HRK5BWQPQAFoPJ/Xc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:ed203245-91cf-4333-a66d-a561a922eb50,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:34de92a2-8fcb-430b-954a-ba3f00fa94a5,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 76027d24e41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1826014015; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 07/11] remoteproc: mediatek: Control SCP core 1 by rproc subdevice Date: Wed, 26 Apr 2023 17:12:07 +0800 Message-ID: <20230426091211.21557-8-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764229588194536819?= X-GMAIL-MSGID: =?utf-8?q?1764229588194536819?= Register SCP core 1 as a subdevice of core 0 for the boot sequence and watchdog timeout handling. The core 1 has to boot after core 0 because the SCP clock and SRAM power is controlled by SCP core 0. As for watchdog timeout handling, the remoteproc framework helps to stop/start subdevices automatically when SCP driver receives watchdog timeout event. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_common.h | 9 +++++ drivers/remoteproc/mtk_scp.c | 66 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h index b73b60c22ea1..f1a021ad7f66 100644 --- a/drivers/remoteproc/mtk_common.h +++ b/drivers/remoteproc/mtk_common.h @@ -100,6 +100,13 @@ struct mtk_scp_of_data { size_t ipi_buf_offset; }; +struct mtk_scp_core_subdev { + struct rproc_subdev subdev; + struct mtk_scp *scp; +}; + +#define to_core_subdev(d) container_of(d, struct mtk_scp_core_subdev, subdev) + struct mtk_scp { struct device *dev; struct rproc *rproc; @@ -131,6 +138,8 @@ struct mtk_scp { struct list_head elem; struct list_head *cluster; + + struct mtk_scp_core_subdev *core_subdev; }; /** diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 0b052b0acf2e..8232dab655c0 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -863,6 +863,60 @@ static void scp_remove_rpmsg_subdev(struct mtk_scp *scp) } } +static int scp_core_subdev_start(struct rproc_subdev *subdev) +{ + struct mtk_scp_core_subdev *core_subdev = to_core_subdev(subdev); + struct mtk_scp *scp = core_subdev->scp; + + rproc_boot(scp->rproc); + + return 0; +} + +static void scp_core_subdev_stop(struct rproc_subdev *subdev, bool crashed) +{ + struct mtk_scp_core_subdev *core_subdev = to_core_subdev(subdev); + struct mtk_scp *scp = core_subdev->scp; + + rproc_shutdown(scp->rproc); +} + +static int scp_core_subdev_register(struct mtk_scp *scp) +{ + struct device *dev = scp->dev; + struct mtk_scp_core_subdev *core_subdev; + struct mtk_scp *scp_c0; + + scp_c0 = list_first_entry(scp->cluster, struct mtk_scp, elem); + if (!scp_c0) + return -ENODATA; + + core_subdev = devm_kzalloc(dev, sizeof(*core_subdev), GFP_KERNEL); + if (!core_subdev) + return -ENOMEM; + + core_subdev->scp = scp; + core_subdev->subdev.start = scp_core_subdev_start; + core_subdev->subdev.stop = scp_core_subdev_stop; + + scp->core_subdev = core_subdev; + rproc_add_subdev(scp_c0->rproc, &scp->core_subdev->subdev); + + return 0; +} + +static void scp_core_subdev_unregister(struct mtk_scp *scp) +{ + struct mtk_scp *scp_c0; + + if (scp->core_subdev) { + scp_c0 = list_first_entry(scp->cluster, struct mtk_scp, elem); + rproc_remove_subdev(scp_c0->rproc, &scp->core_subdev->subdev); + devm_kfree(scp->dev, scp->core_subdev); + scp->core_subdev = NULL; + } +} + static int scp_rproc_init(struct platform_device *cluster_pdev, struct platform_device *core_pdev, const struct mtk_scp_of_data *of_data) @@ -963,6 +1017,7 @@ static void scp_rproc_free(struct mtk_scp *scp) { int i; + scp_core_subdev_unregister(scp); scp_remove_rpmsg_subdev(scp); scp_ipi_unregister(scp, SCP_IPI_INIT); scp_unmap_memory_region(scp); @@ -1054,6 +1109,17 @@ static int scp_cluster_init(struct platform_device *pdev) } list_for_each_entry_safe_reverse(scp, temp, cluster, elem) { + if (!list_is_first(&scp->elem, cluster)) { + ret = scp_core_subdev_register(scp); + if (ret) { + dev_err_probe(scp->dev, ret, "Failed to register as subdev\n"); + goto add_fail; + } + + /* sub cores are booted as subdevices of core 0 */ + scp->rproc->auto_boot = false; + } + ret = rproc_add(scp->rproc); if (ret) goto add_fail; From patchwork Wed Apr 26 09:12:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105890vqo; Wed, 26 Apr 2023 02:14:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47gAMNQ2Lk7EUr2YBR37YcSIb2RM6yZEVffFPf9tIe8d1/0HVHFPUV2NVs54Z3lXARgYHS X-Received: by 2002:a17:902:e888:b0:1a9:9b92:bd79 with SMTP id w8-20020a170902e88800b001a99b92bd79mr3034494plg.29.1682500473068; Wed, 26 Apr 2023 02:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500473; cv=none; d=google.com; s=arc-20160816; b=SqnuBXKoTXEDuZ4brpaVs1tepKjaPLi2Hst8Cbwvl1MYEKyQ72E5yYiU8rIBKpQ0tF r2YXDQ8aPih8geAXirnPV9AYJrhrHK1ztbZLALUz9fT3JKw5r2ol6LCF05yHSg8J/Iyv 8W56+PbYf/GPWo1pzWYxL329zwzWuat7/Qhwzs87Y36iBeocQVCx8NJSOI98aBet3YvW na3sPDhEEJjckb1cpiJkFG51ee+OMgNwOpUPRhr/Cf7PtHJpRlh1EtS3dZcdfzpnOF0M g4XEMZsbvO4PzYCvdhheSxVNFYGyXNcjqjrfoqDpSXWsGxdTz7IR2IjUFGAEGtdKU8K6 oC8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KfZkGXgTkiASVW9o/S/L791BNcO+C+JDRApSEaR3cCM=; b=0Rzdsdy5moK/Z2B3UIUTZXMrdfEpdkHuqnDhb8P4AwFInhn8unU5frqpaDboG7z9y1 BV+5TZG1kmrpWJOjPf/5fHNc1Gz22BdVQbkV6SWcw3hAoitjMaQyK3M2slCc/QRWNzfW Rz2oNlus7RgIcPF6zeiDaGr9x+mvPZ5ss5TeL/4pq6m+XZE1e1YsH1XcUxLUWsyOJb81 I28LjC5PJ5EiHF2OJsZbELlMnZwy23ieqlgN2g5+5NIRhKOIP0f4eEX49SvqmVn+02IW 2VmBOuZng70rQfxZ1iUw8tnuj1DaNTJhcTHYHjLvyfcMPCoFdXGbKowcJVXiFM0ECTN9 Y1Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="JXr3+g/i"; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a170903228b00b001a95b85b070si11495305plh.604.2023.04.26.02.14.15; Wed, 26 Apr 2023 02:14:33 -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=@mediatek.com header.s=dk header.b="JXr3+g/i"; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240028AbjDZJNq (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240099AbjDZJMk (ORCPT ); Wed, 26 Apr 2023 05:12:40 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7492F449C; Wed, 26 Apr 2023 02:12:36 -0700 (PDT) X-UUID: 768bcb6ae41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=KfZkGXgTkiASVW9o/S/L791BNcO+C+JDRApSEaR3cCM=; b=JXr3+g/iBlMAItj1SQa0C9H5tpMKmDM14yhGBNVsX9AeUCrmSOQhZgfwm3xlLsTYFHqjn3JQmBXXksDrlrSGZuROTgnWSrMIzEV4d5UxSOoIffa0FER8qWcjrVwB4JmN14+/7PT7F4MOedlNe13icldS1DVzdig2/64Ba+/m90A=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:7ed42d7b-535b-4537-a125-69b3cf7bd65d,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:b2de92a2-8fcb-430b-954a-ba3f00fa94a5,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 768bcb6ae41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1304326498; Wed, 26 Apr 2023 17:12:26 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 08/11] remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset Date: Wed, 26 Apr 2023 17:12:08 +0800 Message-ID: <20230426091211.21557-9-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764229615931306960?= X-GMAIL-MSGID: =?utf-8?q?1764229615931306960?= Because MT8195 SCP core 0 and core 1 both boot from head of SRAM and have the same viewpoint of SRAM, SCP has a "core 1 SRAM offset" configuration to control the access destination of SCP core 1 to boot core 1 from different SRAM location. The "core 1 SRAM offset" configuration is composed by a range and an offset. It works like a simple memory mapped mechanism. When SCP core 1 accesses a SRAM address located in the range, the SCP bus adds the configured offset to the address to shift the physical destination address on SCP SRAM. This shifting is transparent to the software running on SCP core 1. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_common.h | 7 +++++++ drivers/remoteproc/mtk_scp.c | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h index f1a021ad7f66..6861543a0825 100644 --- a/drivers/remoteproc/mtk_common.h +++ b/drivers/remoteproc/mtk_common.h @@ -65,6 +65,13 @@ #define MT8195_CORE1_MEM_ATT_PREDEF 0x20008 #define MT8195_CORE1_WDT_CFG 0x20034 +#define MT8195_SEC_CTRL 0x85000 +#define MT8195_CORE_OFFSET_ENABLE_D BIT(13) +#define MT8195_CORE_OFFSET_ENABLE_I BIT(12) +#define MT8195_L2TCM_OFFSET_RANGE_0_LOW 0x850b0 +#define MT8195_L2TCM_OFFSET_RANGE_0_HIGH 0x850b4 +#define MT8195_L2TCM_OFFSET 0x850d0 + #define SCP_FW_VER_LEN 32 #define SCP_SHARE_BUFFER_SIZE 288 diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 8232dab655c0..12175ee55844 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -485,6 +485,9 @@ static int mt8195_scp_before_load(struct mtk_scp *scp) static int mt8195_scp_c1_before_load(struct mtk_scp *scp) { + u32 sec_ctrl; + struct mtk_scp *scp_c0; + scp_sram_power_on(scp->reg_base + MT8195_CPU1_SRAM_PD, 0); /* hold SCP in reset while loading FW. */ @@ -493,6 +496,30 @@ static int mt8195_scp_c1_before_load(struct mtk_scp *scp) /* enable MPU for all memory regions */ writel(0xff, scp->reg_base + MT8195_CORE1_MEM_ATT_PREDEF); + /* + * The L2TCM_OFFSET_RANGE and L2TCM_OFFSET shift the destination address + * on SRAM when SCP core 1 accesses SRAM. + * + * This configuration solves booting the SCP core 0 and core 1 from + * different SRAM address because core 0 and core 1 both boot from + * the head of SRAM by default. this must be configured before boot SCP core 1. + * + * The value of L2TCM_OFFSET_RANGE is from the viewpoint of SCP core 1. + * When SCP core 1 issues address within the range (L2TCM_OFFSET_RANGE), + * the address will be added with a fixed offset (L2TCM_OFFSET) on the bus. + * The shift action is tranparent to software. + */ + writel(0, scp->reg_base + MT8195_L2TCM_OFFSET_RANGE_0_LOW); + writel(scp->sram_size, scp->reg_base + MT8195_L2TCM_OFFSET_RANGE_0_HIGH); + + scp_c0 = list_first_entry(scp->cluster, struct mtk_scp, elem); + writel(scp->sram_phys - scp_c0->sram_phys, scp->reg_base + MT8195_L2TCM_OFFSET); + + /* enable SRAM offset when fetching instruction and data */ + sec_ctrl = readl(scp->reg_base + MT8195_SEC_CTRL); + sec_ctrl |= MT8195_CORE_OFFSET_ENABLE_I | MT8195_CORE_OFFSET_ENABLE_D; + writel(sec_ctrl, scp->reg_base + MT8195_SEC_CTRL); + return 0; } From patchwork Wed Apr 26 09:12:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp109164vqo; Wed, 26 Apr 2023 02:22:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gvigknKuhn3EyZPy0e7yWewv4WBNhFOhkVV/Ou2wFlSt5x6EOLQLdrulnXGoR6Cf1n5QZ X-Received: by 2002:a05:6a20:1595:b0:f6:9492:93b2 with SMTP id h21-20020a056a20159500b000f6949293b2mr4314886pzj.23.1682500973881; Wed, 26 Apr 2023 02:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500973; cv=none; d=google.com; s=arc-20160816; b=Or6Eh45swnH7KAvDclfn0/3a8Zsc+MYCalCS8ivojR/0xmeCUqcrs7TR1Kwd2r9pIB 7JecfXOdCTWurL9BYOEdrq+BgQqyCq8gXhAiKFlDqdcEk5fEPzEZ121JMkN9adDMJGI/ qp0W+LF99shntZ8dGdNR0nlUqHhSEK7Hx/ru5inbYHgPixvTKDIdhKu/7YPapxyYNHRL 3IiA8+/eDFt5lEWGlUx8URB/yzpyUadvxTiaQpYH/l4Ku0VO2g0Q069zpWdOUk/Kj3f6 fyOvFBKBqooDoe7SEfnY2FBpoDlT9AC1CzBG9wfFUZlsg602bRW2OusiU4boSZiCpRIF M2Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qBZXw87s3YqhkYY8uTS23iTcLnaU3nGLd4lr1NTyYVM=; b=x2lXuAX9XXGnQWYzMW4Z9ewcoa9Wd7MtGpq5JaGW2zKSFEmaW5TKTMXQ479hmfGDdh io+2n8poxN+3DRru/Mz9VPy5Mi7NsVoCPHcZHUApev8q5bP2U7HFGhwF43L/tSMAhM8T d2Wr+yNEpgf06Gg7LraeA/Nv2vxt+kcBmRgYgycOTGvlkzDkm/xc9ETiG9pACAxdfE79 FTnfNyAMxrd5eJd6EyFsRIs9a0mqezBeJLSdgfqi3h9EAZFJUWw4fKEOOmEVxeNdNumO opYx62qjFvUPwKkfBvyi2uN+V+CVdl3tfNFgifBxVDDN4KCy2cnZbn5AuISzs9zrCZ3r xP+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=vFO1eB7U; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 195-20020a6303cc000000b0051b59786e6csi16095322pgd.300.2023.04.26.02.22.18; Wed, 26 Apr 2023 02:22:53 -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=@mediatek.com header.s=dk header.b=vFO1eB7U; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240315AbjDZJOL (ORCPT + 99 others); Wed, 26 Apr 2023 05:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240169AbjDZJMl (ORCPT ); Wed, 26 Apr 2023 05:12:41 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 066F244AC; Wed, 26 Apr 2023 02:12:36 -0700 (PDT) X-UUID: 76a2a344e41211edb6b9f13eb10bd0fe-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=qBZXw87s3YqhkYY8uTS23iTcLnaU3nGLd4lr1NTyYVM=; b=vFO1eB7UR2UtnjahFUQDepD5igXirV2dqVQecaEdoo5BkwEGOgmQGKEU7DjF/JPbh/TH/GhCSSaA1YJU2zOv/EvNgh3TQppR97+tkvZBHi/UjHTxy5rpgmRhx4yKSAPyMGP/3KZo8fe+oYWRCqMF0roq5n66VuMfytJL9po/BOI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:14a16cbf-0537-448a-8437-13efc20aede9,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:33254e85-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 76a2a344e41211edb6b9f13eb10bd0fe-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2062975793; Wed, 26 Apr 2023 17:12:26 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 09/11] remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout Date: Wed, 26 Apr 2023 17:12:09 +0800 Message-ID: <20230426091211.21557-10-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,RDNS_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no 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?1764230140897899680?= X-GMAIL-MSGID: =?utf-8?q?1764230140897899680?= The MT8195 SCP core 1 watchdog timeout needs to be handled in the SCP core 0 IRQ handler because the MT8195 SCP core 1 watchdog timeout IRQ is wired on the same IRQ entry for core 0 watchdog timeout. MT8195 SCP has a watchdog status register to identify the watchdog timeout source when IRQ triggered. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_common.h | 5 +++++ drivers/remoteproc/mtk_scp.c | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_common.h b/drivers/remoteproc/mtk_common.h index 6861543a0825..1e148cbad0fb 100644 --- a/drivers/remoteproc/mtk_common.h +++ b/drivers/remoteproc/mtk_common.h @@ -55,6 +55,10 @@ #define MT8192_CORE0_WDT_IRQ 0x10030 #define MT8192_CORE0_WDT_CFG 0x10034 +#define MT8195_SYS_STATUS 0x4004 +#define MT8195_CORE0_WDT BIT(16) +#define MT8195_CORE1_WDT BIT(17) + #define MT8195_L1TCM_SRAM_PDN_RESERVED_RSI_BITS GENMASK(7, 4) #define MT8195_CPU1_SRAM_PD 0x1084 @@ -63,6 +67,7 @@ #define MT8195_CORE1_SW_RSTN_CLR 0x20000 #define MT8195_CORE1_SW_RSTN_SET 0x20004 #define MT8195_CORE1_MEM_ATT_PREDEF 0x20008 +#define MT8195_CORE1_WDT_IRQ 0x20030 #define MT8195_CORE1_WDT_CFG 0x20034 #define MT8195_SEC_CTRL 0x85000 diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 12175ee55844..b9cac76b71fd 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -230,6 +230,29 @@ static void mt8192_scp_irq_handler(struct mtk_scp *scp) } } +static void mt8195_scp_irq_handler(struct mtk_scp *scp) +{ + u32 scp_to_host; + + scp_to_host = readl(scp->reg_base + MT8192_SCP2APMCU_IPC_SET); + + if (scp_to_host & MT8192_SCP_IPC_INT_BIT) { + scp_ipi_handler(scp); + } else { + u32 reason = readl(scp->reg_base + MT8195_SYS_STATUS); + + if (reason & MT8195_CORE0_WDT) + writel(1, scp->reg_base + MT8192_CORE0_WDT_IRQ); + + if (reason & MT8195_CORE1_WDT) + writel(1, scp->reg_base + MT8195_CORE1_WDT_IRQ); + + scp_wdt_handler(scp, reason); + } + + writel(scp_to_host, scp->reg_base + MT8192_SCP2APMCU_IPC_CLR); +} + static void mt8195_scp_c1_irq_handler(struct mtk_scp *scp) { u32 scp_to_host; @@ -1293,7 +1316,7 @@ static const struct mtk_scp_of_data mt8192_of_data = { static const struct mtk_scp_of_data mt8195_of_data = { .scp_clk_get = mt8195_scp_clk_get, .scp_before_load = mt8195_scp_before_load, - .scp_irq_handler = mt8192_scp_irq_handler, + .scp_irq_handler = mt8195_scp_irq_handler, .scp_reset_assert = mt8192_scp_reset_assert, .scp_reset_deassert = mt8192_scp_reset_deassert, .scp_stop = mt8195_scp_stop, From patchwork Wed Apr 26 09:12:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp105688vqo; Wed, 26 Apr 2023 02:14:02 -0700 (PDT) X-Google-Smtp-Source: AKy350b+9Pxe/+Q84sd1OLsk6FATNumPBMm3+vhrkFw7HbM2ItDt3XR/nyjmj5SnKdPywm8YGBJK X-Received: by 2002:a05:6a21:6817:b0:f0:164b:fa5d with SMTP id wr23-20020a056a21681700b000f0164bfa5dmr22952578pzb.15.1682500442469; Wed, 26 Apr 2023 02:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500442; cv=none; d=google.com; s=arc-20160816; b=dZB9o9BTpKBvki1XT+kG6wLgdtv9YhEOuiWRIQcfL6R8A62jkjbXfNqOKipT2AWIj5 ub4qN97YapFDfVF2XDLdsWPgBVBHhX/ECJpoZh2dmocSME8SMLCNvti8a0Zij8FeCMO8 WLcVZz+PHwNOEhPFCjan3t6aPRn7w64P8bHMThnWd6zhEutin5c6XCJNZHrTjpSmEeZe dX4fCUM7LvqvYwlUZM6v60KhFPzJSICK8oHNQCfN8iMDjjP2RwG93gg8ygJ8SmXWgsPI uW1iAsZKfXTxfAp8umfR2toPZJ0ktluRVTaocx987HHfIvtjzkAH6jb6SNv5Skc1LPli VMtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ReZGMhsNPPyTBuhIeLOUiJxAwpxEd51U50A23tp1WP8=; b=wfO7BNL3mO9OvkbhjOR8Rt04g/JWFSJARjU0fqZFzipAYpBQcUb2TALC35ntsioM+s C8wwiRCotjORXgZa3xaw5KmLMfYaiqw0ZztG/rB31SueGcmld0cjpP5Po/3VnANUPHq6 nAvBdXG2t4+KlTri49lcR1FXDj52VEwup/4dCJL3ANrrsECov9rCkOObz4lt8NWQU3q0 doCjnatzUx5JXQ9c+8IwECp1s3OTM6vsCky42Cd0RVK/0cynVWMAnPYwCM9fgPJ6ey2E jSBIAaGhl47hla5ieg+0gyXk/BT8p6fMgTLsh/UFiOPzM85QFhmwwAZeHRlDQxznrJKx u+8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tB9VpEIQ; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gd17-20020a17090b0fd100b002308ac7a1b0si15705797pjb.117.2023.04.26.02.13.49; Wed, 26 Apr 2023 02:14:02 -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=@mediatek.com header.s=dk header.b=tB9VpEIQ; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240232AbjDZJN0 (ORCPT + 99 others); Wed, 26 Apr 2023 05:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239984AbjDZJMi (ORCPT ); Wed, 26 Apr 2023 05:12:38 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D8840F7; Wed, 26 Apr 2023 02:12:33 -0700 (PDT) X-UUID: 776b15a4e41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ReZGMhsNPPyTBuhIeLOUiJxAwpxEd51U50A23tp1WP8=; b=tB9VpEIQDWqOANCDylpQfI4ytfg2XdJV9KvZ3Z1KDeFiXoAe95/PU9+rNTwsJRi2ALVuPE46/7O6EJ9JDo74fmfebMR3rPE8ka8+nAR1jeQZoBCrvUM8spbxSOnc8qsSLRgi4w+8/z9gMB1Ys5d5PD6pd/BNHc2U95DynhVKb3A=; X-CID-CACHE: Type:Local,Time:202304261712+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:70f47ea0-11fe-483e-87d2-3171e4eee474,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:2fbd34ec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 776b15a4e41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1004333709; Wed, 26 Apr 2023 17:12:28 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 10/11] remoteproc: mediatek: Refine ipi handler error message Date: Wed, 26 Apr 2023 17:12:10 +0800 Message-ID: <20230426091211.21557-11-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764229584029469894?= X-GMAIL-MSGID: =?utf-8?q?1764229584029469894?= The error message doesn't accurately reflect the cause of the error. The error is due to a handler not being found, not an invalid IPI ID. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_scp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index b9cac76b71fd..02a7673d84c9 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -114,7 +114,7 @@ static void scp_ipi_handler(struct mtk_scp *scp) scp_ipi_lock(scp, id); handler = ipi_desc[id].handler; if (!handler) { - dev_err(scp->dev, "No such ipi id = %d\n", id); + dev_err(scp->dev, "No handler for ipi id = %d\n", id); scp_ipi_unlock(scp, id); return; } From patchwork Wed Apr 26 09:12:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 87764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp108916vqo; Wed, 26 Apr 2023 02:22:12 -0700 (PDT) X-Google-Smtp-Source: AKy350bQMdLJviQX/cT30vdSYrno8K6604p1NLVvv9tf7nTMXYlgNJ0x0FOVJPGnp2EDxRJ+CNDo X-Received: by 2002:a05:6a20:8f03:b0:ea:fb53:4cb1 with SMTP id b3-20020a056a208f0300b000eafb534cb1mr27566682pzk.41.1682500932615; Wed, 26 Apr 2023 02:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682500932; cv=none; d=google.com; s=arc-20160816; b=gV7FAYoakPGZPJPQc3qgQgvls6X8mUcLvPqVngvan1sLSAASujss/xF9/83qCH7Xlp 1wN4cfsZvbIna1jg1UFbhNcKo0MYR6+fpzQHAXYc8uAeenfogj2mKpSlJm3o57oJHMy9 uKD96898p4+NoYMOYL9Dr/8SXSAi/riMFNto7PRp4xL+xebYscHGJhBW7Y0ebZonmoIP NPuaLbxwH3clgcqmPiYUBGp8Tr2hP65wTgfkPZaXc6OPSJGTui3cJa2h1gnYaM5Erm/1 plB+UB7HIyeA1+8K13hd4kS+/hoAYCc0mL/uMMTYfFUhG5aLuE+6DC8InZym8G/l+KBZ FyTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zITZHaBffEXHgQvakViptRVDM6YtdJ7FNpbDESp+DO4=; b=eDhE52eE08C964jSAq5v9pySs8A/FM3neNnSG1GfBudlnwWpdwN03MdrwPhtBembs/ X1ZW67yHCtxrm43G1eiNudFqpxnVwAt8+JQKVW+bKP36p54x6oXEI4rbOfU/S9oMH5D2 0jVYWZfMrvoqzoTpZt2TD+eWiugfEoQt/MqcVPseRKZb3RHC2OfvHft6xjWENS7u0h6j cLYDYjucHlMYL97EzpV74eDOsrtQKgF2G9AazOShtc9CPB1exbUjiZhegPH1YpywwZvE K1DOXVyb2Jc2jdggNpr74yg3zCRDBgG78Lmn0p3ZJkzo7fIZc3g7Ed1KonbMhSEX8HgI euKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OSRCxZeE; 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=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a17090a9f0900b0023d22d0f0fdsi18396525pjp.19.2023.04.26.02.22.00; Wed, 26 Apr 2023 02:22:12 -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=@mediatek.com header.s=dk header.b=OSRCxZeE; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240263AbjDZJOT (ORCPT + 99 others); Wed, 26 Apr 2023 05:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240166AbjDZJMl (ORCPT ); Wed, 26 Apr 2023 05:12:41 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C9430EF; Wed, 26 Apr 2023 02:12:37 -0700 (PDT) X-UUID: 76be70c4e41211eda9a90f0bb45854f4-20230426 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=zITZHaBffEXHgQvakViptRVDM6YtdJ7FNpbDESp+DO4=; b=OSRCxZeEb3Tx3vUNA0cWLhQLEy3ypOwhPh5g4TFZYXrW0qVOFzcCd3ZoiIwTgNKP+LsaYydPR0ts0LHmyVyqxdgCqvUuoRWIXcpD4qEktvk9dupiVyfguf2sxzUEjp7BeVhm1JxnJvdlTI/eT1u4k0mSTqN0WJw1jwEb3qrT8fE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:bd5ecef9-b050-4e38-b6c2-20379eef23c9,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:120426c,CLOUDID:a8bd34ec-db6f-41fe-8b83-13fe7ed1ef52,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: 76be70c4e41211eda9a90f0bb45854f4-20230426 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 575319499; Wed, 26 Apr 2023 17:12:27 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 26 Apr 2023 17:12:25 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Wed, 26 Apr 2023 17:12:25 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v10 11/11] arm64: dts: mediatek: mt8195: Add SCP 2nd core Date: Wed, 26 Apr 2023 17:12:11 +0800 Message-ID: <20230426091211.21557-12-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230426091211.21557-1-tinghan.shen@mediatek.com> References: <20230426091211.21557-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764230097754005235?= X-GMAIL-MSGID: =?utf-8?q?1764230097754005235?= Rewrite the MT8195 SCP device node as a cluster and add the SCP 2nd core in it. Since the SCP device node is changed to multi-core structure, enable SCP cluster to enable probing SCP core 0. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno --- .../boot/dts/mediatek/mt8195-cherry.dtsi | 6 +++- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 32 ++++++++++++++----- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index 8ac80a136c37..8addb94a24a1 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -962,7 +962,11 @@ interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>; }; -&scp { +&scp_cluster { + status = "okay"; +}; + +&scp_c0 { status = "okay"; firmware-name = "mediatek/mt8195/scp.img"; diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index a44aae4ab953..10947b4b4707 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -916,14 +916,30 @@ clocks = <&infracfg_ao CLK_INFRA_AO_GCE2>; }; - scp: scp@10500000 { - compatible = "mediatek,mt8195-scp"; - reg = <0 0x10500000 0 0x100000>, - <0 0x10720000 0 0xe0000>, - <0 0x10700000 0 0x8000>; - reg-names = "sram", "cfg", "l1tcm"; - interrupts = ; + scp_cluster: scp@10500000 { + compatible = "mediatek,mt8195-scp-dual"; + reg = <0 0x10720000 0 0xe0000>, <0 0x10700000 0 0x8000>; + reg-names = "cfg", "l1tcm"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x10500000 0x100000>; status = "disabled"; + + scp_c0: scp@0 { + compatible = "mediatek,scp-core"; + reg = <0x0 0xa0000>; + reg-names = "sram"; + interrupts = ; + status = "disabled"; + }; + + scp_c1: scp@a0000 { + compatible = "mediatek,scp-core"; + reg = <0xa0000 0x20000>; + reg-names = "sram"; + interrupts = ; + status = "disabled"; + }; }; scp_adsp: clock-controller@10720000 { @@ -2464,7 +2480,7 @@ <&iommu_vdo M4U_PORT_L19_VENC_REF_LUMA>, <&iommu_vdo M4U_PORT_L19_VENC_REF_CHROMA>; interrupts = ; - mediatek,scp = <&scp>; + mediatek,scp = <&scp_c0>; clocks = <&vencsys CLK_VENC_VENC>; clock-names = "venc_sel"; assigned-clocks = <&topckgen CLK_TOP_VENC>;