]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Assigned a static SMI address to all UECs TBIPA address.
authorRichard Retanubun <RichardRetanubun@RuggedCom.com>
Wed, 1 Jul 2009 18:03:15 +0000 (14:03 -0400)
committerBen Warren <biggerbadderben@gmail.com>
Mon, 10 Aug 2009 22:55:42 +0000 (15:55 -0700)
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.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
drivers/qe/uec.c

index d48d22b612183e4b5e0b09929f1a36921d8ac305..db95adaeef95cb73672150ca636b0ee0f4ca6c1b 100644 (file)
 #include "uec_phy.h"
 #include "miiphy.h"
 
+/* Default UTBIPAR SMI address */
+#ifndef CONFIG_UTBIPAR_INIT_TBIPA
+#define CONFIG_UTBIPAR_INIT_TBIPA 0x1F
+#endif
+
 static uec_info_t uec_info[] = {
 #ifdef CONFIG_UEC_ETH1
        STD_UEC_INFO(1),        /* UEC1 */
@@ -1071,15 +1076,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);
 
        /* Configure the TBI for SGMII operation */