Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5606131pxu; Wed, 23 Dec 2020 00:17:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQy02f6UX59JOescu3eYczsCvmSPjkiaWykksmZU/szCTksD2f4bkT6TOvkBvZTcTX+D2l X-Received: by 2002:a17:906:a8f:: with SMTP id y15mr3008841ejf.552.1608711427998; Wed, 23 Dec 2020 00:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608711427; cv=none; d=google.com; s=arc-20160816; b=JxPfV1XUjMr1WFiI4RBLkkcTcagCKwubIYrgEwd9hm1ssS5Do26+2n4uOEN+NJjqh0 2qupRu4Xwvo+yLSF3uZsoKn381bDtFN/BSwBV3LuRt3YerRvh2TK/SnDUzBpt9Hfc5Lv 4m6+TgLitnen4esBrMT21bq90nBS4jKAToO0YxC+Vq3ytCUZp7Vc7Y2J6ERGmu1udgat DdJNP2WMREJa52cYLMjcW9WIgkenj2AocYGyHUJ1lkGBdCpma1cAyk6ZbfZIkmQNhids yisl3ZkwnKwpBtWCMUSnZgOPKuF6AqQFavu1bfdRr9vnY+A7FyAb9akaTu8myEap3bwK 0hmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XucMaRIeMybHCwI/S50c0P9P/PzyTr/MY7GdCt6gQ/Q=; b=yIyzVqXsqy4c3NXVyl9pSEcAeky/FnTcrci+WlT7Q3A/gNF2QSX8ODhmonos1yTsbZ aV9weiFlnzH0KB0F8MhWvh6YhV23RVvziQXD/YTzJmdYjKSYji9U6sMeBgiT44gj5e2a bine3e1OIkrR/RQ5rXkSE+4XwXB47tSTtaukypou7RBq51uCdsUPtyvtudqYr1q9OQiE J8VCVNOx3+3aE0qj0K4XtkOPXxWLUAIj5r5anjXZnRZCt377qw6Ne3p/1AUQuvXTIHg2 rUqesUyxs4k94V3mJB/TlPkv7LqCxgSe7leKv40Tlgxwq8U6l3y+Gyvh3HqeH7rKPuib Zwmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aZzdXz0S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si8241003eds.57.2020.12.23.00.16.46; Wed, 23 Dec 2020 00:17:07 -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; dkim=pass header.i=@chromium.org header.s=google header.b=aZzdXz0S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728168AbgLWIQ0 (ORCPT + 99 others); Wed, 23 Dec 2020 03:16:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727929AbgLWIQ0 (ORCPT ); Wed, 23 Dec 2020 03:16:26 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59595C0613D6 for ; Wed, 23 Dec 2020 00:15:46 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id c12so9925660pfo.10 for ; Wed, 23 Dec 2020 00:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XucMaRIeMybHCwI/S50c0P9P/PzyTr/MY7GdCt6gQ/Q=; b=aZzdXz0SBtVFnO7PRB2b7RV7mkqwrJBV3MhQ+S6S1rTiukgrEzwXVuVmBglEF6tyx7 sUMj4R7PThczRRpPOGxwzIDDnG8jhFuhzW11Y/PwPYVvWY8B1h6o1bjgby2jsWczSAK/ SrYuIgiezft8tCl9+en1fO6d6CqE4ft75I0eg= 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=XucMaRIeMybHCwI/S50c0P9P/PzyTr/MY7GdCt6gQ/Q=; b=j9xHsgHmmFqKwxqPrkFFD9FQfR9wkI6bS3t4/hxBu0CL9xQe9NFFCM57e5RlNhtsaA nH9HyFxPyGo4kji21hpDG+Z9BwYa2bltD6opJROUqDOTy2/v5wI/PoVWqDEZ3Qo2RD4H zUl08oUvsuTUQpKle7jZ65Mz1H6duOWU0w7hZwk2Tnwrgd+OVR0vw7Lb9EObF0EEG8/p Jz7HqGpYBwlq4u2zCbWxwmdM8OfKyjk/E3Mk04luihIFELI8xrK8u7pNw/7K9p1HzGvr wEyPdft/x+tSoPQwVaL8qQ3LrdrHbbAJtcvgiQ8SKiAfN2QgNfJKZqh2EfOa3nUUYZEB Q0tw== X-Gm-Message-State: AOAM531J8F1Rng5URNzMvD73p+Ck8KO9rmxEz6tIQiaT0OlWEIVs94Lu tN8MkrCmiU5MV+M/t4+ICgjdqpa377/v9Q== X-Received: by 2002:a63:f12:: with SMTP id e18mr23981690pgl.101.1608711345895; Wed, 23 Dec 2020 00:15:45 -0800 (PST) Received: from chromium.org ([2401:fa00:8f:2:a28c:fdff:fef0:43bf]) by smtp.gmail.com with ESMTPSA id z11sm21421970pjn.5.2020.12.23.00.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 00:15:45 -0800 (PST) Date: Wed, 23 Dec 2020 17:15:38 +0900 From: Tomasz Figa To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Rob Herring , Will Deacon , Robin Murphy , youlin.pei@mediatek.com, devicetree@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com, chao.hao@mediatek.com, linux-kernel@vger.kernel.org, Evan Green , Tomasz Figa , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, Krzysztof Kozlowski , anan.sun@mediatek.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 04/27] dt-bindings: memory: mediatek: Add domain definition Message-ID: References: <20201209080102.26626-1-yong.wu@mediatek.com> <20201209080102.26626-5-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201209080102.26626-5-yong.wu@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yong, On Wed, Dec 09, 2020 at 04:00:39PM +0800, Yong Wu wrote: > In the latest SoC, there are several HW IP require a sepecial iova > range, mainly CCU and VPU has this requirement. Take CCU as a example, > CCU require its iova locate in the range(0x4000_0000 ~ 0x43ff_ffff). Is this really a domain? Does the address range come from the design of the IOMMU? Best regards, Tomasz > > In this patch we add a domain definition for the special port. In the > example of CCU, If we preassign CCU port in domain1, then iommu driver > will prepare a independent iommu domain of the special iova range for it, > then the iova got from dma_alloc_attrs(ccu-dev) will locate in its special > range. > > This is a preparing patch for multi-domain support. > > Signed-off-by: Yong Wu > Acked-by: Krzysztof Kozlowski > Acked-by: Rob Herring > --- > include/dt-bindings/memory/mtk-smi-larb-port.h | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/dt-bindings/memory/mtk-smi-larb-port.h b/include/dt-bindings/memory/mtk-smi-larb-port.h > index 7d64103209af..2d4c973c174f 100644 > --- a/include/dt-bindings/memory/mtk-smi-larb-port.h > +++ b/include/dt-bindings/memory/mtk-smi-larb-port.h > @@ -7,9 +7,16 @@ > #define __DT_BINDINGS_MEMORY_MTK_MEMORY_PORT_H_ > > #define MTK_LARB_NR_MAX 32 > +#define MTK_M4U_DOM_NR_MAX 8 > + > +#define MTK_M4U_DOM_ID(domid, larb, port) \ > + (((domid) & 0x7) << 16 | (((larb) & 0x1f) << 5) | ((port) & 0x1f)) > + > +/* The default dom id is 0. */ > +#define MTK_M4U_ID(larb, port) MTK_M4U_DOM_ID(0, larb, port) > > -#define MTK_M4U_ID(larb, port) (((larb) << 5) | (port)) > #define MTK_M4U_TO_LARB(id) (((id) >> 5) & 0x1f) > #define MTK_M4U_TO_PORT(id) ((id) & 0x1f) > +#define MTK_M4U_TO_DOM(id) (((id) >> 16) & 0x7) > > #endif > -- > 2.18.0 > > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu