Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2015769pxk; Mon, 14 Sep 2020 02:23:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYPkZzY+LqEIbnTChXWxBcSAWvje1DTAhNEPonF632dg10o/0hkXqpCdSuiSg+vfh6VT5r X-Received: by 2002:aa7:c387:: with SMTP id k7mr15833418edq.242.1600075387904; Mon, 14 Sep 2020 02:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600075387; cv=none; d=google.com; s=arc-20160816; b=W4yTaMZfKNgkdDkex9F/CYpBrwu/lW9HvWivL7KSCdiCk63tbr9uAmMjt5vEmlINlK XNtTY1+svqi5+ph00j3InTeFug75p9DMei2E9yo9BBAldq09RR7yaerDBLFEsQ+3ErHJ s96TpkcV4tfJ1jeZFpBLY5v3jVOAvfxnXwNbVVngjRFHVgHJGTM70bW8IGe8Twtflw6U /x9+HrNHVBOSlCeXIZ3+YFoXUk8F0Z3LJzH7yA7xTaJW84+COwd09EKjwOzUEEL9LOnu H1vbfAix5cMQQ3DjkXvMJNEry8TU/8gTiz2iSgdMv9tgq0Mn/iRv8rjtyPJkW739oKrh aquQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=wcF550GwyqliSCSyHw0Z/IDzm3K/ogaNto0zdoWfp60=; b=r7bMxrXx9eKPtUDI6lfastjmrPykbiWlVveLFJjqaTLrGc6L9TNZdNanEAa3BhDJjq 1mo6TTOff/cERy46zwqlxc8cEwsorXz1BTV4r3q+FsgqrksvX2VEcVfTOyMo5EfWI3uN Nl09OMPd5gPMzITiA9jrXqVAvUvoBDbuzz9Zid9uJ73UWGlo0bfnHnjJZ78qDpGU0tGa onXnHjnpIBWaBwxZmPibYcnNAPUzMTEH0eLTNsyoVhTpLXSrOGUPbkm8CYnMCGg7vARk F8UINAhE3yVtgy44QCJs8acFOx/P0E6l1RRt7HFDYfg36EwtkFJnexDDQERc/yKqDbDD w3sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tiMPrN36; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w16si6872308eds.210.2020.09.14.02.22.45; Mon, 14 Sep 2020 02:23:07 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=tiMPrN36; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726289AbgINJTo (ORCPT + 99 others); Mon, 14 Sep 2020 05:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbgINJTb (ORCPT ); Mon, 14 Sep 2020 05:19:31 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E206BC06174A; Mon, 14 Sep 2020 02:19:29 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id z4so17888006wrr.4; Mon, 14 Sep 2020 02:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wcF550GwyqliSCSyHw0Z/IDzm3K/ogaNto0zdoWfp60=; b=tiMPrN36G6dUn/kEUQVays/uU94aZcWuAZpt/Nvk7qqLpik+PvXRFUsv/Eiw4v+VXi nUPyrmVyWgm2X5NAZTkS2bjtga25N+GcOlP/8rgU3wlJRPFvOt6CD0D3XpoZb4zO7MJR RTb5xROBppfNI3+h3yXQO02cMDQH+vUyMhy7m2/bsQuWqO43t/T652wnp3ccQACIrruE w2NSQCEmAac+MPdWfdJqp47I7AkqnuRFn2K3zg5av1CmCkKi4fbhquKHLsLpy7oWEmTq 1gCex1T5rtmEO45QL7sRyL/mFyhdzteRX3EgBCk5kCAKR8O3mBNDIkkYoFl359gSPulx sMIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wcF550GwyqliSCSyHw0Z/IDzm3K/ogaNto0zdoWfp60=; b=BHVN6Dlw3KHHh6rgV+5YF3L93wfE1h4tmFEhoIp0gBY70K1DuS+utKj59SYe7Y9eN6 sdAn8CCh/UHKVwtcIY9FF2QwwqHoGmdgWQWmPQio0vf6XxECNa1D8QRLnCgr6JDZEzCE k5hnl59Bna9/3ETWmTLIz6AoIqvIBoLiitGPOcfNc8+59bUi2Ati7bKxPLWx5txCEIeA maDSa1ynurYjZoSZTKdxNnabP2YUNzXWA2D+oKJIrDZb9Wi3rznuA/zmaVoPVJEfKZIv cnU8YgKBQiXWAp/MfAxkm52zo3dcUGbbWh8qRtRtDKZ/+PKp8QUjH96iUzn9rE+l5osg +uRg== X-Gm-Message-State: AOAM531LXZu7qvaAm4vNPAdVY1s4Uwrb++5Ra7cFNyjOUeEjhfiKssUN 7GMd0dkJsG5NcqitqpGClQA= X-Received: by 2002:a5d:4c52:: with SMTP id n18mr14605256wrt.267.1600075168623; Mon, 14 Sep 2020 02:19:28 -0700 (PDT) Received: from ziggy.stardust ([213.195.113.201]) by smtp.gmail.com with ESMTPSA id j7sm19884886wrs.11.2020.09.14.02.19.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 02:19:27 -0700 (PDT) Subject: Re: [PATCH v4 2/3] iommu/mediatek: add flag for legacy ivrp paddr To: Fabien Parent , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: joro@8bytes.org, robh+dt@kernel.org, yong.wu@mediatek.com, miles.chen@mediatek.com References: <20200907101649.1573134-1-fparent@baylibre.com> <20200907101649.1573134-2-fparent@baylibre.com> From: Matthias Brugger Message-ID: Date: Mon, 14 Sep 2020 11:19:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200907101649.1573134-2-fparent@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/09/2020 12:16, Fabien Parent wrote: > Add a new flag in order to select which IVRP_PADDR format is used > by an SoC. > > Signed-off-by: Fabien Parent > Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger > --- > > v4: no change > v3: set LEGACY_IVRP_PADDR as a flag instead of platform data > v2: new patch > > --- > drivers/iommu/mtk_iommu.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c > index 785b228d39a6..b1f85a7e9346 100644 > --- a/drivers/iommu/mtk_iommu.c > +++ b/drivers/iommu/mtk_iommu.c > @@ -116,6 +116,7 @@ > #define OUT_ORDER_WR_EN BIT(4) > #define HAS_SUB_COMM BIT(5) > #define WR_THROT_EN BIT(6) > +#define HAS_LEGACY_IVRP_PADDR BIT(7) > > #define MTK_IOMMU_HAS_FLAG(pdata, _x) \ > ((((pdata)->flags) & (_x)) == (_x)) > @@ -582,7 +583,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data) > F_INT_PRETETCH_TRANSATION_FIFO_FAULT; > writel_relaxed(regval, data->base + REG_MMU_INT_MAIN_CONTROL); > > - if (data->plat_data->m4u_plat == M4U_MT8173) > + if (MTK_IOMMU_HAS_FLAG(data->plat_data, HAS_LEGACY_IVRP_PADDR)) > regval = (data->protect_base >> 1) | (data->enable_4GB << 31); > else > regval = lower_32_bits(data->protect_base) | > @@ -818,7 +819,8 @@ static const struct mtk_iommu_plat_data mt6779_data = { > > static const struct mtk_iommu_plat_data mt8173_data = { > .m4u_plat = M4U_MT8173, > - .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI, > + .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI | > + HAS_LEGACY_IVRP_PADDR, > .inv_sel_reg = REG_MMU_INV_SEL_GEN1, > .larbid_remap = {{0}, {1}, {2}, {3}, {4}, {5}}, /* Linear mapping. */ > }; >