public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Mayuresh Chitale <mchitale@ventanamicro.com>,
	Bo Gan <ganboing@gmail.com>, Puhan Zhou <puh4n.zhou@gmail.com>,
	Eugen Hristev <eugen.hristev@collabora.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Jonas Karlman <jonas@kwiboo.se>,
	Valentin Caron <valentin.caron@foss.st.com>,
	Shengyu Qu <wiagn233@outlook.com>
Cc: u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH] pci: xilinx: Enable MMIO region
Date: Thu, 2 Nov 2023 10:13:26 +0100	[thread overview]
Message-ID: <5883967a-5591-45ef-99bc-12478573d21d@amd.com> (raw)
In-Reply-To: <20231102082303.354944-4-mchitale@ventanamicro.com>



On 11/2/23 09:23, Mayuresh Chitale wrote:
> 
> The host bridge MMIO region is disabled by default due to which MMIO
> accesses cause an exception. Fix it by setting the bridge enable bit.
> This change is ported from the linux pcie-xilinx driver.
> 
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> ---
>   drivers/pci/pcie_xilinx.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
> index 20b630027f..d1fbd40175 100644
> --- a/drivers/pci/pcie_xilinx.c
> +++ b/drivers/pci/pcie_xilinx.c
> @@ -25,6 +25,8 @@ struct xilinx_pcie {
>   /* Register definitions */
>   #define XILINX_PCIE_REG_PSCR		0x144
>   #define XILINX_PCIE_REG_PSCR_LNKUP	BIT(11)
> +#define XILINX_PCIE_REG_RPSC		0x148
> +#define XILINX_PCIE_REG_RPSC_BEN	BIT(0)
>   
>   /**
>    * pcie_xilinx_link_up() - Check whether the PCIe link is up
> @@ -142,6 +144,7 @@ static int pcie_xilinx_of_to_plat(struct udevice *dev)
>   	struct xilinx_pcie *pcie = dev_get_priv(dev);
>   	fdt_addr_t addr;
>   	fdt_size_t size;
> +	u32 rpsc;
>   
>   	addr = dev_read_addr_size(dev, &size);
>   	if (addr == FDT_ADDR_T_NONE)
> @@ -149,6 +152,11 @@ static int pcie_xilinx_of_to_plat(struct udevice *dev)
>   
>   	pcie->cfg_base = map_physmem(addr, size, MAP_NOCACHE);
>   
> +	/* Enable the Bridge enable bit */
> +	rpsc = __raw_readl(pcie->cfg_base + XILINX_PCIE_REG_RPSC);
> +	rpsc |= XILINX_PCIE_REG_RPSC_BEN;
> +	__raw_writel(rpsc, pcie->cfg_base + XILINX_PCIE_REG_RPSC);
> +
>   	return 0;
>   }
>   

This looks good but depends on previous patch in this series that's why
Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

  reply	other threads:[~2023-11-02  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  8:23 [PATCH] drivers: pcie_xilinx: Fix "reg" not found error Mayuresh Chitale
2023-11-02  8:23 ` [PATCH] drivers: xilinx_spi: Fixes for MMC_SPI Mayuresh Chitale
2023-11-02  8:37   ` Michal Simek
2023-11-11 13:21     ` mchitale
2023-11-02  8:23 ` [PATCH] net: axi_emac: Use reg property for DMA registers Mayuresh Chitale
2023-11-02  9:15   ` Michal Simek
2023-11-11 13:23     ` mchitale
2023-11-02  8:23 ` [PATCH] pci: xilinx: Enable MMIO region Mayuresh Chitale
2023-11-02  9:13   ` Michal Simek [this message]
2023-11-02  9:05 ` [PATCH] drivers: pcie_xilinx: Fix "reg" not found error Michal Simek
2023-11-11 13:25   ` mchitale

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=5883967a-5591-45ef-99bc-12478573d21d@amd.com \
    --to=michal.simek@amd.com \
    --cc=eugen.hristev@collabora.com \
    --cc=ganboing@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=mchitale@ventanamicro.com \
    --cc=puh4n.zhou@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=valentin.caron@foss.st.com \
    --cc=wiagn233@outlook.com \
    --cc=xypron.glpk@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox