From: mchitale@ventanamicro.com
To: Michal Simek <michal.simek@amd.com>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Puhan Zhou <puh4n.zhou@gmail.com>,
Thierry Reding <treding@nvidia.com>,
Alexander Dahl <ada@thorsis.com>, Jonas Karlman <jonas@kwiboo.se>,
Svyatoslav Ryhel <clamor95@gmail.com>,
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] drivers: pcie_xilinx: Fix "reg" not found error
Date: Sat, 11 Nov 2023 18:55:19 +0530 [thread overview]
Message-ID: <01b9c3f4c63cb26a05ef003738b33efca507140a.camel@ventanamicro.com> (raw)
In-Reply-To: <17a0048c-bdaa-4c82-8b51-b193bf14abf5@amd.com>
Hi Michal,
On Thu, 2023-11-02 at 10:05 +0100, Michal Simek wrote:
>
> On 11/2/23 09:23, Mayuresh Chitale wrote:
> > Fix the driver to use the dev_read_addr_size API to fetch the reg
> > property from the DT.
> >
> > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > ---
> > drivers/pci/pcie_xilinx.c | 22 ++++++++--------------
> > 1 file changed, 8 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
> > index 53fd121e90..20b630027f 100644
> > --- a/drivers/pci/pcie_xilinx.c
> > +++ b/drivers/pci/pcie_xilinx.c
> > @@ -140,20 +140,14 @@ static int pcie_xilinx_write_config(struct
> > udevice *bus, pci_dev_t bdf,
> > static int pcie_xilinx_of_to_plat(struct udevice *dev)
> > {
> > struct xilinx_pcie *pcie = dev_get_priv(dev);
> > - struct fdt_resource reg_res;
> > - DECLARE_GLOBAL_DATA_PTR;
> > - int err;
> > -
> > - err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
>
> I don't have HW to test this but here you are removing reference to
> GD that's
> why I think you should also remove
>
> #include <asm/global_data.h>
Ok.
>
>
>
>
> > - 0, ®_res);
> > - if (err < 0) {
> > - pr_err("\"reg\" resource not found\n");
> > - return err;
> > - }
> > -
> > - pcie->cfg_base = map_physmem(reg_res.start,
> > - fdt_resource_size(®_res),
> > - MAP_NOCACHE);
> > + fdt_addr_t addr;
> > + fdt_size_t size;
> > +
> > + addr = dev_read_addr_size(dev, &size);
> > + if (addr == FDT_ADDR_T_NONE)
> > + return -EINVAL;
> > +
> > + pcie->cfg_base = map_physmem(addr, size, MAP_NOCACHE);
>
> Definitely it is better then what was there before.
>
> But can't use use devm_ioremap() instead?
Ok.
>
> Thanks,
> Michal
prev parent reply other threads:[~2023-11-11 13:25 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
2023-11-02 9:05 ` [PATCH] drivers: pcie_xilinx: Fix "reg" not found error Michal Simek
2023-11-11 13:25 ` mchitale [this message]
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=01b9c3f4c63cb26a05ef003738b33efca507140a.camel@ventanamicro.com \
--to=mchitale@ventanamicro.com \
--cc=ada@thorsis.com \
--cc=clamor95@gmail.com \
--cc=jonas@kwiboo.se \
--cc=michal.simek@amd.com \
--cc=patrice.chotard@foss.st.com \
--cc=puh4n.zhou@gmail.com \
--cc=sjg@chromium.org \
--cc=treding@nvidia.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=valentin.caron@foss.st.com \
--cc=wiagn233@outlook.com \
/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