From patchwork Thu Mar 9 10:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 66769 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp220615wrd; Thu, 9 Mar 2023 02:56:10 -0800 (PST) X-Google-Smtp-Source: AK7set9U8aGSBTk+se0VFkFEvYs3tyxJitXgHcdI7OLOQEkpgzWZLvdIDwnOdq4KVBsl+BflidBa X-Received: by 2002:a17:90a:498b:b0:236:84a:8d9d with SMTP id d11-20020a17090a498b00b00236084a8d9dmr22284627pjh.39.1678359370341; Thu, 09 Mar 2023 02:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678359370; cv=none; d=google.com; s=arc-20160816; b=Rmdaqdmr64w6EUUN3y4n7uXHjd/DsnZVhyO4nv66uL6Fjpk6S/V1YoRzbQrIAD9vBG 47DxikFPiJx06BjYtS3VeuPjA9wV3EVAbKUnkLaX7Jnj1coEViPd4sU82a06eRkBRAcO Y/JV6aK/XY8OISI/IRCOSgGQNAu82jegnFFFL/QRsXKG6q2d7Kw5eP0ybjhuKoE1erRd RlJjui2hgvNz2N4LMWcZw37I310FKbDS+/DxWEsZRkILKMBG1WKNIE3WcJPoBT0vWT3x xX/7+Vre1R72PEmmDDTcYQHJw/t28H3M8Ef74b7jIVFt/bt1ULBZZXibwpkJ96i0Pj9d l8EQ== 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=+LgEXNCynfCqXY09+hE0tZm4JZLDDs7gzWacblx7Dbk=; b=aM2n4aWrUVbz9tWSpfB6uy2c0F34rZ8vuukc2/c7r14lzvsDoS3c57TOaWbUjHAM1v hDpi9iqnsGCOgIjE7K7PcTkomKB2KLRrGGGKwASrytwgwvJrDkKmmKmbrGv/dQnADG8R uy1ZzR4Sz0o+hnLD+DuXwx1y8ZBPBoZetqBpDvxfF+ebqAGvzKoV/3wv1yz/rLQuP+f4 Oeq1mqHrHJ/xz4JngTM/8+ca7lNtFkvG1U2D9+Pqf+VsGMm9me1LKzk5d9jyZ2yVmfQu A0J98T/K0zPvZ2Wf6qrivNx6LnJGNITyAncUGfTeQ10pOpxhgrBhHwVwZOqbR2BCJlFb 6KXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=WB67vFQc; 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 a7-20020a17090a70c700b00234b160dd74si1900603pjm.26.2023.03.09.02.55.54; Thu, 09 Mar 2023 02:56:10 -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=@collabora.com header.s=mail header.b=WB67vFQc; 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 S231127AbjCIK0h (ORCPT + 99 others); Thu, 9 Mar 2023 05:26:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjCIK02 (ORCPT ); Thu, 9 Mar 2023 05:26:28 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F085260D50 for ; Thu, 9 Mar 2023 02:26:23 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (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: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0D4E666003AD; Thu, 9 Mar 2023 10:26:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678357582; bh=01EAgAUlV+xLXZIsHxxoCzrjdM/K1xZ06Pj/bk01CIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WB67vFQcLGE3COLzGpjsEVxXX8oY0dO1ixlPUUausCXWND1Nf/6ddRoXO8Jyq15wZ mSNgGS2hMGKJuEbKfXDImv0GAer1OiJCwRzCCH1DDiGXuikIghkhdT7k7NcnXgK25v xYPompuHtlER3A0llr1HgIZ7ggfn9dUOyL3qdSxD1Q7zP9+Z5O9iS7jVp1Q6gYe9Ft g7Z25xO5f/XauCPNKqUC+ogFrMjR0fW9vcYZCd+0be0Sri+7FcCr20ycFtfXhZVWsp TFFrwij5k1xeBqqKv17o5g9jmEpUMxP/IhGBXAzmXKytYZ9CXFzlb+zcAu0cQHd3QA pZjHdrrBJszNw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: [PATCH 1/3] soc: mediatek: mtk-mmsys: Split out MT8173 mmsys DDP routing table Date: Thu, 9 Mar 2023 11:26:16 +0100 Message-Id: <20230309102618.114157-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309102618.114157-1-angelogioacchino.delregno@collabora.com> References: <20230309102618.114157-1-angelogioacchino.delregno@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 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?1759887355155410141?= X-GMAIL-MSGID: =?utf-8?q?1759887355155410141?= MT2701, MT2712 and MT8173 were relying on a "default" DDP I/O routing table, describing all of the possible connections between display block components: while this is definitely working it's suboptimal for the actual routing description, as we may be enabling outputs and inputs that are not needed, possibly impacting on actual DDP performance other than slightly prolonging boot times by having to parse a table that is bigger than needed. Seen that all of the other supported SoCs have got their own table and seen that a comment in mtk-mmsys.h explicitly mentions that the wanted way is to have one table per SoC, create a new routing table that is specifically tailored to MT8173 and, while at it, remove mentions to said SoC from the comment in mtk-mmsys.h. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mt8173-mmsys.h | 95 +++++++++++++++++++++++++++++ drivers/soc/mediatek/mtk-mmsys.c | 5 +- drivers/soc/mediatek/mtk-mmsys.h | 2 +- 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 drivers/soc/mediatek/mt8173-mmsys.h diff --git a/drivers/soc/mediatek/mt8173-mmsys.h b/drivers/soc/mediatek/mt8173-mmsys.h new file mode 100644 index 000000000000..9d24e381271e --- /dev/null +++ b/drivers/soc/mediatek/mt8173-mmsys.h @@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __SOC_MEDIATEK_MT8173_MMSYS_H +#define __SOC_MEDIATEK_MT8173_MMSYS_H + +#define MT8173_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN 0x040 +#define MT8173_DISP_REG_CONFIG_DISP_OVL1_MOUT_EN 0x044 +#define MT8173_DISP_REG_CONFIG_DISP_OD_MOUT_EN 0x048 +#define MT8173_DISP_REG_CONFIG_DISP_GAMMA_MOUT_EN 0x04c +#define MT8173_DISP_REG_CONFIG_DISP_UFOE_MOUT_EN 0x050 +#define MT8173_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN 0x084 +#define MT8173_DISP_REG_CONFIG_DISP_COLOR1_SEL_IN 0x088 +#define MT8173_DISP_REG_CONFIG_DISP_AAL_SEL_IN 0x08c +#define MT8173_DISP_REG_CONFIG_DISP_UFOE_SEL_IN 0x0a0 +#define MT8173_DISP_REG_CONFIG_DSI0_SEL_IN 0x0a4 +#define MT8173_DISP_REG_CONFIG_DPI_SEL_IN 0x0ac +#define MT8173_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN 0x0b0 +#define MT8173_DISP_REG_CONFIG_DISP_RDMA1_SOUT_EN 0x0c8 +#define MT8173_DISP_REG_CONFIG_DISP_COLOR0_SOUT_SEL_IN 0x0bc + +#define MT8173_AAL_SEL_IN_MERGE BIT(0) +#define MT8173_COLOR0_SEL_IN_OVL0 BIT(0) +#define MT8173_COLOR0_SOUT_MERGE BIT(0) +#define MT8173_DPI0_SEL_IN_MASK GENMASK(1, 0) +#define MT8173_DPI0_SEL_IN_RDMA1 BIT(0) +#define MT8173_DSI0_SEL_IN_UFOE BIT(0) +#define MT8173_GAMMA_MOUT_EN_RDMA1 BIT(0) +#define MT8173_OD0_MOUT_EN_RDMA0 BIT(0) +#define MT8173_OVL0_MOUT_EN_COLOR0 BIT(0) +#define MT8173_OVL1_MOUT_EN_COLOR1 BIT(0) +#define MT8173_UFOE_MOUT_EN_DSI0 BIT(0) +#define MT8173_UFOE_SEL_IN_RDMA0 BIT(0) +#define MT8173_RDMA0_SOUT_COLOR0 BIT(0) + +static const struct mtk_mmsys_routes mt8173_mmsys_routing_table[] = { + { + DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0, + MT8173_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN, + MT8173_OVL0_MOUT_EN_COLOR0, MT8173_OVL0_MOUT_EN_COLOR0 + }, { + DDP_COMPONENT_OD0, DDP_COMPONENT_RDMA0, + MT8173_DISP_REG_CONFIG_DISP_OD_MOUT_EN, + MT8173_OD0_MOUT_EN_RDMA0, MT8173_OD0_MOUT_EN_RDMA0 + }, { + DDP_COMPONENT_UFOE, DDP_COMPONENT_DSI0, + MT8173_DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, + MT8173_UFOE_MOUT_EN_DSI0, MT8173_UFOE_MOUT_EN_DSI0 + }, { + DDP_COMPONENT_COLOR0, DDP_COMPONENT_AAL0, + MT8173_DISP_REG_CONFIG_DISP_COLOR0_SOUT_SEL_IN, + MT8173_COLOR0_SOUT_MERGE, 0 /* SOUT to AAL */ + }, { + DDP_COMPONENT_RDMA0, DDP_COMPONENT_UFOE, + MT8173_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN, + MT8173_RDMA0_SOUT_COLOR0, 0 /* SOUT to UFOE */ + }, { + DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0, + MT8173_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN, + MT8173_COLOR0_SEL_IN_OVL0, MT8173_COLOR0_SEL_IN_OVL0 + }, { + DDP_COMPONENT_AAL0, DDP_COMPONENT_COLOR0, + MT8173_DISP_REG_CONFIG_DISP_AAL_SEL_IN, + MT8173_AAL_SEL_IN_MERGE, 0 /* SEL_IN from COLOR0 */ + }, { + DDP_COMPONENT_RDMA0, DDP_COMPONENT_UFOE, + MT8173_DISP_REG_CONFIG_DISP_UFOE_SEL_IN, + MT8173_UFOE_SEL_IN_RDMA0, 0 /* SEL_IN from RDMA0 */ + }, { + DDP_COMPONENT_UFOE, DDP_COMPONENT_DSI0, + MT8173_DISP_REG_CONFIG_DSI0_SEL_IN, + MT8173_DSI0_SEL_IN_UFOE, 0, /* SEL_IN from UFOE */ + }, { + DDP_COMPONENT_OVL1, DDP_COMPONENT_COLOR1, + MT8173_DISP_REG_CONFIG_DISP_OVL1_MOUT_EN, + MT8173_OVL1_MOUT_EN_COLOR1, MT8173_OVL1_MOUT_EN_COLOR1 + }, { + DDP_COMPONENT_GAMMA, DDP_COMPONENT_RDMA1, + MT8173_DISP_REG_CONFIG_DISP_GAMMA_MOUT_EN, + MT8173_GAMMA_MOUT_EN_RDMA1, MT8173_GAMMA_MOUT_EN_RDMA1 + }, { + DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0, + MT8173_DISP_REG_CONFIG_DISP_RDMA1_SOUT_EN, + RDMA1_SOUT_MASK, RDMA1_SOUT_DPI0 + }, { + DDP_COMPONENT_OVL1, DDP_COMPONENT_COLOR1, + MT8173_DISP_REG_CONFIG_DISP_COLOR1_SEL_IN, + COLOR1_SEL_IN_OVL1, COLOR1_SEL_IN_OVL1 + }, { + DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0, + MT8173_DISP_REG_CONFIG_DPI_SEL_IN, + MT8173_DPI0_SEL_IN_MASK, MT8173_DPI0_SEL_IN_RDMA1 + } +}; + +#endif /* __SOC_MEDIATEK_MT8173_MMSYS_H */ diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index b84485670f91..d5844aff0621 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -15,6 +15,7 @@ #include "mtk-mmsys.h" #include "mt8167-mmsys.h" +#include "mt8173-mmsys.h" #include "mt8183-mmsys.h" #include "mt8186-mmsys.h" #include "mt8188-mmsys.h" @@ -52,8 +53,8 @@ static const struct mtk_mmsys_driver_data mt8167_mmsys_driver_data = { static const struct mtk_mmsys_driver_data mt8173_mmsys_driver_data = { .clk_driver = "clk-mt8173-mm", - .routes = mmsys_default_routing_table, - .num_routes = ARRAY_SIZE(mmsys_default_routing_table), + .routes = mt8173_mmsys_routing_table, + .num_routes = ARRAY_SIZE(mt8173_mmsys_routing_table), .sw0_rst_offset = MT8183_MMSYS_SW0_RST_B, .num_resets = 32, }; diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h index 56f8cc3a97b7..6725403d2e3a 100644 --- a/drivers/soc/mediatek/mtk-mmsys.h +++ b/drivers/soc/mediatek/mtk-mmsys.h @@ -96,7 +96,7 @@ struct mtk_mmsys_driver_data { }; /* - * Routes in mt8173, mt2701, mt2712 are different. That means + * Routes in mt2701 and mt2712 are different. That means * in the same register address, it controls different input/output * selection for each SoC. But, right now, they use the same table as * default routes meet their requirements. But we don't have the complete From patchwork Thu Mar 9 10:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 66754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp214734wrd; Thu, 9 Mar 2023 02:38:37 -0800 (PST) X-Google-Smtp-Source: AK7set/rcsC76EunB+CGMtvrnQGerK83T7IV+mrFV0VQK10PR92Srok4e+t/b20P3oa35qaNkh7B X-Received: by 2002:a05:6a20:430c:b0:c6:bb08:a7ab with SMTP id h12-20020a056a20430c00b000c6bb08a7abmr18886979pzk.28.1678358317387; Thu, 09 Mar 2023 02:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678358317; cv=none; d=google.com; s=arc-20160816; b=VHAMyW7O8GRuEuGACEyelc/TLbaOiWjJja/dpXletSzrFCeoEjGh6lSJe1yTWDm7A3 QKjiP4+JMrt5GsebOPTxOTU35zyj1JsSww7m6L2naVxpc+JPAsoF2tchnZRu7DmZ2qiz 1OfCehYKYozJYeHC1SfTap+yk0YZNvfdld6Q+YN0lGV4kCJQnBiR5wJV2zQJ+ebTKHiE 4ppD+kBHAJ02OO4HF2y7t5KogHETcQvvB594cBkGV1CNBITcAJFtV+2sEBVNL6PSYX6I whd8QQLd4zy7xPKc/FdIigCJv4mh7z57tje7FsEEpKvKo2bHY5Xftx6q9SV1J4r0DxXL H5cw== 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=ZEswQA/7bHeAL5XHrPgRkPRNdwF+hoMGmkNgGPI8Ymc=; b=lX7cXzm9qs0YuCnT2vTghyoBurbhxPEM4L8Fp1ylmwfg8He7iKZqsL+LPDOUyAyDMT SbsU5BnDH293tawFZo82m4NwRC33xLqWop4N8aLS90Lsk3jVU3/l8k/vxzXU28mv2RiI Cjfk0Y3/TzWbPF/Zjxf3sxVqtw9+xJBFXhHZUAiPo4QSgE+Pq45xmnuwJnW+JXjw8bFR J+xVGbCc6EWcj4vnNMX4WwRCY1ept/f+v67Ey1TJp3V8HYqvfANvfTry/0exEE6yjB3g VXNZYYKUbAomOsg1Dp4O5A/cQo5/npyjh5cvwuFeBlDOUPr7JSdxHauBS/4nI01Abf0E 8Rbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kAh8CahG; 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 g13-20020aa79dcd000000b005a85d73f825si17280889pfq.125.2023.03.09.02.38.24; Thu, 09 Mar 2023 02:38:37 -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=@collabora.com header.s=mail header.b=kAh8CahG; 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 S231210AbjCIK0m (ORCPT + 99 others); Thu, 9 Mar 2023 05:26:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231285AbjCIK01 (ORCPT ); Thu, 9 Mar 2023 05:26:27 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E0361A9F for ; Thu, 9 Mar 2023 02:26:24 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (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: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8B9EF6603023; Thu, 9 Mar 2023 10:26:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678357582; bh=nkvko6i3DR/+q3uywCjPVyZkbTw5ZbNySmFdON0XhIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kAh8CahGTq3xAWE5qrqzyRqFX7H8WuXeEHEzCOobzTFrNRMdPwTOBHF9nFv3BGOkd dyJRW4TaMbfJsunc7TWAF+1QWKS08UCVvjMjg2bpkLa+pCv7MiZhXH0QGQZCEeN3nA mZ0Rvq3RgHnae/VEiroT7FzrNz1REl4XEylfVj4PfsbN+69P7ruaPlN1dPQDukRWwd YAsHqQhcMqXU/osI6nzleZwAItNmQECuajSqk75RqwiEioawSmM9nnVLqZlYRasmAp qBC39G6BY2mv0dlh+i3puHers3mkzsP/BffXdCMi8a/C16a0sOA3LQdDJ9KcySyi7/ hMpVMDfAcdCnw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: [PATCH 2/3] soc: mediatek: mtk-mmsys: Change MT8173 num_resets to 64 Date: Thu, 9 Mar 2023 11:26:17 +0100 Message-Id: <20230309102618.114157-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309102618.114157-1-angelogioacchino.delregno@collabora.com> References: <20230309102618.114157-1-angelogioacchino.delregno@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 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?1759886251058182791?= X-GMAIL-MSGID: =?utf-8?q?1759886251058182791?= The MT8173 SoC has 64 MMSYS resets, split in two contiguous 32-bits registers, MMSYS_SW0_RST_B (0x140) and MMSYS_SW1_RST_B (0x144), as also stated in the downstream kernel for the Amazon Fire TV 2 (Sloane) in the ddp_reg.h header. Please note that managing more than 32 reset bits is supported since commit 2004f8be8483 ("soc: mediatek: mmsys: add mmsys for support 64 reset bits") This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-mmsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index d5844aff0621..c4eeab99756b 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -56,7 +56,7 @@ static const struct mtk_mmsys_driver_data mt8173_mmsys_driver_data = { .routes = mt8173_mmsys_routing_table, .num_routes = ARRAY_SIZE(mt8173_mmsys_routing_table), .sw0_rst_offset = MT8183_MMSYS_SW0_RST_B, - .num_resets = 32, + .num_resets = 64, }; static const struct mtk_mmsys_driver_data mt8183_mmsys_driver_data = { From patchwork Thu Mar 9 10:26:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 66757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp215161wrd; Thu, 9 Mar 2023 02:39:57 -0800 (PST) X-Google-Smtp-Source: AK7set9S9YsiSLK2V3CyEzCfVkgfzLUQ8sTpMc47upWw8kvjzhaMXuD/z8QOlrEmXl9flodWLai+ X-Received: by 2002:a17:90b:4f8e:b0:237:f925:f46 with SMTP id qe14-20020a17090b4f8e00b00237f9250f46mr22163506pjb.24.1678358396932; Thu, 09 Mar 2023 02:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678358396; cv=none; d=google.com; s=arc-20160816; b=ry7Xoc9keR/BPJLdlqaGwF/gVYztAJej5I7r5ceuJ2WA8ZnarfbzW08vpAjRLLqB0z TWmotvmpZTjOGwwCLh2j8qQEn6u0Vym6CJNE2ft7mcuwkFWvB58e1nfmaqDnXyxqUkkZ qZk2jMqUTZLylhYBfvgKkyd24mDUH954ottP40vRwhShEI2Uw3W/2n1rFBaLWFaioQMR 5HZfhLaiOPH9t8ycC8PYqAEgZlD30nUNmUeThMqZboCH/mFrpXr2yDASkJgfF5D3hU+q xxvRU6PBoPLFnAw44WcAo9WS5dGNCkIxh1rk+2r/ByGAE1gvtUo19qi2tK9y4EX1Fkwg Linw== 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=cebit43FlajBMkBR7mLrM1TjKHYg2gvOrW1fB7J2Qj4=; b=WwyGLAz5R85fV8OvjJHd6QWntqv0oSPBRaD4Z7jVSkCNpkJeX2Ey6cmzk2AgTD80cB SCTENS51OZENVf0VC0gAnskDCcgouz4mJwDslu5Wiy89wi86Ee7x/GFa25QEAxVNbCMe m3REsOcpN2EarGsSzts0iBXF7lRAKH2FAYTMIr9WOtpc0ZsJJ/m74j/B/uq97WRMtMZh duLy4k3NRkj8Uak005hW0vjGgO2NHWneUexgIwEJsTPDS/YvmF3CXb71b62HQUZOXOhr ws9A/9D9tbE4yjiWOh/80KhWLBXVR7aoc0OW697IPpjsP1t4Zt+4Ui4bLNcUR+8QA3WM /taA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=XFQjt7Nt; 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 u8-20020a17090a3fc800b00233773a522fsi1973823pjm.141.2023.03.09.02.39.44; Thu, 09 Mar 2023 02:39:56 -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=@collabora.com header.s=mail header.b=XFQjt7Nt; 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 S231256AbjCIK0p (ORCPT + 99 others); Thu, 9 Mar 2023 05:26:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbjCIK01 (ORCPT ); Thu, 9 Mar 2023 05:26:27 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20BF62312 for ; Thu, 9 Mar 2023 02:26:24 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (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: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 13C866603054; Thu, 9 Mar 2023 10:26:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678357583; bh=gUunv/EcOHFtFDQHosEszweFGXYKJo+Qxwm9e5tgDK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFQjt7Nt3VV33wLDJnIDEHUq9cZ64qD7KMR68RpQhK0+8xOCXDcDLbyc6agKE7Crr Too/qCOHCpxUcafXfijL8czDm5WxJVkGbjP5bOrUMohi2AUO0N0ppjKWWeHacFFkr/ Y9Y7cZATRKWRfLtvtUWYfdcA+egpN2uZLlzsmJpejqoKLH8Ybjdj1GHeaMfjUQFOMq pVC++sat6e1YO5tlS7dU108rmzHYMqJNKiLhUPbKndu5V5bfexrTUufKQV0GiPp3bG hCktQr4fntPXZ/MAlnctsTUamAsXxVGhy8QfPr3KI3ghTIxDLFQjdyWjtPJqufRO5Z tpeEcldG/hjKA== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: angelogioacchino.delregno@collabora.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: [PATCH 3/3] soc: mediatek: mtk-mmsys: Add support for MT6795 Helio X10 Date: Thu, 9 Mar 2023 11:26:18 +0100 Message-Id: <20230309102618.114157-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309102618.114157-1-angelogioacchino.delregno@collabora.com> References: <20230309102618.114157-1-angelogioacchino.delregno@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 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?1759886334071004326?= X-GMAIL-MSGID: =?utf-8?q?1759886334071004326?= Add MMSYS support for the MT6795 SoC using the same mmsys routing table as MT8173 as, for the currently supported usecases (DSI0, DPI0 with no WDMA), these are identical. Signed-off-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-mmsys.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index c4eeab99756b..9619faa796e8 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -41,6 +41,14 @@ static const struct mtk_mmsys_driver_data mt6779_mmsys_driver_data = { .clk_driver = "clk-mt6779-mm", }; +static const struct mtk_mmsys_driver_data mt6795_mmsys_driver_data = { + .clk_driver = "clk-mt6795-mm", + .routes = mt8173_mmsys_routing_table, + .num_routes = ARRAY_SIZE(mt8173_mmsys_routing_table), + .sw0_rst_offset = MT8183_MMSYS_SW0_RST_B, + .num_resets = 64, +}; + static const struct mtk_mmsys_driver_data mt6797_mmsys_driver_data = { .clk_driver = "clk-mt6797-mm", }; @@ -416,6 +424,7 @@ static const struct of_device_id of_match_mtk_mmsys[] = { { .compatible = "mediatek,mt2701-mmsys", .data = &mt2701_mmsys_driver_data }, { .compatible = "mediatek,mt2712-mmsys", .data = &mt2712_mmsys_driver_data }, { .compatible = "mediatek,mt6779-mmsys", .data = &mt6779_mmsys_driver_data }, + { .compatible = "mediatek,mt6795-mmsys", .data = &mt6795_mmsys_driver_data }, { .compatible = "mediatek,mt6797-mmsys", .data = &mt6797_mmsys_driver_data }, { .compatible = "mediatek,mt8167-mmsys", .data = &mt8167_mmsys_driver_data }, { .compatible = "mediatek,mt8173-mmsys", .data = &mt8173_mmsys_driver_data },