From patchwork Tue Jun 27 21:45:51 2023 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: 113624 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8489528vqr; Tue, 27 Jun 2023 14:48:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QsGj3xJmZesVsAT6flgVjE8e944bkjJgO9Lh/jyGOGn89UoUk5N58by6onbmyFEvHHDhR X-Received: by 2002:a17:906:684c:b0:98e:4c96:6e1f with SMTP id a12-20020a170906684c00b0098e4c966e1fmr6121618ejs.69.1687902529855; Tue, 27 Jun 2023 14:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902529; cv=none; d=google.com; s=arc-20160816; b=GzQbPSlxtXKkPHSst4cHl0F2YxKss0i2RFzUtIVA48lqHHTfhbILcVI+aDLrgt4MaH mX/5NWvk3T7uu9x9VHNrc64xgJVEFU2Rfca8Ah7PBF03OQsvjG9VqSlSMhtfYswmBfPP CedeDGea4iukEc0GlTFa6pTIp8lNhW+tx5r/5AzUJ+77kghLB0yEBSFF8qa1Js7zfbAI ui5QtpmogyKyMcL6RzS4qyG4elbRvG2fHjQ4xKCExM6s2euklSuhFfXHdSATnfd+3WMI Z/369EJ76GrfaahAP38C5SavIDnP+FchfBejgnajWJneTn8OFWy4iqvVdkqDtwJ/EckL /hUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5Y4U++2pVLqn5Q1HGH3hQGm5jB6WQHaJ6Bl6H3IcCQQ=; fh=R1fKKnvz0anVmD9ACD6MlNbYQvyB/ouHA74OOm0zbws=; b=k2FubLbzsIc8qA7je41xnYjBQ/1J4T4mZaInaIZC9EflOtBALQHmG1ZJWQoJvO3nvZ e8Cmx5zm5x4NUKrIBA4EijxnqTiPOLnfmae/swGBLnYr3hSqCCFVUBXbUyXeR0O4CDDH hBbbZKJEKIW1BYP3EAvHqG3ENRFIn8KzBCyY5GG0OHEqZ4WFAZgdgBSECx3U23z66UuA tEzmoqNjckn9aWJN3GbwSRwSVmrjb8jIL8PZDkSy1znH7U/n8gMNh+s+CqrmhYXRqeWl c0tSn7z7FzUrfUs6AcjSWxXTBpxrEXjSOwERhV91KY+i/tmVp7eVvGvNkcnzZGwy71zG Ys1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=OX4G7uSa; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju1-20020a17090798a100b0098df4217bf6si4192427ejc.989.2023.06.27.14.48.26; Tue, 27 Jun 2023 14:48:49 -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=@collabora.com header.s=mail header.b=OX4G7uSa; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbjF0Vqa (ORCPT + 99 others); Tue, 27 Jun 2023 17:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbjF0Vq1 (ORCPT ); Tue, 27 Jun 2023 17:46:27 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EB3E272D; Tue, 27 Jun 2023 14:46:27 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6AD66660716B; Tue, 27 Jun 2023 22:46:23 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902385; bh=Ud2ruCQMrs0y4/oeVi64N6XaZrL6MD3Lu7ndY/b2YiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OX4G7uSaFVf1Rp+S5iCmBZuljKzbtG39+f4Fu4sgj7vuOZ7zbTVP7mIOXjSiMkzkx KnTEnsqh7eKb7K1um2WAEez1k6/QVYbHo+OMfYILQnycfc5DrPJLt7Nbjx6C0E5fwR t5ADZ0wYP8AvqGKNNINOQxQPSD4Z4Elyv+MHgyuoqr3FrkgkcqSc8twxoX0cHzwKKz /crOOTx+3AnC3X2hajK3C8lWRr1o73oTf6aNm7EkGpWn3+MhEJYrvFFZFsdTDPvmXu NCaH3PGvFIPxu2pqu4Spj9YLyK3Oj/fb/qhZZNhYw6SLFf6bFIiO1mPLIJK9vlB4W/ /656KnuIXCOfQ== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Andrew-CT Chen , Conor Dooley , Krzysztof Kozlowski , Mauro Carvalho Chehab , Rob Herring , Tiffany Lin , Yunfei Dong , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 1/7] media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183 Date: Tue, 27 Jun 2023 17:45:51 -0400 Message-ID: <20230627214615.1503901-2-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894083158658048?= X-GMAIL-MSGID: =?utf-8?q?1769894083158658048?= MT8173 and MT8183 have different clocks, and consequently clock-names. Relax the number of clocks and set clock-names based on compatible. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nícolas F. R. A. Prado --- (no changes since v3) Changes in v3: - Reintroduced this commit from v1 since the active clock is no longer used. - Further constrained clocks as suggested in v1. .../media/mediatek,vcodec-decoder.yaml | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml index fad59b486d5d..1506d2693f7d 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml @@ -27,18 +27,12 @@ properties: maxItems: 1 clocks: + minItems: 1 maxItems: 8 clock-names: - items: - - const: vcodecpll - - const: univpll_d2 - - const: clk_cci400_sel - - const: vdec_sel - - const: vdecpll - - const: vencpll - - const: venc_lt_sel - - const: vdec_bus_clk_src + minItems: 1 + maxItems: 8 assigned-clocks: true @@ -88,6 +82,15 @@ allOf: required: - mediatek,scp + properties: + clocks: + minItems: 1 + maxItems: 1 + + clock-names: + items: + - const: vdec + - if: properties: compatible: @@ -99,6 +102,22 @@ allOf: required: - mediatek,vpu + properties: + clocks: + minItems: 8 + maxItems: 8 + + clock-names: + items: + - const: vcodecpll + - const: univpll_d2 + - const: clk_cci400_sel + - const: vdec_sel + - const: vdecpll + - const: vencpll + - const: venc_lt_sel + - const: vdec_bus_clk_src + additionalProperties: false examples: From patchwork Tue Jun 27 21:45:52 2023 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: 113625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8489643vqr; Tue, 27 Jun 2023 14:49:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ754mSLr1nM2HV7CH0ZS7a3SmHbPQ+N9HoVwwGVKGlDzlXToqOndKNT46hUxJdVVpWSJDgi X-Received: by 2002:a05:6402:1496:b0:51d:91ef:c836 with SMTP id e22-20020a056402149600b0051d91efc836mr5423570edv.32.1687902543277; Tue, 27 Jun 2023 14:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902543; cv=none; d=google.com; s=arc-20160816; b=NUTi/oo7SMiR1yrV3T9PRKpGQo6sFhwy8/7BcblHT5aik8qid9oMITG5UAKpMhxtay MH+s0dDaZ2lGAhzr7138GTEALH2gtk5g9pgjwbvVTDKYCvZWebyEVx8bsPW+9BBgZpQ8 woilFEJihxMOZAYHyGKi4OYx7n2eNrpbRiL/D5x2wnulHkcL1UrhpcM6y+3KAZyZg4Zb 8JBidgRdl62r7krBwopLtcT3Ozs/2Cp7ne8XsxTs/Uas8JlW21xBCcp1PgQLcXmq1L+k vlaB7XGW4WNTNABKbkYUwV8/ALfJtQXqNJ9Rvh77nDe5it5kQEL3GnFI9ixi6kKlFYSs qbWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U/1728/8lz7c18NWge1qSqmZxN9V+tKYzr5/NRHcY1A=; fh=R1fKKnvz0anVmD9ACD6MlNbYQvyB/ouHA74OOm0zbws=; b=OYXb++EA+JgBZVQLUQ9oTRTlyiH9GixeZ2W5o4/dUJC6xzdTpZt1JiNvgHMqqmIYBD dEH4A2HaVEDj5e2JVMn2G2oGl/ThYV899EisWPnEo8zJVB7D7yMCa/49YGt1LfnnwHK5 ZLwIvftGOOwjeVu4BjG1LkB2Iay3Y+jtV4lmwhBdHACMA/Z0blY+HkiDQ4YZVTjfZSzd 2+f3byxA4Kdve0x8BqhAEFBDqEgnUzJhu3jqssq9XMOGoFjfnTzcczhohGTge10KyUj1 Ey3LDg5eEOhOOPG/ISFByUirwbW5ugMou3irFY79MCdXLQT21fNYR5QhvnIsPU8+FzSO 3f4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oJZYJJHl; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay5-20020a056402202500b0051be6c0be70si4450006edb.138.2023.06.27.14.48.39; Tue, 27 Jun 2023 14:49:03 -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=@collabora.com header.s=mail header.b=oJZYJJHl; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbjF0Vqh (ORCPT + 99 others); Tue, 27 Jun 2023 17:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230465AbjF0Vqa (ORCPT ); Tue, 27 Jun 2023 17:46:30 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A070F2706; Tue, 27 Jun 2023 14:46:29 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2B29A660716C; Tue, 27 Jun 2023 22:46:26 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902388; bh=9a46aNnESj501/E03oYlm9sAjEXaazXllJOV13stIS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJZYJJHlniKS48gum0sgefsmbP8xR8Oa/MOZCbnM02KPe/5T9EJyWJr1G00Xj7kmG oXP0mPaRlV/gUGtbzvXWB5Rwjf4jDWxTjh6kA3u7cb1w5NQ2Z2+042i4tSmRiv+msf 8Fhc/oRhY4vpUYckZukQOQlWoSpuOvYMyUeBxBU6DRJKFmyRpxMVtEXMYPdf6uH7VF X2RW78Ua55vZSEaHEjG6PvTOp39EEWQVE8N7A2TeHvizyWTBi/qmC9OvNwsZrujzjO e13JzXrZTVwrdwxD9nsE8N6QaY2JTP7Vyw4DcN78NoGKfJoy3db5Ku25x6hqS/97fh LjJOChpCdgz0w== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Andrew-CT Chen , Conor Dooley , Krzysztof Kozlowski , Mauro Carvalho Chehab , Rob Herring , Tiffany Lin , Yunfei Dong , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 2/7] media: dt-bindings: mediatek,vcodec: Don't require assigned-clocks Date: Tue, 27 Jun 2023 17:45:52 -0400 Message-ID: <20230627214615.1503901-3-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894097269358517?= X-GMAIL-MSGID: =?utf-8?q?1769894097269358517?= On MT8183 it's not necessary to configure the parent for the clocks. Remove the assigned-clocks and assigned-clock-parents from the required list. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski --- (no changes since v1) .../devicetree/bindings/media/mediatek,vcodec-decoder.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml index 1506d2693f7d..1e56ece44aee 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml @@ -67,8 +67,6 @@ required: - clocks - clock-names - iommus - - assigned-clocks - - assigned-clock-parents allOf: - if: From patchwork Tue Jun 27 21:45:53 2023 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: 113629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8490307vqr; Tue, 27 Jun 2023 14:50:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CJ84CYbB1dl8STMyjmKKUl9NiaAFOJO11ngIeHm2eTAxoGb4Dq1lhWeJDqxBGubvo+qK5 X-Received: by 2002:a17:907:26cc:b0:98a:29ca:c58e with SMTP id bp12-20020a17090726cc00b0098a29cac58emr18002219ejc.27.1687902638143; Tue, 27 Jun 2023 14:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902638; cv=none; d=google.com; s=arc-20160816; b=XWaXbILFpAd9G4Ai3tJYVUEPsKJcrichcXxNpG5HG93l3ophBtT5jSNv4/GJ1jbXwn DNmnwxfUBtQKxw7ZoioWwc78qpL0F6YrwnnputRM9uXxBg5H92jjT8J00EpwqIeUVo8S WdKs8US4Ezcq8D4wDsmZA1q80STokrhuQCqtGlaQTBXc++9//eSt7X6qrIB7scsx8LKD pn0IW9hMVIFQPbNqhjHYBNuS6YD1mlCIO2T08mr+3+IOuSsNCn78q34YsHd+N123EWfH 9LemySGDW1Z/zFgoTGLjteP2PUZ5Du1Q4BPxzgjaBnw/kNmi1OIoQg+lukGrdH5lciaB U4JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OKE9BiQP+eOe1UTQpPcrsrjA1s2xHp5VPFiPPtT4pdY=; fh=R1fKKnvz0anVmD9ACD6MlNbYQvyB/ouHA74OOm0zbws=; b=c1XyzvLzjYB3XrnRPFHMNVoirLWKJOQjxo8dUKgMFfVolB63d1sWSJ/jmbIjfyygH2 2K/l08E77haDaDrVEAlig8TnVy1+idrbVGqtAEqZFLYhr4FFP8iNSKIepyRaZvI9i8/r 1TXMz2Aq7Kp7ggrA3SDtXlTsgIWBYxiMXuyfLNTyxXkvIA0dUSpbkNbpAn0QojtXWQEJ EoZmCR8zWhLj/7Rgu5tBohrx7qQO8MJKtZLr/akfqZuDrl1j7TbFF+6NSYCnhJLMLrQi prTJMwBOk9gRpBjBtGbil3aw2E4Kh5Va70ibkEioHYWOtwUYbxdOF1a2de3/yal074iP vW8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QRX7Y7FJ; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gg18-20020a170906e29200b0098d7390816asi5098441ejb.756.2023.06.27.14.50.14; Tue, 27 Jun 2023 14:50:38 -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=@collabora.com header.s=mail header.b=QRX7Y7FJ; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230209AbjF0Vqj (ORCPT + 99 others); Tue, 27 Jun 2023 17:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbjF0Vqf (ORCPT ); Tue, 27 Jun 2023 17:46:35 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63EE42976; Tue, 27 Jun 2023 14:46:32 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id DDAE8660716D; Tue, 27 Jun 2023 22:46:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902391; bh=6/vcaD7vHgxFo563mcGSzADfJpcIhcKqIWXtcXlmyyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRX7Y7FJczspzvg1lbr4hdqkL2V2n45ngk1lc9CQScHa7bQQYNO6BXWJjQ4mdUwxJ /9TsURMA8BOHYMi0/Fu7ThKFO5dXWGl02FiKipJReDlL/oU340MrHwcADXNhUXbN/R Ar7nAy7hwB1n1fFG9oX9YJpKbYno+7ObS6bmEJ7NFPjGR+Q/RZB5dHbw+Oc4zx4OZf SRs4akW6zCFzxlDCOOtajVTuPnyjEhgqqkQP13tDy9KBzV7UfY0ncA2U/xN6KHret8 F4QmMtU7qTp035vpOCTPfbJKxor8dFaC9NlV0UgyerJSZhXuNjSgFzwVjB+KshnJ1C jn/wsh0jiqtcQ== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Andrew-CT Chen , Conor Dooley , Krzysztof Kozlowski , Mauro Carvalho Chehab , Rob Herring , Tiffany Lin , Yunfei Dong , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 3/7] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS register space Date: Tue, 27 Jun 2023 17:45:53 -0400 Message-ID: <20230627214615.1503901-4-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894196961859418?= X-GMAIL-MSGID: =?utf-8?q?1769894196961859418?= The binding expects the first register space to be VDEC_SYS. However this register space is already assigned to a different node on both MT8173 and MT8183: a clock-controller node called 'vdecsys' which is also a syscon. In order to resolve the overlapping address ranges, remove the VDEC_SYS register space from the video decoder, and add a new property to hold the phandle to the syscon, so that iospace can still be handled. Also add reg-names to be able to tell that this new register schema is used, so the driver can keep backward compatibility. Signed-off-by: Nícolas F. R. A. Prado --- Changes in v4: - Removed VDEC_SYS reg from mt8173 as well - Reworded commit Changes in v3: - Removed the active clock - Added a mediatek,vdecsys syscon property Changes in v2: - Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single clock for mt8183) to avoid changing number of clocks twice - Added maxItems to reg-names - Constrained clocks for each compatible - Reordered properties for each compatible .../media/mediatek,vcodec-decoder.yaml | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml index 1e56ece44aee..b401c67e3ba0 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml @@ -21,7 +21,22 @@ properties: - mediatek,mt8183-vcodec-dec reg: - maxItems: 12 + minItems: 11 + maxItems: 11 + + reg-names: + items: + - const: misc + - const: ld + - const: top + - const: cm + - const: ad + - const: av + - const: pp + - const: hwd + - const: hwq + - const: hwb + - const: hwg interrupts: maxItems: 1 @@ -60,6 +75,10 @@ properties: description: Describes point to scp. + mediatek,vdecsys: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the vdecsys syscon node. + required: - compatible - reg @@ -67,6 +86,7 @@ required: - clocks - clock-names - iommus + - mediatek,vdecsys allOf: - if: @@ -126,10 +146,9 @@ examples: #include #include - vcodec_dec: vcodec@16000000 { + vcodec_dec: vcodec@16020000 { compatible = "mediatek,mt8173-vcodec-dec"; - reg = <0x16000000 0x100>, /*VDEC_SYS*/ - <0x16020000 0x1000>, /*VDEC_MISC*/ + reg = <0x16020000 0x1000>, /*VDEC_MISC*/ <0x16021000 0x800>, /*VDEC_LD*/ <0x16021800 0x800>, /*VDEC_TOP*/ <0x16022000 0x1000>, /*VDEC_CM*/ @@ -150,6 +169,7 @@ examples: <&iommu M4U_PORT_HW_VDEC_VLD_EXT>, <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>; mediatek,vpu = <&vpu>; + mediatek,vdecsys = <&vdecsys>; power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>; clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>, <&topckgen CLK_TOP_UNIVPLL_D2>, From patchwork Tue Jun 27 21:45:54 2023 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: 113626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8489671vqr; Tue, 27 Jun 2023 14:49:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s/5zuRFLIZT32KgcgiJsezo3USdSq9rBdJ6ehPNdL4TyEVsqLTdaIKxiOwi1a7MucAqS/ X-Received: by 2002:a17:906:8445:b0:991:e5a5:cd4b with SMTP id e5-20020a170906844500b00991e5a5cd4bmr3420151ejy.56.1687902549689; Tue, 27 Jun 2023 14:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902549; cv=none; d=google.com; s=arc-20160816; b=eCUiWSVMlIz7cbc7di8Q4Wf8hOXdeEl4Hh5utWfHfC9yYNOk4Gcs19coZxCxvjYCNi x9xHXxtYTSP36bn+FEXGyo6HHAY5cWzIrfouVM3oNokW4poAdOzfV8ppfInjrDDMMb5j PllB3qwusGJ570nTG9AQa95/KShkiz7QwGHF2wuy2LYX3YQhbY8+Hyaij/VEJ5R+HrZ5 M0iXn8f0hKXkZTEbnp7FjiXolddOaOGZX6eYiY9YH1Udzj33StlCRVxNa955zH5KG2re 8x8sMO/jkaXAfa3g94mJOofI3BlKdJA+cF8JskGZjzekxABl1OFC8qbtOelGOVoWRJgQ yCJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TERIzU15yeXmu9DzY8Kxd+c6di/BQGALijSOmeevHbI=; fh=+MFlUDxSCYsjNyvPvlzVsG1VB0x9jhdc15ksEIeUZLg=; b=xtaaJo0drIBG+udhGEyP0Tv3A57nFsrwuLnaPePRQMpRVwFOTjH8tegUN3BvLgjXXs MfvU3UuQuIKc0w5Nn9Xby17krkKa+CEwasffqEMfi2iuBv2Y+epSwDg1KdMQP9fIhmqn LQrUz9NfE36fcB5BxqMCNJ/ggrvupJi80JX8h5JoVghKU82cUoaa13qV3VUfZj8wvlt/ UtC+1u7pBBd96MHQZDYlL2Xd3m370eqc3TqqTwDWURJx7A9j2dIn9T0p10f6rmL4lfsU LGhuQnnYMcpltUYaEF468j1EBoXDHZZrJk63WXvRTHrO0PjXedL4xu6MtY9n0lxYtrp1 UeRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bdHidwzk; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mb7-20020a170906eb0700b00991fe707692si1794638ejb.63.2023.06.27.14.48.45; Tue, 27 Jun 2023 14:49:09 -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=@collabora.com header.s=mail header.b=bdHidwzk; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbjF0Vqo (ORCPT + 99 others); Tue, 27 Jun 2023 17:46:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbjF0Vqg (ORCPT ); Tue, 27 Jun 2023 17:46:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12512D44; Tue, 27 Jun 2023 14:46:34 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9E1786607165; Tue, 27 Jun 2023 22:46:31 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902393; bh=qe7GxwnSjbAfRY/6FkdfYaxWhyQir3XZsikITphI9wM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdHidwzklkAhbmUpYjA44CW3qrHkIZZVA7RjXR3Z/QIt8traaERt3QwwvkUyb/Qev 5+rBFDjPiEs2wxzb32LmsViFA7e7zWPYwjfG2eBADE8bo82zAOPEENI+KtscCjgJ+L NGhFrfHi5IgwvM+ADyCynZARqJZNPYsRVyb9szXItCjrHoNjnTRHf8LZrlgmEkejRu 8SN2h6ryZrVMAoPN2ZK8PireVNbcbJIr+g8E0ARgNd49Xm+n3TlBJKf+56iM5sVmzq hof9n+5xgFAkeVJl+7JG+DxhCLvbEXi51oN5go1ZVErKVx6wcC76A44ADqcocuIWvR B8JuhVQMWVSaw== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Andrew-CT Chen , Mauro Carvalho Chehab , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 4/7] media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE Date: Tue, 27 Jun 2023 17:45:54 -0400 Message-ID: <20230627214615.1503901-5-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894103843704615?= X-GMAIL-MSGID: =?utf-8?q?1769894103843704615?= The VDEC_HW_ACTIVE bit is located at offset 0, bit 4 of the VDECSYS iospace. Only the mask was previously defined, with the address being implicit. Explicitly define the address, and append a '_MASK' suffix to the mask, to make accesses to this bit clearer. This commit brings no functional change. Signed-off-by: Nícolas F. R. A. Prado --- Changes in v4: - Made use of BIT() macro for mask Changes in v3: - Added this commit drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 ++-- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index d41f2121b94f..83780d29a9cf 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -50,8 +50,8 @@ static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv) ctx = mtk_vcodec_get_curr_ctx(dev, MTK_VDEC_CORE); /* check if HW active or not */ - cg_status = readl(dev->reg_base[0]); - if ((cg_status & VDEC_HW_ACTIVE) != 0) { + cg_status = readl(dev->reg_base[0] + VDEC_HW_ACTIVE_ADDR); + if ((cg_status & VDEC_HW_ACTIVE_MASK) != 0) { mtk_v4l2_err("DEC ISR, VDEC active is not 0x0 (0x%08x)", cg_status); return IRQ_HANDLED; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c index e1cb2f8dca33..41aa66c7295b 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c @@ -75,8 +75,8 @@ static irqreturn_t mtk_vdec_hw_irq_handler(int irq, void *priv) ctx = mtk_vcodec_get_curr_ctx(dev->main_dev, dev->hw_idx); /* check if HW active or not */ - cg_status = readl(dev->reg_base[VDEC_HW_SYS]); - if (cg_status & VDEC_HW_ACTIVE) { + cg_status = readl(dev->reg_base[VDEC_HW_SYS] + VDEC_HW_ACTIVE_ADDR); + if (cg_status & VDEC_HW_ACTIVE_MASK) { mtk_v4l2_err("vdec active is not 0x0 (0x%08x)", cg_status); return IRQ_HANDLED; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h index 36faa8d9d681..ff250e3be78e 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h @@ -12,7 +12,8 @@ #include "mtk_vcodec_drv.h" -#define VDEC_HW_ACTIVE 0x10 +#define VDEC_HW_ACTIVE_ADDR 0x0 +#define VDEC_HW_ACTIVE_MASK BIT(4) #define VDEC_IRQ_CFG 0x11 #define VDEC_IRQ_CLR 0x10 #define VDEC_IRQ_CFG_REG 0xa4 From patchwork Tue Jun 27 21:45:55 2023 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: 113627 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8489746vqr; Tue, 27 Jun 2023 14:49:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cXN+CkLfOZ5Qbnjsm274TBlmvFDwSJ7RdTwCHu0PUYjCTE8SAhkM3dPVXrAtoPwwgSgPL X-Received: by 2002:ac2:4f12:0:b0:4ed:cc6d:61fe with SMTP id k18-20020ac24f12000000b004edcc6d61femr6002535lfr.24.1687902562455; Tue, 27 Jun 2023 14:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902562; cv=none; d=google.com; s=arc-20160816; b=jU1DJ48WILvVdcAtA+bzsoWnODdwMdGxSqu3hV5EvAIIuVTDGi+NT4coU9MoRCrA/F TCmCHZKU02uNXVdgB3OLG+7LX1ibC7AxhCraWipdfks8rSbeJsemlGuo9QSBoyldnabW ww4QY4y85pbUbnQ7SJk+ErwoiSv1PH23xwGxxUSCv15qp829fIVZkpx9QO2m4tZ6LzFE mVZQNLZMz9cJrxZnj42gzktq8G7g6voO8F7Z9GInGwHWCUwEfR5FefC/LdrYgx+TpzLv tq6q6hrNvTAP4sEY7FmrZnNwFFS9sY0hcNIr2wwewvqlvm9DjpKx4GwUfg8NwXLJ+IiN /3VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ner3KLHw+HpPYQ+hh0GuxVoFBaSERn2M4WqE9Oyukdc=; fh=+MFlUDxSCYsjNyvPvlzVsG1VB0x9jhdc15ksEIeUZLg=; b=CYRONUDBWEYTEiOs5ORjUy5yu8jKOytyOw86pVajyanB042bAO11r2xDOZRNIQ8jkj cmxpQJH9Ikbyh+ApvWGyT4YinDTyri8AH03g7sLhSci87C5/NoU/xE8it4Gow9HTIfLS mt35DUKYJ8D6XSuJiOpSOJkWmjF1NE3y12NCBp+//4pa0h/St0ei5pWn1lDpnjZ9Cdpo Tn4X9gTzZhlsPDdVczJTzNOMpEtilbWjI8Xg/qUAZsDhRUlFuM90S+BgqRU8+h6WGspW ZpGfJfQvtnJHRtynYlvtP9GO79Qft7jfgHtetQ9nBkUUdUWLN1qz2IcjvHT25pNFMGJN vC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bCt6Wnh0; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d22-20020a50fb16000000b0051d98308c3csi3115810edq.470.2023.06.27.14.48.58; Tue, 27 Jun 2023 14:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=bCt6Wnh0; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjF0Vqv (ORCPT + 99 others); Tue, 27 Jun 2023 17:46:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbjF0Vql (ORCPT ); Tue, 27 Jun 2023 17:46:41 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2F682953; Tue, 27 Jun 2023 14:46:36 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id D4B99660716B; Tue, 27 Jun 2023 22:46:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902395; bh=7Yv0RLEqwrkwHViyfVu6oNggvzTGRKyaB317MVjZZKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCt6Wnh0qQyBkJ/zP4lYYrsd7dAsxqaPhyFzzqJyrmx4f3SCG0p+aO2Gi+Boqi+G0 JHlT68vKq1OFsrCtXIBuC3Cc4eoE+qXCr/R4nX1PjopFMYi3cmhveCut23B9hS7ONa mNpn162Q2W8XWmDjPvLYBTq6ijOaeqs5o8xCCIOUC+9/aYQuzNsr63I1IDMPyjzzeB PWZJyzhx5Soz2uoxEW/Pz+BrYHEW1Iue0+yu7H+4krGsiZ12wS8WHvBRs+nuKmapWW LSNdFYyUb3qKWwBajZ7pPwroP0kjmwTEQDmMq2cKk59WgvtSUo+m8/5s3+vDb0+8IZ nbZq0gVinZAtg== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Andrew-CT Chen , Mauro Carvalho Chehab , Tiffany Lin , Yunfei Dong , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 5/7] media: mediatek: vcodec: Read HW active status from syscon Date: Tue, 27 Jun 2023 17:45:55 -0400 Message-ID: <20230627214615.1503901-6-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894117282770803?= X-GMAIL-MSGID: =?utf-8?q?1769894117282770803?= Remove the requirement of a VDEC_SYS reg iospace for both MT8173 and MT8183. To achieve that, rely on a vdecsys syscon to be passed through the DT, and use it to directly read the VDEC_HW_ACTIVE bit during IRQ handling to check whether the HW is active. Also update the VP8 stateful decoder to use the syscon, if present, for writes to VDEC_SYS. The old behavior is still present when reg-names aren't supplied, as to keep backward compatibility. Signed-off-by: Nícolas F. R. A. Prado --- Changes in v4: - Added new helper and updated VP8 stateful decoder to use it, so the syscon can also be used by mt8173 - Made handling cleaner - Reworded commit Changes in v3: - Switched handling of VDEC_HW_ACTIVE to use a syscon instead of the 'active' clock - Reworded commit - Removed changes to subdev part of driver, since they aren't used by MT8183 .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 76 ++++++++++++++++--- .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 + .../mediatek/vcodec/mtk_vcodec_util.c | 15 ++++ .../mediatek/vcodec/mtk_vcodec_util.h | 2 + .../mediatek/vcodec/vdec/vdec_vp8_if.c | 10 +-- 5 files changed, 86 insertions(+), 18 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index 83780d29a9cf..d83c2eb6f118 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -8,10 +8,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -38,22 +40,30 @@ static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dev *dev) } } +static bool mtk_vcodec_is_hw_active(struct mtk_vcodec_dev *dev) +{ + u32 cg_status; + + if (dev->vdecsys_regmap) + return !regmap_test_bits(dev->vdecsys_regmap, VDEC_HW_ACTIVE_ADDR, + VDEC_HW_ACTIVE_MASK); + + cg_status = readl(dev->reg_base[VDEC_SYS] + VDEC_HW_ACTIVE_ADDR); + return !FIELD_GET(VDEC_HW_ACTIVE_MASK, cg_status); +} + static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv) { struct mtk_vcodec_dev *dev = priv; struct mtk_vcodec_ctx *ctx; - u32 cg_status = 0; unsigned int dec_done_status = 0; void __iomem *vdec_misc_addr = dev->reg_base[VDEC_MISC] + VDEC_IRQ_CFG_REG; ctx = mtk_vcodec_get_curr_ctx(dev, MTK_VDEC_CORE); - /* check if HW active or not */ - cg_status = readl(dev->reg_base[0] + VDEC_HW_ACTIVE_ADDR); - if ((cg_status & VDEC_HW_ACTIVE_MASK) != 0) { - mtk_v4l2_err("DEC ISR, VDEC active is not 0x0 (0x%08x)", - cg_status); + if (!mtk_vcodec_is_hw_active(dev)) { + mtk_v4l2_err("DEC ISR, VDEC active is not 0x0"); return IRQ_HANDLED; } @@ -82,6 +92,33 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) { struct platform_device *pdev = dev->plat_dev; int reg_num, i; + struct resource *res; + bool has_vdecsys_reg; + static const char * const mtk_dec_reg_names[] = { + "misc", + "ld", + "top", + "cm", + "ad", + "av", + "pp", + "hwd", + "hwq", + "hwb", + "hwg" + }; + + /* + * If we have reg-names in devicetree, this means that we're on a new + * register organization, which implies that the VDEC_SYS iospace gets + * R/W through a syscon (regmap). + * Here we try to get the "misc" iostart only to check if we have reg-names + */ + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "misc"); + if (res) + has_vdecsys_reg = false; + else + has_vdecsys_reg = true; /* Sizeof(u32) * 4 bytes for each register base. */ reg_num = of_property_count_elems_of_size(pdev->dev.of_node, "reg", @@ -91,12 +128,29 @@ static int mtk_vcodec_get_reg_bases(struct mtk_vcodec_dev *dev) return -EINVAL; } - for (i = 0; i < reg_num; i++) { - dev->reg_base[i] = devm_platform_ioremap_resource(pdev, i); - if (IS_ERR(dev->reg_base[i])) - return PTR_ERR(dev->reg_base[i]); + if (has_vdecsys_reg) { + for (i = 0; i < reg_num; i++) { + dev->reg_base[i] = devm_platform_ioremap_resource(pdev, i); + if (IS_ERR(dev->reg_base[i])) + return PTR_ERR(dev->reg_base[i]); + + mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]); + } + } else { + for (i = 0; i < reg_num; i++) { + dev->reg_base[i+1] = devm_platform_ioremap_resource_byname(pdev, mtk_dec_reg_names[i]); + if (IS_ERR(dev->reg_base[i+1])) + return PTR_ERR(dev->reg_base[i+1]); - mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]); + mtk_v4l2_debug(2, "reg[%d] base=%p", i+1, dev->reg_base[i+1]); + } + + dev->vdecsys_regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, + "mediatek,vdecsys"); + if (IS_ERR(dev->vdecsys_regmap)) { + dev_err(&pdev->dev, "Missing mediatek,vdecsys property"); + return PTR_ERR(dev->vdecsys_regmap); + } } return 0; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h index f17d67e781c9..0b430936f67d 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_drv.h @@ -489,6 +489,7 @@ struct mtk_vcodec_dev { void __iomem *reg_base[NUM_MAX_VCODEC_REG_BASE]; const struct mtk_vcodec_dec_pdata *vdec_pdata; const struct mtk_vcodec_enc_pdata *venc_pdata; + struct regmap *vdecsys_regmap; struct mtk_vcodec_fw *fw_handler; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c index f214e6f67005..8aaa5eb45444 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "mtk_vcodec_dec_hw.h" #include "mtk_vcodec_drv.h" @@ -34,6 +35,20 @@ void __iomem *mtk_vcodec_get_reg_addr(struct mtk_vcodec_ctx *data, } EXPORT_SYMBOL(mtk_vcodec_get_reg_addr); +int mtk_vcodec_write_vdecsys(struct mtk_vcodec_ctx *ctx, unsigned int reg, + unsigned int val) +{ + struct mtk_vcodec_dev *dev = ctx->dev; + + if (dev->vdecsys_regmap) + return regmap_write(dev->vdecsys_regmap, reg, val); + + writel(val, dev->reg_base[VDEC_SYS] + reg); + + return 0; +} +EXPORT_SYMBOL(mtk_vcodec_write_vdecsys); + int mtk_vcodec_mem_alloc(struct mtk_vcodec_ctx *data, struct mtk_vcodec_mem *mem) { diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h index 88d389b65f13..c8bb4fc5153f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h @@ -70,6 +70,8 @@ extern int mtk_vcodec_dbg; void __iomem *mtk_vcodec_get_reg_addr(struct mtk_vcodec_ctx *data, unsigned int reg_idx); +int mtk_vcodec_write_vdecsys(struct mtk_vcodec_ctx *ctx, unsigned int reg, + unsigned int val); int mtk_vcodec_mem_alloc(struct mtk_vcodec_ctx *data, struct mtk_vcodec_mem *mem); void mtk_vcodec_mem_free(struct mtk_vcodec_ctx *data, diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c index 88c046731754..2592fa37b4c8 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c @@ -91,7 +91,6 @@ struct vdec_vp8_vsi { /** * struct vdec_vp8_hw_reg_base - HW register base - * @sys : base address for sys * @misc : base address for misc * @ld : base address for ld * @top : base address for top @@ -100,7 +99,6 @@ struct vdec_vp8_vsi { * @hwb : base address for hwb */ struct vdec_vp8_hw_reg_base { - void __iomem *sys; void __iomem *misc; void __iomem *ld; void __iomem *top; @@ -170,7 +168,6 @@ static void get_hw_reg_base(struct vdec_vp8_inst *inst) inst->reg_base.top = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_TOP); inst->reg_base.cm = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_CM); inst->reg_base.hwd = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_HWD); - inst->reg_base.sys = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_SYS); inst->reg_base.misc = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_MISC); inst->reg_base.ld = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_LD); inst->reg_base.hwb = mtk_vcodec_get_reg_addr(inst->ctx, VDEC_HWB); @@ -222,17 +219,16 @@ static void read_hw_segmentation_data(struct vdec_vp8_inst *inst) static void enable_hw_rw_function(struct vdec_vp8_inst *inst) { u32 val = 0; - void __iomem *sys = inst->reg_base.sys; void __iomem *misc = inst->reg_base.misc; void __iomem *ld = inst->reg_base.ld; void __iomem *hwb = inst->reg_base.hwb; void __iomem *hwd = inst->reg_base.hwd; - writel(0x1, sys + VP8_RW_CKEN_SET); + mtk_vcodec_write_vdecsys(inst->ctx, VP8_RW_CKEN_SET, 0x1); writel(0x101, ld + VP8_WO_VLD_SRST); writel(0x101, hwb + VP8_WO_VLD_SRST); - writel(1, sys); + mtk_vcodec_write_vdecsys(inst->ctx, 0, 0x1); val = readl(misc + VP8_RW_MISC_SRST); writel((val & 0xFFFFFFFE), misc + VP8_RW_MISC_SRST); @@ -241,7 +237,7 @@ static void enable_hw_rw_function(struct vdec_vp8_inst *inst) writel(0x71201100, misc + VP8_RW_MISC_FUNC_CON); writel(0x0, ld + VP8_WO_VLD_SRST); writel(0x0, hwb + VP8_WO_VLD_SRST); - writel(0x1, sys + VP8_RW_DCM_CON); + mtk_vcodec_write_vdecsys(inst->ctx, VP8_RW_DCM_CON, 0x1); writel(0x1, misc + VP8_RW_MISC_DCM_CON); writel(0x1, hwd + VP8_RW_VP8_CTRL); } From patchwork Tue Jun 27 21:45:56 2023 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: 113630 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8493695vqr; Tue, 27 Jun 2023 14:59:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lWcru7ijgUjXiBOSoy1K0Rs3B5+Nq25GkwIG58Be8gP+O110JVzS2vMac7eWCWgIAWFo5 X-Received: by 2002:a17:907:75ed:b0:992:47d7:35d7 with SMTP id jz13-20020a17090775ed00b0099247d735d7mr1095813ejc.14.1687903181680; Tue, 27 Jun 2023 14:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687903181; cv=none; d=google.com; s=arc-20160816; b=Bbc2W718liOd4ED+TjMXh2S4y9j9mgS5uj3/k4FVB5OiNBvj0aXKrYC9HonoykxUqo 4KOMRrqMWo5KMPA8sQ4HHJjjWaimA2SMQqqlzSsPgfl/eWpqWFk9dyNAqq4mmHhJqPWv g5yzC7cTa8E2KSIs40Dtpcpk2j6369x+dNTbkgrwhC//CFToXTF7uRwDJRxKdYB1+jQx PUaC58g9FBhTcv8UKzVtrNiGKl+vQcwEkSzxVSg5PCvvsJEpMbk92/z/A5K3jLjFANpC gGUgyIefGv4ht5l7Y5Bj4xCLLipLFOngORE+KL3NmUyF+NxRGKV7Qnp/l1e7I3TRPjtI D9Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gJn5ETyC0ghT/iFS0bIu7beesld3hMcc/RLSs5NmtYg=; fh=EZYN073uZnOIXF3feDsNMKZEySDS9WXLByY4mJK1DBw=; b=uEXWt25pAyVEOqasRxVSR5svsXpa7Sl57BL+BqPmBShVqqvRlItSSdMzlYvuP+qHJ1 brGFC5FAwrwTXVWxa/s9uJLCR10jmvUh32OFKkBZf5pM2MSeorXI8tJU22CwInBXDwq0 EXhgs640A9/hETZa32gt9Nr3129u2xuiL2WcYxfT20GNc04cscto0IyksMoRe6NLFxnS 8NHVscI7FKQDRJAPTNvfvS+ksO/EGgdWWBcMKxJuiitkXEX4SLhEYYdgAdkQ+t9GrORe 6uw1f0c7oT5s1en0mqGeeaO15iZSTIZfJcVaHfieCxrNsHyYsNdUfLqzmk08eyHN64F+ bc7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BEmknKh9; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gj25-20020a170906e11900b0098e0fb375e9si4266773ejb.7.2023.06.27.14.59.17; Tue, 27 Jun 2023 14:59: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=@collabora.com header.s=mail header.b=BEmknKh9; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjF0VrF (ORCPT + 99 others); Tue, 27 Jun 2023 17:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbjF0Vqp (ORCPT ); Tue, 27 Jun 2023 17:46:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C399297D; Tue, 27 Jun 2023 14:46:39 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1E6BA660716C; Tue, 27 Jun 2023 22:46:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902397; bh=khyVQY+Nu/Z4EDKrg96abLDsAid37RZNAFA7dJoh+K8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BEmknKh9uXv6AKN+kRQcmsKlfxopmDPOGU9wtjVeDOZByqNTKWgbBrpoNoUI/tJ/o JpCg6mqBUt8NpYy0cSQujxUuCgPiNI3k/w+SlZjOFZQA73DrJK7NKQNNUvLNnzMKIh okq1nDuFjUBiz8c3QC38vE2njRckaIzgmn5iKFiGOlClmGv1JXBoem+gJEo8SmLlgt s6UXFaOjHpIM10NU4NDzidkVlCX00STy5mojjPJmz999jEU4XsYr84LXg81DzHNPs8 VzyCm1mPcA+vQlPjma5/jMcJoS0Ec11mnN6yePr+MifjF3aj6FVbQMbvN3tdkBo7lr kvPOrsasFsA7g== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 6/7] arm64: dts: mediatek: mt8173: Drop VDEC_SYS reg from decoder Date: Tue, 27 Jun 2023 17:45:56 -0400 Message-ID: <20230627214615.1503901-7-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894766255756849?= X-GMAIL-MSGID: =?utf-8?q?1769894766255756849?= Remove the VDEC_SYS register space from the decoder, so that the node address becomes that of VDEC_MISC, solving the long-standing conflicting addresses between this node and the vdecsys clock-controller node: arch/arm64/boot/dts/mediatek/mt8173.dtsi:1365.38-1369.5: Warning (unique_unit_address_if_enabled): /soc/clock-controller@16000000: duplicate unit-address (also used in node /soc/vcodec@16000000) The driver makes use of this register space, however, so also add a phandle to the VDEC_SYS syscon to maintain functionality. Signed-off-by: Nícolas F. R. A. Prado --- Changes in v4: - Added this commit arch/arm64/boot/dts/mediatek/mt8173.dtsi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi index c47d7d900f28..cac4cd0a0320 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi @@ -1368,10 +1368,9 @@ vdecsys: clock-controller@16000000 { #clock-cells = <1>; }; - vcodec_dec: vcodec@16000000 { + vcodec_dec: vcodec@16020000 { compatible = "mediatek,mt8173-vcodec-dec"; - reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */ - <0 0x16020000 0 0x1000>, /* VDEC_MISC */ + reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ <0 0x16021000 0 0x800>, /* VDEC_LD */ <0 0x16021800 0 0x800>, /* VDEC_TOP */ <0 0x16022000 0 0x1000>, /* VDEC_CM */ @@ -1382,6 +1381,8 @@ vcodec_dec: vcodec@16000000 { <0 0x16027000 0 0x800>, /* VDEC_HWQ */ <0 0x16027800 0 0x800>, /* VDEC_HWB */ <0 0x16028400 0 0x400>; /* VDEC_HWG */ + reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", + "hwd", "hwq", "hwb", "hwg"; interrupts = ; iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>, <&iommu M4U_PORT_HW_VDEC_PP_EXT>, @@ -1392,6 +1393,7 @@ vcodec_dec: vcodec@16000000 { <&iommu M4U_PORT_HW_VDEC_VLD_EXT>, <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>; mediatek,vpu = <&vpu>; + mediatek,vdecsys = <&vdecsys>; power-domains = <&spm MT8173_POWER_DOMAIN_VDEC>; clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>, <&topckgen CLK_TOP_UNIVPLL_D2>, From patchwork Tue Jun 27 21:45:57 2023 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: 113628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8489878vqr; Tue, 27 Jun 2023 14:49:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tZNeOtNAM74hzyrOGpCKSu05jrmLzBrvz2jUCyPRCZ4l6PDToPH6zXkJEyJdPiv5PsgK2 X-Received: by 2002:a17:906:ee82:b0:988:f307:aea3 with SMTP id wt2-20020a170906ee8200b00988f307aea3mr20419681ejb.9.1687902583131; Tue, 27 Jun 2023 14:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687902583; cv=none; d=google.com; s=arc-20160816; b=JObTGNGIUQEuziSxXWu47DspT4HFMBgwaom86YK1E7x+B3GFxni9mWh0OJqHLNSPaM xrb26xenWjLbfCHlGwbceRbez7YxDrBQsyrtSCD5uu8B9pIeUf4XvfdWQNImvBFJE6mJ pKFK0jSe1mdvomLNxPTdPeg+dE+3vHBozTr9DOeZxJF0pyR0uNfGZ/xq65oJE7kYoQmt xGaN4kPOykhRhOVMV2p/3GXWNyhnDFGmm3BI3F8v7qcgcc266G2vB8i+tOHHOhexGm+/ pSSvfRI17Cj1fJcAk6JJRzu8NSQsfgQMplNAdbLRLfb3+ZUy9xNGkIYN6buJQgajLryr GJAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CXr8XJfOW4/UN4ADlvfnrER99mK8AwEoo6FCdZDe8P4=; fh=3En/7ZQ1z6zfqKMJk+xTXJTk1ClH9QFcTHNSb4uNwIM=; b=UFvlD2/j+ItBJcDGALMXzq1mB+XZHRpwz1bmspDy9BI6GgZzs/jsv0k1aHaKABwf3B p/3PqSv3bqr0q1Mbs2bF2jnzRR16Ialrn5BuGA2ZqCTAZEkg33acLG2xoqpsjAxUF6ly 1Ie/PhPD+oMgXXDp2xwFA3GHUQ4M7gwE7iq3WmhXGvCTYCFEk05EDX3Iu/F5GSPQPJ3O b44nBh+P0ICl038dU/fwDbx2a3KnluwgPXH5AIJRFGqATUz320HroUGuG7wvhZ8BhAer lueSqfUWImpU8YAz4lKgCbza/zbCkSkiLT7B1Up+hnwcOyLphZQUUciQZpx8qt9zrrMF MC0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dSKXhDd1; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170906248600b009829ede9296si4247138ejb.83.2023.06.27.14.49.19; Tue, 27 Jun 2023 14:49: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=@collabora.com header.s=mail header.b=dSKXhDd1; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbjF0VrL (ORCPT + 99 others); Tue, 27 Jun 2023 17:47:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbjF0VrD (ORCPT ); Tue, 27 Jun 2023 17:47:03 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C642D60; Tue, 27 Jun 2023 14:46:41 -0700 (PDT) Received: from notapiano.myfiosgateway.com (zone.collabora.co.uk [167.235.23.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 405646607064; Tue, 27 Jun 2023 22:46:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687902400; bh=dDGAXyQUfLadYEQWCBPnnvjplu6XpXRhFI0R4wZeknQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dSKXhDd1emsZa4HhNT1tcgAMDFHBcBmlnRvmDAd9gL2AaITNgAboDNXgt2YXunMAQ ZRAHCsLcxy7k1dy28NtOOUdRwjCvQTzU1I+GmkIB6tYXG+p2kzqW3x9wgZCuWApjxw 3yG+gAYCE0m+lny6J3QOrYMKZxTsqq5pzxijphIoP9otTEo0Y9D6vIzQofs07wr/wF IQremBG9SIWyWjQ+lqPDI3RRc0jhevbyjC/phJSG2DP9WC5YCSBV9fXsNgtNeAu1GA PjxYbtDMnhMhT7HBz0NVvBU9YFSX5I1i3icYyvGFAmrRS8apBBmA1LKNw4U/WHkPi5 /mleiZth/OsKw== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: Matthias Brugger , Hans Verkuil Cc: kernel@collabora.com, AngeloGioacchino Del Regno , Yunfei Dong , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_?= =?utf-8?q?A_=2E_Prado?= , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 7/7] arm64: dts: mediatek: mt8183: Add decoder Date: Tue, 27 Jun 2023 17:45:57 -0400 Message-ID: <20230627214615.1503901-8-nfraprado@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230627214615.1503901-1-nfraprado@collabora.com> References: <20230627214615.1503901-1-nfraprado@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769894139165631708?= X-GMAIL-MSGID: =?utf-8?q?1769894139165631708?= From: Yunfei Dong Add node for the hardware decoder present on the MT8183 SoC. Signed-off-by: Yunfei Dong Signed-off-by: Qianqian Yan Signed-off-by: Frederic Chen Signed-off-by: Alexandre Courbot Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- (no changes since v3) Changes in v3: - Dropped 'active' clock and added the 'mediatek,vdecsys' syscon phandle property instead Changes in v2: - Reformatted reg-names to fit in fewer lines arch/arm64/boot/dts/mediatek/mt8183.dtsi | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index 5169779d01df..4144f1ed3ff0 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -2019,6 +2019,36 @@ vdecsys: syscon@16000000 { #clock-cells = <1>; }; + vcodec_dec: video-codec@16020000 { + compatible = "mediatek,mt8183-vcodec-dec"; + reg = <0 0x16020000 0 0x1000>, /* VDEC_MISC */ + <0 0x16021000 0 0x800>, /* VDEC_VLD */ + <0 0x16021800 0 0x800>, /* VDEC_TOP */ + <0 0x16022000 0 0x1000>, /* VDEC_MC */ + <0 0x16023000 0 0x1000>, /* VDEC_AVCVLD */ + <0 0x16024000 0 0x1000>, /* VDEC_AVCMV */ + <0 0x16025000 0 0x1000>, /* VDEC_PP */ + <0 0x16026800 0 0x800>, /* VP8_VD */ + <0 0x16027000 0 0x800>, /* VP6_VD */ + <0 0x16027800 0 0x800>, /* VP8_VL */ + <0 0x16028400 0 0x400>; /* VP9_VD */ + reg-names = "misc", "ld", "top", "cm", "ad", "av", "pp", + "hwd", "hwq", "hwb", "hwg"; + interrupts = ; + iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>, + <&iommu M4U_PORT_HW_VDEC_PP_EXT>, + <&iommu M4U_PORT_HW_VDEC_VLD_EXT>, + <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>, + <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>, + <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>, + <&iommu M4U_PORT_HW_VDEC_PPWRAP_EXT>; + mediatek,scp = <&scp>; + mediatek,vdecsys = <&vdecsys>; + power-domains = <&spm MT8183_POWER_DOMAIN_VDEC>; + clocks = <&vdecsys CLK_VDEC_VDEC>; + clock-names = "vdec"; + }; + larb1: larb@16010000 { compatible = "mediatek,mt8183-smi-larb"; reg = <0 0x16010000 0 0x1000>;