From patchwork Thu Jul 27 02:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honghui Zhang X-Patchwork-Id: 9866127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5477F602B1 for ; Thu, 27 Jul 2017 02:02:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 440022883A for ; Thu, 27 Jul 2017 02:02:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 389602883C; Thu, 27 Jul 2017 02:02:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB7192883A for ; Thu, 27 Jul 2017 02:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=UV/qcYAKclU8uXJ99neP6GHbS2TE/pIrwr/BQwgmOKs=; b=Ff3R7i+GDOMd/q l2V6DhBmZNcwuKVHgUq9hhuOuOyQeR3Q+kclndRDSUDlGw62cYoGgA8cq8vQOnnFLdS8oJoI9nneS uH7tcGVU2klBFyI1OYp2UfmX1fE3T5oXez6rUgYStV/+D2r/Rux4sLQVqFAAdA8X3d8XCnZKYhizy LhHB4P3vLmhV5+/wjBKnOn2oZNaXx9rv2O63lS5WUarD+DuUMzlGNdwKZ/tgnzL1R5mOh8v5oNaHE I24M5uSVH80W5wtcu6RbGK1e4AseGHCRPGL3IuWme6jOReURhKl/+paqfuevn0khNRVxDu2gZyFFZ QDPx3G99AFk+R2229+ew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1daY84-0001h8-OV; Thu, 27 Jul 2017 02:02:20 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1daY7W-00014n-IC; Thu, 27 Jul 2017 02:01:48 +0000 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 248072989; Thu, 27 Jul 2017 10:01:15 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Jul 2017 10:00:55 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 27 Jul 2017 10:00:55 +0800 From: To: , , , Subject: [PATCH 1/3] memory: mtk-smi: add larbid init routine Date: Thu, 27 Jul 2017 10:01:10 +0800 Message-ID: <1501120872-19652-2-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1501120872-19652-1-git-send-email-honghui.zhang@mediatek.com> References: <1501120872-19652-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170726_190146_816870_AB04D941 X-CRM114-Status: GOOD ( 11.49 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, kendrick.hsu@mediatek.com, srv_heupstream@mediatek.com, erin.lo@mediatek.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, yong.wu@mediatek.com, Honghui Zhang , xinping.qian@mediatek.com, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Honghui Zhang In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larb->larbid was added but not initialized. Mediatek's gen1 smi need this hardware larbid information to get the register offset which controls whether enable iommu for this larb. This patch add the initialize routine for larbid. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 2b798bb4..fe36b3e 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -240,6 +240,7 @@ static int mtk_smi_larb_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *smi_node; struct platform_device *smi_pdev; + int err; if (!dev->pm_domain) return -EPROBE_DEFER; @@ -263,6 +264,14 @@ static int mtk_smi_larb_probe(struct platform_device *pdev) return PTR_ERR(larb->smi.clk_smi); larb->smi.dev = dev; + err = of_property_read_u32(dev->of_node, "mediatek,larbid", + &larb->larbid); + if (err && of_device_is_compatible(dev->of_node, + "mediatek,mt2701-smi-larb")) { + dev_err(dev, "missing larbid property\n"); + return err; + } + smi_node = of_parse_phandle(dev->of_node, "mediatek,smi", 0); if (!smi_node) return -EINVAL;