All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 4/7] ARM: k2g: add a workaround to reset the phy
Date: Mon, 25 Feb 2019 15:27:36 -0500	[thread overview]
Message-ID: <20190225202739.26916-5-m-karicheri2@ti.com> (raw)
In-Reply-To: <20190225202739.26916-1-m-karicheri2@ti.com>

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

  parent reply	other threads:[~2019-02-25 20:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Murali Karicheri [this message]
2019-03-05 18:05   ` [U-Boot] ARM: k2g: add a workaround to reset the phy 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190225202739.26916-5-m-karicheri2@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.