[PATCH] Fix ucc_geth MII master selection
Joakim Tjernlund
joakim.tjernlund at transmode.se
Fri Feb 15 21:09:59 EST 2008
On Thu, 2008-02-14 at 18:11 +0100, Joakim Tjernlund wrote:
> Remove bogus UCC regs range test and correct
> off by one error in call to ucc_set_qe_mux_mii_mng()
>
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund at transmode.se>
> ---
>
> I am not 100% sure this is the correct fix, please ACK or NACK
>
> drivers/net/ucc_geth_mii.c | 26 +++++++++++---------------
> 1 files changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
> index 6c257b8..472d5a1 100644
> --- a/drivers/net/ucc_geth_mii.c
> +++ b/drivers/net/ucc_geth_mii.c
> @@ -200,21 +200,17 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
> if (err)
> goto bus_register_fail;
>
> - /* if our mdio regs fall within this UCC regs range */
> - if ((res.start >= tempres.start) &&
> - (res.end <= tempres.end)) {
> - /* set this UCC to be the MII master */
> - const u32 *id = of_get_property(tempnp, "device-id", NULL);
> - if (id == NULL)
> - goto bus_register_fail;
> -
> - ucc_set_qe_mux_mii_mng(*id - 1);
> -
> - /* assign the TBI an address which won't
> - * conflict with the PHYs */
> - out_be32(®s->utbipar, UTBIPAR_INIT_TBIPA);
> - break;
> - }
> + /* set this UCC to be the MII master */
> + const u32 *id = of_get_property(tempnp, "device-id", NULL);
> + if (id == NULL)
> + goto bus_register_fail;
> +
> + ucc_set_qe_mux_mii_mng(*id);
> +
> + /* assign the TBI an address which won't
> + * conflict with the PHYs */
> + out_be32(®s->utbipar, UTBIPAR_INIT_TBIPA);
> + break;
> }
>
> err = mdiobus_register(new_bus);
This patch is crap, turns out that ucc_set_qe_mux_mii_mng(2) always
works even if UCC3 isn't used at all. I can't figured out why not 1
or 3 works.
Jocke
More information about the Linuxppc-dev
mailing list