Re: [PATCH 1/3] bootwrapper: In cuImage, print message for ENET devices not found in tree

2007-08-31 Thread Grant Likely
On 8/30/07, David Gibson [EMAIL PROTECTED] wrote:
 Sorry, I was misleading.  Scott moved the printf() into the if (devp)
 as you do, but *didn't* add the alternative warning message in the
 else.

 The reason for this is that Planetcore only supplies the first MAC
 address, and the bootwrapper must derive the addresses for all the
 ENETs from that.  That in turn means it is much more convenient to
 call fixup_mac_addresses() with more addresses than there are
 ethernets, so we don't want a warning message when that happens.

Okay, that makes sense.  I just found Scott's patch which does the
same, so I'll drop my version.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/3] bootwrapper: In cuImage, print message for ENET devices not found in tree

2007-08-30 Thread Grant Likely
From: Grant Likely [EMAIL PROTECTED]

Signed-off-by: Grant Likely [EMAIL PROTECTED]
CC: Scott Wood [EMAIL PROTECTED]
CC: Kumar Gala [EMAIL PROTECTED]
CC: David Gibson [EMAIL PROTECTED]
---

 arch/powerpc/boot/devtree.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index e1b8122..8451a1c 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -99,14 +99,14 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
while ((addr = va_arg(ap, const u8 *))) {
devp = find_node_by_prop_value(NULL, linux,network-index,
   (void*)index, sizeof(index));
-
-   printf(ENET%d: local-mac-address -
-   %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
-  addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
-
-   if (devp)
+   if (devp) {
+   printf(ENET%d: local-mac-address -
+   %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
+  addr[0], addr[1], addr[2], addr[3], addr[4], 
addr[5]);
setprop(devp, local-mac-address, addr, 6);
-
+   } else {
+   printf(ENET%d: no device in tree\n\r, index);
+   }
index++;
}
va_end(ap);

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] bootwrapper: In cuImage, print message for ENET devices not found in tree

2007-08-30 Thread David Gibson
On Thu, Aug 30, 2007 at 02:26:18PM -0600, Grant Likely wrote:
 From: Grant Likely [EMAIL PROTECTED]
 
 Signed-off-by: Grant Likely [EMAIL PROTECTED]
 CC: Scott Wood [EMAIL PROTECTED]
 CC: Kumar Gala [EMAIL PROTECTED]
 CC: David Gibson [EMAIL PROTECTED]

Hrm... I thought Scott had deliberately removed that message in his
patch set, to work with the way PlanetCore generates Ethernet
addresses.

 ---
 
  arch/powerpc/boot/devtree.c |   14 +++---
  1 files changed, 7 insertions(+), 7 deletions(-)
 
 diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
 index e1b8122..8451a1c 100644
 --- a/arch/powerpc/boot/devtree.c
 +++ b/arch/powerpc/boot/devtree.c
 @@ -99,14 +99,14 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
   while ((addr = va_arg(ap, const u8 *))) {
   devp = find_node_by_prop_value(NULL, linux,network-index,
  (void*)index, sizeof(index));
 -
 - printf(ENET%d: local-mac-address -
 - %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
 -addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
 -
 - if (devp)
 + if (devp) {
 + printf(ENET%d: local-mac-address -
 + %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
 +addr[0], addr[1], addr[2], addr[3], addr[4], 
 addr[5]);
   setprop(devp, local-mac-address, addr, 6);
 -
 + } else {
 + printf(ENET%d: no device in tree\n\r, index);
 + }
   index++;
   }
   va_end(ap);
 
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@ozlabs.org
 https://ozlabs.org/mailman/listinfo/linuxppc-dev
 

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] bootwrapper: In cuImage, print message for ENET devices not found in tree

2007-08-30 Thread Grant Likely
On 8/30/07, David Gibson [EMAIL PROTECTED] wrote:
 On Thu, Aug 30, 2007 at 02:26:18PM -0600, Grant Likely wrote:
  From: Grant Likely [EMAIL PROTECTED]
 
  Signed-off-by: Grant Likely [EMAIL PROTECTED]
  CC: Scott Wood [EMAIL PROTECTED]
  CC: Kumar Gala [EMAIL PROTECTED]
  CC: David Gibson [EMAIL PROTECTED]

 Hrm... I thought Scott had deliberately removed that message in his
 patch set, to work with the way PlanetCore generates Ethernet
 addresses.

I'm confused then.  The code either sets the property or it doesn't.
From what I can see, the message doesn't make any sense in the context
of *not* calling setprop().  How does PlanetCore work?  Scott?

g.


  ---
 
   arch/powerpc/boot/devtree.c |   14 +++---
   1 files changed, 7 insertions(+), 7 deletions(-)
 
  diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
  index e1b8122..8451a1c 100644
  --- a/arch/powerpc/boot/devtree.c
  +++ b/arch/powerpc/boot/devtree.c
  @@ -99,14 +99,14 @@ void __dt_fixup_mac_addresses(u32 startindex, ...)
while ((addr = va_arg(ap, const u8 *))) {
devp = find_node_by_prop_value(NULL, linux,network-index,
   (void*)index, sizeof(index));
  -
  - printf(ENET%d: local-mac-address -
  - %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
  -addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
  -
  - if (devp)
  + if (devp) {
  + printf(ENET%d: local-mac-address -
  + %02x:%02x:%02x:%02x:%02x:%02x\n\r, index,
  +addr[0], addr[1], addr[2], addr[3], addr[4], 
  addr[5]);
setprop(devp, local-mac-address, addr, 6);
  -
  + } else {
  + printf(ENET%d: no device in tree\n\r, index);
  + }
index++;
}
va_end(ap);
 
  ___
  Linuxppc-dev mailing list
  Linuxppc-dev@ozlabs.org
  https://ozlabs.org/mailman/listinfo/linuxppc-dev
 

 --
 David Gibson| I'll have my music baroque, and my code
 david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
 | _way_ _around_!
 http://www.ozlabs.org/~dgibson



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/3] bootwrapper: In cuImage, print message for ENET devices not found in tree

2007-08-30 Thread David Gibson
On Thu, Aug 30, 2007 at 10:14:41PM -0600, Grant Likely wrote:
 On 8/30/07, David Gibson [EMAIL PROTECTED] wrote:
  On Thu, Aug 30, 2007 at 02:26:18PM -0600, Grant Likely wrote:
   From: Grant Likely [EMAIL PROTECTED]
  
   Signed-off-by: Grant Likely [EMAIL PROTECTED]
   CC: Scott Wood [EMAIL PROTECTED]
   CC: Kumar Gala [EMAIL PROTECTED]
   CC: David Gibson [EMAIL PROTECTED]
 
  Hrm... I thought Scott had deliberately removed that message in his
  patch set, to work with the way PlanetCore generates Ethernet
  addresses.
 
 I'm confused then.  The code either sets the property or it doesn't.
 From what I can see, the message doesn't make any sense in the context
 of *not* calling setprop().  How does PlanetCore work?  Scott?

Sorry, I was misleading.  Scott moved the printf() into the if (devp)
as you do, but *didn't* add the alternative warning message in the
else.

The reason for this is that Planetcore only supplies the first MAC
address, and the bootwrapper must derive the addresses for all the
ENETs from that.  That in turn means it is much more convenient to
call fixup_mac_addresses() with more addresses than there are
ethernets, so we don't want a warning message when that happens.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev