From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C486DC5517A for ; Wed, 11 Nov 2020 21:34:34 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 535E4208B3 for ; Wed, 11 Nov 2020 21:34:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 535E4208B3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DB76886C3A; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wxLxrbr6jt0k; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 37FC386C5B; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2027FC088B; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id C5DABC016F for ; Wed, 11 Nov 2020 21:34:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B38D9875DE for ; Wed, 11 Nov 2020 21:34:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6iGWDmSdyU7l for ; Wed, 11 Nov 2020 21:34:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id B3F53875D9 for ; Wed, 11 Nov 2020 21:34:30 +0000 (UTC) Received: by mail-ej1-f67.google.com with SMTP id cw8so4749039ejb.8 for ; Wed, 11 Nov 2020 13:34:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cbSPGqSoajDdzgBXkcQ9pceYyj1fwUocImvC8LVuhnA=; b=ZoTcU3iJGtdq8YRi8G7V41gZMexOXEf9J0hLppa0lccQdB6edJ2mFx9TG8lvRnr/Mo 7qeyLIlO8GwaHirdsPw9FiPnN5lcLgr7OEoz7WlNm26aSuPfXYtQ2HYY8merWdSJ0ygv 1QJiDh6gUerHscjPXt2cCa4XG0c+28prha+Oj2EcAcYDofgmUekCC5stOpr4hv19hzDu ETrxIrYQIMZdluvm9r6TxVxJe1ufMhFqdrbmnis0PnsKswqFCLa7GI1cYRMuF4jUiAIu H/AxNpqEYOF/5WsS6FkrXaEN67O2jDBihRNnxo4C1uy0qeSYrBF4JUyPViZTcCuch/82 0Vgg== X-Gm-Message-State: AOAM531GZV0oKiXVhWLKIbOi88DH9VgjVDQA+KzlnkIjZ4Hq0Bx6kBZy IxuTlEEhvwBqW15mQF71T6k= X-Google-Smtp-Source: ABdhPJxZ1WBxXRo++KtU6Sg0+JLnVf2CzzVbv4KmTREyVVotlVP7TjUvZ7DBVgSFoHPvAHxci/+JFw== X-Received: by 2002:a17:906:d7b7:: with SMTP id pk23mr28400140ejb.214.1605130469179; Wed, 11 Nov 2020 13:34:29 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id x1sm1437867edl.82.2020.11.11.13.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 13:34:27 -0800 (PST) Date: Wed, 11 Nov 2020 22:34:26 +0100 From: Krzysztof Kozlowski To: Yong Wu Subject: Re: [PATCH v4 18/24] iommu/mediatek: Support master use iova over 32bit Message-ID: <20201111213426.GF287176@kozik-lap> References: <20201111123838.15682-1-yong.wu@mediatek.com> <20201111123838.15682-19-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201111123838.15682-19-yong.wu@mediatek.com> Cc: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, chao.hao@mediatek.com, Will Deacon , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , kernel-team@android.com, anan.sun@mediatek.com, Robin Murphy , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Nov 11, 2020 at 08:38:32PM +0800, Yong Wu wrote: > After extending v7s, our pagetable already support iova reach > 16GB(34bit). the master got the iova via dma_alloc_attrs may reach > 34bits, but its HW register still is 32bit. then how to set the > bit32/bit33 iova? this depend on a SMI larb setting(bank_sel). > > we separate whole 16GB iova to four banks: > bank: 0: 0~4G; 1: 4~8G; 2: 8-12G; 3: 12-16G; > The bank number is (iova >> 32). > > We will preassign which bank the larbs belong to. currently we don't > have a interface for master to adjust its bank number. > > Each a bank is a iova_region which is a independent iommu-domain. > the iova range for each iommu-domain can't cross 4G. > > Signed-off-by: Yong Wu > Acked-by: Krzysztof Kozlowski # memory part > --- > drivers/iommu/mtk_iommu.c | 12 +++++++++--- > drivers/memory/mtk-smi.c | 7 +++++++ > include/soc/mediatek/smi.h | 1 + > 3 files changed, 17 insertions(+), 3 deletions(-) > Acked-by: Krzysztof Kozlowski Best regards, Krzysztof _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 210BDC5517A for ; Wed, 11 Nov 2020 21:34:49 +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 A3CCD208B3 for ; Wed, 11 Nov 2020 21:34:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gr1nbrW6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A3CCD208B3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kgVfviV0kO9sxcaebcH6w/PZ/aHlmSytU1Q342+efLk=; b=gr1nbrW6koJ6H4A6k4ximBMP9 doAzT7nmiUdRfDVVyRQEladNWaT5pjI/2xZT1/ODg9VVZfTVfrVTZujXbqpvHz9Dh9hu9c9NNZo1j x2qtG/1EhTzkZVxTCsYMrJ0/N8PcWh46xL7DDQgpPJKYFKVOfki60V0QxcNXrVIfNnnJkUEyYFSK0 2vYkJU4tZYMTGxCidu3eZQnF5UR9qAu0jO7+N9f1PtknKyQyyIOd4YoxM26SArs7viaMThc2fEQEV 5Tu86eS6EfNfN6fGkzTBUZ4MILzpW3l0WUY4/MKfHUzLEavKYqUlMFf6rL16gHMqxSR7tEhk1l+4o 9La9ZCJRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcxlB-00026Y-Bh; Wed, 11 Nov 2020 21:34:33 +0000 Received: from mail-ej1-f65.google.com ([209.85.218.65]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcxl8-00025Q-HQ; Wed, 11 Nov 2020 21:34:31 +0000 Received: by mail-ej1-f65.google.com with SMTP id dk16so4734655ejb.12; Wed, 11 Nov 2020 13:34:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cbSPGqSoajDdzgBXkcQ9pceYyj1fwUocImvC8LVuhnA=; b=BtP+QI6eH5jYeG8AsdHPnEAZzYGyY+EWg4Ht0FzBPHsUzmUHDvtwExa5r2ANxOx/5j hEhJoe6/ytWEW6lK/HmFJF5JDKheMbG9oV0qc20roFcdyU5fNqQrDCSrFApQW0JEg356 WL+yqzkiXJaa6jduQjR2eOLmVaWNJIyIYmShQcwLkRMKB8ET3PNJYAB5gaku1h5Qbcr4 GXqv+m3qnA3QptifI/W19q2TOFU3lznhJBtUmfXZ1H/rxTUR3snS2MzxJx0U2catM8mj Rl4PxSYhQnOS2MRAWarJCPIT3mXuFxGL1vv45U9R1TtPQbZqJi13K6Vp9NfQ1JIkm105 upgg== X-Gm-Message-State: AOAM530UKkJ33CXiw0PKheLEYKLNQsn5bgGmVKQribQyp7h0hXEh3c1r NY+Sz4H3/zKHoU1HO8awf68= X-Google-Smtp-Source: ABdhPJxZ1WBxXRo++KtU6Sg0+JLnVf2CzzVbv4KmTREyVVotlVP7TjUvZ7DBVgSFoHPvAHxci/+JFw== X-Received: by 2002:a17:906:d7b7:: with SMTP id pk23mr28400140ejb.214.1605130469179; Wed, 11 Nov 2020 13:34:29 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id x1sm1437867edl.82.2020.11.11.13.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 13:34:27 -0800 (PST) Date: Wed, 11 Nov 2020 22:34:26 +0100 From: Krzysztof Kozlowski To: Yong Wu Subject: Re: [PATCH v4 18/24] iommu/mediatek: Support master use iova over 32bit Message-ID: <20201111213426.GF287176@kozik-lap> References: <20201111123838.15682-1-yong.wu@mediatek.com> <20201111123838.15682-19-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201111123838.15682-19-yong.wu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_163430_727025_87CA123D X-CRM114-Status: GOOD ( 16.05 ) 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: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, chao.hao@mediatek.com, Will Deacon , Joerg Roedel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , kernel-team@android.com, anan.sun@mediatek.com, Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Wed, Nov 11, 2020 at 08:38:32PM +0800, Yong Wu wrote: > After extending v7s, our pagetable already support iova reach > 16GB(34bit). the master got the iova via dma_alloc_attrs may reach > 34bits, but its HW register still is 32bit. then how to set the > bit32/bit33 iova? this depend on a SMI larb setting(bank_sel). > > we separate whole 16GB iova to four banks: > bank: 0: 0~4G; 1: 4~8G; 2: 8-12G; 3: 12-16G; > The bank number is (iova >> 32). > > We will preassign which bank the larbs belong to. currently we don't > have a interface for master to adjust its bank number. > > Each a bank is a iova_region which is a independent iommu-domain. > the iova range for each iommu-domain can't cross 4G. > > Signed-off-by: Yong Wu > Acked-by: Krzysztof Kozlowski # memory part > --- > drivers/iommu/mtk_iommu.c | 12 +++++++++--- > drivers/memory/mtk-smi.c | 7 +++++++ > include/soc/mediatek/smi.h | 1 + > 3 files changed, 17 insertions(+), 3 deletions(-) > Acked-by: Krzysztof Kozlowski Best regards, Krzysztof _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAE24C388F9 for ; Wed, 11 Nov 2020 21:35:09 +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 6C94C20637 for ; Wed, 11 Nov 2020 21:35:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MmkKFbRe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C94C20637 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ucPpwuWqcFcGss0CRs51ut2U/e08LbjVS3IU1832uzU=; b=MmkKFbReZ6M0DgORDya446O+k TnIPhfnd0rQb7C5nGXkbiggxQJBc9GaVxlih03rp4vNw6n7hMEdlWKHUZWl6BkTRdaGwU1aN85m5R MLHDYEYQ67cfpX5LkAqH3dlvT73zLv6WSIy3PcjIlbHTDYPRUZnqbOzSqSBT6bE0tI2/DbIzh0Y7e 67BvSaNmHyZZNP0P82jARYI8m2mW1JbXC5Upg19YcFJS2epmYT/k7aAHZWgFTEA0a7X1nC81LOBez JMSwG8Tn37r4h4Uj3XdxtDmNE5EFDMf9U0sLpBnqsAZsJeyC3qNWowHAVkS8UIAYEfLJMTvrgAnCx 9cVb+a+nA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcxlE-00026u-3Q; Wed, 11 Nov 2020 21:34:36 +0000 Received: from mail-ej1-f65.google.com ([209.85.218.65]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcxl8-00025Q-HQ; Wed, 11 Nov 2020 21:34:31 +0000 Received: by mail-ej1-f65.google.com with SMTP id dk16so4734655ejb.12; Wed, 11 Nov 2020 13:34:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cbSPGqSoajDdzgBXkcQ9pceYyj1fwUocImvC8LVuhnA=; b=BtP+QI6eH5jYeG8AsdHPnEAZzYGyY+EWg4Ht0FzBPHsUzmUHDvtwExa5r2ANxOx/5j hEhJoe6/ytWEW6lK/HmFJF5JDKheMbG9oV0qc20roFcdyU5fNqQrDCSrFApQW0JEg356 WL+yqzkiXJaa6jduQjR2eOLmVaWNJIyIYmShQcwLkRMKB8ET3PNJYAB5gaku1h5Qbcr4 GXqv+m3qnA3QptifI/W19q2TOFU3lznhJBtUmfXZ1H/rxTUR3snS2MzxJx0U2catM8mj Rl4PxSYhQnOS2MRAWarJCPIT3mXuFxGL1vv45U9R1TtPQbZqJi13K6Vp9NfQ1JIkm105 upgg== X-Gm-Message-State: AOAM530UKkJ33CXiw0PKheLEYKLNQsn5bgGmVKQribQyp7h0hXEh3c1r NY+Sz4H3/zKHoU1HO8awf68= X-Google-Smtp-Source: ABdhPJxZ1WBxXRo++KtU6Sg0+JLnVf2CzzVbv4KmTREyVVotlVP7TjUvZ7DBVgSFoHPvAHxci/+JFw== X-Received: by 2002:a17:906:d7b7:: with SMTP id pk23mr28400140ejb.214.1605130469179; Wed, 11 Nov 2020 13:34:29 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id x1sm1437867edl.82.2020.11.11.13.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 13:34:27 -0800 (PST) Date: Wed, 11 Nov 2020 22:34:26 +0100 From: Krzysztof Kozlowski To: Yong Wu Subject: Re: [PATCH v4 18/24] iommu/mediatek: Support master use iova over 32bit Message-ID: <20201111213426.GF287176@kozik-lap> References: <20201111123838.15682-1-yong.wu@mediatek.com> <20201111123838.15682-19-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201111123838.15682-19-yong.wu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201111_163430_727025_87CA123D X-CRM114-Status: GOOD ( 16.05 ) 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: youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, chao.hao@mediatek.com, Will Deacon , Joerg Roedel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , kernel-team@android.com, anan.sun@mediatek.com, Robin Murphy , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 11, 2020 at 08:38:32PM +0800, Yong Wu wrote: > After extending v7s, our pagetable already support iova reach > 16GB(34bit). the master got the iova via dma_alloc_attrs may reach > 34bits, but its HW register still is 32bit. then how to set the > bit32/bit33 iova? this depend on a SMI larb setting(bank_sel). > > we separate whole 16GB iova to four banks: > bank: 0: 0~4G; 1: 4~8G; 2: 8-12G; 3: 12-16G; > The bank number is (iova >> 32). > > We will preassign which bank the larbs belong to. currently we don't > have a interface for master to adjust its bank number. > > Each a bank is a iova_region which is a independent iommu-domain. > the iova range for each iommu-domain can't cross 4G. > > Signed-off-by: Yong Wu > Acked-by: Krzysztof Kozlowski # memory part > --- > drivers/iommu/mtk_iommu.c | 12 +++++++++--- > drivers/memory/mtk-smi.c | 7 +++++++ > include/soc/mediatek/smi.h | 1 + > 3 files changed, 17 insertions(+), 3 deletions(-) > Acked-by: Krzysztof Kozlowski Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C646C388F9 for ; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4367420825 for ; Wed, 11 Nov 2020 21:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725949AbgKKVec (ORCPT ); Wed, 11 Nov 2020 16:34:32 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:40858 "EHLO mail-ej1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgKKVec (ORCPT ); Wed, 11 Nov 2020 16:34:32 -0500 Received: by mail-ej1-f65.google.com with SMTP id oq3so4748132ejb.7; Wed, 11 Nov 2020 13:34:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cbSPGqSoajDdzgBXkcQ9pceYyj1fwUocImvC8LVuhnA=; b=s+lgVQoyIW0PeKdZKrDWyFxxEpc4DbPh6p+yHWJ/IbtSjdf7cVMKb8FGU2NirNa0Hx Me3cVYEXjlQt3A9SjOp4Mdt9d+EaZwIrpQVKaShXGAAtrMhHD0EELryObVxJFjssS7V7 K8wNAZAfEoUlCkeA1S0Ftt8lleQTdszAodLLIxE2lbohIy4LLYbMxBN9mXOgxnDsTbIX yici5A8YYvQ4lK6m4ZdETQVdQSP72bvkRW6FGgjg+GkeYOJ9wyKdDUQ2L535rTidg5mz jLGymmRyMoiSIny6FlPdXjiJzDqyXDfRsohSHGnDxPkGF41Akdc0/03lE0/Zhw1vxUmY eRFQ== X-Gm-Message-State: AOAM530JYP3M+AwJ8P/L1nqNV6O+t/Xf2rxT8jo3mJASKb2TR26ZOJ7R W3ARGYBmd1DkjB3DB1b5vwI= X-Google-Smtp-Source: ABdhPJxZ1WBxXRo++KtU6Sg0+JLnVf2CzzVbv4KmTREyVVotlVP7TjUvZ7DBVgSFoHPvAHxci/+JFw== X-Received: by 2002:a17:906:d7b7:: with SMTP id pk23mr28400140ejb.214.1605130469179; Wed, 11 Nov 2020 13:34:29 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id x1sm1437867edl.82.2020.11.11.13.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 13:34:27 -0800 (PST) Date: Wed, 11 Nov 2020 22:34:26 +0100 From: Krzysztof Kozlowski To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Rob Herring , Will Deacon , Robin Murphy , Evan Green , Tomasz Figa , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, youlin.pei@mediatek.com, Nicolas Boichat , anan.sun@mediatek.com, chao.hao@mediatek.com, Greg Kroah-Hartman , kernel-team@android.com Subject: Re: [PATCH v4 18/24] iommu/mediatek: Support master use iova over 32bit Message-ID: <20201111213426.GF287176@kozik-lap> References: <20201111123838.15682-1-yong.wu@mediatek.com> <20201111123838.15682-19-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201111123838.15682-19-yong.wu@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, Nov 11, 2020 at 08:38:32PM +0800, Yong Wu wrote: > After extending v7s, our pagetable already support iova reach > 16GB(34bit). the master got the iova via dma_alloc_attrs may reach > 34bits, but its HW register still is 32bit. then how to set the > bit32/bit33 iova? this depend on a SMI larb setting(bank_sel). > > we separate whole 16GB iova to four banks: > bank: 0: 0~4G; 1: 4~8G; 2: 8-12G; 3: 12-16G; > The bank number is (iova >> 32). > > We will preassign which bank the larbs belong to. currently we don't > have a interface for master to adjust its bank number. > > Each a bank is a iova_region which is a independent iommu-domain. > the iova range for each iommu-domain can't cross 4G. > > Signed-off-by: Yong Wu > Acked-by: Krzysztof Kozlowski # memory part > --- > drivers/iommu/mtk_iommu.c | 12 +++++++++--- > drivers/memory/mtk-smi.c | 7 +++++++ > include/soc/mediatek/smi.h | 1 + > 3 files changed, 17 insertions(+), 3 deletions(-) > Acked-by: Krzysztof Kozlowski Best regards, Krzysztof