From patchwork Tue Mar 28 02:27:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1922613vqo; Mon, 27 Mar 2023 19:29:42 -0700 (PDT) X-Google-Smtp-Source: AK7set8nK8YBBHKXiCIPJ4qZU3z/6dCv4sdKfq4GhQI5Nuovv/mOs/bdA8L2PzRmAdqVvmvJTJVX X-Received: by 2002:a05:6a20:548a:b0:d9:dbb6:2e7a with SMTP id i10-20020a056a20548a00b000d9dbb62e7amr18578865pzk.27.1679970581895; Mon, 27 Mar 2023 19:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970581; cv=none; d=google.com; s=arc-20160816; b=P4fYAGW4OWGiPszPk25PvQZ9bcBnVQHqdQjc0NHxFR08YOaAk2kkfX3u6VuyjntSHx QpAB1WIbcThajvjQUzDqUeZ5ttL+h49kNzE4VLsYpz8HbjD6uPZkEP+/dCTEKfQOjGAc 5D4Qi1jNSeppHO+D/5DCIHe8HpnOicIjQV4SDDh54Zi4pYwxkgXSVhC1JVX2uqF/N+HL IGPkG8n20DeijOR3Puf1PYLCBg1UTfo6oDyeiwAetJovo7ByVndyxS2B0+lhxfH6zixQ Mlh8AepkXLXr1hxyXodljrrTIjb+v5yKSTbUoYPlsEKyvg95dSY8RthviVzXtuwA5gnZ VMGw== 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=XjZacM9ifP/b4IHVLS7lQ8P07kb9kvobQ52/URK5/6LYqyqo4sxkW0fe7SywT5z2b+ likawC0Q8H7mje1QunKpKjFjE4jikHs8+tOC0NgFcBUkKSivWmGEaTMMTvf23DW9ediY ZHcNelUsT1m1PiPLTeytxqf3lBr16COzFCoqh38454J/ChNsFB+ckb1/rcc3v9YQzf5u FyU2IVm2CvXzT6aXEJb+AgRVW7jHkW4U6/IZj/6IiUHNpfEcNTLkjbGBwYMplCOtZqfE Pwc1y1giO+6j8lhUXlyyh9PfmnMjc/zfQYQn9doTpXrd1UjNnqN+PPiY5cpnHvCdUk7I CINA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Te6hZgZx; 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 x5-20020a654145000000b00503005a4f2fsi27305368pgp.857.2023.03.27.19.29.29; Mon, 27 Mar 2023 19:29:41 -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=Te6hZgZx; 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 S232562AbjC1C2L (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbjC1C2I (ORCPT ); Mon, 27 Mar 2023 22:28:08 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 778E019A0; Mon, 27 Mar 2023 19:28:02 -0700 (PDT) X-UUID: 2648fca4cd1011eda9a90f0bb45854f4-20230328 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=Te6hZgZxmE+9ZlNp0EIBpyaoKkkJx2zzUlGOalF4wWVQYjNnDSgF4DKtv/RTrO+iW5U9SRvAjmsb+I5wwWsItxEffFumVsz+KdLsQHABJMOLUmGJf36IkKZ8YPzF2HgOo6rOhaPw9MlC6dfNEWpklEWAdobHp8agJFTQ7JBxBJQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:8cccf62e-6d00-4d0a-b45c-672bcf2be83e,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:8cccf62e-6d00-4d0a-b45c-672bcf2be83e,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:94e98db4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:23032810275947VRII9Y,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 2648fca4cd1011eda9a90f0bb45854f4-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1933316158; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:54 +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; Tue, 28 Mar 2023 10:27:54 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 01/11] dt-bindings: remoteproc: mediatek: Improve the rpmsg subnode definition Date: Tue, 28 Mar 2023 10:27:23 +0800 Message-ID: <20230328022733.29910-2-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable 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?1761576832800909863?= X-GMAIL-MSGID: =?utf-8?q?1761576832800909863?= 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 Tue Mar 28 02:27:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75795 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1928338vqo; Mon, 27 Mar 2023 19:47:29 -0700 (PDT) X-Google-Smtp-Source: AKy350bwK8kHmQFT3g8jL1n/ZvhBefko/oTc0SWIWF6/bKu9Ycw9Mo0ki7nNT3yfDoVWwd70cdbU X-Received: by 2002:a17:906:e0c6:b0:93b:a133:f7e6 with SMTP id gl6-20020a170906e0c600b0093ba133f7e6mr13672676ejb.46.1679971649314; Mon, 27 Mar 2023 19:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679971649; cv=none; d=google.com; s=arc-20160816; b=FlEGKWutRp193TAoRfPRBPJQkRNHO9xmdCMgt1ooKiBY2a2gjmHWw1C4AwD3By1hKw icOYJM1VPjRB+wadDPQjsqXNvLomIuJa/Y6V7c/pHD+xILcopERydeSmeWdx7l6CX+8+ XH0fs0kZS/Yoojn1RdtSH33ViNCndX8RfHpEfpDPefTEb9wvN/DziskhO7YoXdK770bx +NJ8ZBXtKo6MN04bA3dUfwU1YdJpd+VSHZKA9dey4ZQDPOt0vvZBKh86cQYB/WRBSqud zFcy6XBthiLN7z0jWiCtpJQzCaWONZxouEHxYo+rslELUORVgtGbIcUfv39KKpqia1+5 n88w== 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=6RFdGCQH8CwMl3cCS8uEv83UelcwU4aqIgZl9J6q30U=; b=s52xdO265W2boua8AwDkKf6pGPeC0fed2QlF3/BJEAkPhLQ16q1m6EY0np8bTCW4rY hrLItqTFNjoliWyuOZeDe/y/Yc6BpebkWxJt4EG5qQCxh9aMWYWL9bOaNCIy47EF1nOi 98iZq8Ps6yLu2CTDYIbaWnvdAXoR1c4kSkYJNNVkzWAzjkijflgg8jMju1NMw0YgP7P6 ZT+PmkT1hRMry1F2s7I6CvTpcYIbdaMMc9llVtcnh0V/RNa9e67mE0cK39s2vcHOv3vH eAhEkBaVjg/WWxW8YaL62DYUqJsOHC99mEKeGi26Sja2MOPa7/u5RNcEwhTNm1EwJqOa yuSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Oy5kob+R; 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 h3-20020a170906828300b008d6b51de6bcsi28948419ejx.32.2023.03.27.19.46.52; Mon, 27 Mar 2023 19:47:29 -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=Oy5kob+R; 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 S229935AbjC1C23 (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232115AbjC1C2L (ORCPT ); Mon, 27 Mar 2023 22:28:11 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9352219BA; Mon, 27 Mar 2023 19:28:08 -0700 (PDT) X-UUID: 266431d6cd1011edb6b9f13eb10bd0fe-20230328 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=6RFdGCQH8CwMl3cCS8uEv83UelcwU4aqIgZl9J6q30U=; b=Oy5kob+RkQps7huHw82voMwAa67bll06OScjMma7GiD0A0EgfpmS44rtviwHHDfODcvA621fOUxEHbAddS/QLbYFV6DkPlW3nF+jTu3mhAKTEIov60XvkAscIGFr+Pm67YQa5lvTcTgtD9SKnpfnr5fU/rLbf2UXHbSwVav/4dY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:77a87fa5-e34d-4718-a7da-a3c1728263ae,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:77a87fa5-e34d-4718-a7da-a3c1728263ae,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:6bc8ac29-564d-42d9-9875-7c868ee415ec,B ulkID:230328102759ZL8K3IWQ,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 266431d6cd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1155895560; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 02/11] arm64: dts: mediatek: Update the node name of SCP rpmsg subnode Date: Tue, 28 Mar 2023 10:27:24 +0800 Message-ID: <20230328022733.29910-3-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761577951889956728?= X-GMAIL-MSGID: =?utf-8?q?1761577951889956728?= 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 fbe14b13051a..a259eb043de5 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -810,7 +810,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 9f12257ab4e7..8f14b633c1e1 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi @@ -1260,7 +1260,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 Tue Mar 28 02:27:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1923290vqo; Mon, 27 Mar 2023 19:31:26 -0700 (PDT) X-Google-Smtp-Source: AKy350axk41wZM0dUZikuo3ITMzGmfHTturE+Wk0dlUzyMaAjLGpXS8hcU9fhlN3qr1Ib/2fiquQ X-Received: by 2002:a17:902:ea11:b0:1a1:f06b:f171 with SMTP id s17-20020a170902ea1100b001a1f06bf171mr14652619plg.17.1679970686189; Mon, 27 Mar 2023 19:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970686; cv=none; d=google.com; s=arc-20160816; b=JBMHKbCuXNWXl2yfihhHgzqExbif4iTeQcOqkPuJ33MI5LPO3s4QOXvPgsNJVs1CCg XItf5MiU9IyHFH0uYmKO0vQEOaINwuSKLdnZZUzb1sN+piH62bYqauJJZKg842iw5xl5 SjGpLltmzQGto/1VmFTTGIOMBxw8C9YR6JqL50fuZwssluqb/bF9NvmoUTLtGsWXzNzI hev2ppmy5fX2U6F8Y+/6vk1SCkX0nEnzDj8p3+eOnVtkzzfBB1lze4r0J7IrmtMZdF7+ 61ye7eAO6g3xTeSIhlPZB7tNvBGCvSMFmBMWqqVXqTU2wzH4V7dOkTacgVspu099Zkgv kJbg== 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=B/KX4yp5d2Utju7WiuqAXFEKzirjoYJycbBUCG/tJOEowmw8YPYaYvlhD8KwH6wFWm /3EFxecXa6u8Bm1ryTsVZ0CDWKpe4VQNFSrAdDB+cZ0e4L3MOup6xF8hC2tcs4AjIYXa PaOAobWLBZmbhSBQ8V0ZRnBKjSLOMfURRuVkHHlYocfjaIi663Qc0V+gStTr5R58lILy /Kt+U1OJ1G1ihPkNBvgK1l/FCKkER4i9sQMBmRHn1cFe/xgx94/VbGzHHJwEvXhEFZY2 52joupeTehdSEMbsWUbVWyOykl1S1Ugx07GAIZCkhiw2MyVwD795/+GHM0kDgGs72YBZ QuJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=YfxyTaxO; 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 w1-20020a631601000000b005133c334fe1si6628698pgl.454.2023.03.27.19.31.13; Mon, 27 Mar 2023 19:31:26 -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=YfxyTaxO; 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 S232777AbjC1C2g (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbjC1C2N (ORCPT ); Mon, 27 Mar 2023 22:28:13 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929D7199E; Mon, 27 Mar 2023 19:28:06 -0700 (PDT) X-UUID: 26719128cd1011edb6b9f13eb10bd0fe-20230328 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=YfxyTaxO2DohYv6Fq83k4+cGcXI/baBwFjSSI7pynx95JQEc3ExdkBLA/WcOQm/UyS5auv4X9fvGrfB36ANbRp6BvSKRiCWxaWByqr5f81BfBX3wn+HcDrXcsZjFvt2m9TLxhWtqU0pDWWvdNlDggTU5oAxVrHEniWa++DE8XD0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:79d98bda-4b24-4fb2-990a-c6fe624fea99,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:79d98bda-4b24-4fb2-990a-c6fe624fea99,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:91e98db4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:230328102759U2HMDMM3,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26719128cd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1266171292; Tue, 28 Mar 2023 10:27:56 +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.25; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 03/11] dt-bindings: remoteproc: mediatek: Support MT8195 dual-core SCP Date: Tue, 28 Mar 2023 10:27:25 +0800 Message-ID: <20230328022733.29910-4-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable 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?1761576942245076545?= X-GMAIL-MSGID: =?utf-8?q?1761576942245076545?= 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 Tue Mar 28 02:27:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1925860vqo; Mon, 27 Mar 2023 19:39:36 -0700 (PDT) X-Google-Smtp-Source: AKy350Z3xSeh44+ZJb0IfhL8UZQDE+Ok+OnMxK8k+3hpsFlssmDqIbokywBh/Gbab6jHLox/6faW X-Received: by 2002:a17:902:e30b:b0:1a1:7c2b:4aea with SMTP id q11-20020a170902e30b00b001a17c2b4aeamr10651290plc.0.1679971176282; Mon, 27 Mar 2023 19:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679971176; cv=none; d=google.com; s=arc-20160816; b=ydffIKT42BeLQJK5gKVDh31g2mCZX27EF1Q80FC/XcocGN/62MEbQHjctLk0BsLtXy KopukUhtMXO0wMzL6RUeO44pi7m4CdLaLkNXrVsZCz6BX1Hm6EF9z1+d2+KPoCiQsQSq 5INKjOVo7wB4EKD4NJjOgW/pliXXU3UlG4bB+HCPraFJSzAklsX0ZSDUAIcm+OdGWdFI D6/awCKo/eH2d9YT4prCGhq1n68X3IiUravO5+Iqnbvtl+mK2lxBdd7FZLlg8IuMV3xc zjV8+g5nntI+JxQI3B3neXckIgAOtw6yRHnPheNFYQgg/n066lvuvRM/jaI+3zDIpFjv 5Bsg== 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=cMNTIJZmGwYCT3gi3BFOionOLTyJOICMUovIktXwWP4=; b=ZiCLy12CfSzngknwA9+PHcEzhWKJuren0pDLHXLFABnsOdgXND9xrTTtg+dwx4QeKX xtdVyLlhp3RWLiOPTHjffydQYZxZ1oqGz7LySzcCN207QrTCp26HA9wBZuBWf6BfQ2JW MwSoxcTdGMF91FBrXD2sLBULvUioxOyurnK8neDCleZatBZDNYCqLV2XzqA+FgCwI4pb fO7B1c47pwRiifDXOnsizyKH0JkgV8HlRmL54QlC6RvJYEHdglS1fe0a0s9NfWgb9N7n S2m/nGocEmeISFuMIbYDWLEWGxcsrGyVVBRWuz9KFO9g0eRpayOkT7sjFpHsT7YCHp08 geog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=bnctapdH; 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 jx7-20020a170903138700b001a053f3376asi12584380plb.301.2023.03.27.19.39.23; Mon, 27 Mar 2023 19:39:36 -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=bnctapdH; 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 S232797AbjC1C2m (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbjC1C2N (ORCPT ); Mon, 27 Mar 2023 22:28:13 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91E602696; Mon, 27 Mar 2023 19:28:10 -0700 (PDT) X-UUID: 26672788cd1011edb6b9f13eb10bd0fe-20230328 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=cMNTIJZmGwYCT3gi3BFOionOLTyJOICMUovIktXwWP4=; b=bnctapdHUyRcp5I5ijFr5TqsArgXQLvUUzLnCWWHUJey2QOEoXL7OZullujO+hlJVfK52rqck243+HiILbijt/31qFv/mGGiDsevQ+jLFDyfkWqxGwHEgwJkJd3G/PDpfoG+JX0v3nGHsiBwsHAx149Exbl6OXd0LhEKQq6Tntg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:ececd07a-288b-403e-a50c-50a67fb45ee0,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:ececd07a-288b-403e-a50c-50a67fb45ee0,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:89e98db4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:230328102759KIOO0OL2,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26672788cd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 862668222; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 04/11] remoteproc: mediatek: Add MT8195 SCP core 1 operations Date: Tue, 28 Mar 2023 10:27:26 +0800 Message-ID: <20230328022733.29910-5-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761577456131665081?= X-GMAIL-MSGID: =?utf-8?q?1761577456131665081?= 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 0861b76f185f..a3b9bc158cd9 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 = (struct mtk_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 Tue Mar 28 02:27:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75787 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1922769vqo; Mon, 27 Mar 2023 19:30:09 -0700 (PDT) X-Google-Smtp-Source: AKy350ZIxS2eIvxHlfhBHonDh1olyscDRQAgBDf6OZBf3oFdAtflX/xDVtIv9Mcg/w2Xxr4AWnvm X-Received: by 2002:a17:90b:4c0c:b0:233:d12f:f43a with SMTP id na12-20020a17090b4c0c00b00233d12ff43amr13566695pjb.1.1679970608844; Mon, 27 Mar 2023 19:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970608; cv=none; d=google.com; s=arc-20160816; b=gtH6WnpXAZBW+CN7ADl0yAnYeTwjzHksZ8MWQk/fBywzTJPLFk+X7O+5i17UKRm+wq B80JJzpstBcLm98fa9sUySrYJIz6K6vy17pm8a/JZBZl4g7/B0LJqJjMNQx0esFVsimR gZ2hqdwRNadoa0WfRO3MM1O8lawTVtSafdJNq7xfe6pO4Gd/+mqxzdOkAz17UioOX5QZ kuDeLrFot5I5F4ZvDXcJ8voWhE4C8xHApLMoUWdXvDEmrfxQ3ojsjT/kYDNksyKCm2T1 JCysidl+q6b7egpJjy9CxkYRRhjLkNhjtOHTLpW7umPQHh6/Of16PkgX4p+z9rGV+03/ v+mQ== 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=reo26zyzbyWFM5kohN/Wkl/Jbo8+FV2cThy+TnnCN6I=; b=suHGQ0gkuJYKWVFWBF5cOgeJQ+QoopvJWpCoW8PkOoA/AtM/ioyyzqca/IDKXRQWnA t4SJd23fpcrfom5tOJ6vJcuSDugiGTdrX3ZZTxkiQ/j63yNBfeDj0WkcTe4oAgbKX/69 Nwy8rscDxN/EG6L/RfhUwNSYAY1/54YOT4VHCCNwjfAbEGtqjV6PKwhE4eZz4pRc21Id y9fvCwBYWzwL3PaS0mFTgnfEZy4xjAONYbYlXUYVHgL8tkQ6XQmv8e7DuArGELMz1UOp PA6Jv/pOy1TU82JzrLfrdnoRcp84gmVIEBbg5xawy4H6WoIjEu9IeeVGLqrUJE5EsrcV lnCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=oKVPNF7h; 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 la3-20020a170902fa0300b0019e2eb4922esi26889342plb.639.2023.03.27.19.29.56; Mon, 27 Mar 2023 19:30:08 -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=oKVPNF7h; 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 S232509AbjC1C2Z (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232287AbjC1C2L (ORCPT ); Mon, 27 Mar 2023 22:28:11 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 951C619A8; Mon, 27 Mar 2023 19:28:07 -0700 (PDT) X-UUID: 266921dccd1011edb6b9f13eb10bd0fe-20230328 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=reo26zyzbyWFM5kohN/Wkl/Jbo8+FV2cThy+TnnCN6I=; b=oKVPNF7h3pzfHWQ9uWUWaag8PmXF73LBAvEWRvW01qiqkPrfAM6rgjiXqKZtu70ACcUhNNDpXnhtLKoiHXiNwuoJrk4zLunudAXWLmrlw2+2QuzlKYLgki+8XHpJR8yjZ0uqj4ccN9wqfXgYhRRYhVzJxt7LdSyt+Iq4ib/le6s=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:530aba23-ccbe-4e15-a845-3096944721bd,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.22,REQID:530aba23-ccbe-4e15-a845-3096944721bd,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:120426c,CLOUDID:6cc8ac29-564d-42d9-9875-7c868ee415ec,B ulkID:2303281027590T2S0TIG,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 266921dccd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 162280053; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 05/11] remoteproc: mediatek: Extract remoteproc initialization flow Date: Tue, 28 Mar 2023 10:27:27 +0800 Message-ID: <20230328022733.29910-6-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761576861234485698?= X-GMAIL-MSGID: =?utf-8?q?1761576861234485698?= 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 | 64 +++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index a3b9bc158cd9..32ecd1450c6f 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_regs { + 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,7 +862,8 @@ 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 mtk_scp_of_regs *of_regs) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; @@ -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_regs->reg_base; + scp->l1tcm_base = of_regs->l1tcm_base; + scp->l1tcm_size = of_regs->l1tcm_size; + scp->l1tcm_phys = of_regs->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,37 @@ 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_regs scp_regs; + struct resource *res; + int ret; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); + scp_regs.reg_base = devm_ioremap_resource(dev, res); + if (IS_ERR(scp_regs.reg_base)) + return dev_err_probe(dev, PTR_ERR(scp_regs.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"); + scp_regs.l1tcm_base = devm_ioremap_resource(dev, res); + if (IS_ERR(scp_regs.l1tcm_base)) { + ret = PTR_ERR(scp_regs.l1tcm_base); + if (ret != -EINVAL) + return dev_err_probe(dev, ret, "Failed to map l1tcm memory\n"); + + scp_regs.l1tcm_size = 0; + scp_regs.l1tcm_phys = 0; + } else { + scp_regs.l1tcm_size = resource_size(res); + scp_regs.l1tcm_phys = res->start; + } + + return scp_rproc_init(pdev, &scp_regs); +} + static int scp_remove(struct platform_device *pdev) { struct mtk_scp *scp = platform_get_drvdata(pdev); From patchwork Tue Mar 28 02:27:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1925858vqo; Mon, 27 Mar 2023 19:39:36 -0700 (PDT) X-Google-Smtp-Source: AKy350aRFnlGWukuRR8Be20T/FdtWMqHASgJFJpTmbPjO9OFsuGc2qoJB5KdHRqK7lq7p50/iono X-Received: by 2002:a17:902:e546:b0:19c:ea4d:5995 with SMTP id n6-20020a170902e54600b0019cea4d5995mr16856568plf.68.1679971176010; Mon, 27 Mar 2023 19:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679971175; cv=none; d=google.com; s=arc-20160816; b=iK9X9BZrzMYpkQWLYO/pKh/NsBd2TviwKYBQT4sz7Dwl8KtKgwYgt3DJae2Ak9stQt xdHeLdEuPPRLb5PYCf8CkZjTRdimMn4zYPO/2j7MribfYLyUfvnqwuP2xYyCMt9zX+wM wqyCtTmfZiPSohxsyzRDG5qiomqWTNhj1FUby/5JabyziU/OeiDW/azeXvx1qsglC57J aDOtVufs7nJ0IBxJSJMQhdwsTb/TE2oSRCEAhOzktg/R9g9V2FDCte2umwpoK0XGXdIE RMP0lklL2JFEgRxjhfPhn0Gjsv8lvX6O0CCPvtOa6fqvPcQHN/cLbU7imY6M0t1d9tIw Z4VQ== 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=PWifEkb0OIatmNEx/6KTrWcEBReepHuUz42K0jTyRHM=; b=mWJOTj2p3MZG2FlXpK1qv1yCqcrE/EL7yFLNNd+NeWlc5nSd07IMyPoZGbne85Kl9D EnAb6U0y2EcWdLKk8KMwehvbpbdC7HispGpqfFbobj58fksmObVPyKDsj3eE6p3kYATU CUQJkUA0HK2Go4Ro5ZQ59rf6O5wvggnkXjN5RqQpA4huG2lK3nTqW39A9SncmvgbUKoi NnBOxOMiL0SlpoKCDQ+MRyf45cGWaWxZUnxH0+o2cU6Xwi+vc5lVZrQCnHUI3xCzHN3K HqPb/R1c/7es1S7ApvLvBVqPCV2gtoMyoCd0lVUrePNibE3PeJFW44IX99VPipw97dt7 XC7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=g6aW9+IQ; 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 138-20020a630690000000b005074669ce19si29223515pgg.673.2023.03.27.19.39.23; Mon, 27 Mar 2023 19:39:35 -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=g6aW9+IQ; 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 S232458AbjC1C2S (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232531AbjC1C2K (ORCPT ); Mon, 27 Mar 2023 22:28:10 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 770F0DD; Mon, 27 Mar 2023 19:28:04 -0700 (PDT) X-UUID: 26b5f6f6cd1011eda9a90f0bb45854f4-20230328 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=PWifEkb0OIatmNEx/6KTrWcEBReepHuUz42K0jTyRHM=; b=g6aW9+IQcVd34roWCvZzXr292FoeSd46iuDmX62nfIeS6qkks2xAXUwCtU0uJDpxNtdS+jM5sl+nUZDB19xNW63Tj9OIPPAA0ZH9Bh61XFaWD/rBay1fgWpZbKr6oZiPbUbV3er1ftXM6UBE8gP6eU1UaE7a7tcFeGGZjMJwPH4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:9e5f9078-dae7-4ec9-978c-1d98cb8ef596,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.22,REQID:9e5f9078-dae7-4ec9-978c-1d98cb8ef596,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:120426c,CLOUDID:7dc8ac29-564d-42d9-9875-7c868ee415ec,B ulkID:230328102759H1WIPOQG,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26b5f6f6cd1011eda9a90f0bb45854f4-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1608841717; Tue, 28 Mar 2023 10:27:57 +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.25; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 06/11] remoteproc: mediatek: Probe multi-core SCP Date: Tue, 28 Mar 2023 10:27:28 +0800 Message-ID: <20230328022733.29910-7-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable 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?1761577455853685763?= X-GMAIL-MSGID: =?utf-8?q?1761577455853685763?= 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 | 150 ++++++++++++++++++++++++++++---- 2 files changed, 137 insertions(+), 16 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 32ecd1450c6f..71882ed31e16 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -30,6 +30,8 @@ struct mtk_scp_of_regs { phys_addr_t l1tcm_phys; }; +static struct list_head cluster_cores; + /** * scp_get() - get a reference to SCP. * @@ -863,7 +865,8 @@ static void scp_remove_rpmsg_subdev(struct mtk_scp *scp) } static int scp_rproc_init(struct platform_device *pdev, - struct mtk_scp_of_regs *of_regs) + struct mtk_scp_of_regs *of_regs, + const struct mtk_scp_of_data *of_data) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; @@ -884,7 +887,7 @@ static int scp_rproc_init(struct platform_device *pdev, scp = (struct mtk_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_regs->reg_base; @@ -934,10 +937,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 +951,109 @@ 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_cluster_init(struct platform_device *pdev, + struct mtk_scp_of_regs *of_regs) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev_of_node(dev); + struct platform_device *cpdev; + struct device_node *child; + const struct mtk_scp_of_data **cluster_of_data; + struct list_head *cluster = &cluster_cores; + struct mtk_scp *scp, *temp; + int core_id = 0, num_cores; + int ret; + + child = of_get_next_available_child(np, NULL); + if (!child) + return dev_err_probe(dev, -ENODEV, "No child node\n"); + + of_node_put(child); + if (of_node_name_eq(child, "cros-ec-rpmsg")) { + dev_dbg(dev, "single-core scp\n"); + + ret = scp_rproc_init(pdev, of_regs, of_device_get_match_data(dev)); + if (ret) + return dev_err_probe(dev, ret, "Failed to initialize single-core scp\n"); + + /* the single-core drvdata is intended to be the mtk_scp object. + * the mtk_scp object is used by APIs in mtk_scp_rpmsg_info. + */ + 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); + + num_cores = of_get_available_child_count(np); + + for_each_available_child_of_node(np, child) { + if (core_id >= num_cores || !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(cpdev, of_regs, 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; @@ -980,21 +1082,30 @@ static int scp_probe(struct platform_device *pdev) scp_regs.l1tcm_phys = res->start; } - return scp_rproc_init(pdev, &scp_regs); + ret = devm_of_platform_populate(dev); + if (ret) + return dev_err_probe(dev, ret, "Failed to populate platform devices\n"); + + INIT_LIST_HEAD(&cluster_cores); + platform_set_drvdata(pdev, &cluster_cores); + + ret = scp_cluster_init(pdev, &scp_regs); + 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 list_head *cluster = &cluster_cores; + struct mtk_scp *scp, *temp; - 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); + list_for_each_entry_safe_reverse(scp, temp, cluster, elem) { + list_del(&scp->elem); + rproc_del(scp->rproc); + scp_rproc_free(scp); + } return 0; } @@ -1073,12 +1184,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 Tue Mar 28 02:27:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1922685vqo; Mon, 27 Mar 2023 19:29:55 -0700 (PDT) X-Google-Smtp-Source: AKy350YinOMdrfYlTiYKpb5L9BvvoHD/xH97mc86ES5DLM/5i+ByWwBRgsBUMcqPCrcWuf91NI/P X-Received: by 2002:a17:90a:18e:b0:23b:2c51:6e7 with SMTP id 14-20020a17090a018e00b0023b2c5106e7mr14861930pjc.21.1679970595622; Mon, 27 Mar 2023 19:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970595; cv=none; d=google.com; s=arc-20160816; b=C09QdlCnzR0KALHpNOPeqMoMVp3OJtGQO9yHJQWFqiW6aVIxMBkHTVgiDrZO8EgDA7 obIIeSA5R3WupMHmFu1UfkG7ilBYKYWFyU9muPdr8t7kCwBH2lmitdiULxcKqqXIsgKv BhsOmELbZxthc0r6+MxEQdk9IBh4bBZPmfowmPsUT5x6kxicGHpI7ZEzpaeU69UqZPgG SxOKWnZF3kKyiUemUh2lSpR7v5bknZMywRMIZZ3VL29BvxVp7pSqneVvzcQjnZN7k+X/ rrxzchBXmYJozb0fu1+C2yjKku1NMamsHSKJvvDZRDAQ6MTYuJR0R2Y1+MRFGVhKxL+C LBKw== 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=5fc5VKu5pwtacTmVqJcZvafVocVzGr7YjsffATNdVkU=; b=M35bTWS8lPV44Qr9ia+cNAAfSUKKKus7Qn+8NBCLTMCPqBZUITN2WYyl0IGRYcffCO bwyf5pntjOJmg2w6cJDGohONDG6v0bXKI2/k+CBMAtHSMfGLHG0pf0VS6kMsYk16x77O ZWfs1M09XrcJRimWv1NpCBR3ZqUIVxTiD/Nu8PJzG2br57cKcUbWbX3xgDL79utVRXCI smzo1cI9hR+3uyzG48jmmehBBgbwBfRBwAZxmy8vIZIVj5XqpIgbwLwkHQI7sv1nkTeI 6diy1FUdH68G6LhnCUb6fAU+ONpPrvGrtaRTGIe1uyHk9jEv2KO7DjfejlEhQi31p3fm OISg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=t9iPDRM9; 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 i31-20020a63585f000000b005030925d31asi28114755pgm.203.2023.03.27.19.29.42; Mon, 27 Mar 2023 19:29:55 -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=t9iPDRM9; 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 S232609AbjC1C2W (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232536AbjC1C2K (ORCPT ); Mon, 27 Mar 2023 22:28:10 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFE47196; Mon, 27 Mar 2023 19:28:04 -0700 (PDT) X-UUID: 26742d66cd1011edb6b9f13eb10bd0fe-20230328 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=5fc5VKu5pwtacTmVqJcZvafVocVzGr7YjsffATNdVkU=; b=t9iPDRM9YKRANIUbiFrjcJnbUOCobyXsxMhUpfilASEn2YOuGt7fddFEbxq6JT34iUKNkGXdZEjGW2eL1hJf54ylIpe5hLqII151rR4TFBt8Y0o6sbLqqedNgjAs/VSYWkxMNfu/cKLodw7UgW/AebVXz8jeeG3QGoVM/Yw12bw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:570fa70e-7af1-4f64-a8e4-39d2b7510589,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:570fa70e-7af1-4f64-a8e4-39d2b7510589,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:e19a1bf7-ddba-41c3-91d9-10eeade8eac7,B ulkID:230328102759EWVX0FV7,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26742d66cd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2075299968; Tue, 28 Mar 2023 10:27:56 +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.25; Tue, 28 Mar 2023 10:27:55 +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; Tue, 28 Mar 2023 10:27:55 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 07/11] remoteproc: mediatek: Control SCP core 1 by rproc subdevice Date: Tue, 28 Mar 2023 10:27:29 +0800 Message-ID: <20230328022733.29910-8-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761576847063505269?= X-GMAIL-MSGID: =?utf-8?q?1761576847063505269?= 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 71882ed31e16..ba931d550c1e 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -864,6 +864,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 *pdev, struct mtk_scp_of_regs *of_regs, const struct mtk_scp_of_data *of_data) @@ -955,6 +1009,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); @@ -1034,6 +1089,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 Tue Mar 28 02:27:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1923403vqo; Mon, 27 Mar 2023 19:31:43 -0700 (PDT) X-Google-Smtp-Source: AK7set+4+wz6zl3YlSxfEUXY3eBeC8D8PNrdn26x8siVuw1KC6f4VhwJ4kRGDMycnG7puwBMFPVp X-Received: by 2002:a62:7b95:0:b0:625:ce06:e58 with SMTP id w143-20020a627b95000000b00625ce060e58mr13563082pfc.17.1679970703096; Mon, 27 Mar 2023 19:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970703; cv=none; d=google.com; s=arc-20160816; b=gSCyW4gyTGSPCYOQasgVs0dKopyXEcwrtcI3ysuFaI+LFQSoCdFSx6zufZgRDc0y3T rtX72cYrmS25ElziTOY9qPaF3+ryBmW97MlNLkwp4/uHaiGDcysRc45BSgygLT0YhI5X zoUamatDaQRPuLPtUYsfamgYhkYhxIoPPXGq80csbCvxMwtceDM/TUwXQ0ptS6DlGWNb BEXISb6JPHVFfeH4L5lmg0XpGVY01NYW7aAb0s8wRfSLyVNXXWar7F/L6GCngJTXsQmK ySiS0VoefEZrHwZIisptm0+tknMvGP+MqxUCVZorul1YYI5fjzf1DCNVNoitfzB95KYT cpqw== 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=Wa16E7v4/oxQJBuGCKVIakPyTMFOlhEx6cQrvF1xl1I=; b=KvXpME+OOhNC0FysuQXPKoDlFP9TE67DqZXB22DPOavD8MPSAog5U/GJaTbPhdCq3e VcfxlfCMgNHOh5Q+92ivsxKBXg92gXj40eQH1MBEYetT32dso4AeDx68HEmBjHD02d4q /M89A3GMYi/X+J6zwEMfGW0/OOKDQzE/t7FwUbFoyZZ1hSo21hoTrr0nXfErNWNHNEyY zQJeZoJC27h/DBG1mT7NGzsJYIFc4PlewxoJ6HrfXRC2k4sNEjTF9bsZXeMPAkvIoGVD h2kZS6WcbHMGJgjDb+kED7oDroW2Ejj9k7/a8aGCC6/bw7M1atGe+rZxf4RBebdxd0fa Xnrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="i/6QvYGJ"; 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 14-20020a62180e000000b0062a43ccaba7si12163855pfy.313.2023.03.27.19.31.30; Mon, 27 Mar 2023 19:31:43 -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="i/6QvYGJ"; 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 S232626AbjC1C2q (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232630AbjC1C2O (ORCPT ); Mon, 27 Mar 2023 22:28:14 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A148026B7; Mon, 27 Mar 2023 19:28:11 -0700 (PDT) X-UUID: 26765320cd1011edb6b9f13eb10bd0fe-20230328 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=Wa16E7v4/oxQJBuGCKVIakPyTMFOlhEx6cQrvF1xl1I=; b=i/6QvYGJ/nwbtf7tAIyDKkKd03T34WtGDZAp45cBrDgzzKAxoLF4T7cLajz13aq8uD+Sux39f+lhJzQtyqZFoem9gXP6qZsPBhDtI/+6N0aBjzEHuK08VRt0c5VlTZqyzxaWVnw4My0RIJu3YzGsEcm4Nq9IYfhTXfhV4zQP+VQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:30ef562f-305e-4f36-83a3-b639db92476f,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:30ef562f-305e-4f36-83a3-b639db92476f,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:72c8ac29-564d-42d9-9875-7c868ee415ec,B ulkID:2303281027593YA70PBM,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26765320cd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 782766213; Tue, 28 Mar 2023 10:27:56 +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.25; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:56 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 08/11] remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset Date: Tue, 28 Mar 2023 10:27:30 +0800 Message-ID: <20230328022733.29910-9-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761576960200956978?= X-GMAIL-MSGID: =?utf-8?q?1761576960200956978?= 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 ba931d550c1e..f74ee80838e9 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -486,6 +486,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. */ @@ -494,6 +497,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 Tue Mar 28 02:27:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1923338vqo; Mon, 27 Mar 2023 19:31:35 -0700 (PDT) X-Google-Smtp-Source: AK7set+6kVLTQ1oJpMyOyKrH/BLcou/LsNTblvgtdB5XoV/DFITwRW8n6pvDIKYX4rOcAQKtFWLu X-Received: by 2002:a05:6a20:66a9:b0:d9:43a5:8cd0 with SMTP id o41-20020a056a2066a900b000d943a58cd0mr13144935pzh.14.1679970694898; Mon, 27 Mar 2023 19:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970694; cv=none; d=google.com; s=arc-20160816; b=LvMKpSuFm4TnRttJrWIQ3gqaZ7DghbJBKBhDRisc/wmczT2WZBnNvnApvtneW9z3kR hmfSHC8acdGLZjYwSyrRMz2vZQkKk1tbj+5FdtGDYmT+GwJFt6BFD8X7Zz6iZZhw9YGM iPK0buwO3x6W+426rhy+QJ69LO1kFUljmwYidXbFqaWVYx7u+6ZfcWo0yiTW87gGAnD3 GLR49NrAWcsMXidHdHSocWBCG/oWtxlfDZ2CEJwBju4RTnjlKcrHQn/6RiY3Xt0+q2Rb uoAIkcG1s/Z4eYqwo+17dzcaQIMRYsUe3uxf86wUkUm2WFDatmQFaMZKJj0/jJtgwYOV s04w== 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=iPmuGgTPXcfyX5TrjJAMLBtjpDpn9RP6N8eyPLJPoIY=; b=oEul2/b7OSXwysoG7MxnLQoX9E4ChAeFM0z/LeNmS1z/8NYKBwETE2DvXFXkxyjBa/ cPt4oFyvxyZDe3eB7NgkHUVAXCJ9/7Mbv8PCaDFHjDra8lsniBp1nW7B4U2yCSvB0pJC Ol1CrZO+PzF93gwje2g3sgaG+krwnYxWN+IqH1o8R0bnWuBAOPv+Bm6EPRmejaGwjjSM i1MVNGy9VOrRr64uCZ6p4BGyYb7kLXX8eEWAtqksDUHWdRli3lJl8/4bqMpzyHzoIuO/ NJU+f99F1kr6PoR5nyTRvkDSMKopoWS92RVpov20kw+83NPFupcMEwn1Qg4PC/7RBr0l vykg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XJu5vd4B; 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 i31-20020a63585f000000b005030925d31asi28114755pgm.203.2023.03.27.19.31.22; Mon, 27 Mar 2023 19:31: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=XJu5vd4B; 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 S232400AbjC1C2k (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232617AbjC1C2N (ORCPT ); Mon, 27 Mar 2023 22:28:13 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B99B2681; Mon, 27 Mar 2023 19:28:09 -0700 (PDT) X-UUID: 26f37ee0cd1011edb6b9f13eb10bd0fe-20230328 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=iPmuGgTPXcfyX5TrjJAMLBtjpDpn9RP6N8eyPLJPoIY=; b=XJu5vd4BMmhU23tcjug3nB6CXhzKkdpWVq8z1H/UPvnrPrqBxOFA+fAoKgoFZQEsPsFYsrFmceIANbYQLowaGkBU/DNps9CvZQNjnwzO7lUQ7lHVnYTHlkqTeGJjFpNQaR//doZ6uoFpsKJfGiqTF9V4usHGNPaP4s2HBXRFTEk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:8e57c2f9-f66a-4d85-8d89-2dabf412d032,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:e49a1bf7-ddba-41c3-91d9-10eeade8eac7,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: 26f37ee0cd1011edb6b9f13eb10bd0fe-20230328 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 1172088504; Tue, 28 Mar 2023 10:27:57 +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.25; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:56 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 09/11] remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout Date: Tue, 28 Mar 2023 10:27:31 +0800 Message-ID: <20230328022733.29910-10-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable 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?1761576951549931297?= X-GMAIL-MSGID: =?utf-8?q?1761576951549931297?= 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 f74ee80838e9..d08f21c1f947 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -231,6 +231,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; @@ -1256,7 +1279,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 Tue Mar 28 02:27:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1922914vqo; Mon, 27 Mar 2023 19:30:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZIODbJklRhicd+vzzLhPWOdEig84sZLq+lyWxZCt3jRyyV6RrfpJK2ZEjzMedYeODJ6DyU X-Received: by 2002:a17:90b:3b90:b0:23f:a667:4efa with SMTP id pc16-20020a17090b3b9000b0023fa6674efamr15873914pjb.15.1679970626462; Mon, 27 Mar 2023 19:30:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970626; cv=none; d=google.com; s=arc-20160816; b=kXBwI4FOFrD6dFkRE1hKhWXp2LDjPFZvfIfft1okmOr1C5qBcjhqY+8aJBuPCxBev5 d+jzra0nvzgeYU204AmG/ZPYqEZcKqd2KbcM7NUiF/XJLHi9Sb8p7Yy6jmilrtrBA8OL OuYG5XwlG3Ud5j1p3qA6LSrnE8DyUemRpaZmkGXiadILzREtZzGIeiD30nt3C23ZPsXw g0bjXlUR5/5wFpFGks0EgQswHu2NCD8bXZ0EPDTeNOSH+NX61C97kfPnaSIaB9JSfg0O OaM+Z0UnV5RIZPeXLY7mxz/60M/RloHX/0AQF9gwNN5Wgd+DzJHL/+IZP7MQzoY0TCqK xuLQ== 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=g5ZNkAYN4ZY/Q2Ol/GTU25e+0aKLgeNnvGnT68vbtpM=; b=1KyZj1jq4/D9JCxwo92rjINP+byU3/p1ANWkplQFh+FWmk25PlOXQ9H3uNh4QEvFP5 XTBcmWw8siLnTJW8dqY0OAw0WVMDhunoH5yxHN7vSSNxO5USC6WQl3Rai7/lj2pGUPk0 E9/bDwjOnmfFmHnpqLXobanpYbIA3A618mL2Zy7d/ZOjxURq4zRrK33t9RCg7IcpnirP wsqKKaCdRNU+uSh7WnCphxOAd8VU+AQtSa0qDfA8X08BTi+TfkmRlWq1Y+d507lRrcEZ /1DCff1yAYXQ3FrAE4oHnyknb40YFQAqPMqxwqLEK9+WXkloAAz0y5p9EPiHC9JiBZDG QDcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ReNkmWNg; 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 x5-20020a654145000000b00503005a4f2fsi27305368pgp.857.2023.03.27.19.30.14; Mon, 27 Mar 2023 19:30:26 -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=ReNkmWNg; 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 S232734AbjC1C2c (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232583AbjC1C2M (ORCPT ); Mon, 27 Mar 2023 22:28:12 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92190199A; Mon, 27 Mar 2023 19:28:05 -0700 (PDT) X-UUID: 270e3f0acd1011edb6b9f13eb10bd0fe-20230328 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=g5ZNkAYN4ZY/Q2Ol/GTU25e+0aKLgeNnvGnT68vbtpM=; b=ReNkmWNg3etge2vswKDfC/tKDDq8MCNOnDV+R6RUvd9JrE+eCO6+tpQwBB2JXoy1S5chA5Gh7kJVCt6RzjRwzBtT/2X0EGCzTilkPzhGwiVGM1IsyvYD+CW1saj2Zz9uU5kQKmHr56ZS1Tnl5D1VT3kT62ivlz4m2kK3vHkE/6c=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:572f5162-844a-4390-8218-44e01a1ab474,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:6fc8ac29-564d-42d9-9875-7c868ee415ec,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: 270e3f0acd1011edb6b9f13eb10bd0fe-20230328 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2044835218; Tue, 28 Mar 2023 10:27:57 +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; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:56 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 10/11] remoteproc: mediatek: Refine ipi handler error message Date: Tue, 28 Mar 2023 10:27:32 +0800 Message-ID: <20230328022733.29910-11-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable 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?1761576879278122275?= X-GMAIL-MSGID: =?utf-8?q?1761576879278122275?= 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 d08f21c1f947..fec74631557a 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -115,7 +115,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 Tue Mar 28 02:27:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 75784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1922614vqo; Mon, 27 Mar 2023 19:29:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZcsQ9VXRsDWfggN1HbiQ2WmXC7pq+4ItM3/w8MeIUSa51H8K9kFAem828rThKW/N3FRJrC X-Received: by 2002:a17:903:1c5:b0:1a1:cf70:33d5 with SMTP id e5-20020a17090301c500b001a1cf7033d5mr17941053plh.56.1679970582256; Mon, 27 Mar 2023 19:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679970582; cv=none; d=google.com; s=arc-20160816; b=SIK6ANJ1W8YUjQoUwGizSiLbELqbsEmKUyM6AUAB5oitN2qqPLe5ezUBaflrPg8D5U Z1XEXj6kRQftM4U4xtb6AaXdwFJakU8QM1AnnIBrQ5OqRFuVsmXmO1WRfXwzQfry3Uqy 758iKHG+oj0S7XF5zBseif0Y57KyyrqR+btz2Qc0qiG8nPxBsvln9S8S42d80JTV9SMJ L7CRFApc3G30YC9e9bn/B5V+aZBSo5pCeXtIdiC8xoQ9ofy/uFGrunWSflCcQnYXHNJK 35GPFAqlBISd6cu0tC+whGdJaJ3igmFev7a8UxPC/IF4NWX2/aOjXuo4eAGOa46I86fe SqLw== 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=da8xtj3GEK5PCXWnakDtGHNuxmDl0f1XqfPRmZJ45xk=; b=VFu2vRMuc8IfH89h24kk1ZXDbFeqFwJmeSqkh84DRi+qvcOgmq2U9A+w5tVGfyda/h lt7rjZH/fif1Ex7Y+fnLaj53O7tbS6AeW8r1Wajp1L3xrcuHK3dA0ZT0z3IejXktr3a+ nR0fdfmpdWSzkN36d4ZOljaIjCcUONYpLu5aH+m8VU/CRPQJa3GyEJzckciMROgdv2Oh huQPl0hsfwetffEpssm8gYY66RwkEs0o2WPxmYdniR8wwwWBQHlvLyIzbP6JZUlycYsQ yG3gK42XGg2Lmghu+Q9RAXTyTxnZpQGvdOfVEcdk3epLJLPIBVxeleuBL3fYwOERceo5 6gZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=MxtvDsih; 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 kt11-20020a170903088b00b00198ff2d6543si27103262plb.117.2023.03.27.19.29.30; Mon, 27 Mar 2023 19:29:42 -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=MxtvDsih; 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 S230070AbjC1C2P (ORCPT + 99 others); Mon, 27 Mar 2023 22:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231976AbjC1C2I (ORCPT ); Mon, 27 Mar 2023 22:28:08 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F6119A9; Mon, 27 Mar 2023 19:28:03 -0700 (PDT) X-UUID: 26b7ce90cd1011eda9a90f0bb45854f4-20230328 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=da8xtj3GEK5PCXWnakDtGHNuxmDl0f1XqfPRmZJ45xk=; b=MxtvDsih3SE9tRK/C5yeiagliwpFHG07AIKTGqs0ErAZmZsua/nJI69Oz8Pplk12sOxbd0LRQgfb2HP+h3dBwb5Yf+aKyw5RB0KDDDB1gTVMP2I83P/XLfpvmCP2uNmE45m/E0fAZbBugoKLdQIla2MF8D31gd9zuqYVI8mG+rs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:7cc04742-36b0-4118-a6d8-fce49b49cd4f,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.22,REQID:7cc04742-36b0-4118-a6d8-fce49b49cd4f,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:120426c,CLOUDID:96e98db4-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:230328102759ICX4TM7P,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL: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: 26b7ce90cd1011eda9a90f0bb45854f4-20230328 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 722749702; Tue, 28 Mar 2023 10:27:57 +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.25; Tue, 28 Mar 2023 10:27:56 +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; Tue, 28 Mar 2023 10:27:56 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v9 11/11] arm64: dts: mediatek: mt8195: Add SCP 2nd core Date: Tue, 28 Mar 2023 10:27:33 +0800 Message-ID: <20230328022733.29910-12-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230328022733.29910-1-tinghan.shen@mediatek.com> References: <20230328022733.29910-1-tinghan.shen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=unavailable 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?1761576833417285879?= X-GMAIL-MSGID: =?utf-8?q?1761576833417285879?= 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 56749cfe7c33..31415d71b6a4 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -933,7 +933,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 8fc527570791..5fe5fb32261e 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -826,14 +826,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 { @@ -2309,7 +2325,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>;