[U-Boot] [PATCH] Add support for KSZ8895 switch

Christian Gmeiner christian.gmeiner at gmail.com
Mon Aug 19 20:35:56 CEST 2013


Am 12.08.2013 16:48 schrieb "Christian Gmeiner" <christian.gmeiner at gmail.com
>:
>
> This patch adds a dump phy driver for the KSZ8895 switch from
> Micrel. As the SoC MAC is directly connected to switch no
> autonegotiation is needed as the link is always up.
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  drivers/net/phy/micrel.c |   31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
>
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index aa9cbcf..76d6846 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -36,6 +36,36 @@ static struct phy_driver KSZ804_driver = {
>         .shutdown = &genphy_shutdown,
>  };
>
> +/**
> + * KSZ8895
> + */
> +
> +int ksz8895_config(struct phy_device *phydev)
> +{
> +       /* we are connected directly to the switch without
> +        * dedicated PHY. SCONF1 == 001 */
> +       phydev->link = 1;
> +       phydev->duplex = DUPLEX_FULL;
> +       phydev->speed = SPEED_100;
> +
> +       return 0;
> +}
> +
> +static int ksz8895_startup(struct phy_device *phydev)
> +{
> +       return 0;
> +}
> +
> +static struct phy_driver ksz8895_driver = {
> +       .name = "Micrel KSZ8895/KSZ8864",
> +       .uid  = 0x221450,
> +       .mask = 0xffffe1,
> +       .features = PHY_BASIC_FEATURES,
> +       .config   = &ksz8895_config,
> +       .startup  = &ksz8895_startup,
> +       .shutdown = &genphy_shutdown,
> +};
> +
>  #ifndef CONFIG_PHY_MICREL_KSZ9021
>  /*
>   * I can't believe Micrel used the exact same part number
> @@ -204,5 +234,6 @@ int phy_micrel_init(void)
>         phy_register(&KS8721_driver);
>  #endif
>         phy_register(&ksz9031_driver);
> +       phy_register(&ksz8895_driver);
>         return 0;
>  }
> --
> 1.7.10.4
>

Any comments?


More information about the U-Boot mailing list