public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Clint Adams <clint@debian.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 3/4] Initialize second PHY on OpenRD-Client and OpenRD-Ultimate
Date: Tue,  3 May 2011 11:00:38 -0400	[thread overview]
Message-ID: <1304434839-14896-4-git-send-email-clint@debian.org> (raw)
In-Reply-To: <1304434839-14896-1-git-send-email-clint@debian.org>

Though the OpenRD-Base only has one gigabit Ethernet port,
both the OpenRD-Client and OpenRD-Ultimate each have two.

On the Ultimate, the PHY addresses are consecutive, but
on the Client they are not.

(based on
<62a0952ce368acc725063a00a5ec680a639d6c27.1301040318.git.julian.pidancet@citrix.com>
<ad0a2dc1e422698b005d6f0ceb6dd6f75a87e00a.1301040318.git.julian.pidancet@citrix.com>
)

Signed-off-by: Clint Adams <clint@debian.org>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Cc: Julian Pidancet <julian.pidancet@citrix.com>
--
Changes for v3:
  - lengthened commit message
Changes for v4:
   - Added Signed-off-by: line to commit message
   - Changed whitespace to TABs
---
 board/Marvell/openrd/openrd.c |   25 +++++++++++++++++++++----
 include/configs/openrd.h      |   14 ++++++++++++--
 2 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/board/Marvell/openrd/openrd.c b/board/Marvell/openrd/openrd.c
index 14ca88e..87939de 100644
--- a/board/Marvell/openrd/openrd.c
+++ b/board/Marvell/openrd/openrd.c
@@ -124,12 +124,11 @@ int board_init(void)
 }
 
 #ifdef CONFIG_RESET_PHY_R
-/* Configure and enable MV88E1116 PHY */
-void reset_phy(void)
+/* Configure and enable MV88E1116/88E1121 PHY */
+void mv_phy_init(char *name)
 {
 	u16 reg;
 	u16 devadr;
-	char *name = "egiga0";
 
 	if (miiphy_set_current_dev(name))
 		return;
@@ -154,6 +153,24 @@ void reset_phy(void)
 	/* reset the phy */
 	miiphy_reset(name, devadr);
 
-	printf("88E1116 Initialized on %s\n", name);
+	printf(PHY_NO" Initialized on %s\n", name);
+}
+
+void reset_phy(void)
+{
+	mv_phy_init("egiga0");
+
+#ifdef CONFIG_BOARD_IS_OPENRD_CLIENT
+	/* Kirkwood ethernet driver is written with the assumption that in case
+	 * of multiple PHYs, their addresses are consecutive. But unfortunately
+	 * in case of OpenRD-Client, PHY addresses are not consecutive.*/
+	miiphy_write("egiga1", 0xEE, 0xEE, 24);
+#endif
+
+#if defined(CONFIG_BOARD_IS_OPENRD_CLIENT) || \
+	defined(CONFIG_BOARD_IS_OPENRD_ULTIMATE)
+	/* configure and initialize both PHY's */
+	mv_phy_init("egiga1");
+#endif
 }
 #endif /* CONFIG_RESET_PHY_R */
diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index 7299749..8d86067 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -117,8 +117,18 @@
  * Ethernet Driver configuration
  */
 #ifdef CONFIG_CMD_NET
-#define CONFIG_MVGBE_PORTS	{1, 0}	/* enable port 0 only */
-#define CONFIG_PHY_BASE_ADR	0x8
+# ifdef CONFIG_BOARD_IS_OPENRD_BASE
+#  define CONFIG_MVGBE_PORTS	{1, 0}	/* enable port 0 only */
+# else
+#  define CONFIG_MVGBE_PORTS	{1, 1}	/* enable both ports */
+# endif
+# ifdef CONFIG_BOARD_IS_OPENRD_ULTIMATE
+#  define CONFIG_PHY_BASE_ADR	0x0
+#  define PHY_NO		"88E1121"
+# else
+#  define CONFIG_PHY_BASE_ADR	0x8
+#  define PHY_NO		"88E1116"
+# endif
 #endif /* CONFIG_CMD_NET */
 
 /*
-- 
1.7.4.4

  parent reply	other threads:[~2011-05-03 15:00 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  8:48 [U-Boot] [PATCH v2 0/4] Kirkwood: Add support for OpenRD-Client & OpenRD-Ultimate julian.pidancet at citrix.com
2011-03-25  8:48 ` [U-Boot] [PATCH v2 1/4] Kirkwood: Rename openrd_base board files to openrd julian.pidancet at citrix.com
2011-03-29 12:53   ` Prafulla Wadaskar
2011-04-06 18:55     ` [U-Boot] [PATCH 1/2] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-06 18:55       ` [U-Boot] [PATCH 2/2] Initialize second PHY on " Clint Adams
2011-04-07  6:17         ` Prafulla Wadaskar
2011-04-07  7:18           ` Albert ARIBAUD
2011-04-11 12:03             ` Prafulla Wadaskar
2011-04-11 12:45               ` Albert ARIBAUD
2011-04-11 17:05                 ` Prafulla Wadaskar
2011-04-12 16:09               ` [U-Boot] [PATCH 1/3] Add definitions for " Clint Adams
2011-04-12 16:09                 ` [U-Boot] [PATCH 2/3] Initialize second PHY on " Clint Adams
2011-04-12 18:38                   ` Julian Pidancet
2011-04-12 18:44                     ` [U-Boot] [PATCH 1/3] Add definitions for " Clint Adams
2011-04-12 18:44                       ` [U-Boot] [PATCH 2/3] Initialize second PHY on " Clint Adams
2011-04-13 11:13                         ` Detlev Zundel
2011-04-13 14:18                         ` Prafulla Wadaskar
2011-04-12 18:44                       ` [U-Boot] [PATCH 3/3] Rename openrd_base files to openrd Clint Adams
2011-04-13 14:22                         ` Prafulla Wadaskar
2011-04-13 16:25                           ` [U-Boot] [V1 0/3] OpenRD-Client and OpenRD-Ultimate support Clint Adams
2011-04-13 16:25                             ` [U-Boot] [V1 1/3] Rename openrd_base files to openrd Clint Adams
2011-04-13 16:25                             ` [U-Boot] [V1 2/3] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-13 16:25                             ` [U-Boot] [V1 3/3] Initialize second PHY on " Clint Adams
2011-04-13 19:57                             ` [U-Boot] [V1 0/3] OpenRD-Client and OpenRD-Ultimate support Albert ARIBAUD
2011-04-14  0:11                               ` Clint Adams
2011-04-14  4:56                                 ` Albert ARIBAUD
2011-04-18 23:47                               ` [U-Boot] [PATCH v2 0/4] support for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-18 23:47                                 ` [U-Boot] [PATCH v2 1/4] Rename openrd_base files to openrd Clint Adams
2011-04-25 22:10                                   ` Wolfgang Denk
2011-04-18 23:47                                 ` [U-Boot] [PATCH v2 2/4] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-25 22:11                                   ` Wolfgang Denk
2011-04-25 22:12                                   ` Wolfgang Denk
2011-04-26  1:17                                     ` [U-Boot] [PATCH v4 0/4] OpenRD-Client and OpenRD-Ultimate support Clint Adams
2011-04-26  1:17                                       ` [U-Boot] [PATCH v4 1/4] Rename openrd_base files to openrd Clint Adams
2011-04-26  1:17                                       ` [U-Boot] [PATCH v4 2/4] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-26  1:17                                       ` [U-Boot] [PATCH v4 3/4] Initialize second PHY on " Clint Adams
2011-04-26  1:17                                       ` [U-Boot] [PATCH v4 4/4] Enable multiple fs options for Marvell SoC family on OpenRD boards Clint Adams
2011-05-03 12:01                                       ` [U-Boot] [PATCH v4 0/4] OpenRD-Client and OpenRD-Ultimate support Prafulla Wadaskar
2011-05-03 15:00                                         ` [U-Boot] [PATCH v5 " Clint Adams
2011-05-03 15:00                                           ` [U-Boot] [PATCH v5 1/4] Rename openrd_base files to openrd Clint Adams
2011-05-03 15:00                                           ` [U-Boot] [PATCH v5 2/4] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-05-03 15:00                                           ` Clint Adams [this message]
2011-05-03 15:00                                           ` [U-Boot] [PATCH v5 4/4] Enable multiple fs options for Marvell SoC family on OpenRD boards Clint Adams
2011-05-06 13:20                                           ` [U-Boot] [PATCH v5 0/4] OpenRD-Client and OpenRD-Ultimate support Prafulla Wadaskar
2011-04-26  1:20                                     ` [U-Boot] [PATCH v2 2/4] Add definitions for OpenRD-Client and OpenRD-Ultimate Clint Adams
2011-04-18 23:47                                 ` [U-Boot] [PATCH v2 3/4] Initialize second PHY on " Clint Adams
2011-04-19  4:24                                   ` Prafulla Wadaskar
2011-04-25 22:14                                   ` Wolfgang Denk
2011-04-18 23:47                                 ` [U-Boot] [PATCH v2 4/4] Enable multiple fs options for Marvell SoC family on OpenRD boards Clint Adams
2011-04-25 22:14                                   ` Wolfgang Denk
2011-04-18 23:52                               ` [U-Boot] [V1 0/3] OpenRD-Client and OpenRD-Ultimate support Clint Adams
2011-04-12 19:57                       ` [U-Boot] [PATCH 1/3] Add definitions for OpenRD-Client and OpenRD-Ultimate Albert ARIBAUD
2011-04-12 18:48                     ` [U-Boot] [PATCH 2/3] Initialize second PHY on " Clint Adams
2011-04-12 16:09                 ` [U-Boot] [PATCH 3/3] Rename openrd_base files to openrd Clint Adams
2011-04-12 16:41                   ` Albert ARIBAUD
2011-04-12 16:44                 ` [U-Boot] [PATCH 1/3] Add definitions for OpenRD-Client and OpenRD-Ultimate Albert ARIBAUD
2011-04-12 16:14               ` [U-Boot] [PATCH 2/2] Initialize second PHY on " Clint Adams
2011-04-06 18:59     ` [U-Boot] [PATCH v2 1/4] Kirkwood: Rename openrd_base board files to openrd Clint Adams
2011-03-25  8:48 ` [U-Boot] [PATCH v2 2/4] Change OpenRD Base board identification string julian.pidancet at citrix.com
2011-03-29 12:58   ` Prafulla Wadaskar
2011-03-25  8:48 ` [U-Boot] [PATCH v2 3/4] Add support for the Client variant of the OpenRD board julian.pidancet at citrix.com
2011-03-29 13:01   ` Prafulla Wadaskar
2011-03-25  8:48 ` [U-Boot] [PATCH v2 4/4] Add support for the Ultimate " julian.pidancet at citrix.com
2011-03-25 22:02 ` [U-Boot] [PATCH v2 0/4] Kirkwood: Add support for OpenRD-Client & OpenRD-Ultimate Clint Adams
2011-03-27  5:18   ` Prafulla Wadaskar
2011-03-28 12:14 ` Harro Haan
2011-04-02 21:11 ` Albert ARIBAUD

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=1304434839-14896-4-git-send-email-clint@debian.org \
    --to=clint@debian.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox