Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3310282pxk; Mon, 7 Sep 2020 09:10:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycLgiXSatlD1QDJ7eSN4Ewm4/pvcuWuihE//wAfLI5aqBkAfi1XP1zJdAk+QtIfNKBe2xT X-Received: by 2002:a05:6402:b68:: with SMTP id cb8mr4803022edb.350.1599495056961; Mon, 07 Sep 2020 09:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599495056; cv=none; d=google.com; s=arc-20160816; b=xG4TBE+lBn1BrQJYRJQsLMNuO22bTNYpD6REOhLWrufg80k063Ripl0kWtvFGCvDZ9 z7uQQZ1RbHopi+ngmOlIokOhLTeTGcNC8/e5Z9XhWq/1i5rVmDIkOJiyrZCHbEkzGmg4 ZAJWxbx2EpXPTkT46D+xzeqLn+JWdvDlBcz3MtPp57GTnpTrYulyA6n7Kl3tcYYVM3PC HjIVNPAgPiz45MDkxLtpqI7Tzmq+DaAjguYDGCWIdkidPSUv2cVJ66TKdWifaK7CtjMN 4wvWfjjZKpjpGbGlg/nUDWMJg31a8gzCBCwlcEQipEY4D3LCrI5CNUb7dsyexaG4ycGA 2tbg== 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; bh=DeKV5DEIK7/eBZGnA2ut3gG/J+kJVuQa3H9118DZnS4=; b=N0sYMbvXmte9v0SSZM3+66GYx1QF7GdL0t2mpf0S0FgFMBHuhzGdIbYKk5UByargYr 839xBiwI40T6GL8W3BaK7mGSM/KQDkDO5rjSGmUa8+qu3ThrnoOWOXRl+lKpSt6VlscB IsM5IqKFLlqkyEp3FJP13I3I+plbFbRoW+Gy+vlmtupi7Q9gyLVVOiexYcPYmd1wUZCG eTifWr9iVCQCAm0HaJpJfn/ApOtPQFj94pafoPe8ILy/Lo/PMn2qUds6oS3ySak1rJKi n5SCcPP7LOvUkE8toV4g1kpvBZcor81uQuDZVsxWLIftU7t+K+9yxlvKBG7s+HeggRm2 1orw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j61si10053291edd.365.2020.09.07.09.10.34; Mon, 07 Sep 2020 09:10:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730305AbgIGQJx (ORCPT + 99 others); Mon, 7 Sep 2020 12:09:53 -0400 Received: from mx.socionext.com ([202.248.49.38]:4579 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730295AbgIGQJ1 (ORCPT ); Mon, 7 Sep 2020 12:09:27 -0400 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 08 Sep 2020 01:09:24 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id 84AF060060; Tue, 8 Sep 2020 01:09:24 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Tue, 8 Sep 2020 01:09:24 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id EA8C01A0509; Tue, 8 Sep 2020 01:09:23 +0900 (JST) Received: from [10.212.1.10] (unknown [10.212.1.10]) by yuzu.css.socionext.com (Postfix) with ESMTP id 299A91205FF; Tue, 8 Sep 2020 01:09:23 +0900 (JST) Subject: Re: [PATCH v6 5/6] PCI: uniphier: Add iATU register support To: Rob Herring Cc: Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Masahiro Yamada , Marc Zyngier , PCI , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , Masami Hiramatsu , Jassi Brar References: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> <1596795922-705-6-git-send-email-hayashi.kunihiko@socionext.com> From: Kunihiko Hayashi Message-ID: <7b6ae470-23c1-735c-08ca-67dd644d7f23@socionext.com> Date: Tue, 8 Sep 2020 01:09:22 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: 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 Hi Rob, On 2020/09/04 7:12, Rob Herring wrote: > On Fri, Aug 21, 2020 at 1:05 AM Kunihiko Hayashi > wrote: >> >> On 2020/08/18 1:48, Rob Herring wrote: >>> On Fri, Aug 7, 2020 at 4:25 AM Kunihiko Hayashi >>> wrote: >>>> >>>> This gets iATU register area from reg property. In Synopsys DWC version >>>> 4.80 or later, since iATU register area is separated from core register >>>> area, this area is necessary to get from DT independently. >>>> >>>> Signed-off-by: Kunihiko Hayashi >>>> --- >>>> drivers/pci/controller/dwc/pcie-uniphier.c | 5 +++++ >>>> 1 file changed, 5 insertions(+) >>>> >>>> diff --git a/drivers/pci/controller/dwc/pcie-uniphier.c b/drivers/pci/controller/dwc/pcie-uniphier.c >>>> index 55a7166..93ef608 100644 >>>> --- a/drivers/pci/controller/dwc/pcie-uniphier.c >>>> +++ b/drivers/pci/controller/dwc/pcie-uniphier.c >>>> @@ -471,6 +471,11 @@ static int uniphier_pcie_probe(struct platform_device *pdev) >>>> if (IS_ERR(priv->pci.dbi_base)) >>>> return PTR_ERR(priv->pci.dbi_base); >>>> >>>> + priv->pci.atu_base = >>>> + devm_platform_ioremap_resource_byname(pdev, "atu"); >>>> + if (IS_ERR(priv->pci.atu_base)) >>>> + priv->pci.atu_base = NULL; >>> >>> Keystone has the same 'atu' resource setup. Please move its code to >>> the DW core and use that. >> >> There are some platforms that pci.atu_base is set by other way. >> The 'atu' code shouldn't be conflicted with the following existing code. > > No, it's not a conflict but needless duplication. I see. >> drivers/pci/controller/dwc/pci-keystone.c: atu_base = devm_platform_ioremap_resource_byname(pdev, "atu"); >> drivers/pci/controller/dwc/pci-keystone.c: pci->atu_base = atu_base; >> drivers/pci/controller/dwc/pcie-designware.c: pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET; >> drivers/pci/controller/dwc/pcie-intel-gw.c: pci->atu_base = pci->dbi_base + data->pcie_atu_offset; > > This one should have had an 'atu' region in DT. > >> drivers/pci/controller/dwc/pcie-tegra194.c: pci->atu_base = devm_ioremap_resource(dev, atu_dma_res); > > Unfortunately, a different name was used. That is the mess which is > the DW PCI controller. Okay, this has already set atu_base, so ignore it for this patch. >> >> So I'm not sure where to move the code in the DW core. >> Is there any idea? > > You just need this and then remove the keystone code: > > diff --git a/drivers/pci/controller/dwc/pcie-designware.c > b/drivers/pci/controller/dwc/pcie-designware.c > index b723e0cc41fb..680084467447 100644 > --- a/drivers/pci/controller/dwc/pcie-designware.c > +++ b/drivers/pci/controller/dwc/pcie-designware.c > @@ -556,6 +556,8 @@ void dw_pcie_setup(struct dw_pcie *pci) > dw_pcie_iatu_unroll_enabled(pci))) { > pci->iatu_unroll_enabled = true; > if (!pci->atu_base) > + pci->atu_base = > devm_platform_ioremap_resource_byname(pdev, "atu"); > + if (IS_ERR(pci->atu_base)) > pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET; > } > dev_dbg(pci->dev, "iATU unroll: %s\n", pci->iatu_unroll_enabled ? > I've got it. I think I need to add a bit of code to this though, I'll try to apply this and remove the duplicate code. I'll separate this from other PER/AER patches and send new series. Thank you, --- Best Regards Kunihiko Hayashi