Hi Joe,

On 25.03.2017 21:05, Joe Hershberger wrote:
On Thu, Mar 23, 2017 at 12:02 PM, Stefan Roese <s...@denx.de> 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 <s...@denx.de>
Cc: Stefan Chulski <stef...@marvell.com>
Cc: Kostya Porotchkin <kos...@marvell.com>
Cc: Nadav Haklai <nad...@marvell.com>
Cc: Joe Hershberger <joe.hershber...@ni.com>

---

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?

Yes, its copied from the original Marvell sources. And yes, I also
am not fond of this additional enum (just forgot to get rid of it
actually). I'll change it int instead.

+{
+       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.

Also copied, yes. "bool" is probably not used that much in U-Boot,
even though somewhat in this Linux driver. I'll move to int though
with these parameters.

Thanks,
Stefan
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to