[U-Boot-Users] Proposed change; What do you think?

Jon Loeliger jdl at freescale.com
Thu Aug 19 00:08:55 CEST 2004


Guys,

I'd like to get your opinion on a proposed change to a
few files that handle some aspects of the various enetaddr
fields as found in asm-ppc/u-boot.h, common/cmd_bdinfo.c
and lib_ppc/board.c.

In particular, I'd like to propose a shift from having these
fields be present when certain boards are #defined to having
these fields be present when CONFIG_ETH1ADDR symbols are defined.

So, don't take the following as a literal patch.  It is just
some cut-n-paste diffs to show what I mean.

There are only a few boards for which this might make a difference.
I'm the bit swizzler for most of them (MPC85xxXDS), but the others
include the PN62, the PPCCHAMEONEVB, the 440GX, the GT_6426x.
SXNI855T, SVM_SC8xx and possibly the DB64360, DB64460, CATcenter,
and OCOTEA boards.  The latter define CONFIG_ETH1ADDR but don't
have their cases include in places like the coomon/cmd_bdinfo.c.

I think this sorr of change would make the handling of the
ETH1ADDR, ETH2ADDR and ETH3ADDR more consistent across any
platform that defines these fields.

Opinions?  If you buy this, I'll submit a proper patch, of course.

Thanks,
jdl




--- include/asm-ppc/u-boot.h    2004/04/13 21:42:46     1.1.1.2.2.1
+++ include/asm-ppc/u-boot.h    2004/08/06 10:51:41
@@ -77,25 +77,15 @@
 #if defined(CONFIG_HYMOD)
        hymod_conf_t    bi_hymod_conf;  /* hymod configuration
information */
 #endif
-#if defined(CFG_GT_6426x)              || \
-    defined(CONFIG_PN62)               || \
-    defined(CONFIG_PPCHAMELEONEVB)     || \
-    defined(CONFIG_SXNI855T)           || \
-    defined(CONFIG_SVM_SC8xx)          || \
-    defined(CONFIG_MPC8540ADS)          || \
-    defined(CONFIG_MPC8555CDS)         || \
-    defined(CONFIG_MPC8560ADS)         || \
-    defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH1ADDR
        /* second onboard ethernet port */
        unsigned char   bi_enet1addr[6];
 #endif
-#if defined(CFG_GT_6426x) || defined(CONFIG_SVM_SC8xx) || \
-    defined(CONFIG_MPC8540ADS) || defined(CONFIG_MPC8560ADS) || \
-    defined(CONFIG_MPC8555CDS) || defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH2ADDR
        /* third onboard ethernet port */
        unsigned char   bi_enet2addr[6];
 #endif
-#if defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH3ADDR
        unsigned char   bi_enet3addr[6];
 #endif
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined
(CONFIG_440_GX)


and also:


diff -u -r1.1.1.2.2.2 cmd_bdinfo.c
--- common/cmd_bdinfo.c 2004/06/17 20:37:25     1.1.1.2.2.2
+++ common/cmd_bdinfo.c 2004/08/06 10:51:40
@@ -83,16 +83,13 @@
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
        }
-#if (defined CONFIG_PN62) || (defined CONFIG_PPCHAMELEONEVB) \
-    || (defined CONFIG_MPC8540ADS) || (defined CONFIG_MPC8560ADS) \
-    || (defined CONFIG_MPC8555CDS)
+#ifdef CONFIG_ETH1ADDR
        puts ("\neth1addr    =");
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enet1addr[i]);
        }
-#endif /* CONFIG_PN62 */
-#if defined(CONFIG_MPC8540ADS) || defined(CONFIG_MPC8560ADS) \
-   || defined(CONFIG_MPC8555CDS)
+#endif /* CONFIG_ETH1ADDR */
+#ifdef CONFIG_ETH2ADDR 
        puts ("\neth2addr    =");
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enet2addr[i])


And one other place over in:


diff -u -r1.1.1.2.2.4 board.c
--- lib_ppc/board.c     2004/06/17 20:37:41     1.1.1.2.2.4
+++ lib_ppc/board.c     2004/08/06 10:51:41

@@ -772,11 +774,7 @@
        load_sernum_ethaddr ();
 #endif
 
-#if defined(CFG_GT_6426x) || defined(CONFIG_PN62) ||
defined(CONFIG_PPCHAMELEONEVB) || \
-    defined(CONFIG_MPC8540ADS) || \
-    defined(CONFIG_MPC8555CDS) || \
-    defined(CONFIG_MPC8560ADS) || \
-    defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH1ADDR
        /* handle the 2nd ethernet address */
 
        s = getenv ("eth1addr");
@@ -787,11 +785,7 @@
                        s = (*e) ? e + 1 : e;
        }
 #endif
-#if defined(CFG_GT_6426x) || \
-    defined(CONFIG_MPC8540ADS) || \
-    defined(CONFIG_MPC8555CDS) || \
-    defined(CONFIG_MPC8560ADS) || \
-    defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH2ADDR
        /* handle the 3rd ethernet address */
 
        s = getenv ("eth2addr");
@@ -807,7 +801,7 @@
        }
 #endif
 
-#if defined(CONFIG_440_GX)
+#ifdef CONFIG_ETH3ADDR
        /* handle 4th ethernet address */
        s = getenv("eth3addr");
 #if defined(CONFIG_XPEDITE1K)





More information about the U-Boot mailing list