From patchwork Sun Sep 6 18:09:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11759667 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 6B5C9746 for ; Sun, 6 Sep 2020 18:10:12 +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 14FC120639 for ; Sun, 6 Sep 2020 18:10:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gT2ppbDI"; 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="nzzQyiNa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14FC120639 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-arm-kernel-bounces+patchwork-linux-arm=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: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:In-Reply-To:References:List-Owner; bh=9mWFwDun8Q17fLqa3Zu2LpRLlDGhaWmlfMU+4DBiuHc=; b=gT2ppbDIhst7NohvYTeTsKaUwx UoVbwSOj41Is0gIxy98S225l0GWlt/qdOflVYaMzFUx3GSFW6ciYSGpyPm98eQnkIxwY18bNBYMz1 3qH1S29d2wstELYjMM0ThKlZD+xqnFvFEUg/dd+7Nx1EvKsqLfe7aTxoMGwAHDTg3OwMdFwExiFsB Km/C21rMx9xWALy+OXYLgN9Lq+fap2KkTVnovdssEdP6xIXB7+3bBJVkvW6+Gjxqwcq3/jy6klUAD eFwUq48sNo7lBktQ/1CgrOzacHRzlMZS/mO/DuYujT/k6C/2rLTN4YP551taFc9cPRqWHUePZMOTu 1LNhkkkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEz6u-0007Yx-Sn; Sun, 06 Sep 2020 18:09:52 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEz6r-0007XT-0t for linux-arm-kernel@lists.infradead.org; Sun, 06 Sep 2020 18:09:50 +0000 Received: by mail-wm1-x344.google.com with SMTP id e17so11426047wme.0 for ; Sun, 06 Sep 2020 11:09:48 -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:mime-version :content-transfer-encoding; bh=NQSqriQ+Oe6AXLkXoxURAgwhIAz5B8mg5HUOyceRaNE=; b=nzzQyiNa8rQcUAxBAKtcjxvn8Z/NBnTq1BCOt8tepxUgorNExl1s0ZkDz1CyCc70xC bB6xvUMwoV0UTUU+mv8bjg0hWZsvrsrou45DpBCu1+OOH5Vru8A0mFbQVD7cMcVkAOVp xropCu5NotExuTib2BY0RPN6qsRiItiRgcwYGWErDtodSMgW/THTIDr8AJDLBNSR/0Q8 BuShhulLeCJf9gnEO/WeZi4COs/OvEoUU5TdwNCVZvKW9Y+iZoLCtao6AHDCc8bI6As4 EVclkLAEDCZ+PzcLZF2pVQr+a11H8d7nHYuFG8LyislgqlcZphJTPeufC68EkzllDA7g lnEQ== 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:mime-version :content-transfer-encoding; bh=NQSqriQ+Oe6AXLkXoxURAgwhIAz5B8mg5HUOyceRaNE=; b=oIuvfdb7l0VTWqT7x5eMvar1ZGIDGjBCrpyOiPRVKAo1HxnuIhRymqOK2WQDC/fzY7 ZZe0afXEZI+JfpWltIMJVBdLvImLvztyJ+OfDDJcNpvoV2x9vAMZGjgBbLv1AFspuw9h CcPDxtjBnweSx5EEsKt7EnoW7ubgP9yxsfiQ4drlNh4fnq5SqRTw16TK5ELLykbeKlIr xj125TyXjwl7q3zjg1ERqfWhDRGwuAJWNvSXkZHU01gaZCleuj9aB3a1TJiL3TOZEb7Q nHjxKKRdswFDlmIMd75vBZB2SElcseyfMHNB4j0y8RPkJHdZO+iIxkMlLey66meXvbcH SI2A== X-Gm-Message-State: AOAM532IM0ByPqcren36EfNIW7WjI6Ce8g0liNb9xk8eTznLTtXt2fQF +MyiM0e2jO6gVs71gvgjyhc5Ug== X-Google-Smtp-Source: ABdhPJwT0GnOgudgWfvSH7xfMSErDdiy138y71snJGOMmAaWrk+a+mBdo9cAwboSzipzn8KYwteQtw== X-Received: by 2002:a7b:c84a:: with SMTP id c10mr17091888wml.139.1599415787873; Sun, 06 Sep 2020 11:09:47 -0700 (PDT) Received: from localhost.localdomain (208.19.23.93.rev.sfr.net. [93.23.19.208]) by smtp.gmail.com with ESMTPSA id s11sm24593937wrt.43.2020.09.06.11.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 11:09:47 -0700 (PDT) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: mediatek: Add binding for MT8167 SMI Date: Sun, 6 Sep 2020 20:09:37 +0200 Message-Id: <20200906180938.1117526-1-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200906_140949_283818_211D4092 X-CRM114-Status: GOOD ( 12.77 ) 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:344 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com, Fabien Parent , robh+dt@kernel.org, krzk@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add device tree bindings documentation for MT8167 SMI. Signed-off-by: Fabien Parent --- .../bindings/memory-controllers/mediatek,smi-common.txt | 3 ++- .../bindings/memory-controllers/mediatek,smi-larb.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.txt b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.txt index b64573680b42..dbafffe3f41e 100644 --- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.txt +++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.txt @@ -5,7 +5,7 @@ The hardware block diagram please check bindings/iommu/mediatek,iommu.txt Mediatek SMI have two generations of HW architecture, here is the list which generation the SoCs use: generation 1: mt2701 and mt7623. -generation 2: mt2712, mt6779, mt8173 and mt8183. +generation 2: mt2712, mt6779, mt8167, mt8173 and mt8183. There's slight differences between the two SMI, for generation 2, the register which control the iommu port is at each larb's register base. But @@ -20,6 +20,7 @@ Required properties: "mediatek,mt2712-smi-common" "mediatek,mt6779-smi-common" "mediatek,mt7623-smi-common", "mediatek,mt2701-smi-common" + "mediatek,mt8167-smi-common" "mediatek,mt8173-smi-common" "mediatek,mt8183-smi-common" - reg : the register and size of the SMI block. diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt index 8f19dfe7d80e..0c5de12b5496 100644 --- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt +++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt @@ -8,6 +8,7 @@ Required properties: "mediatek,mt2712-smi-larb" "mediatek,mt6779-smi-larb" "mediatek,mt7623-smi-larb", "mediatek,mt2701-smi-larb" + "mediatek,mt8167-smi-larb" "mediatek,mt8173-smi-larb" "mediatek,mt8183-smi-larb" - reg : the register and size of this local arbiter. @@ -22,7 +23,7 @@ Required properties: - "gals": the clock for GALS(Global Async Local Sync). Here is the list which has this GALS: mt8183. -Required property for mt2701, mt2712, mt6779 and mt7623: +Required property for mt2701, mt2712, mt6779, mt7623 and mt8167: - mediatek,larb-id :the hardware id of this larb. Example: From patchwork Sun Sep 6 18:09:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 11759669 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 BCECC746 for ; Sun, 6 Sep 2020 18:11:21 +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 57CEF2078E for ; Sun, 6 Sep 2020 18:11:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EWF1LNi2"; 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="NEj8UwN8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57CEF2078E 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-arm-kernel-bounces+patchwork-linux-arm=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=JX5tRJPAv++Wg7qlKS86jkX8hp22MTAxHhsYK3H45xI=; b=EWF1LNi2XwniBkFu4utSk2thR 3b6c6073DMX24/UMpfLcxCOtvdlBT5I1pDzs32ju3dS6SiwqkMvP0qSeKwZavvAiRfGh3+f3AZZWP p6PFpd6W0w4aa6gCcAQygGrnhKttQ8n6IL9sm1hxiEetyYXxO6oQvLrACG853R051rK2optFwpF0n qy+b1x2pMrHhi/1kKn64HMIVkfw/Y0RFmZDXJVW8vJoKEdtAI5o2fpP5PuHq68hF56j9mTqvmGHCA nEHfjkgF18HrL1if98Cu2P2Mpw6YN2Wd/Edy++1V+iolqb+I8L+ZDMQVGsQfZ7E+zjjSAZMLffbD2 Uxm+rwEQw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEz6x-0007ZG-16; Sun, 06 Sep 2020 18:09:55 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEz6s-0007Y4-M7 for linux-arm-kernel@lists.infradead.org; Sun, 06 Sep 2020 18:09:51 +0000 Received: by mail-wm1-x341.google.com with SMTP id c19so10873182wmd.1 for ; Sun, 06 Sep 2020 11:09:50 -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=kumt6xPsCDUuNyx6USsuuQtWS1PyP3Rmwiip0oO6sZA=; b=NEj8UwN8yasyL4TZ1RQ6+S5zY6HtOe3KksHAaj1N4LVkekAMp2+cXNNujH7LCX4PhY olauxi2xPneYW/ZDDVpBuMw98JfGBx7sVYFtUBYTj2hmkiGRz308vh+sq0+AxdyaSy9U /CHl1bg25LdFRzU43OyCvAnHbes89mnUtpKzJv84Zi7g4TtRcu5dU0phMSLef/9lexMn hVMxfI6zYcDNWXZX1mpT8hxGMOvfBwQa5MwQu+WWra3jrGXHAWh6fIPMIyRUXfxpVduA ZaWtDtJyjRehtSqemZEbXwnA7ziVAQ4P09YgeiPkFrPfIWplDMG85yf4KGFfbgC/V0Mx vs5w== 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=kumt6xPsCDUuNyx6USsuuQtWS1PyP3Rmwiip0oO6sZA=; b=Umz619Ca8fGJPpljKm7BGhmkt6PSyuN1BRsdEK0zjZ1AmiziNeu4z+ntUiQCBLw1or FSRdmPzfOS6Ld5hSRET6GqkwY+Vy8IvaQKv8DgxNtI7/98dqSOf8IrCqtEWjNBf1W+rm 6lHj8IsNFhcYaUQf6JYj+NDsnU8yvGpnIdAuhwLJVVkfAyAaD1Zv1yuW+PPzaXtPd+Ia Bg2gLbQS8nLIpahIdo+59/EBL55FoOpATHPc/nfuXe6IQ8atUF9l/8qwI5aLqYcAXtO4 K7RiK6wCKinGiSs1QSwiLLrCx0P66e7JSGrgZs+q4t6OMo0voWD5scAkKMWKGMb+iEJ+ jzbQ== X-Gm-Message-State: AOAM530zBxY19U7do0qIm4Iqc6DW6Aczs4QEFrMYwE2CUmGAU1JRupSf Gj8sn8RGfeoRfrprfqTpl95HJA== X-Google-Smtp-Source: ABdhPJw+Umfe+hF29nj4Wke2ReLCF+37Go/9KRaICoq/knhxVIsJkqpp5l7hb+oG6GtpEn0t9Zal9A== X-Received: by 2002:a1c:9c0b:: with SMTP id f11mr16769412wme.0.1599415789890; Sun, 06 Sep 2020 11:09:49 -0700 (PDT) Received: from localhost.localdomain (208.19.23.93.rev.sfr.net. [93.23.19.208]) by smtp.gmail.com with ESMTPSA id s11sm24593937wrt.43.2020.09.06.11.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 11:09:49 -0700 (PDT) From: Fabien Parent To: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] memory: mtk-smi: add support for MT8167 Date: Sun, 6 Sep 2020 20:09:38 +0200 Message-Id: <20200906180938.1117526-2-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906180938.1117526-1-fparent@baylibre.com> References: <20200906180938.1117526-1-fparent@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200906_140950_756456_A6E6ADAD X-CRM114-Status: GOOD ( 15.12 ) 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:341 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com, Fabien Parent , robh+dt@kernel.org, krzk@kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add support for the SMI IP on MT8167 Signed-off-by: Fabien Parent --- drivers/memory/mtk-smi.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index c21262502581..691e4c344cf8 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -19,6 +19,9 @@ /* mt8173 */ #define SMI_LARB_MMU_EN 0xf00 +/* mt8167 */ +#define MT8167_SMI_LARB_MMU_EN 0xfc0 + /* mt2701 */ #define REG_SMI_SECUR_CON_BASE 0x5c0 @@ -179,6 +182,13 @@ static void mtk_smi_larb_config_port_mt8173(struct device *dev) writel(*larb->mmu, larb->base + SMI_LARB_MMU_EN); } +static void mtk_smi_larb_config_port_mt8167(struct device *dev) +{ + struct mtk_smi_larb *larb = dev_get_drvdata(dev); + + writel(*larb->mmu, larb->base + MT8167_SMI_LARB_MMU_EN); +} + static void mtk_smi_larb_config_port_gen1(struct device *dev) { struct mtk_smi_larb *larb = dev_get_drvdata(dev); @@ -226,6 +236,11 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8173 = { .config_port = mtk_smi_larb_config_port_mt8173, }; +static const struct mtk_smi_larb_gen mtk_smi_larb_mt8167 = { + /* mt8167 do not need the port in larb */ + .config_port = mtk_smi_larb_config_port_mt8167, +}; + static const struct mtk_smi_larb_gen mtk_smi_larb_mt2701 = { .port_in_larb = { LARB0_PORT_OFFSET, LARB1_PORT_OFFSET, @@ -254,6 +269,10 @@ static const struct mtk_smi_larb_gen mtk_smi_larb_mt8183 = { }; static const struct of_device_id mtk_smi_larb_of_ids[] = { + { + .compatible = "mediatek,mt8167-smi-larb", + .data = &mtk_smi_larb_mt8167 + }, { .compatible = "mediatek,mt8173-smi-larb", .data = &mtk_smi_larb_mt8173 @@ -418,6 +437,10 @@ static const struct of_device_id mtk_smi_common_of_ids[] = { .compatible = "mediatek,mt8173-smi-common", .data = &mtk_smi_common_gen2, }, + { + .compatible = "mediatek,mt8167-smi-common", + .data = &mtk_smi_common_gen2, + }, { .compatible = "mediatek,mt2701-smi-common", .data = &mtk_smi_common_gen1,