public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Proposed change; What do you think?
@ 2004-08-18 22:08 Jon Loeliger
  2004-08-19 18:35 ` Dan Malek
  2004-10-09 22:24 ` Wolfgang Denk
  0 siblings, 2 replies; 11+ messages in thread
From: Jon Loeliger @ 2004-08-18 22:08 UTC (permalink / raw)
  To: u-boot

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)

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [U-Boot-Users] Proposed change; What do you think?
@ 2004-08-19 14:40 Dave Ellis
  2004-08-19 19:51 ` Jon Loeliger
  0 siblings, 1 reply; 11+ messages in thread
From: Dave Ellis @ 2004-08-19 14:40 UTC (permalink / raw)
  To: u-boot

Jon Loeliger wrote:
> 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.

I like the idea of using a common symbol, but I would prefer a new
one, something like CONFIG_HAS_ETH1, so I can have bi_enet1addr in the
kernel interface without putting a default value for it in the
environment.

> 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.

As the SXNI855T maintainer, I don't see any problems with using
CONFIG_ETH1ADDR or CONFIG_HAS_ETH1.

Dave Ellis

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

end of thread, other threads:[~2004-10-09 22:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-18 22:08 [U-Boot-Users] Proposed change; What do you think? Jon Loeliger
2004-08-19 18:35 ` Dan Malek
2004-08-19 18:57   ` Jon Loeliger
2004-08-19 19:24     ` Dan Malek
2004-08-22 23:34   ` Wolfgang Denk
2004-10-09 22:24 ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-08-19 14:40 Dave Ellis
2004-08-19 19:51 ` Jon Loeliger
2004-08-22 23:38   ` Wolfgang Denk
2004-08-23 14:14     ` Jon Loeliger
2004-08-23 17:10       ` Wolfgang Denk

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