[PATCH 1/4] [POWERPC] 85xx: add board support for the TQM8548 modules

Arnd Bergmann arnd at arndb.de
Fri May 30 18:24:18 EST 2008


On Friday 30 May 2008, Wolfgang Grandegger wrote:
> 
>  #ifdef CONFIG_PCI
> -       for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
> -               fsl_add_bridge(np, 1);
> +       for_each_node_by_type(np, "pci") {
> +               if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
> +                   of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
> +                       struct resource rsrc;
> +                       of_address_to_resource(np, 0, &rsrc);
> +                       if ((rsrc.start & 0xfffff) == 0x8000)
> +                               fsl_add_bridge(np, 1);
> +                       else
> +                               fsl_add_bridge(np, 0);
> +               }
> +       }
>  #endif

This looks like a very wrong to figure out what is a primary bridge.
I do realize that you copied it from other places, but that doesn't
make it better.
Can't we change fsl_add_bridge to figure this out automatically?
A much better heuristic should be to make a bridge primary if
it has an "ISA" child bus. Does that work for all existing systems?

	Arnd <><


More information about the Linuxppc-dev mailing list