public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Assigned a static SMI address to all UECs TBIPA address.
@ 2009-06-02 15:59 Richard Retanubun
  2009-07-18 23:21 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Retanubun @ 2009-06-02 15:59 UTC (permalink / raw)
  To: u-boot

It is set to 0x1F by default and can be overwritten on the board
header file by defining CONFIG_UTBIPAR_INIT_TBIPA. This allows
the CPU to simply "reserve" one SMI address instead of using
a different one for each UEC.
---
 drivers/qe/uec.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index 91d1182..a8a229f 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -31,6 +31,11 @@
 #include "uec_phy.h"
 #include "miiphy.h"
 
+/* Default UTBIPAR SMI address */
+#ifndef CONFIG_UTBIPAR_INIT_TBIPA
+#define CONFIG_UTBIPAR_INIT_TBIPA 0x1F
+#endif
+
 #ifdef CONFIG_UEC_ETH1
 static uec_info_t eth1_uec_info = {
 	.uf_info		= {
@@ -1179,15 +1184,11 @@ static int uec_startup(uec_private_t *uec)
 	utbipar = in_be32(&uec_regs->utbipar);
 	utbipar &= ~UTBIPAR_PHY_ADDRESS_MASK;
 	enet_interface = uec->uec_info->enet_interface;
-	if (enet_interface == ENET_1000_TBI ||
-		 enet_interface == ENET_1000_RTBI) {
-		utbipar |=  (uec_info->phy_address + uec_info->uf_info.ucc_num)
-						 << UTBIPAR_PHY_ADDRESS_SHIFT;
-	} else {
-		utbipar |=  (0x10 + uec_info->uf_info.ucc_num)
-						 << UTBIPAR_PHY_ADDRESS_SHIFT;
-	}
 
+	/* Initialize UTBIPAR address to CONFIG_UTBIPAR_INIT_TBIPA for ALL UEC.
+	 * This frees up the remaining SMI addresses for use.
+	 */
+	utbipar |= CONFIG_UTBIPAR_INIT_TBIPA << UTBIPAR_PHY_ADDRESS_SHIFT;
 	out_be32(&uec_regs->utbipar, utbipar);
 
 	/* Allocate Tx BDs */
-- 
1.6.2.4

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

* [U-Boot] [PATCH] Assigned a static SMI address to all UECs TBIPA address.
@ 2009-07-01 18:03 Richard Retanubun
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Retanubun @ 2009-07-01 18:03 UTC (permalink / raw)
  To: u-boot

 From 092396fa161036fc9754296269c510e76910c756 Mon Sep 17 00:00:00 2001
From: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Date: Tue, 2 Jun 2009 11:31:05 -0400
Subject: [PATCH] Assigned a static SMI address to all UECs TBIPA address.

It is set to 0x1F by default and can be overwritten on the board
header file by defining CONFIG_UTBIPAR_INIT_TBIPA. This allows
the CPU to simply "reserve" one SMI address instead of using
a different one for each UEC.
---
  drivers/qe/uec.c |   17 +++++++++--------
  1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index 91d1182..a8a229f 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -31,6 +31,11 @@
  #include "uec_phy.h"
  #include "miiphy.h"

+/* Default UTBIPAR SMI address */
+#ifndef CONFIG_UTBIPAR_INIT_TBIPA
+#define CONFIG_UTBIPAR_INIT_TBIPA 0x1F
+#endif
+
  #ifdef CONFIG_UEC_ETH1
  static uec_info_t eth1_uec_info = {
  	.uf_info		= {
@@ -1179,15 +1184,11 @@ static int uec_startup(uec_private_t *uec)
  	utbipar = in_be32(&uec_regs->utbipar);
  	utbipar &= ~UTBIPAR_PHY_ADDRESS_MASK;
  	enet_interface = uec->uec_info->enet_interface;
-	if (enet_interface == ENET_1000_TBI ||
-		 enet_interface == ENET_1000_RTBI) {
-		utbipar |=  (uec_info->phy_address + uec_info->uf_info.ucc_num)
-						 << UTBIPAR_PHY_ADDRESS_SHIFT;
-	} else {
-		utbipar |=  (0x10 + uec_info->uf_info.ucc_num)
-						 << UTBIPAR_PHY_ADDRESS_SHIFT;
-	}

+	/* Initialize UTBIPAR address to CONFIG_UTBIPAR_INIT_TBIPA for ALL UEC.
+	 * This frees up the remaining SMI addresses for use.
+	 */
+	utbipar |= CONFIG_UTBIPAR_INIT_TBIPA << UTBIPAR_PHY_ADDRESS_SHIFT;
  	out_be32(&uec_regs->utbipar, utbipar);

  	/* Allocate Tx BDs */
-- 
1.6.2.4

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

* [U-Boot] [PATCH] Assigned a static SMI address to all UECs TBIPA address.
  2009-06-02 15:59 Richard Retanubun
@ 2009-07-18 23:21 ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2009-07-18 23:21 UTC (permalink / raw)
  To: u-boot

Dear Ben,

In message <1243958368-28613-1-git-send-email-RichardRetanubun@RuggedCom.com> Richard Retanubun wrote:
> It is set to 0x1F by default and can be overwritten on the board
> header file by defining CONFIG_UTBIPAR_INIT_TBIPA. This allows
> the CPU to simply "reserve" one SMI address instead of using
> a different one for each UEC.
> ---
>  drivers/qe/uec.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)

Can you please check the state of this patch? Thanks in advance.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's a way out of any cage.
	-- Captain Christopher Pike, "The Menagerie" ("The Cage"),
	   stardate unknown.

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

end of thread, other threads:[~2009-07-18 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 18:03 [U-Boot] [PATCH] Assigned a static SMI address to all UECs TBIPA address Richard Retanubun
  -- strict thread matches above, loose matches on Subject: below --
2009-06-02 15:59 Richard Retanubun
2009-07-18 23:21 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox