[U-Boot-Users] [PATCH][RFC] pci: Add check PCI bridge class (Re: [PATCH][RFC] pci: Remove CONFIG_PCI_SKIP_HOST_BRIDGE and Add check PCI class of host bridge)

Nobuhiro Iwamatsu iwamatsu at nigauri.org
Tue Jul 8 08:51:54 CEST 2008


Hi, Stefan.

2008/7/7 Stefan Roese <sr at denx.de>:
- 引用テキストを表示しない -
> Hi Nobuhiro,
>
> sorry about the late reply.
>
> On Tuesday 17 June 2008, Nobuhiro Iwamatsu wrote:
>> In current source code, when the device number of PCI is 0, process PCI
>> bridge without fail. However, when the device number is 0, it is not PCI
>> always bridge. There are times when device of PCI allocates.
>>
>> This patch add check PCI bridge class.
>>
>>   - 0x0604 PCI to AGP bridge / PCI to PCI bridge
>>   - 0x0605 PCI to PCMCIA bridge
>>   - 0x0606 Nu Bus bridge
>>   - 0x0607 PCMCIA CardBus controller
>>   - 0x0608 RACEWay bridge
>
> I now finally took the time to take a closer look at this issue. Your approach
> doesn't look "clean" to me. To be honsest, the original code isn't "clean"
> either. But with your addition it really get confusing. At least for me.
>
> So let me summarize what the current code (without your patch) does and
> perhaps you could write again what exactly you want to fix/change. And please
> correct me if I am wrong.
>
> Currently, the configuration of the PCI device at BDF == 0,0,0 will be skipped
> if:
>
> a) CONFIG_PCI_CONFIG_HOST_BRIDGE is not defined
>
> or
>
> b) CONFIG_PCI_CONFIG_HOST_BRIDGE is defined but the env variable
>   "pciconfighost" is not defined
>
> So this PCI device will get configured if:
>
> c) CONFIG_PCI_CONFIG_HOST_BRIDGE is defined and the env variable
>   "pciconfighost" is defined too
>
> If I understand you correctly, then you have some PCI devices at BDF == 0,0,0
> that need to be configured (and not skipped). Correct? If this is correct,
> wouldn't it be enough for you to use "solution" c) from above?
>
Yes, Your indication is right. And there was the part which I did not
understand.
But, I think that there is still a problem only by these measures.

For example, BDF == 0,0,0 are not displayed when I validated
CONFIG_PCI_SCAN_SHOW.

475 #ifdef CONFIG_PCI_SCAN_SHOW
476             /* Skip our host bridge */
477             if ( dev != PCI_BDF(hose->first_busno,0,0) ) {
478                 unsigned char int_line;
479
480                 pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_LINE,
481                               &int_line);
482                 printf("        %02x  %02x  %04x  %04x  %04x  %02x\n",
483                    PCI_BUS(dev), PCI_DEV(dev), vendor, device, class,
484                    int_line);
485             }
486 #endif

I think that it is a problem to handle only  "BDF == 0,0,0".
I think that I had better check it in Class ID.
(Of cource, I understand that my implementation is mean.)

> If this is not the case, then please explain again exactly what you need to
> achieve.

Best regards,
 Nobuhiro




More information about the U-Boot mailing list