All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM
@ 2019-02-25 20:27 Murali Karicheri
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This patch series add networking capability to K2G ICE EVM
based on netcp driver. Networking function has been tested
using the latest master branch from u-boot repo. Following
boot mode has been tested for networking.

Net boot (tftp images over ethernet interface and boot kernel)
          log at https://pastebin.ubuntu.com/p/b3nyCXPhWc/
MMC boot: (load images from boot folder of rootfs and boot kernel)
          log at https://pastebin.ubuntu.com/p/FWycmKd9KB/

Used Linux upstream linux kernel version 4.19.9 for the tests. 

Please review and apply if this looks good.

Thanks

Revision history:

 v4: Sorted pins by pin number in patch 1 and 2 as per comment.
     Collected Acked-by and included in patch
 v3: Addressed comment to use KConfig for enable TI PHY driver and also 
     netcp driver comment to use proper function as in cpsw driver.
     Rebased to latest on master branch.
 v2: Collected Reviewed-by for patch 1 and 2. Rebased to latest
     on master

Murali Karicheri (7):
  ARM: k2g-gp-evm: update to rgmii pinmux configuration
  ARM: k2g-ice: Add pinmux support for rgmii interface
  net: netcp: add support for phy with rgmii ids
  ARM: k2g: add a workaround to reset the phy
  ARM: dts: k2g-evm: remove unused phy-mode property from phy node
  k2g: config enable ti phy dp83867 for k2g
  ARM: dts: k2g-ice: add dt node for netcp

 arch/arm/dts/keystone-k2g-evm.dts             |  1 -
 arch/arm/dts/keystone-k2g-ice.dts             | 35 +++++++++++++
 .../mach-keystone/include/mach/hardware-k2g.h |  3 ++
 arch/arm/mach-keystone/include/mach/mux-k2g.h |  5 ++
 board/ti/ks2_evm/board_k2g.c                  | 15 ++++++
 board/ti/ks2_evm/mux-k2g.h                    | 51 +++++++++++++------
 configs/k2g_evm_defconfig                     |  1 +
 drivers/net/ti/keystone_net.c                 | 22 +++++++-
 8 files changed, 116 insertions(+), 17 deletions(-)

-- 
2.17.0

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

* [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-02-25 21:53   ` Joe Hershberger
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 2/7] ARM: k2g-ice: Add pinmux support for rgmii interface Murali Karicheri
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This patch updates pinmux configuration for K2G GP EVM based on
data generated by the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 board/ti/ks2_evm/mux-k2g.h | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/board/ti/ks2_evm/mux-k2g.h b/board/ti/ks2_evm/mux-k2g.h
index 706fb7e838..ea23b886f9 100644
--- a/board/ti/ks2_evm/mux-k2g.h
+++ b/board/ti/ks2_evm/mux-k2g.h
@@ -125,21 +125,23 @@ struct pin_cfg k2g_evm_pin_cfg[] = {
 	{ 70,	MODE(0) },	/* SOC_MMC1_SDWP */
 	{ 71,	MODE(0) },	/* MMC1POW TP124 */
 
-	/* RGMII */
-	{ 72,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXCLK */
-	{ 77,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXD3 */
-	{ 78,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXD2 */
-	{ 79,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXD1 */
-	{ 80,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXD0 */
-	{ 81,	MODE(1) | PIN_IEN },	/* SOC_RGMII_RXCTL */
-	{ 85,	MODE(1) },	/* SOC_RGMII_TXCLK */
-	{ 91,	MODE(1)	},	/* SOC_RGMII_TXD3 */
-	{ 92,	MODE(1) },	/* SOC_RGMII_TXD2 */
-	{ 93,	MODE(1) },	/* SOC_RGMII_TXD1 */
-	{ 94,	MODE(1) },	/* SOC_RGMII_TXD0 */
-	{ 95,	MODE(1) },	/* SOC_RGMII_TXCTL */
-	{ 98,	MODE(0) },	/* SOC_MDIO_DATA */
-	{ 99,	MODE(0) },	/* SOC_MDIO_CLK */
+		/* EMAC */
+	{ 72,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXC */
+	{ 77,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD3 */
+	{ 78,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD2 */
+	{ 79,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD1 */
+	{ 80,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD0 */
+	{ 81,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXCTL */
+	{ 85,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXC */
+	{ 91,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD3 */
+	{ 92,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD2 */
+	{ 93,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD1 */
+	{ 94,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD0 */
+	{ 95,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXCTL */
+
+	/* MDIO */
+	{ 98,	BUFFER_CLASS_B | PIN_PDIS | MODE(0) },	/* MDIO_DATA */
+	{ 99,	BUFFER_CLASS_B | PIN_PDIS | MODE(0) },	/* MDIO_CLK */
 
 	/* PWM */
 	{ 73,	MODE(4) },	/* SOC_EHRPWM3A */
-- 
2.17.0

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

* [U-Boot] [PATCH v4 2/7] ARM: k2g-ice: Add pinmux support for rgmii interface
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 3/7] net: netcp: add support for phy with rgmii ids Murali Karicheri
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This add pinmux configuration for rgmii interface so that network
driver can be supported on K2G ICE boards. The pinmux configurations
for this are generated using the pinmux tool at
https://dev.ti.com/pinmux/app.html#/default

As this required some BUFFER_CLASS definitions, same is re-used
from the linux defnitions in include/dt-bindings/pinctrl/keystone.h

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 arch/arm/mach-keystone/include/mach/mux-k2g.h |  5 +++++
 board/ti/ks2_evm/mux-k2g.h                    | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm/mach-keystone/include/mach/mux-k2g.h b/arch/arm/mach-keystone/include/mach/mux-k2g.h
index 809b72d5bf..67d47f8172 100644
--- a/arch/arm/mach-keystone/include/mach/mux-k2g.h
+++ b/arch/arm/mach-keystone/include/mach/mux-k2g.h
@@ -27,6 +27,11 @@
 #define PIN_PTU	(1 << 17) /* pull up */
 #define PIN_PTD	(0 << 17) /* pull down */
 
+#define BUFFER_CLASS_B	(0 << 19)
+#define BUFFER_CLASS_C	(1 << 19)
+#define BUFFER_CLASS_D	(2 << 19)
+#define BUFFER_CLASS_E	(3 << 19)
+
 #define MODE(m)	((m) & 0x7)
 #define MAX_PIN_N	260
 
diff --git a/board/ti/ks2_evm/mux-k2g.h b/board/ti/ks2_evm/mux-k2g.h
index ea23b886f9..6aa785ea42 100644
--- a/board/ti/ks2_evm/mux-k2g.h
+++ b/board/ti/ks2_evm/mux-k2g.h
@@ -348,6 +348,25 @@ struct pin_cfg k2g_ice_evm_pin_cfg[] = {
 	{ 133,	MODE(0) },	/* SOC_QSPI_D2 */
 	{ 134,	MODE(0) },	/* SOC_QSPI_D3 */
 	{ 135,	MODE(0) },	/* SOC_QSPI_CSN0 */
+
+	/* EMAC */
+	{ 72,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXC */
+	{ 77,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD3 */
+	{ 78,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD2 */
+	{ 79,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD1 */
+	{ 80,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXD0 */
+	{ 81,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_RXCTL */
+	{ 85,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXC */
+	{ 91,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD3 */
+	{ 92,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD2 */
+	{ 93,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD1 */
+	{ 94,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXD0 */
+	{ 95,	BUFFER_CLASS_D | PIN_PDIS | MODE(1) },	/* RGMII_TXCTL */
+
+	/* MDIO */
+	{ 98,	BUFFER_CLASS_B | PIN_PDIS | MODE(0) },	/* MDIO_DATA */
+	{ 99,	BUFFER_CLASS_B | PIN_PDIS | MODE(0) },	/* MDIO_CLK */
+
 	{ MAX_PIN_N, }
 };
 
-- 
2.17.0

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

* [U-Boot] [PATCH v4 3/7] net: netcp: add support for phy with rgmii ids
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 2/7] ARM: k2g-ice: Add pinmux support for rgmii interface Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy Murali Karicheri
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

Enhance the netcp driver to support phys that can be configured
for internal delay (rgmii-id, rgmii-rxid, rgmii-txid)

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/ti/keystone_net.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ti/keystone_net.c b/drivers/net/ti/keystone_net.c
index a3ba91cc3f..4baeeb83f1 100644
--- a/drivers/net/ti/keystone_net.c
+++ b/drivers/net/ti/keystone_net.c
@@ -88,6 +88,7 @@ struct ks2_eth_priv {
 	struct mii_dev			*mdio_bus;
 	int				phy_addr;
 	phy_interface_t			phy_if;
+	int				phy_of_handle;
 	int				sgmii_link_type;
 	void				*mdio_base;
 	struct rx_buff_desc		net_rx_buffs;
@@ -588,6 +589,10 @@ static int ks2_eth_probe(struct udevice *dev)
 	if (priv->has_mdio) {
 		priv->phydev = phy_connect(priv->mdio_bus, priv->phy_addr,
 					   dev, priv->phy_if);
+#ifdef CONFIG_DM_ETH
+	if (priv->phy_of_handle)
+		priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
+#endif
 		phy_config(priv->phydev);
 	}
 
@@ -679,6 +684,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
 	int phy;
 	int dma_count;
 	u32 dma_channel[8];
+	const char *phy_mode;
 
 	priv->slave_port = fdtdec_get_int(fdt, slave, "slave-port", -1);
 	priv->net_rx_buffs.rx_flow = priv->slave_port * 8;
@@ -700,7 +706,9 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
 	priv->link_type = fdtdec_get_int(fdt, slave, "link-interface", -1);
 
 	phy = fdtdec_lookup_phandle(fdt, slave, "phy-handle");
+
 	if (phy >= 0) {
+		priv->phy_of_handle = phy;
 		priv->phy_addr = fdtdec_get_int(fdt, phy, "reg", -1);
 
 		mdio = fdt_parent_offset(fdt, phy);
@@ -717,7 +725,19 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
 		priv->sgmii_link_type = SGMII_LINK_MAC_PHY;
 		priv->has_mdio = true;
 	} else if (priv->link_type == LINK_TYPE_RGMII_LINK_MAC_PHY) {
-		priv->phy_if = PHY_INTERFACE_MODE_RGMII;
+		phy_mode = fdt_getprop(fdt, slave, "phy-mode", NULL);
+		if (phy_mode) {
+			priv->phy_if = phy_get_interface_by_name(phy_mode);
+			if (priv->phy_if != PHY_INTERFACE_MODE_RGMII &&
+			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_ID &&
+			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_RXID &&
+			    priv->phy_if != PHY_INTERFACE_MODE_RGMII_TXID) {
+				pr_err("invalid phy-mode\n");
+				return -EINVAL;
+			}
+		} else {
+			priv->phy_if = PHY_INTERFACE_MODE_RGMII;
+		}
 		pdata->phy_interface = priv->phy_if;
 		priv->has_mdio = true;
 	}
-- 
2.17.0

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

* [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
                   ` (2 preceding siblings ...)
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 3/7] net: netcp: add support for phy with rgmii ids Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 5/7] ARM: dts: k2g-evm: remove unused phy-mode property from phy node Murali Karicheri
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This patch adds a workaround to reset the phy one time during boot
using GPIO0 pin 10 to make sure, the Phy latches the configuration
from the input pins correctly.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 .../arm/mach-keystone/include/mach/hardware-k2g.h |  3 +++
 board/ti/ks2_evm/board_k2g.c                      | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/arch/arm/mach-keystone/include/mach/hardware-k2g.h b/arch/arm/mach-keystone/include/mach/hardware-k2g.h
index 8b902641ec..971c081bb3 100644
--- a/arch/arm/mach-keystone/include/mach/hardware-k2g.h
+++ b/arch/arm/mach-keystone/include/mach/hardware-k2g.h
@@ -69,9 +69,12 @@
 
 #define K2G_GPIO0_BASE			0X02603000
 #define K2G_GPIO1_BASE			0X0260a000
+#define K2G_GPIO0_BANK0_BASE		K2G_GPIO0_BASE + 0x10
 #define K2G_GPIO1_BANK2_BASE		K2G_GPIO1_BASE + 0x38
 #define K2G_GPIO_DIR_OFFSET		0x0
+#define K2G_GPIO_OUTDATA_OFFSET		0x4
 #define K2G_GPIO_SETDATA_OFFSET		0x8
+#define K2G_GPIO_CLRDATA_OFFSET		0xC
 
 /* BOOTCFG RESETMUX8 */
 #define KS2_RSTMUX8			(KS2_DEVICE_STATE_CTRL_BASE + 0x328)
diff --git a/board/ti/ks2_evm/board_k2g.c b/board/ti/ks2_evm/board_k2g.c
index 39a782e479..6d0fc21c67 100644
--- a/board/ti/ks2_evm/board_k2g.c
+++ b/board/ti/ks2_evm/board_k2g.c
@@ -315,6 +315,21 @@ int embedded_dtb_select(void)
 			     BIT(9));
 		setbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_SETDATA_OFFSET,
 			     BIT(9));
+	} else if (board_is_k2g_ice()) {
+		/* GBE Phy workaround. For Phy to latch the input
+		 * configuration, a GPIO reset is asserted at the
+		 * Phy reset pin to latch configuration correctly after SoC
+		 * reset. GPIO0 Pin 10 (Ball AA20) is used for this on ICE
+		 * board. Just do a low to high transition.
+		 */
+		clrbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_DIR_OFFSET,
+			     BIT(10));
+		setbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_CLRDATA_OFFSET,
+			     BIT(10));
+		/* Delay just to get a transition to high */
+		udelay(100);
+		setbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_SETDATA_OFFSET,
+			     BIT(10));
 	}
 
 	return 0;
-- 
2.17.0

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

* [U-Boot] [PATCH v4 5/7] ARM: dts: k2g-evm: remove unused phy-mode property from phy node
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
                   ` (3 preceding siblings ...)
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 6/7] k2g: config enable ti phy dp83867 for k2g Murali Karicheri
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This patch removes the unused phy-mode property from the phy dt node. On
K2G, currently link-interface determines if phy is used or not and is
already set to use rgmii. So this is not needed. Besides phy-mode should
be added to slave interface configuration of the cpsw driver, not in the
phy node.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 arch/arm/dts/keystone-k2g-evm.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/dts/keystone-k2g-evm.dts b/arch/arm/dts/keystone-k2g-evm.dts
index 6c9de25b94..4820c7e50d 100644
--- a/arch/arm/dts/keystone-k2g-evm.dts
+++ b/arch/arm/dts/keystone-k2g-evm.dts
@@ -29,7 +29,6 @@
 	status = "okay";
 	ethphy0: ethernet-phy at 0 {
 		reg = <0>;
-		phy-mode = "rgmii-id";
 	};
 };
 
-- 
2.17.0

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

* [U-Boot] [PATCH v4 6/7] k2g: config enable ti phy dp83867 for k2g
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
                   ` (4 preceding siblings ...)
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 5/7] ARM: dts: k2g-evm: remove unused phy-mode property from phy node Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 7/7] ARM: dts: k2g-ice: add dt node for netcp Murali Karicheri
  2019-02-25 21:47 ` [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

Enable ti phy dp83867 for k2g

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 configs/k2g_evm_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/k2g_evm_defconfig b/configs/k2g_evm_defconfig
index 838b6f14b6..4c5e344d3a 100644
--- a/configs/k2g_evm_defconfig
+++ b/configs/k2g_evm_defconfig
@@ -70,3 +70,4 @@ CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_SDP=y
+CONFIG_PHY_TI=y
-- 
2.17.0

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

* [U-Boot] [PATCH v4 7/7] ARM: dts: k2g-ice: add dt node for netcp
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
                   ` (5 preceding siblings ...)
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 6/7] k2g: config enable ti phy dp83867 for k2g Murali Karicheri
@ 2019-02-25 20:27 ` Murali Karicheri
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  2019-02-25 21:47 ` [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 20:27 UTC (permalink / raw)
  To: u-boot

This patch adds dt node for DP83867 phy used on K2G ICE board and
also enable netcp device nodes for the board.

EVM hardware spec recommends to add 0.25 nsec delay in the tx
direction and 2.25 nsec delay in the rx direction for internal
delay in the clock path to be on the safer side.

The board straps RX_DV/RX_CTRL pin of on board DP83867 phy in mode
1. Unfortunately, the phy data manual disallows this. Add
ti,dp83867-rxctrl-strap-quirk in the phy node to allow software to
enable workaround suggested for this incorrect strap setting. This
ensures proper operation of this PHY.

The dts bindings are kept in sync with that from 4.14.y linux
kernel. This required the pinmux device related bindings to be
commented out to allow for compilation.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---
 arch/arm/dts/keystone-k2g-ice.dts | 35 +++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/dts/keystone-k2g-ice.dts b/arch/arm/dts/keystone-k2g-ice.dts
index 698338b93d..b67332fed5 100644
--- a/arch/arm/dts/keystone-k2g-ice.dts
+++ b/arch/arm/dts/keystone-k2g-ice.dts
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "keystone-k2g.dtsi"
+#include <dt-bindings/net/ti-dp83867.h>
 
 / {
 	compatible = "ti,k2g-ice", "ti,k2g", "ti,keystone";
@@ -81,3 +82,37 @@
 		};
 	};
 };
+
+&qmss {
+	status = "okay";
+};
+
+&knav_dmas {
+	status = "okay";
+};
+
+&netcp {
+	pinctrl-names = "default";
+	//pinctrl-0 = <&emac_pins>;
+	status = "okay";
+};
+
+&mdio {
+	pinctrl-names = "default";
+	//pinctrl-0 = <&mdio_pins>;
+	status = "okay";
+	ethphy0: ethernet-phy at 0 {
+		reg = <0>;
+		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+		ti,tx-internal-delay = <DP83867_RGMIIDCTL_250_PS>;
+		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_8_B_NIB>;
+		ti,min-output-impedance;
+		ti,dp83867-rxctrl-strap-quirk;
+	};
+};
+
+&gbe0 {
+	phy-handle = <&ethphy0>;
+	phy-mode = "rgmii-id";
+	status = "okay";
+};
-- 
2.17.0

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

* [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM
  2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
                   ` (6 preceding siblings ...)
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 7/7] ARM: dts: k2g-ice: add dt node for netcp Murali Karicheri
@ 2019-02-25 21:47 ` Murali Karicheri
  2019-02-25 21:47   ` Joe Hershberger
  7 siblings, 1 reply; 18+ messages in thread
From: Murali Karicheri @ 2019-02-25 21:47 UTC (permalink / raw)
  To: u-boot

Hello Maintainer,

On 02/25/2019 03:27 PM, Murali Karicheri wrote:
> This patch series add networking capability to K2G ICE EVM
> based on netcp driver. Networking function has been tested
> using the latest master branch from u-boot repo. Following
> boot mode has been tested for networking.
> 
> Net boot (tftp images over ethernet interface and boot kernel)
>            log at https://pastebin.ubuntu.com/p/b3nyCXPhWc/
> MMC boot: (load images from boot folder of rootfs and boot kernel)
>            log at https://pastebin.ubuntu.com/p/FWycmKd9KB/
> 
> Used Linux upstream linux kernel version 4.19.9 for the tests.
> 
> Please review and apply if this looks good.
> 
> Thanks
> 
> Revision history:
> 
>   v4: Sorted pins by pin number in patch 1 and 2 as per comment.
>       Collected Acked-by and included in patch
>   v3: Addressed comment to use KConfig for enable TI PHY driver and also
>       netcp driver comment to use proper function as in cpsw driver.
>       Rebased to latest on master branch.
>   v2: Collected Reviewed-by for patch 1 and 2. Rebased to latest
>       on master
> 
> Murali Karicheri (7):
>    ARM: k2g-gp-evm: update to rgmii pinmux configuration
>    ARM: k2g-ice: Add pinmux support for rgmii interface
>    net: netcp: add support for phy with rgmii ids
>    ARM: k2g: add a workaround to reset the phy
>    ARM: dts: k2g-evm: remove unused phy-mode property from phy node
>    k2g: config enable ti phy dp83867 for k2g
>    ARM: dts: k2g-ice: add dt node for netcp
> 
>   arch/arm/dts/keystone-k2g-evm.dts             |  1 -
>   arch/arm/dts/keystone-k2g-ice.dts             | 35 +++++++++++++
>   .../mach-keystone/include/mach/hardware-k2g.h |  3 ++
>   arch/arm/mach-keystone/include/mach/mux-k2g.h |  5 ++
>   board/ti/ks2_evm/board_k2g.c                  | 15 ++++++
>   board/ti/ks2_evm/mux-k2g.h                    | 51 +++++++++++++------
>   configs/k2g_evm_defconfig                     |  1 +
>   drivers/net/ti/keystone_net.c                 | 22 +++++++-
>   8 files changed, 116 insertions(+), 17 deletions(-)
> 

Please merge this version if looks good. Have addressed all comments 
received so far.

Murali

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

* [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM
  2019-02-25 21:47 ` [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
@ 2019-02-25 21:47   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-02-25 21:47 UTC (permalink / raw)
  To: u-boot

On Mon, Feb 25, 2019 at 3:45 PM Murali Karicheri <m-karicheri2@ti.com> wrote:
>
> Hello Maintainer,
>
> On 02/25/2019 03:27 PM, Murali Karicheri wrote:
> > This patch series add networking capability to K2G ICE EVM
> > based on netcp driver. Networking function has been tested
> > using the latest master branch from u-boot repo. Following
> > boot mode has been tested for networking.
> >
> > Net boot (tftp images over ethernet interface and boot kernel)
> >            log at https://pastebin.ubuntu.com/p/b3nyCXPhWc/
> > MMC boot: (load images from boot folder of rootfs and boot kernel)
> >            log at https://pastebin.ubuntu.com/p/FWycmKd9KB/
> >
> > Used Linux upstream linux kernel version 4.19.9 for the tests.
> >
> > Please review and apply if this looks good.

Will do, thanks,
-Joe

> >
> > Thanks
> >
> > Revision history:
> >
> >   v4: Sorted pins by pin number in patch 1 and 2 as per comment.
> >       Collected Acked-by and included in patch
> >   v3: Addressed comment to use KConfig for enable TI PHY driver and also
> >       netcp driver comment to use proper function as in cpsw driver.
> >       Rebased to latest on master branch.
> >   v2: Collected Reviewed-by for patch 1 and 2. Rebased to latest
> >       on master
> >
> > Murali Karicheri (7):
> >    ARM: k2g-gp-evm: update to rgmii pinmux configuration
> >    ARM: k2g-ice: Add pinmux support for rgmii interface
> >    net: netcp: add support for phy with rgmii ids
> >    ARM: k2g: add a workaround to reset the phy
> >    ARM: dts: k2g-evm: remove unused phy-mode property from phy node
> >    k2g: config enable ti phy dp83867 for k2g
> >    ARM: dts: k2g-ice: add dt node for netcp
> >
> >   arch/arm/dts/keystone-k2g-evm.dts             |  1 -
> >   arch/arm/dts/keystone-k2g-ice.dts             | 35 +++++++++++++
> >   .../mach-keystone/include/mach/hardware-k2g.h |  3 ++
> >   arch/arm/mach-keystone/include/mach/mux-k2g.h |  5 ++
> >   board/ti/ks2_evm/board_k2g.c                  | 15 ++++++
> >   board/ti/ks2_evm/mux-k2g.h                    | 51 +++++++++++++------
> >   configs/k2g_evm_defconfig                     |  1 +
> >   drivers/net/ti/keystone_net.c                 | 22 +++++++-
> >   8 files changed, 116 insertions(+), 17 deletions(-)
> >
>
> Please merge this version if looks good. Have addressed all comments
> received so far.
>
> Murali
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

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

* [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
@ 2019-02-25 21:53   ` Joe Hershberger
  2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
  1 sibling, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-02-25 21:53 UTC (permalink / raw)
  To: u-boot

On Mon, Feb 25, 2019 at 2:28 PM Murali Karicheri <m-karicheri2@ti.com> wrote:
>
> This patch updates pinmux configuration for K2G GP EVM based on
> data generated by the pinmux tool at
> https://dev.ti.com/pinmux/app.html#/default
>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>

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

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

* [U-Boot] ARM: k2g-gp-evm: update to rgmii pinmux configuration
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
  2019-02-25 21:53   ` Joe Hershberger
@ 2019-03-05 18:05   ` Joe Hershberger
  1 sibling, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047981/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] ARM: k2g-ice: Add pinmux support for rgmii interface
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 2/7] ARM: k2g-ice: Add pinmux support for rgmii interface Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047978/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] net: netcp: add support for phy with rgmii ids
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 3/7] net: netcp: add support for phy with rgmii ids Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047982/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] ARM: k2g: add a workaround to reset the phy
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047979/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] ARM: dts: k2g-evm: remove unused phy-mode property from phy node
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 5/7] ARM: dts: k2g-evm: remove unused phy-mode property from phy node Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047977/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] k2g: config enable ti phy dp83867 for k2g
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 6/7] k2g: config enable ti phy dp83867 for k2g Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047983/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

* [U-Boot] ARM: dts: k2g-ice: add dt node for netcp
  2019-02-25 20:27 ` [U-Boot] [PATCH v4 7/7] ARM: dts: k2g-ice: add dt node for netcp Murali Karicheri
@ 2019-03-05 18:05   ` Joe Hershberger
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Hershberger @ 2019-03-05 18:05 UTC (permalink / raw)
  To: u-boot

Hi Murali,

https://patchwork.ozlabs.org/patch/1047980/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

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

end of thread, other threads:[~2019-03-05 18:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25 20:27 [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
2019-02-25 20:27 ` [U-Boot] [PATCH v4 1/7] ARM: k2g-gp-evm: update to rgmii pinmux configuration Murali Karicheri
2019-02-25 21:53   ` Joe Hershberger
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 2/7] ARM: k2g-ice: Add pinmux support for rgmii interface Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 3/7] net: netcp: add support for phy with rgmii ids Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 5/7] ARM: dts: k2g-evm: remove unused phy-mode property from phy node Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 6/7] k2g: config enable ti phy dp83867 for k2g Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 20:27 ` [U-Boot] [PATCH v4 7/7] ARM: dts: k2g-ice: add dt node for netcp Murali Karicheri
2019-03-05 18:05   ` [U-Boot] " Joe Hershberger
2019-02-25 21:47 ` [U-Boot] [PATCH v4 0/7] Add netcp networking support on K2G ICE EVM Murali Karicheri
2019-02-25 21:47   ` Joe Hershberger

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.