Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2188237pxb; Mon, 11 Jan 2021 03:24:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxesUo7CMj/hXMNgEPOiRcDORk6dBP9w0hlxtkg92CFMeJime5EZFN4tggMTyn3FzLbTtQ/ X-Received: by 2002:aa7:dac5:: with SMTP id x5mr14165934eds.198.1610364293673; Mon, 11 Jan 2021 03:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610364293; cv=none; d=google.com; s=arc-20160816; b=obzQ5X7i5YFf2yATFxwYPgRHdYoWxIIqv2yPFI9wmTyA1riwPl/CEa01bHpY2yXZe2 EeRPjtKmYH1i2H1cmsbGcOm/JQa10aeEfN7BNV3cf9ZQ2QBfTxxMtFUKFdtA9dBuQSxw 7pybYCIXz6m2vAdBVVpEROzp3ZUhNuz8BpFxJQ6XzEhf59eifi3QPI/krBv2HG/ltoxD dSL1hRg9d3R7EyxysvwUa2r8FZJdPqRGx8z+t3Q0lvnJwdXxWx4Tuc5bBZgDkr/Kmsvi R1p5CD2w0IW9Kq095vSiFWvEQ8bHbK9gVnq7l761T6Un1dtI/zG9iwPytoCa+L6H84aF gJHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=oqXAC0jGIM+y8N38QJEPThP1d3Hm8kWkyx/r59xxCHQ=; b=BYstIhAzXbOHHT4rz+hfP0pRIgx2hEKnuyHNAZa9P7EwKNyZVLDFCyiiMsHwbxhs1r NO1L5qq6osjVIvyYPJvNocZMDfS+oQ/u87zJDcw61xDCGRhas4+78m17cDnkP9S1a0VV Mtmknhd8yPZGh/hDZ0TZM5GrKRFSD3KsVLSdF3ffpmcFWhmxwyjsHYQJ1LpBluCoRNmW KRomtuT57VUoPg1PYBH4XqUT33cjP0AbDujieoqqelwOG5uvb09CySOyVKwT2QsUADx9 nO/U2NTY/vrW6Tsgz/QkhwooW/Lbv6a3d/4IPRlTty7myHIkefCQIxDFOBrnLX0xc2O+ zIyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si6449537eja.271.2021.01.11.03.24.30; Mon, 11 Jan 2021 03:24:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729836AbhAKLWg (ORCPT + 99 others); Mon, 11 Jan 2021 06:22:36 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:60030 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728305AbhAKLWf (ORCPT ); Mon, 11 Jan 2021 06:22:35 -0500 X-UUID: b710d73c20bb4a2e8f89df9aad4e615d-20210111 X-UUID: b710d73c20bb4a2e8f89df9aad4e615d-20210111 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 604849001; Mon, 11 Jan 2021 19:21:55 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Jan 2021 19:21:53 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Jan 2021 19:21:53 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH v6 15/33] iommu/mediatek: Update oas for v7s Date: Mon, 11 Jan 2021 19:18:56 +0800 Message-ID: <20210111111914.22211-16-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210111111914.22211-1-yong.wu@mediatek.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch only updates oas in different SoCs. If the SoC supports 4GB-mode and current dram size is 4GB, the oas is 33. otherwise, it's still 32. In the lastest SoC, the oas is 35bits. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index bf1277d58121..1c4af574f5f7 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -301,10 +301,14 @@ static int mtk_iommu_domain_finalise(struct mtk_iommu_domain *dom) IO_PGTABLE_QUIRK_ARM_MTK_EXT, .pgsize_bitmap = mtk_iommu_ops.pgsize_bitmap, .ias = MTK_IOMMU_HAS_FLAG(data->plat_data, IOVA_34_EN) ? 34 : 32, - .oas = 35, .iommu_dev = data->dev, }; + if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_4GB_MODE)) + dom->cfg.oas = data->enable_4GB ? 33 : 32; + else + dom->cfg.oas = 35; + dom->iop = alloc_io_pgtable_ops(ARM_V7S, &dom->cfg, data); if (!dom->iop) { dev_err(data->dev, "Failed to alloc io pgtable\n"); -- 2.18.0