All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: "Jingoo Han" <jingoohan1@gmail.com>,
	"Gustavo Pimentel" <gustavo.pimentel@synopsys.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	"Alexey Malahov" <Alexey.Malahov@baikalelectronics.ru>,
	"Pavel Parkhomenko" <Pavel.Parkhomenko@baikalelectronics.ru>,
	"Frank Li" <Frank.Li@nxp.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/12] PCI: dwc: Discard IP-core version checking on unrolled iATU detection
Date: Thu, 24 Mar 2022 17:49:05 +0530	[thread overview]
Message-ID: <20220324121905.GH2854@thinkpad> (raw)
In-Reply-To: <20220324012524.16784-9-Sergey.Semin@baikalelectronics.ru>

On Thu, Mar 24, 2022 at 04:25:19AM +0300, Serge Semin wrote:
> It's pretty much pointless. Even though unrolled version of the internal
> ATU has been indeed available since DWC PCIe v4.80a IP-core, there is no
> guarantee it was enabled during the IP-core configuration (Synopsys
> suggests to contact the Solvnet support for guidance of how to do that for
> the newer IP-cores). So the only reliable way to find out the unrolled
> iATU feature availability is indeed to check the iATU viewport register
> content. In accordance with the reference manual [1] if the register
> doesn't exist (unrolled iATU is enabled) it's content is fixed with
> 0xff-s, otherwise it will contain some zeros. So we can freely drop the
> IP-core version checking in this matter then and use the
> dw_pcie_iatu_unroll_enabled() method only to detect whether iATU/eDMA
> space is unrolled.
> 
> [1] DesignWare Cores, PCI Express Controller, Register Desciptions,
> v.4.90a, December 2016, p.855
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/pci/controller/dwc/pcie-designware.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> index 3bd1cfd12148..e3d2c11e6998 100644
> --- a/drivers/pci/controller/dwc/pcie-designware.c
> +++ b/drivers/pci/controller/dwc/pcie-designware.c
> @@ -600,15 +600,15 @@ static void dw_pcie_link_set_max_speed(struct dw_pcie *pci, u32 link_gen)
>  
>  }
>  
> -static u8 dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci)
> +static bool dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci)
>  {
>  	u32 val;
>  
>  	val = dw_pcie_readl_dbi(pci, PCIE_ATU_VIEWPORT);
>  	if (val == 0xffffffff)
> -		return 1;
> +		return true;
>  
> -	return 0;
> +	return false;
>  }
>  
>  static void dw_pcie_iatu_detect_regions_unroll(struct dw_pcie *pci)
> @@ -680,9 +680,8 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci)
>  	struct device *dev = pci->dev;
>  	struct platform_device *pdev = to_platform_device(dev);
>  
> -	if (pci->version >= 0x480A || (!pci->version &&
> -				       dw_pcie_iatu_unroll_enabled(pci))) {
> -		pci->iatu_unroll_enabled = true;
> +	pci->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pci);
> +	if (pci->iatu_unroll_enabled) {
>  		if (!pci->atu_base) {
>  			struct resource *res =
>  				platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu");
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-03-24 12:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24  1:25 [PATCH 00/12] PCI: dwc: Various fixes and cleanups Serge Semin
2022-03-24  1:25 ` [PATCH 01/12] PCI: dwc: Stop link in the host init error and de-initialization Serge Semin
2022-03-24  8:11   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 02/12] PCI: dwc: Don't use generic IO-ops for DBI-space access Serge Semin
2022-03-24  8:27   ` Manivannan Sadhasivam
2022-04-13 21:03     ` Serge Semin
2022-03-24  1:25 ` [PATCH 03/12] PCI: dwc: Add unroll iATU space support to the regions disable method Serge Semin
2022-03-24  8:59   ` Manivannan Sadhasivam
2022-03-28 21:34   ` kernel test robot
2022-03-28 21:34   ` kernel test robot
2022-03-24  1:25 ` [PATCH 04/12] PCI: dwc: Disable outbound windows for controllers with iATU Serge Semin
2022-03-24  9:05   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 05/12] PCI: dwc: Set INCREASE_REGION_SIZE flag based on limit address Serge Semin
2022-03-24 12:05   ` Manivannan Sadhasivam
2022-04-13 21:54     ` Serge Semin
2022-03-24  1:25 ` [PATCH 06/12] PCI: dwc: Add braces to the multi-line if-else statements Serge Semin
2022-03-24 12:13   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 07/12] PCI: dwc: Add trailing new-line literals to the log messages Serge Semin
2022-03-24 12:16   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 08/12] PCI: dwc: Discard IP-core version checking on unrolled iATU detection Serge Semin
2022-03-24 12:19   ` Manivannan Sadhasivam [this message]
2022-03-24  1:25 ` [PATCH 09/12] PCI: dwc: Convert Link-up status method to using dw_pcie_readl_dbi() Serge Semin
2022-03-24 12:20   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 10/12] PCI: dwc-plat: Simplify the probe method return value handling Serge Semin
2022-03-24 12:23   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 11/12] PCI: dwc-plat: Discard unused regmap pointer Serge Semin
2022-03-24 12:24   ` Manivannan Sadhasivam
2022-03-24  1:25 ` [PATCH 12/12] PCI: dwc-plat: Drop dw_plat_pcie_of_match forward declaration Serge Semin
2022-03-24 12:26   ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220324121905.GH2854@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Frank.Li@nxp.com \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=bhelgaas@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=jingoohan1@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.