* [PATCH] pci: ecm generic: use dev_read_() interface
@ 2023-02-18 12:25 Mayuresh Chitale
2023-02-20 16:21 ` Simon Glass
2023-05-03 20:34 ` Tom Rini
0 siblings, 2 replies; 6+ messages in thread
From: Mayuresh Chitale @ 2023-02-18 12:25 UTC (permalink / raw)
To: u-boot; +Cc: Mayuresh Chitale
Use dev_read_() api instead of the fdtdec API to fetch the host
controller's reg property value. This is similar to the other host
controller drivers such as Sifive, Rockchip etc. Without this change,
enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
machine. The issue is described in the link below:
Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
---
drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
index 1a9f9aec2e..f0effe0001 100644
--- a/drivers/pci/pcie_ecam_generic.c
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -132,19 +132,14 @@ static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
static int pci_generic_ecam_of_to_plat(struct udevice *dev)
{
struct generic_ecam_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",
- 0, ®_res);
- if (err < 0) {
- pr_err("\"reg\" resource not found\n");
- return err;
- }
-
- pcie->size = fdt_resource_size(®_res);
- pcie->cfg_base = map_physmem(reg_res.start, pcie->size, MAP_NOCACHE);
+ fdt_addr_t addr;
+ fdt_size_t size;
+
+ addr = dev_read_addr_size(dev, "reg", &size);
+ if (addr == FDT_ADDR_T_NONE)
+ return -EINVAL;
+ pcie->size = size;
+ pcie->cfg_base = map_physmem(addr, pcie->size, MAP_NOCACHE);
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: ecm generic: use dev_read_() interface
2023-02-18 12:25 [PATCH] pci: ecm generic: use dev_read_() interface Mayuresh Chitale
@ 2023-02-20 16:21 ` Simon Glass
2023-05-03 20:34 ` Tom Rini
1 sibling, 0 replies; 6+ messages in thread
From: Simon Glass @ 2023-02-20 16:21 UTC (permalink / raw)
To: Mayuresh Chitale; +Cc: u-boot
On Sat, 18 Feb 2023 at 05:25, Mayuresh Chitale
<mchitale@ventanamicro.com> wrote:
>
> Use dev_read_() api instead of the fdtdec API to fetch the host
> controller's reg property value. This is similar to the other host
> controller drivers such as Sifive, Rockchip etc. Without this change,
> enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
> machine. The issue is described in the link below:
>
> Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> ---
> drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: ecm generic: use dev_read_() interface
2023-02-18 12:25 [PATCH] pci: ecm generic: use dev_read_() interface Mayuresh Chitale
2023-02-20 16:21 ` Simon Glass
@ 2023-05-03 20:34 ` Tom Rini
2023-05-08 15:00 ` Mayuresh Chitale
1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2023-05-03 20:34 UTC (permalink / raw)
To: Mayuresh Chitale; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
On Sat, Feb 18, 2023 at 05:55:25PM +0530, Mayuresh Chitale wrote:
> Use dev_read_() api instead of the fdtdec API to fetch the host
> controller's reg property value. This is similar to the other host
> controller drivers such as Sifive, Rockchip etc. Without this change,
> enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
> machine. The issue is described in the link below:
>
> Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
> Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)
This breaks some platforms such as qemu_arm at a minimum.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: ecm generic: use dev_read_() interface
2023-05-03 20:34 ` Tom Rini
@ 2023-05-08 15:00 ` Mayuresh Chitale
2023-05-08 15:08 ` Tom Rini
0 siblings, 1 reply; 6+ messages in thread
From: Mayuresh Chitale @ 2023-05-08 15:00 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot
On Thu, May 4, 2023 at 2:04 AM Tom Rini <trini@konsulko.com> wrote:
>
> On Sat, Feb 18, 2023 at 05:55:25PM +0530, Mayuresh Chitale wrote:
>
> > Use dev_read_() api instead of the fdtdec API to fetch the host
> > controller's reg property value. This is similar to the other host
> > controller drivers such as Sifive, Rockchip etc. Without this change,
> > enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
> > machine. The issue is described in the link below:
> >
> > Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
> > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> > ---
> > drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
> > 1 file changed, 8 insertions(+), 13 deletions(-)
>
> This breaks some platforms such as qemu_arm at a minimum.
Ok. How do I reproduce the issue?
>
> --
> Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: ecm generic: use dev_read_() interface
2023-05-08 15:00 ` Mayuresh Chitale
@ 2023-05-08 15:08 ` Tom Rini
2023-11-10 11:50 ` Simon Glass
0 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2023-05-08 15:08 UTC (permalink / raw)
To: Mayuresh Chitale; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 1696 bytes --]
On Mon, May 08, 2023 at 08:30:15PM +0530, Mayuresh Chitale wrote:
> On Thu, May 4, 2023 at 2:04 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Feb 18, 2023 at 05:55:25PM +0530, Mayuresh Chitale wrote:
> >
> > > Use dev_read_() api instead of the fdtdec API to fetch the host
> > > controller's reg property value. This is similar to the other host
> > > controller drivers such as Sifive, Rockchip etc. Without this change,
> > > enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
> > > machine. The issue is described in the link below:
> > >
> > > Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
> > > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > ---
> > > drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
> > > 1 file changed, 8 insertions(+), 13 deletions(-)
> >
> > This breaks some platforms such as qemu_arm at a minimum.
>
> Ok. How do I reproduce the issue?
Right, sorry. So the failure log is:
https://source.denx.de/u-boot/u-boot/-/jobs/622397
And https://u-boot.readthedocs.io/en/latest/develop/py_testing.html
talks about running the pytest suite outside of CI and
https://u-boot.readthedocs.io/en/latest/develop/ci_testing.html about
how to trigger CI yourself. One thing that's not documented well enough
is that you'll likely want
https://source.denx.de/u-boot/u-boot-test-hooks as well as you can just
use as-is the "travis-ci" directories (legacy name, used by both gitlab
and azure as-is) as the configuration hooks for your system as well and
then the network tests will run easily, locally.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pci: ecm generic: use dev_read_() interface
2023-05-08 15:08 ` Tom Rini
@ 2023-11-10 11:50 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2023-11-10 11:50 UTC (permalink / raw)
To: Tom Rini; +Cc: Mayuresh Chitale, u-boot
Hi,
On Mon, 8 May 2023 at 09:08, Tom Rini <trini@konsulko.com> wrote:
>
> On Mon, May 08, 2023 at 08:30:15PM +0530, Mayuresh Chitale wrote:
> > On Thu, May 4, 2023 at 2:04 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sat, Feb 18, 2023 at 05:55:25PM +0530, Mayuresh Chitale wrote:
> > >
> > > > Use dev_read_() api instead of the fdtdec API to fetch the host
> > > > controller's reg property value. This is similar to the other host
> > > > controller drivers such as Sifive, Rockchip etc. Without this change,
> > > > enabling CONFIG_OF_LIVE breaks the PCIe enumeration on Qemu Risc-V virt
> > > > machine. The issue is described in the link below:
> > > >
> > > > Link: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
> > > > Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > ---
> > > > drivers/pci/pcie_ecam_generic.c | 21 ++++++++-------------
> > > > 1 file changed, 8 insertions(+), 13 deletions(-)
> > >
> > > This breaks some platforms such as qemu_arm at a minimum.
> >
> > Ok. How do I reproduce the issue?
>
> Right, sorry. So the failure log is:
> https://source.denx.de/u-boot/u-boot/-/jobs/622397
> And https://u-boot.readthedocs.io/en/latest/develop/py_testing.html
> talks about running the pytest suite outside of CI and
> https://u-boot.readthedocs.io/en/latest/develop/ci_testing.html about
> how to trigger CI yourself. One thing that's not documented well enough
> is that you'll likely want
> https://source.denx.de/u-boot/u-boot-test-hooks as well as you can just
> use as-is the "travis-ci" directories (legacy name, used by both gitlab
> and azure as-is) as the configuration hooks for your system as well and
> then the network tests will run easily, locally.
Any update on this one? It is:
https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/1
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-11-10 11:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18 12:25 [PATCH] pci: ecm generic: use dev_read_() interface Mayuresh Chitale
2023-02-20 16:21 ` Simon Glass
2023-05-03 20:34 ` Tom Rini
2023-05-08 15:00 ` Mayuresh Chitale
2023-05-08 15:08 ` Tom Rini
2023-11-10 11:50 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox