From patchwork Fri May 6 21:32:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 12841648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46F43C433EF for ; Fri, 6 May 2022 21:33:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7XJg/W6xfSqZS5//j9ETI9tufbFTpNG/inLBWXDKp9M=; b=mNqXp2aSbiYIZp Ls60hWq32FiEhEWjxq13pwChzJNT3epVQ3OpEJcc3fkZbVhrJMxKrae5pAf28PfdNFIjAtLBHdnTH XJKkwxnp5BHCN6AlGZ3LxAChemOisXHwby3KL9ABhbUJrqvAVdqWlgpp3aWocT5vgcgZzg77Rn537 8Anwm36ZW8fN8isO1mPWR+g1q8F4Dh9D6OXKPjNCTpV1rdWD5kVaGTHdA/9dRJWeTWpelGH83s8OB ITxLXeoa5v2WNcmSyL5U4aIOdNV65lFH552HBf8NrN/4u2u6DulBo6goiZvq8v6X+qZWcQYYow51p h/yqaqbYYKoOPuOLP6TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn5Z9-0058Mm-9D; Fri, 06 May 2022 21:32:47 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn5Yx-0058Iw-Gf; Fri, 06 May 2022 21:32:37 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nfraprado) with ESMTPSA id BBC231F46F14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651872754; bh=/dlltmm0CjgK9MLJxH9V1QvvneVKOwNJ66ACc15SFyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LFDaJssSl/nm+tkMOWesdtUJGcuNj+3SIi+O4V55fnnb6G3kKXcbtRIaTwe0SzRuU EDUJ6zcPrKkZTkoIa0JCzrq7Yocctx4r/wEWDMlA2vFp/MTsy4YA3bnnlySiEJ70q0 7mx7AbPfQwyM4jCt6BVEIK+7BMTVlsvSVdfZE1bNheGH+mC7VwOo/5U1O9G4mOM789 iamv4C8SFrYy36JOiweqAFdI05APxpd9pL8RJSMin9KzE3h6uvU4KIWqMsDlq/R6P6 RME07Ns1ymoaJVuKkW421hcaD5pFfp9muV+ffFUVNQGXSyoIt9fDT3AhaC534FQXY1 IhwuHBRlSHy9w== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Bjorn Andersson Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Krzysztof Kozlowski , Mathieu Poirier , Matthias Brugger , Rob Herring , Tinghan Shen , Tzung-Bi Shih , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v4 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Date: Fri, 6 May 2022 17:32:25 -0400 Message-Id: <20220506213226.257859-2-nfraprado@collabora.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220506213226.257859-1-nfraprado@collabora.com> References: <20220506213226.257859-1-nfraprado@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_143235_859030_FB380BF4 X-CRM114-Status: GOOD ( 14.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit ca23ecfdbd44 ("remoteproc/mediatek: support L1TCM") added support for the l1tcm memory region on the MT8192 SCP, adding a new da_to_va callback that handles l1tcm while keeping the old one for back-compatibility with MT8183. However, since the mt8192 compatible was missing from the dt-binding, the accompanying dt-binding commit 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region") mistakenly added this reg as if it were for mt8183. And later it became common to all platforms as their compatibles were added. Fix the dt-binding so that the l1tcm reg can, and must, be present only on the supported platforms: mt8192 and mt8195. Fixes: 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region") Signed-off-by: NĂ­colas F. R. A. Prado --- The if:then: branches became rather long since it seems that it's not possible to override the properties in them, only add new ones. That is, I couldn't leave the items definition for all three regs in the global reg-names and just decrease minItems and maxItems to 2 for mt8183/mt8186. Also I had to add a description to the global reg-names, since it couldn't be neither missing nor empty. Let me know if there are better ways to achieve this. Changes in v4: - Reworked presence of l1tcm reg to be if:then: based and present only on mt8192/mt8195 - Rewrote commit message - Added Fixes tag Changes in v3: - Made the cfg reg required again. After looking again into the mtk-scp driver, only l1tcm is optional. - Added mention that a dtbs_check warning gets fixed by patch in commit message. .../bindings/remoteproc/mtk,scp.yaml | 69 ++++++++++++++----- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml index 823a236242de..e1793a85e610 100644 --- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml +++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml @@ -23,15 +23,12 @@ properties: reg: description: - Should contain the address ranges for memory regions SRAM, CFG, and - L1TCM. - maxItems: 3 + Should contain the address ranges for memory regions SRAM, CFG, and, + on some platforms, L1TCM. reg-names: - items: - - const: sram - - const: cfg - - const: l1tcm + description: + Register names depend on the platform. clocks: description: @@ -50,16 +47,50 @@ required: - reg - reg-names -if: - properties: - compatible: - enum: - - mediatek,mt8183-scp - - mediatek,mt8192-scp -then: - required: - - clocks - - clock-names +allOf: + - if: + properties: + compatible: + enum: + - mediatek,mt8183-scp + - mediatek,mt8192-scp + then: + required: + - clocks + - clock-names + + - if: + properties: + compatible: + enum: + - mediatek,mt8183-scp + - mediatek,mt8186-scp + then: + properties: + reg: + minItems: 2 + maxItems: 2 + reg-names: + items: + - const: sram + - const: cfg + + - if: + properties: + compatible: + enum: + - mediatek,mt8192-scp + - mediatek,mt8195-scp + then: + properties: + reg: + minItems: 3 + maxItems: 3 + reg-names: + items: + - const: sram + - const: cfg + - const: l1tcm additionalProperties: type: object @@ -79,10 +110,10 @@ additionalProperties: examples: - | - #include + #include scp@10500000 { - compatible = "mediatek,mt8183-scp"; + compatible = "mediatek,mt8192-scp"; reg = <0x10500000 0x80000>, <0x10700000 0x8000>, <0x10720000 0xe0000>; From patchwork Fri May 6 21:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 12841646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F6FAC433F5 for ; Fri, 6 May 2022 21:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N5vv3RGkOydjHdNGlhpZ0ZHkbzBnS2bfx2ZWggy3tLg=; b=lqMykg/3lRogji 9oZWTqxeAo7eLNPI4E5ej8Ek7ghjETYjncqHTSUmgSNNfD67ZI+22XQfTY5zj56BkEIE7BucVR2MZ L4+SU6pQNSXLoUlzGL1wzJraz3G/JBfqoGZK1iyeu8pupoOj3swWoiBxqP7KhWQ4AgUBhRGWPfEoK A6oZEjFE3sIVF+wN9lUTqn9WNHGpCRlWSOriOtQAH3brPevRXhpEBbY2MG3OuO8oQAIcAGWNoDDBW uydCvIWubVKAl2tMjamJe5jeyHo9EL5umjfFO7Bs/LViN2GMAmYJJf+bPtWOq4pAru9R0fxZazLrG hn4UYL7qdiObQw+A63eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn5ZI-0058Qq-Jl; Fri, 06 May 2022 21:32:56 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nn5Yz-0058JR-FX; Fri, 06 May 2022 21:32:38 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nfraprado) with ESMTPSA id ABEA51F46F19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651872756; bh=7/ruMOw9euAiDMHjfy/tYPDDLSQ2ojwszbkys9iXdo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cyOHKSKEm0Xl8bq7Ms0QZLOsaU/N6hUKUV6TpMGAReQ1A6WY6leaqWNUJfgviOnCf OGPhAvVL2lmDWpsdiWjVz1H2p6ldfa6xpevW8ZbRn1mxDuZ94NLQAaOQPoBW5kr24W JMAMXFneC5iwv/XgHH5+bM8WBp9BUnCbIkEtXoAkp0u7rtVpm0J1FIRG2Uu3dcDGEo 47l3VZSE78ZM+jmj3HORqEXuoP4c4P5vN/OTavCHPbTPxXq782c4mM6cDAs+nS7lxM j7G/gtFGS0OMz4IQA2kjs/Mit4Za3N11h5GPJXSUIy4wj7lZ2rn/Bi/4MdreXeugE/ lRe86rpNYlZRA== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Bjorn Andersson Cc: AngeloGioacchino Del Regno , kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Krzysztof Kozlowski , Mathieu Poirier , Matthias Brugger , Rob Herring , Tinghan Shen , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-remoteproc@vger.kernel.org Subject: [PATCH v4 2/2] dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk, scp Date: Fri, 6 May 2022 17:32:26 -0400 Message-Id: <20220506213226.257859-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220506213226.257859-1-nfraprado@collabora.com> References: <20220506213226.257859-1-nfraprado@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220506_143237_712619_BE1FC5DE X-CRM114-Status: UNSURE ( 8.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SCP co-processor can optionally be passed a reserved memory region to use. Add this property in the dt-binding. Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring --- (no changes since v2) Changes in v2: - Dropped type and description since it's a well-known property - Set maxItems to 1 Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml index e1793a85e610..b0503146d7fe 100644 --- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml +++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml @@ -42,6 +42,9 @@ properties: interrupts: maxItems: 1 + memory-region: + maxItems: 1 + required: - compatible - reg