Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2175052pxy; Mon, 2 Aug 2021 22:39:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMxhOHsvOBvE1qkPPUyOV7ZTyFZic3XWYYUhwV+9zGcmcGb7CNNRKqzNKAdjAHqiWOIQig X-Received: by 2002:a17:906:839a:: with SMTP id p26mr19155786ejx.547.1627969179195; Mon, 02 Aug 2021 22:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627969179; cv=none; d=google.com; s=arc-20160816; b=Okc22Ab0F5w5Jbh5/oQgMOcY5smH+MhiKE9nHnSAoOZjV+oaP3VweyjLoyZPTHMYc3 FFojifAboV6D9tJIDeizu5cgFvtvrsQffoRbZawwE1GuocrthmBi+vDG/YNnLeHzYTSP rt9ApJaO5uyPe/FfCOedXPROywNlSp+eeyHWbbbOPxM4vMr29hU7YaW2as6blITCXFe4 AUPjSkc6MScSNjWSkADmcSHkS6JV7bC4LmetVFYEss8v+HZZ6Wf4cE6xBqop+VPyWmZy B0tB0PZ3zqiwMYOxZr0//nrViu1LHNBr91jXP+Mit3N/he/eYNGQ1rrknU3F9vC3uTrl eHnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TzgmYchbci/zhvlgXLAGmYsl7UzG8nnyQecH+/1YGbQ=; b=MLjfZLU1DEwfEbaHO8Gqd063Wci+mDOG8l2tT/shpi+f63dtmAj1n/dCGJJTYMe1en EScEbK4T5JP2yuCMxeyP6w56gvnZjhF/TMZe1dOJcEZ3q7vL6I2zcTqzt5tzcN1qbdrt tS3UkUoAeQ89Fj+tgx9srK/CkHi9IJTH45PtriA32q3YY1C+OfqLIlJjsJqX66aFBXOb OfkuOPjx8H6uZj1htZg7tM7COqtCG88k1HaXYlqt/kKa8pG9uHculfX416K548zfhu0i ff08rS7aB6NVnpvBR/mMxIrgg3BjQiKjIsOgXHEXKG9gtKub1TmLsRJaXRnvxijx6AUZ XfkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ES55ynag; 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 h25si13613670edq.396.2021.08.02.22.39.16; Mon, 02 Aug 2021 22:39:39 -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=@chromium.org header.s=google header.b=ES55ynag; 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 S231386AbhHCFhX (ORCPT + 99 others); Tue, 3 Aug 2021 01:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233784AbhHCFhW (ORCPT ); Tue, 3 Aug 2021 01:37:22 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE3BC06175F for ; Mon, 2 Aug 2021 22:37:12 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id e21so22339952pla.5 for ; Mon, 02 Aug 2021 22:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TzgmYchbci/zhvlgXLAGmYsl7UzG8nnyQecH+/1YGbQ=; b=ES55ynagZ88pg0GPjV6f9YmdPOu1QNR8D/oRa8bNQ/T4u9Nxk+qPpJ5UcbEoQilUyZ u3+F/HwsLgeupDpIDbgs1unBMYXyLlltf0CudKw6Ac1QXWjntXx+kNos74b2LiMtNEcv es9C9D3nxwbVWjEvI1IPePrzDYu2Oqq5AJMmU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TzgmYchbci/zhvlgXLAGmYsl7UzG8nnyQecH+/1YGbQ=; b=KKpV9YzMF7WExpyuu5ORRKSRQoScdKv+ZqjniKk6AKfLrzkeH8IL4dCcs7BhtJK7Tg nq4WXBgeLgVlpc23ZQUec6+RY5mswWjCNlZ9J+2PzTurRtoBaCOkstW5mN6/KRfBU2Xs cjHAFZvsMk5kHr7aN09te7WmqutgfmQL3pSBOwljkGhobT30vLeIlwPX/g0ZKkxQC56D EdFRZZy0vPRKr/ilB87NDmEKtaKxaUVxEEQn6JfDcIUlFmTjLhg3rgdw8UuQxCpnBEkd J/0Mm/wHEsE9irloKO4hnESmLoCwYfsuZwGmCMiLdCvoLratKi1TzZCOV45JMrpnU/Et QGBA== X-Gm-Message-State: AOAM533BfcXvnuiM8/V4Jar8GjZR+OG1UooiZgtoN/79YlooHu2JUJTx ytB+wgSBmcuTKDSENCp5iGBEmXZyw0DJlznpQw2Wqw== X-Received: by 2002:a17:902:b788:b029:12c:2888:9589 with SMTP id e8-20020a170902b788b029012c28889589mr17319543pls.60.1627969031860; Mon, 02 Aug 2021 22:37:11 -0700 (PDT) MIME-Version: 1.0 References: <20210715121209.31024-1-yong.wu@mediatek.com> <20210715121209.31024-12-yong.wu@mediatek.com> <1626935902.27875.7.camel@mhfsdcap03> <1627540902.13818.3.camel@mhfsdcap03> In-Reply-To: <1627540902.13818.3.camel@mhfsdcap03> From: Ikjoon Jang Date: Tue, 3 Aug 2021 13:37:01 +0800 Message-ID: Subject: Re: [PATCH v2 11/11] memory: mtk-smi: mt8195: Add initial setting for smi-larb To: Yong Wu Cc: Krzysztof Kozlowski , Rob Herring , Matthias Brugger , Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , Tomasz Figa , "moderated list:ARM/Mediatek SoC support" , srv_heupstream , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/Mediatek SoC support" , iommu@lists.linux-foundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jul 29, 2021 at 2:41 PM Yong Wu wrote: > > Hi Ikjoon, > > Just a ping. > > On Thu, 2021-07-22 at 14:38 +0800, Yong Wu wrote: > > On Wed, 2021-07-21 at 21:40 +0800, Ikjoon Jang wrote: > > > On Thu, Jul 15, 2021 at 8:23 PM Yong Wu wrote: > > > > > > > > To improve the performance, We add some initial setting for smi larbs. > > > > there are two part: > > > > 1), Each port has the special ostd(outstanding) value in each larb. > > > > 2), Two general setting for each larb. Honestly, I think nobody outside Mediatek will understand this. Can you please update this to be more generic? Like "Apply default bus settings for mt8195, without this, XXX problems can happen.. "? Or for example, adding brief descriptions on what MTK_SMI_FLAG_LARB_THRT_EN, MTK_SMI_FLAG_LARB_SW_FLAG, and MTK_SMI_FLAG_LARB_SW_FLAG[] are for would be better if it's available. > > > > > > > > In some SoC, this setting maybe changed dynamically for some special case > > > > like 4K, and this initial setting is enough in mt8195. > > > > > > > > Signed-off-by: Yong Wu > > > > --- > > [...] > > > > struct mtk_smi { > > > > @@ -213,12 +228,22 @@ static void mtk_smi_larb_config_port_mt8173(struct device *dev) > > > > static void mtk_smi_larb_config_port_gen2_general(struct device *dev) > > > > { > > > > struct mtk_smi_larb *larb = dev_get_drvdata(dev); > > > > - u32 reg; > > > > + u32 reg, flags_general = larb->larb_gen->flags_general; > > > > + const u8 *larbostd = larb->larb_gen->ostd[larb->larbid]; > > > > int i; > > > > > > > > if (BIT(larb->larbid) & larb->larb_gen->larb_direct_to_common_mask) > > > > return; > > > > > > > > + if (MTK_SMI_CAPS(flags_general, MTK_SMI_FLAG_LARB_THRT_EN)) > > > > + writel_relaxed(SMI_LARB_THRT_EN, larb->base + SMI_LARB_CMD_THRT_CON); > > > > + > > > > + if (MTK_SMI_CAPS(flags_general, MTK_SMI_FLAG_LARB_SW_FLAG)) > > > > + writel_relaxed(SMI_LARB_SW_FLAG_1, larb->base + SMI_LARB_SW_FLAG); > > > > + > > > > + for (i = 0; i < SMI_LARB_PORT_NR_MAX && larbostd && !!larbostd[i]; i++) > > > > + writel_relaxed(larbostd[i], larb->base + SMI_LARB_OSTDL_PORTx(i)); > > > > > > All other mtk platform's larbs have the same format for SMI_LARB_OSTDL_PORTx() > > > registers at the same offset? or is this unique feature for mt8195? > > > > All the other Platform's larbs have the same format at the same offset. > > In this case, Do you have some other further comment? If no, I will keep > the current solution for this. Sorry for the late response, I have no further comments or any objections on here. Please go ahead for v3. I just had no idea on the register definitions and wanted to be sure that newly added register definitions are common to all MTK platforms. Thanks! > > Thanks. > > > > > > > > > > + > > > > for_each_set_bit(i, (unsigned long *)larb->mmu, 32) { > > > > reg = readl_relaxed(larb->base + SMI_LARB_NONSEC_CON(i)); > > > > reg |= F_MMU_EN; > > > > @@ -227,6 +252,51 @@ static void mtk_smi_larb_config_port_gen2_general(struct device *dev) > > > > } > > > > } > > > > > > > > [...] > > >