[PATCH v2.6.26] powerpc: Add 8568 PHY workarounds to board code
Olof Johansson
olof at lixom.net
Sat May 3 09:49:29 EST 2008
Hi,
On Fri, May 02, 2008 at 01:03:42PM -0500, Andy Fleming wrote:
> +static int __init board_fixups(void)
> +{
> + char phy_id[BUS_ID_SIZE];
> + char *compstrs[2] = {"fsl,gianfar-mdio", "fsl,ucc-mdio"};
> + struct device_node *mdio;
> + struct resource res;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(compstrs); i++) {
> + mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
> +
> + of_address_to_resource(mdio, 0, &res);
> + snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
> +
> + phy_register_fixup_for_id(phy_id, mpc8568_fixup_125_clock);
> + phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
> +
> + /* Register a workaround for errata */
> + snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 7);
> + phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
> +
> + of_node_put(mdio);
> + }
> +
> + return 0;
> +}
> +arch_initcall(board_fixups);
Are you sure you want to run this workaround on all boards that happen
to be built-in? I.e. shouldn't you be checked for what board you are
running on, since the compatible strings you match on seem generic?
-Olof
More information about the Linuxppc-dev
mailing list