From patchwork Tue Oct 27 16:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11860771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A035697 for ; Tue, 27 Oct 2020 16:06:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA51420878 for ; Tue, 27 Oct 2020 16:06:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="r4/bhr9Z"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="Z7PBAuqg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA51420878 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LTSG8igj16j/Pc6N6MVk3N8MdUOCzg84VZ+QGZyjJnw=; b=r4/bhr9Zo0tTHafSm9EmPpedA zCILwwR7wdDMnCOpEK6iXrP+yi6si7NeMPgTCvV8bFBmqTUMah513XLS2twsGyqSTPeP3lwuAWEVR AieWoO0cEABib+b7oBrp+fqaJfchSiCRxQ9hElRWGmg+B73y2whd5wxuxwiLEkZm2+VcV/AlprnKL W92RbA9iAjAzRR+uTNfjT/gIhFFLUgQNDoxDYyYgT1CzRLvyUzX6ZQyw+cX8AOzDoGT2GvTTU83Sx uyuzHURMQP4D6Nhm39W/pg3Ghk7kg7LEH1GGYQx2pHsqV6unwdzJMKsowJmY58TWVNStfsZch6M9A +By3FMc6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXRUk-0008Bw-WC; Tue, 27 Oct 2020 16:06:47 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXRUd-00087e-8E for linux-mediatek@lists.infradead.org; Tue, 27 Oct 2020 16:06:41 +0000 Received: by mail-wm1-x343.google.com with SMTP id h22so2002904wmb.0 for ; Tue, 27 Oct 2020 09:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gXSEQ4RUigdrvEfUyIgbTcDJA4ZN5o0EgF33NFMe/HI=; b=Z7PBAuqgcEVXrYXq5zpM+K2aVf6AMg0r/JAMVFHkIIX/SHkuy21wembDxlSchyeVQh skD9R5Gul6GtMbRtqXsI+hBPJj2U0IUVhsxaZ1nGFh3tgll1CkOvokBHZMgal5o10fFO +oRUWXI9R7Pr1xIfIN4Sq5jUmRkZ2JP3ro70EHknjrLAnlrD9DnwrP8tRqYdDJm4Fb7d QarJtt56QEdZRJJnvD/cAG8DaqgCJf9xdNx08meoEWciBLS6UaSTN/a8fE1egL2q1ksd wZBetg/t1OPkekJaTkVjbJL94qD6ETjcTrM0/PEfrYQdK7TXRYlFLsJ0YYwUfNnA7tVC LNXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gXSEQ4RUigdrvEfUyIgbTcDJA4ZN5o0EgF33NFMe/HI=; b=Fgn+zwKXcHlaDqkLsYAiLI2qGgZbwUDvUT9mBEMOKxQIADLYMBlLt2ZBMnDYDIMxQ/ qzTrWGl+IrQzEWVZhRiFSf5XS4fZCWCjJIiJ+pEKi27D0vnOJFnhPLqSJban7WF99z1N wsqN+LzwUZcUsvRuJZ0OPqpeZuhfCe6Jtu38iWktv6ifpjaJSs6XAC6KzBYmyRzx9Fuj RDc/qt2/8tYZOkODTlis4OU62ZgBA90scueiwoXWCR+gNv2+u6xMgx2A6emxf+6ABjWY yMvbiODAvjam0lDq5rY6LtJT/VuK6ItP+b1vC0AaiyF+wDga0mpXCsZ0xvVrTALvI1XF 2/Ug== X-Gm-Message-State: AOAM530YPjWD2umQ/m/gV5Dsb0ls4EmNbRxm2D/NQbgbZ8DhllecCMKY OVwCTKaYfApLl8RNhk9fJdqbMQ== X-Google-Smtp-Source: ABdhPJxihresPsw4/wvhbg7EfhnGhObn99mfaRvDs9xBb/F2uJ0PuDX4OWXZtPU1lCMWjoAHckfkaQ== X-Received: by 2002:a7b:cb81:: with SMTP id m1mr3644718wmi.140.1603814797773; Tue, 27 Oct 2020 09:06:37 -0700 (PDT) Received: from localhost.localdomain (159.174.185.81.rev.sfr.net. [81.185.174.159]) by smtp.gmail.com with ESMTPSA id u15sm2656988wrm.77.2020.10.27.09.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 09:06:37 -0700 (PDT) From: Fabien Parent To: Matthias Brugger Subject: [PATCH 2/2] soc: mediatek: mmsys: Add support for MT8167 SoC Date: Tue, 27 Oct 2020 17:06:30 +0100 Message-Id: <20201027160631.608503-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201027160631.608503-1-fparent@baylibre.com> References: <20201027160631.608503-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_120639_366911_C0D9A07C X-CRM114-Status: GOOD ( 16.21 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:343 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabien Parent , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Add routing table for DSI on MT8167 SoC. The registers are mostly incompatible with the current defines, so new one for MT8167 are added. Signed-off-by: Fabien Parent --- This patch depends on the patch series "soc: mediatek: Prepare MMSYS for DDP routing using tables" [0] https://lore.kernel.org/patchwork/cover/1317813/ drivers/soc/mediatek/mtk-mmsys.c | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index f00d6d08c9c5..9890990a74a9 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -85,6 +85,22 @@ #define DSI_SEL_IN_RDMA 0x1 #define DSI_SEL_IN_MASK 0x1 +/* MT8167 */ +#define MT8167_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN 0x030 +#define MT8167_DISP_REG_CONFIG_DISP_DITHER_MOUT_EN 0x038 +#define MT8167_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN 0x058 +#define MT8167_DISP_REG_CONFIG_DISP_DSI0_SEL_IN 0x064 +#define MT8167_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN 0x06c + +#define MT8167_DITHER_MOUT_EN_RDMA0 BIT(0) +#define MT8167_DITHER_MOUT_EN_MASK 0x7 + +#define MT8167_RDMA0_SOUT_DSI0 0x2 +#define MT8167_RDMA0_SOUT_MASK 0x3 + +#define MT8167_DSI0_SEL_IN_RDMA0 0x1 +#define MT8167_DSI0_SEL_IN_MASK 0x3 + struct mtk_mmsys_routes { u32 from_comp; u32 to_comp; @@ -124,6 +140,30 @@ struct mtk_mmsys { const struct mtk_mmsys_driver_data *data; }; +static const struct mtk_mmsys_routes mt8167_mmsys_routing_table[] = { + { + DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0, + MT8167_DISP_REG_CONFIG_DISP_OVL0_MOUT_EN, + OVL0_MOUT_EN_COLOR0, OVL0_MOUT_EN_COLOR0 + }, { + DDP_COMPONENT_DITHER, DDP_COMPONENT_RDMA0, + MT8167_DISP_REG_CONFIG_DISP_DITHER_MOUT_EN, + MT8167_DITHER_MOUT_EN_MASK, MT8167_DITHER_MOUT_EN_RDMA0 + }, { + DDP_COMPONENT_OVL0, DDP_COMPONENT_COLOR0, + MT8167_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN, + COLOR0_SEL_IN_OVL0, COLOR0_SEL_IN_OVL0 + }, { + DDP_COMPONENT_RDMA0, DDP_COMPONENT_DSI0, + MT8167_DISP_REG_CONFIG_DISP_DSI0_SEL_IN, + MT8167_DSI0_SEL_IN_MASK, MT8167_DSI0_SEL_IN_RDMA0 + }, { + DDP_COMPONENT_RDMA0, DDP_COMPONENT_DSI0, + MT8167_DISP_REG_CONFIG_DISP_RDMA0_SOUT_SEL_IN, + MT8167_RDMA0_SOUT_MASK, MT8167_RDMA0_SOUT_DSI0 + }, +}; + static const struct mtk_mmsys_routes mt8173_mmsys_routing_table[] = { { DDP_COMPONENT_BLS, DDP_COMPONENT_DSI0, @@ -288,6 +328,12 @@ static const struct mtk_mmsys_routes mt8173_mmsys_routing_table[] = { } }; +static const struct mtk_mmsys_driver_data mt8167_mmsys_driver_data = { + .clk_driver = "clk-mt8167-mm", + .routes = mt8167_mmsys_routing_table, + .num_routes = ARRAY_SIZE(mt8167_mmsys_routing_table), +}; + static const struct mtk_mmsys_driver_data mt8173_mmsys_driver_data = { .clk_driver = "clk-mt8173-mm", .routes = mt8173_mmsys_routing_table, @@ -385,6 +431,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = { .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,