mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Subject: [PATCH 5/5] P2020rdb: eTSEC2 support
Date: Thu, 20 Sep 2012 17:31:09 +0100	[thread overview]
Message-ID: <1348158669-14034-6-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1348158669-14034-1-git-send-email-renaud.barbier@ge.com>

The mdio bus is registered before adding the gianfar interface.
Also the eTSEC2 is configured. Either eTSEC2 or eTSEC3 can now be
used.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
---
 arch/ppc/boards/freescale-p2020rdb/p2020rdb.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
index edb9bcd..9d83133 100644
--- a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
+++ b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
@@ -59,9 +59,14 @@
 #define SYSCLK_50	50000000
 #define SYSCLK_100	100000000
 
-/* Ethernet. Use eTSEC3 */
+/* eTSEC2 and eTSEC 3 Ethernet port parameters */
 static struct gfar_info_struct gfar_info[] = {
 	{
+		.phyaddr = 0,
+		.tbiana = 0x1a0,
+		.tbicr = 0x9140,
+	},
+	{
 		.phyaddr = 1,
 		.tbiana = 0,
 		.tbicr = 0,
@@ -75,6 +80,9 @@ struct i2c_platform_data i2cplat = {
 
 static int devices_init(void)
 {
+	void __iomem *tsecregs;
+	int ix;
+
 	add_cfi_flash_device(DEVICE_ID_DYNAMIC, CFG_FLASH_BASE, 16 << 20, 0);
 
 	add_generic_device("i2c-fsl", 0, NULL, I2C1_BASE_ADDR,
@@ -82,8 +90,21 @@ static int devices_init(void)
 	add_generic_device("i2c-fsl", 1, NULL, I2C2_BASE_ADDR,
 			0x100, IORESOURCE_MEM, &i2cplat);
 
+	/*
+	 * Assign TBI physical address early because eTSEC2 has a PHY address
+	 * of 0. Otherwise, the PHY on eTSEC2 goes into a bad state.
+	 */
+	for (ix = 0; ix < 3; ix++) {
+		tsecregs = (void __iomem *)(GFAR_BASE_ADDR + (ix * 0x1000));
+		out_be32(tsecregs + 0x30, 0x1f);
+	}
+
+	fsl_pq_mdio_init((void *)MDIO_BASE_ADDR);
+
+	/* eTSEC2 */
+	fsl_eth_init(2, &gfar_info[0]);
 	/* eTSEC3 */
-	fsl_eth_init(3, &gfar_info[0]);
+	fsl_eth_init(3, &gfar_info[1]);
 
 	devfs_add_partition("nor0", 0xf80000, 0x80000, DEVFS_PARTITION_FIXED,
 			    "self0");
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2012-09-20 16:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 16:31 [PATCH 0/5] gianfar: mdio bus support Renaud Barbier
2012-09-20 16:31 ` [PATCH 1/5] phylib: bus reset function Renaud Barbier
2012-09-20 18:23   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-21  6:34     ` Sascha Hauer
2012-09-21  8:06       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-21  8:30         ` Sascha Hauer
2012-09-21 17:04           ` Renaud Barbier
2012-09-21 17:20             ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 16:31 ` [PATCH 2/5] FSL mdio bus support Renaud Barbier
2012-09-20 18:27   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 16:31 ` [PATCH 3/5] gianfar update Renaud Barbier
2012-09-20 18:30   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 16:31 ` [PATCH 4/5] FSL mdio: configuration and build file Renaud Barbier
2012-09-20 16:31 ` Renaud Barbier [this message]

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=1348158669-14034-6-git-send-email-renaud.barbier@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    /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