[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)

Stefan Roese sr at denx.de
Tue Jul 8 11:27:30 CEST 2008


Hi Nobuhiro,

On Tuesday 08 July 2008, Nobuhiro Iwamatsu wrote:
> > 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.

Right, this is a problem.

> 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.)

Yes, switching to this class-ID check would be probably "cleaner". The main 
problem I see with this is, that we could break backward compatibility. I 
really don't know if all boards currently using this "Host-Bridge-Skipping" 
implementation have the class-ID set to 0x0680 (Other bridge type).

So I suggest the following solution: I'll prepare a patch to move 
this "Skip-device-check" into a separate weak function with the current 
behavior. You (and others) can then define a custom "Skip-device-check" 
function in your platform code that overrides this default function.

I'll send this patch to the list in a short while. Please try it out and let 
me know if this works for you.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================




More information about the U-Boot mailing list