From patchwork Wed Feb 15 04:12:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tinghan Shen X-Patchwork-Id: 5434 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3359134wrn; Tue, 14 Feb 2023 20:15:19 -0800 (PST) X-Google-Smtp-Source: AK7set8ujHNr1/PYFk9QujwvyP7RyT7CW1aoC2CIHoY+CzjwIP1aMDQjh3iKSjbKTnYX2VaYZ3mA X-Received: by 2002:aa7:cf8d:0:b0:4ac:b858:37b1 with SMTP id z13-20020aa7cf8d000000b004acb85837b1mr624885edx.7.1676434518970; Tue, 14 Feb 2023 20:15:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676434518; cv=none; d=google.com; s=arc-20160816; b=TbJjMucgp7muQ2k7Hb1ueWmBWxd3JdypI/bqWdDDpDE+IUlLSWyQjVy9c+H+i6gICZ vXLEai1mm4/zcCgm+77RotjqhjfiihkTCFFNwYBDdMxWh8BA8YrYe1yGEOQz7Fikv8Yo Ty1KnEjSz8f0wFJe3ZWCJM4Ru4GwHukgz82LsdnFxuW1SlgMFeGr/sDOvMznjthLeq/1 0s3fbXQ2awCfxVrjQVVhHXmIUbxJvMcs9Qyajp2BWxJWUlXVK6p00ob0E9ESZ7tE2zuE RK88s3q/KCpjFOVXMZ+0RbbouETyGclqfVxlmYYGHSNHVa0J++RqOi1iSUgQQSFwKOi5 WuNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=b7x8YxesTymoInlVceUQpEbihjM+o7uEEDU4Ea9Jrt8=; b=nsQMKZTUEU8wurIWliZvJysYCIjstT2OV7f/BJ+nXSWmGVN5c3bEjSf+hcWQQ6k6I/ Au/u+wRflWRi1H5DDJ76+EPp8QETqd4+c8Ta/hkxEYig9kSq4l8XIB3kCmesG4HTc/0m R9/E0p9FJcpcK+UllHzYYBEvUHbah4wspXN1EQCp9x50H9WBuOR4F3iNMz3fqyDe27Vk ryc7kAyJ6ygy6AjgkVmWmCy0+JkfnJqyTm+F5ck+DupQK7sMEr9hJbqzkjOJ8CGsVuAQ Dk09E2+8sEeRgTVRHs73/AXee5KWMgq5v8r+M2muvh3tjbNCO/IfQzJ8yxX+8Ij4X1AT 7afg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=DrvvgLGG; 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 y18-20020aa7d512000000b004acc7e7e6d3si8324777edq.143.2023.02.14.20.14.53; Tue, 14 Feb 2023 20:15:18 -0800 (PST) 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=DrvvgLGG; 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 S233115AbjBOENl (ORCPT + 99 others); Tue, 14 Feb 2023 23:13:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231803AbjBOENP (ORCPT ); Tue, 14 Feb 2023 23:13:15 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A9925E1D; Tue, 14 Feb 2023 20:13:07 -0800 (PST) X-UUID: 07ded606ace711ed945fc101203acc17-20230215 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=b7x8YxesTymoInlVceUQpEbihjM+o7uEEDU4Ea9Jrt8=; b=DrvvgLGGQ/eRr5KCnBQjfjQsthapbcQZ+l9uspKydZUmIsUeFFpWccYI9R7JKc8z7CuLTp0c+hZWqsPtoVkS27JfPc/ebWjmGEeAhqWsmFh6jbf1X3cS2XUYNd0JaXakZWk0H9yhIdcCi4X75KomijzIJhE4lNnXwN95t2aWpWM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:cd5db158-d73c-492b-8dcb-a7016d591d15,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.19,REQID:cd5db158-d73c-492b-8dcb-a7016d591d15,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:885ddb2,CLOUDID:b3197cb0-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:2302151213011NYAS9BM,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-UUID: 07ded606ace711ed945fc101203acc17-20230215 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 1642543023; Wed, 15 Feb 2023 12:12:58 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) 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.792.3; Wed, 15 Feb 2023 12:12:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 15 Feb 2023 12:12:58 +0800 From: Tinghan Shen To: Bjorn Andersson , Mathieu Poirier , Rob Herring , "Krzysztof Kozlowski" , Matthias Brugger , AngeloGioacchino Del Regno , Tinghan Shen CC: , , , , , Subject: [PATCH v7 00/12] Add support for MT8195 SCP 2nd core Date: Wed, 15 Feb 2023 12:12:45 +0800 Message-ID: <20230215041257.14548-1-tinghan.shen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757869001809998888?= X-GMAIL-MSGID: =?utf-8?q?1757869001809998888?= The mediatek remoteproc driver currently only allows bringing up a single core SCP, e.g. MT8183. It also only bringing up the 1st core in SoCs with a dual-core SCP, e.g. MT8195. This series support to bring-up the 2nd core of the dual-core SCP. v6 -> v7: 1. merge the mtk_scp_cluster struct into the mtk_scp structure at the "Probe multi-core SCP" patch v5 -> v6: 1. move the mtk_scp_of_regs structure from mtk_common.h to mtk_scp.c 2. rename the SCP core 0 label from 'scp' to 'scp_c0' v4 -> v5: 1. move resource release actions to the platform driver remove operation 2. fix dual-core watchdog handling v3 -> v4: 1. change the representation of dual-core SCP in dts file and update SCP yaml 2. rewrite SCP driver to reflect the change of dts node 3. drop 'remove redundant call of rproc_boot for SCP' in v3 for further investigation v2 -> v3: 1. change the representation of dual-core SCP in dts file and update SCP yaml 2. rewrite SCP driver to reflect the change of dts node 3. add SCP core 1 node to mt8195.dtsi 4. remove redundant call of rproc_boot for SCP 5. refine IPI error message v1 -> v2: 1. update dt-binding property description 2. remove kconfig for scp dual driver 3. merge mtk_scp_dual.c and mtk_scp_subdev.c to mtk_scp.c Tinghan Shen (12): dt-bindings: remoteproc: mediatek: Improve the rpmsg subnode definition arm64: dts: mediatek: mt8183-kukui: Update the node name of SCP rpmsg subnode dt-bindings: remoteproc: mediatek: Support MT8195 dual-core SCP remoteproc: mediatek: Add SCP core 1 register definitions remoteproc: mediatek: Add MT8195 SCP core 1 operations remoteproc: mediatek: Extract remoteproc initialization flow remoteproc: mediatek: Probe multi-core SCP remoteproc: mediatek: Control SCP core 1 by rproc subdevice remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout remoteproc: mediatek: Refine ipi handler error message arm64: dts: mediatek: mt8195: Add SCP 2nd core .../bindings/remoteproc/mtk,scp.yaml | 176 +++++++- .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 2 +- .../boot/dts/mediatek/mt8195-cherry.dtsi | 6 +- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 32 +- drivers/remoteproc/mtk_common.h | 38 ++ drivers/remoteproc/mtk_scp.c | 401 ++++++++++++++++-- 6 files changed, 596 insertions(+), 59 deletions(-)