All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR)
@ 2017-04-06 13:39 Stefan Roese
  2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
  2017-05-31  8:56 ` [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Roese @ 2017-04-06 13:39 UTC (permalink / raw)
  To: u-boot

This patch enables the mvpp2 port 0 usage on the Armada 7k DB by setting
the correct PHY type (KR / SFI) for the COMPHY driver and enabling the
ethernet0 device node in the dts.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Stefan Chulski <stefanc@marvell.com>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Nadav Haklai <nadavh@marvell.com>
---
 arch/arm/dts/armada-7040-db.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/armada-7040-db.dts b/arch/arm/dts/armada-7040-db.dts
index 84e0dbdc3d..54b888ac22 100644
--- a/arch/arm/dts/armada-7040-db.dts
+++ b/arch/arm/dts/armada-7040-db.dts
@@ -168,8 +168,7 @@
 	};
 
 	phy2 {
-		phy-type = <PHY_TYPE_SGMII0>;
-		phy-speed = <PHY_SPEED_1_25G>;
+		phy-type = <PHY_TYPE_KR>;
 	};
 
 	phy3 {
@@ -223,6 +222,11 @@
 	status = "okay";
 };
 
+&cpm_eth0 {
+	status = "okay";
+	phy-mode = "sfi"; /* lane-2 */
+};
+
 &cpm_eth1 {
 	status = "okay";
 	phy = <&phy0>;
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI)
  2017-04-06 13:39 [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese
@ 2017-04-06 13:39 ` Stefan Roese
  2017-04-19  5:46   ` Stefan Roese
                     ` (2 more replies)
  2017-05-31  8:56 ` [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese
  1 sibling, 3 replies; 7+ messages in thread
From: Stefan Roese @ 2017-04-06 13:39 UTC (permalink / raw)
  To: u-boot

From: Stefan Chulski <stefanc@marvell.com>

This patch fixes some remaining issues in the mvpp2 driver for the 10GB
support on port 0. These changes are:

- Incorrect PCS configuration
- Skip PHY configuration when no PHY is connected
- Skip GMAC configurations if 10G SFI mode set

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Kostya Porotchkin <kostap@marvell.com>
Cc: Nadav Haklai <nadavh@marvell.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/mvpp2.c | 55 ++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 8ffe6c84d4..8fbff9f7b0 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -442,7 +442,7 @@ do {									\
 /* MPCS registers */
 
 #define PCS40G_COMMON_CONTROL			0x14
-#define      FORWARD_ERROR_CORRECTION_MASK	BIT(1)
+#define      FORWARD_ERROR_CORRECTION_MASK	BIT(10)
 
 #define PCS_CLOCK_RESET				0x14c
 #define      TX_SD_CLK_RESET_MASK		BIT(0)
@@ -3244,7 +3244,7 @@ static int gop_xpcs_mode(struct mvpp2_port *port, int num_of_lanes)
 
 	/* configure XG MAC mode */
 	val = readl(port->priv->xpcs_base + MVPP22_XPCS_GLOBAL_CFG_0_REG);
-	val &= ~MVPP22_XPCS_PCSMODE_OFFS;
+	val &= ~MVPP22_XPCS_PCSMODE_MASK;
 	val &= ~MVPP22_XPCS_LANEACTIVE_MASK;
 	val |= (2 * lane) << MVPP22_XPCS_LANEACTIVE_OFFS;
 	writel(val, port->priv->xpcs_base + MVPP22_XPCS_GLOBAL_CFG_0_REG);
@@ -4472,7 +4472,15 @@ static int mvpp2_rx_refill(struct mvpp2_port *port,
 /* Set hw internals when starting port */
 static void mvpp2_start_dev(struct mvpp2_port *port)
 {
-	mvpp2_gmac_max_rx_size_set(port);
+	switch (port->phy_interface) {
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_RGMII_ID:
+	case PHY_INTERFACE_MODE_SGMII:
+		mvpp2_gmac_max_rx_size_set(port);
+	default:
+		break;
+	}
+
 	mvpp2_txp_max_tx_size_set(port);
 
 	if (port->priv->hw_version == MVPP21)
@@ -4567,11 +4575,16 @@ static int mvpp2_open(struct udevice *dev, struct mvpp2_port *port)
 		return err;
 	}
 
-	err = mvpp2_phy_connect(dev, port);
-	if (err < 0)
-		return err;
+	if (port->phy_node) {
+		err = mvpp2_phy_connect(dev, port);
+		if (err < 0)
+			return err;
 
-	mvpp2_link_event(port);
+		mvpp2_link_event(port);
+	} else {
+		mvpp2_egress_enable(port);
+		mvpp2_ingress_enable(port);
+	}
 
 	mvpp2_start_dev(port);
 
@@ -4716,13 +4729,19 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
 	const char *phy_mode_str;
 	int phy_node;
 	u32 id;
-	u32 phyaddr;
+	u32 phyaddr = 0;
 	int phy_mode = -1;
 
 	phy_node = fdtdec_lookup_phandle(gd->fdt_blob, port_node, "phy");
-	if (phy_node < 0) {
-		dev_err(&pdev->dev, "missing phy\n");
-		return -ENODEV;
+
+	if (phy_node > 0) {
+		phyaddr = fdtdec_get_int(gd->fdt_blob, phy_node, "reg", 0);
+		if (phyaddr < 0) {
+			dev_err(&pdev->dev, "could not find phy address\n");
+			return -1;
+		}
+	} else {
+		phy_node = 0;
 	}
 
 	phy_mode_str = fdt_getprop(gd->fdt_blob, port_node, "phy-mode", NULL);
@@ -4748,8 +4767,6 @@ static int phy_info_parse(struct udevice *dev, struct mvpp2_port *port)
 	port->phy_speed = fdtdec_get_int(gd->fdt_blob, port_node,
 					 "phy-speed", 1000);
 
-	phyaddr = fdtdec_get_int(gd->fdt_blob, phy_node, "reg", 0);
-
 	port->id = id;
 	if (port->priv->hw_version == MVPP21)
 		port->first_rxq = port->id * rxq_number;
@@ -5309,7 +5326,14 @@ static int mvpp2_start(struct udevice *dev)
 	/* Reconfigure parser accept the original MAC address */
 	mvpp2_prs_update_mac_da(port, port->dev_addr);
 
-	mvpp2_port_power_up(port);
+	switch (port->phy_interface) {
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_RGMII_ID:
+	case PHY_INTERFACE_MODE_SGMII:
+		mvpp2_port_power_up(port);
+	default:
+		break;
+	}
 
 	mvpp2_open(dev, port);
 
@@ -5472,7 +5496,8 @@ static int mvpp2_probe(struct udevice *dev)
 			port->gop_id * MVPP22_PORT_OFFSET;
 
 		/* Set phy address of the port */
-		mvpp22_smi_phy_addr_cfg(port);
+		if(port->phy_node)
+			mvpp22_smi_phy_addr_cfg(port);
 
 		/* GoP Init */
 		gop_port_init(port);
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI)
  2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
@ 2017-04-19  5:46   ` Stefan Roese
       [not found]     ` <CANr=Z=bqcPQKDZGsadpWOtkKpWd1cUaj15wd0WCogaUWaCK67A@mail.gmail.com>
  2017-05-30 20:40   ` Joe Hershberger
  2017-06-02 19:48   ` [U-Boot] " Joe Hershberger
  2 siblings, 1 reply; 7+ messages in thread
From: Stefan Roese @ 2017-04-19  5:46 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On 06.04.2017 15:39, Stefan Roese wrote:
> From: Stefan Chulski <stefanc@marvell.com>
>
> This patch fixes some remaining issues in the mvpp2 driver for the 10GB
> support on port 0. These changes are:
>
> - Incorrect PCS configuration
> - Skip PHY configuration when no PHY is connected
> - Skip GMAC configurations if 10G SFI mode set
>
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Kostya Porotchkin <kostap@marvell.com>
> Cc: Nadav Haklai <nadavh@marvell.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>

Joe, are you okay with this patch? If yes, could you pull it via
your net repository or do I have your ACK so that I can pull it
via the marvell one?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI)
       [not found]     ` <CANr=Z=bqcPQKDZGsadpWOtkKpWd1cUaj15wd0WCogaUWaCK67A@mail.gmail.com>
@ 2017-05-30 20:40       ` Joe Hershberger
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2017-05-30 20:40 UTC (permalink / raw)
  To: u-boot

On Wed, Apr 19, 2017 at 2:14 AM, Joe Hershberger <joe.hershberger@ni.com> wrote:
> Hi Stefan,
>
> On Wed, Apr 19, 2017 at 12:46 AM, Stefan Roese <sr@denx.de> wrote:
>> Hi Joe,
>>
>> On 06.04.2017 15:39, Stefan Roese wrote:
>>>
>>> From: Stefan Chulski <stefanc@marvell.com>
>>>
>>> This patch fixes some remaining issues in the mvpp2 driver for the 10GB
>>> support on port 0. These changes are:
>>>
>>> - Incorrect PCS configuration
>>> - Skip PHY configuration when no PHY is connected
>>> - Skip GMAC configurations if 10G SFI mode set
>>>
>>> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
>>> Signed-off-by: Stefan Roese <sr@denx.de>
>>> Cc: Kostya Porotchkin <kostap@marvell.com>
>>> Cc: Nadav Haklai <nadavh@marvell.com>
>>> Cc: Joe Hershberger <joe.hershberger@ni.com>
>>
>>
>> Joe, are you okay with this patch? If yes, could you pull it via
>> your net repository or do I have your ACK so that I can pull it
>> via the marvell one?
>
> I'm travelling right now, so if it benefits you to have it in your
> tree in the next few weeks, then feel free to take it through your
> tree. Don't forget to delegate it to yourself in patchwork.
>
> Cheers,
> -Joe

It seems my emails that I've been sending the last few months have
been silently been getting dropped. Sorry about this.

-Joe

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI)
  2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
  2017-04-19  5:46   ` Stefan Roese
@ 2017-05-30 20:40   ` Joe Hershberger
  2017-06-02 19:48   ` [U-Boot] " Joe Hershberger
  2 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2017-05-30 20:40 UTC (permalink / raw)
  To: u-boot

On Thu, Apr 6, 2017 at 8:39 AM, Stefan Roese <sr@denx.de> wrote:
> From: Stefan Chulski <stefanc@marvell.com>
>
> This patch fixes some remaining issues in the mvpp2 driver for the 10GB
> support on port 0. These changes are:
>
> - Incorrect PCS configuration
> - Skip PHY configuration when no PHY is connected
> - Skip GMAC configurations if 10G SFI mode set
>
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Kostya Porotchkin <kostap@marvell.com>
> Cc: Nadav Haklai <nadavh@marvell.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR)
  2017-04-06 13:39 [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese
  2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
@ 2017-05-31  8:56 ` Stefan Roese
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Roese @ 2017-05-31  8:56 UTC (permalink / raw)
  To: u-boot

On 06.04.2017 15:39, Stefan Roese wrote:
> This patch enables the mvpp2 port 0 usage on the Armada 7k DB by setting
> the correct PHY type (KR / SFI) for the COMPHY driver and enabling the
> ethernet0 device node in the dts.
> 
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Stefan Chulski <stefanc@marvell.com>
> Cc: Kostya Porotchkin <kostap@marvell.com>
> Cc: Nadav Haklai <nadavh@marvell.com>

Applied to u-boot-marvell/master.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] net: mvpp2.c: Enable 10G support for port 0 (SFI)
  2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
  2017-04-19  5:46   ` Stefan Roese
  2017-05-30 20:40   ` Joe Hershberger
@ 2017-06-02 19:48   ` Joe Hershberger
  2 siblings, 0 replies; 7+ messages in thread
From: Joe Hershberger @ 2017-06-02 19:48 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

https://patchwork.ozlabs.org/patch/747807/ was applied to u-boot-net.git.

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-02 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 13:39 [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese
2017-04-06 13:39 ` [U-Boot] [PATCH] net: mvpp2.c: Enable 10G support for port 0 (SFI) Stefan Roese
2017-04-19  5:46   ` Stefan Roese
     [not found]     ` <CANr=Z=bqcPQKDZGsadpWOtkKpWd1cUaj15wd0WCogaUWaCK67A@mail.gmail.com>
2017-05-30 20:40       ` Joe Hershberger
2017-05-30 20:40   ` Joe Hershberger
2017-06-02 19:48   ` [U-Boot] " Joe Hershberger
2017-05-31  8:56 ` [U-Boot] [PATCH] arm64: mvebu: armada-7040-db: Enable 10GB port 0 / SFI (KR) Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.