On Thu, Mar 23, 2017 at 12:02 PM, Stefan Roese <[email protected]> wrote:
> This patch adds the GoP (Group of Ports) and NetC (Net Complex) setup to
> the Marvell mvpp2 ethernet driver. This code is mostly copied from the
> Marvell U-Boot version and was written by Stefan Chulski. Please
> note that only RGMII and SGMII support have been added, as these are
> the only interfaces that this code has been tested with.
>
> Signed-off-by: Stefan Roese <[email protected]>
> Cc: Stefan Chulski <[email protected]>
> Cc: Kostya Porotchkin <[email protected]>
> Cc: Nadav Haklai <[email protected]>
> Cc: Joe Hershberger <[email protected]>
>
> ---
>
> Changes in v2:
> - New patch
>
> drivers/net/mvpp2.c | 766
> +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 758 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
> index 6f9a4137f8..76370faff0 100644
> --- a/drivers/net/mvpp2.c
> +++ b/drivers/net/mvpp2.c
<snip>
> @@ -2833,6 +2986,570 @@ static inline void mvpp2_gmac_max_rx_size_set(struct
> mvpp2_port *port)
> writel(val, port->base + MVPP2_GMAC_CTRL_0_REG);
> }
>
> +/* PPv2.2 GoP/GMAC config */
> +
> +/* Set the MAC to reset or exit from reset */
> +static int gop_gmac_reset(struct mvpp2_port *port, enum mv_reset reset)
Is this copied from somewhere? The enum parameter seems unnecessary.
Why not just int for type?
> +{
> + u32 val;
> +
> + /* read - modify - write */
> + val = readl(port->base + MVPP2_GMAC_CTRL_2_REG);
> + if (reset == RESET)
> + val |= MVPP2_GMAC_PORT_RESET_MASK;
> + else
> + val &= ~MVPP2_GMAC_PORT_RESET_MASK;
> + writel(val, port->base + MVPP2_GMAC_CTRL_2_REG);
> +
> + return 0;
> +}
> +
> +/*
> + * gop_gpcs_mode_cfg
> + *
> + * Configure port to working with Gig PCS or don't.
> + */
> +static int gop_gpcs_mode_cfg(struct mvpp2_port *port, bool en)
Similar here. Copied? Do we really use "bool" in U-Boot much? I care
less about this one that the enum above, though.
> +{
> + u32 val;
> +
> + val = readl(port->base + MVPP2_GMAC_CTRL_2_REG);
> + if (en)
> + val |= MVPP2_GMAC_PCS_ENABLE_MASK;
> + else
> + val &= ~MVPP2_GMAC_PCS_ENABLE_MASK;
> + /* enable / disable PCS on this port */
> + writel(val, port->base + MVPP2_GMAC_CTRL_2_REG);
> +
> + return 0;
> +}
<snip>
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot