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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 49845C4320A for ; Tue, 3 Aug 2021 05:39:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 102B560F48 for ; Tue, 3 Aug 2021 05:39:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 102B560F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9gBZbl8mfPfjJuqI758lsP+iDBih5OHYawpwQ8WaSwU=; b=0Pm2+m315VZFvW x/0zugdLojGMqIggk+gTu4jYZJEP7IV3z4EZDaE0KvGVqBV/VodLzAA9cieictACeAkURlNTCJscU grPTmteD1dMBCpFL/H7LQYjvwA/0LDD8zmjsuprwWJcMO5PYGuq725kIzipGk4Iq4JFTiNWxtjJf9 J2WoEivnuMIqRrPIvjT5H7QoIsVgoPw7NYsUktcQsvNkRrRCHIyro7dTgiukaNTxLcXdRHOjtHnw5 H8VvU2/2nrXfwWzbVxzhOFa32pyfgmDTPJMppwl41k7EDUNQEh8EIBYxUy60c2/w/2HEhxfbQEj7F PPCrvpVGM2bO7Ivjq+RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAn78-001BgB-Fd; Tue, 03 Aug 2021 05:37:18 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAn73-001BfB-DY for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 05:37:14 +0000 Received: by mail-pl1-x629.google.com with SMTP id d17so370921plr.12 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=XZxjQK71IuBFFrfD4bK26uH7y0md2YkXe47TTUlUm3yz0fpZT/GVmwSAuuL5Gl8FwF N6NdS93DLi7iN14w+l5ivfFTtxzkQQcfY/Em5XK7WE2PvpKo2yNt9FO+azYSS0p2eT0m bLGK+4pCpEjO1Fq/x51+dYrgOBzQtPL16ocYfmBZU0PCWLh2/JI4+KpyaKrX5Z3vaa/U Hh+Kw0swJ1xjaYTH4ncNszWfqJnUVnqPcXoNTU4dL1/RP2epp1oZRDT47PntP+wmL8qn I5dku1lJ60NFmVCFFOdS2XgKNBUuHD1yzMLbW/vkSo5htgIkisSg/9I64njlEczg7eJT SVdA== X-Gm-Message-State: AOAM532e5vCK+EwsiNzojQbexbBE5VyDVfzkWMqKQIf2wCc6ZfZhslW/ ZRYvTUIaMFx3/h/7wv6kj/lCF3x8uBoff5OYGZxvfA== X-Google-Smtp-Source: ABdhPJwy22hM/0nLperLTs7oqlOkW3eLaO6jLCVztbfyp37svS9AhfV/dPAYrDNKRL8a0yAc2zvp451Ro7v8cSdVagE= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_223713_526527_C42230B3 X-CRM114-Status: GOOD ( 31.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 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) > > > > } > > > > } > > > > > > > > [...] > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel