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,