* [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI
@ 2016-01-28 7:15 Gong Qianyu
2016-01-28 7:29 ` Bin Meng
0 siblings, 1 reply; 5+ messages in thread
From: Gong Qianyu @ 2016-01-28 7:15 UTC (permalink / raw)
To: u-boot
From: Mingkai Hu <Mingkai.Hu@freescale.com>
Referring to 'commit ff3e077bd23c ("dm: pci: Add a uclass for PCI")'.
For legacy PCIe driver, it needs loop to read the vender_id from
devie 0 to devie 255 to check if there is device available.
Reading non-existen device will trigger the "Cannot read bus
configuration: -1" information.
Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
---
common/cmd_pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 4e0951f..d94f90d 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -324,7 +324,9 @@ void pciinfo(int bus_num, int short_pci_listing)
unsigned char header_type;
unsigned short vendor_id;
pci_dev_t dev;
+#ifdef CONFIG_DM_PCI
int ret;
+#endif
if (!hose)
return;
@@ -348,10 +350,14 @@ void pciinfo(int bus_num, int short_pci_listing)
if (pci_skip_dev(hose, dev))
continue;
+#ifdef CONFIG_DM_PCI
ret = pci_read_config_word(dev, PCI_VENDOR_ID,
&vendor_id);
if (ret)
goto error;
+#else
+ pci_read_config_word(dev, PCI_VENDOR_ID, &vendor_id);
+#endif
if ((vendor_id == 0xFFFF) || (vendor_id == 0x0000))
continue;
@@ -373,8 +379,10 @@ void pciinfo(int bus_num, int short_pci_listing)
}
return;
+#ifdef CONFIG_DM_PCI
error:
printf("Cannot read bus configuration: %d\n", ret);
+#endif
}
#endif
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI
2016-01-28 7:15 [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI Gong Qianyu
@ 2016-01-28 7:29 ` Bin Meng
2016-01-28 7:43 ` Qianyu Gong
0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2016-01-28 7:29 UTC (permalink / raw)
To: u-boot
On Thu, Jan 28, 2016 at 3:15 PM, Gong Qianyu <Qianyu.Gong@nxp.com> wrote:
> From: Mingkai Hu <Mingkai.Hu@freescale.com>
>
> Referring to 'commit ff3e077bd23c ("dm: pci: Add a uclass for PCI")'.
>
> For legacy PCIe driver, it needs loop to read the vender_id from
> devie 0 to devie 255 to check if there is device available.
> Reading non-existen device will trigger the "Cannot read bus
> configuration: -1" information.
>
> Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
> ---
Which pci controller are you testing?
[snip]
Regards,
Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI
2016-01-28 7:29 ` Bin Meng
@ 2016-01-28 7:43 ` Qianyu Gong
2016-01-28 8:02 ` Bin Meng
0 siblings, 1 reply; 5+ messages in thread
From: Qianyu Gong @ 2016-01-28 7:43 UTC (permalink / raw)
To: u-boot
Hi,
> -----Original Message-----
> From: Bin Meng [mailto:bmeng.cn at gmail.com]
> Sent: Thursday, January 28, 2016 3:30 PM
> To: Qianyu Gong <qianyu.gong@nxp.com>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>
> Subject: Re: [U-Boot] [PATCH] pci: gate print info of reading vender id with
> CONFIG_DM_PCI
>
> On Thu, Jan 28, 2016 at 3:15 PM, Gong Qianyu <Qianyu.Gong@nxp.com> wrote:
> > From: Mingkai Hu <Mingkai.Hu@freescale.com>
> >
> > Referring to 'commit ff3e077bd23c ("dm: pci: Add a uclass for PCI")'.
> >
> > For legacy PCIe driver, it needs loop to read the vender_id from devie
> > 0 to devie 255 to check if there is device available.
> > Reading non-existen device will trigger the "Cannot read bus
> > configuration: -1" information.
> >
> > Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> > Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
> > ---
>
> Which pci controller are you testing?
>
> [snip]
>
> Regards,
> Bin
Designware PCIe controller on LS2085A.
Regards,
Qianyu
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI
2016-01-28 7:43 ` Qianyu Gong
@ 2016-01-28 8:02 ` Bin Meng
2016-01-28 8:55 ` Qianyu Gong
0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2016-01-28 8:02 UTC (permalink / raw)
To: u-boot
On Thu, Jan 28, 2016 at 3:43 PM, Qianyu Gong <qianyu.gong@nxp.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: Bin Meng [mailto:bmeng.cn at gmail.com]
>> Sent: Thursday, January 28, 2016 3:30 PM
>> To: Qianyu Gong <qianyu.gong@nxp.com>
>> Cc: U-Boot Mailing List <u-boot@lists.denx.de>
>> Subject: Re: [U-Boot] [PATCH] pci: gate print info of reading vender id with
>> CONFIG_DM_PCI
>>
>> On Thu, Jan 28, 2016 at 3:15 PM, Gong Qianyu <Qianyu.Gong@nxp.com> wrote:
>> > From: Mingkai Hu <Mingkai.Hu@freescale.com>
>> >
>> > Referring to 'commit ff3e077bd23c ("dm: pci: Add a uclass for PCI")'.
>> >
>> > For legacy PCIe driver, it needs loop to read the vender_id from devie
>> > 0 to devie 255 to check if there is device available.
>> > Reading non-existen device will trigger the "Cannot read bus
>> > configuration: -1" information.
>> >
>> > Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
>> > Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
>> > ---
>>
>> Which pci controller are you testing?
>>
>> [snip]
>>
>> Regards,
>> Bin
>
> Designware PCIe controller on LS2085A.
>
Please check commit 7ba34ff09f1ef105521f914e4ad4e4ac19975bac "pci:
layerscape: Adjust the return value when ls_pcie_addr_valid() fails"
which is already in mainline.
Regards,
Bin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI
2016-01-28 8:02 ` Bin Meng
@ 2016-01-28 8:55 ` Qianyu Gong
0 siblings, 0 replies; 5+ messages in thread
From: Qianyu Gong @ 2016-01-28 8:55 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Bin Meng [mailto:bmeng.cn at gmail.com]
> Sent: Thursday, January 28, 2016 4:02 PM
> To: Qianyu Gong <qianyu.gong@nxp.com>
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH] pci: gate print info of reading vender id with
> CONFIG_DM_PCI
>
> On Thu, Jan 28, 2016 at 3:43 PM, Qianyu Gong <qianyu.gong@nxp.com> wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Bin Meng [mailto:bmeng.cn at gmail.com]
> >> Sent: Thursday, January 28, 2016 3:30 PM
> >> To: Qianyu Gong <qianyu.gong@nxp.com>
> >> Cc: U-Boot Mailing List <u-boot@lists.denx.de>
> >> Subject: Re: [U-Boot] [PATCH] pci: gate print info of reading vender
> >> id with CONFIG_DM_PCI
> >>
> >> On Thu, Jan 28, 2016 at 3:15 PM, Gong Qianyu <Qianyu.Gong@nxp.com> wrote:
> >> > From: Mingkai Hu <Mingkai.Hu@freescale.com>
> >> >
> >> > Referring to 'commit ff3e077bd23c ("dm: pci: Add a uclass for PCI")'.
> >> >
> >> > For legacy PCIe driver, it needs loop to read the vender_id from
> >> > devie
> >> > 0 to devie 255 to check if there is device available.
> >> > Reading non-existen device will trigger the "Cannot read bus
> >> > configuration: -1" information.
> >> >
> >> > Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
> >> > Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
> >> > ---
> >>
> >> Which pci controller are you testing?
> >>
> >> [snip]
> >>
> >> Regards,
> >> Bin
> >
> > Designware PCIe controller on LS2085A.
> >
>
> Please check commit 7ba34ff09f1ef105521f914e4ad4e4ac19975bac "pci:
> layerscape: Adjust the return value when ls_pcie_addr_valid() fails"
> which is already in mainline.
>
> Regards,
> Bin
Ok. That's nice of you.
And we also find another commit cab24b3407189a12 "dm: pci: Convert 'pci'
command to driver model" submitted by Simon has fixed the issue. So no
need of this patch.
Thanks a lot.
Regards,
Qianyu
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-28 8:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 7:15 [U-Boot] [PATCH] pci: gate print info of reading vender id with CONFIG_DM_PCI Gong Qianyu
2016-01-28 7:29 ` Bin Meng
2016-01-28 7:43 ` Qianyu Gong
2016-01-28 8:02 ` Bin Meng
2016-01-28 8:55 ` Qianyu Gong
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.