From: David Gibson <david@gibson.dropbear.id.au>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 07/10] bootwrapper: Add PlanetCore firmware support.
Date: Fri, 7 Sep 2007 11:03:04 +1000 [thread overview]
Message-ID: <20070907010304.GK26079@localhost.localdomain> (raw)
In-Reply-To: <20070905192115.GG32113@ld0162-tx32.am.freescale.net>
On Wed, Sep 05, 2007 at 02:21:15PM -0500, Scott Wood wrote:
> This is a library that board code can use to extract information from the
> PlanetCore configuration keys. PlanetCore is used on various boards from
> Embedded Planet.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
[snip]
> +void planetcore_set_mac_addrs(const char *table)
> +{
> + char addr[4][6];
> + u64 int_addr;
> + int i, j;
> +
> + if (!planetcore_get_hex(table, PLANETCORE_KEY_MAC_ADDR, &int_addr))
> + return;
> +
> + for (i = 0; i < 4; i++) {
> + u64 this_dev_addr = int_addr | mac_table[i];
> +
> + for (j = 5; j >= 0; j--) {
> + addr[i][j] = this_dev_addr & 0xff;
> + this_dev_addr >>= 8;
> + }
> + }
> +
> + dt_fixup_mac_addresses(addr[0], addr[1], addr[2], addr[3]);
> +}
It seems a bit silly to loop generating the MAC addresses, then loop
again assigning them to the device nodes. Better, I think, to extract
the loop innards from dt_fixup_mac_addresses(), taking the
network-index as a parameter, then call that from within your loop
here.
--
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
next prev parent reply other threads:[~2007-09-07 1:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-05 19:20 [PATCH 00/10] Bootwrapper patches Scott Wood
2007-09-05 19:21 ` [PATCH 01/10] bootwrapper: Use fsl_get_immr() in cuboot-pq2.c Scott Wood
2007-09-05 19:21 ` [PATCH 02/10] bootwrapper: Support all-in-one PCI nodes in cuboot-pq2 Scott Wood
2007-09-05 19:21 ` [PATCH 03/10] bootwrapper: flatdevtree fixes Scott Wood
2007-09-07 0:49 ` David Gibson
2007-09-05 19:21 ` [PATCH 04/10] bootwrapper: Add strtoull() Scott Wood
2007-09-05 21:12 ` Josh Boyer
2007-09-07 0:50 ` David Gibson
2007-09-05 19:21 ` [PATCH 05/10] bootwrapper: Add get_path() Scott Wood
2007-09-07 0:52 ` David Gibson
2007-09-05 19:21 ` [PATCH 06/10] bootwrapper: Move strncmp() from flatdevtree_env.h to string.S/string.h Scott Wood
2007-09-07 0:51 ` David Gibson
2007-09-07 14:24 ` Scott Wood
2007-09-05 19:21 ` [PATCH 07/10] bootwrapper: Add PlanetCore firmware support Scott Wood
2007-09-07 1:03 ` David Gibson [this message]
2007-09-05 19:21 ` [PATCH 08/10] bootwrapper: Add a firmware-independent "raw" target Scott Wood
2007-09-07 0:58 ` David Gibson
2007-09-09 23:29 ` Milton Miller
2007-09-10 14:25 ` Scott Wood
2007-09-10 14:30 ` Scott Wood
2007-09-10 16:01 ` Milton Miller
2007-09-10 16:09 ` Milton Miller
2007-09-10 21:17 ` Segher Boessenkool
2007-09-21 17:31 ` Grant Likely
2007-09-21 17:33 ` Scott Wood
2007-10-03 20:29 ` Grant Likely
2007-09-05 19:21 ` [PATCH 09/10] bootwrapper: Only print MAC addresses when the node is actually present Scott Wood
2007-09-07 0:52 ` David Gibson
2007-09-05 19:21 ` [PATCH 10/10] bootwrapper: Add fsl_get_immr() and 8xx/pq2 clock functions Scott Wood
2007-09-07 0:53 ` David Gibson
2007-09-07 14:26 ` Scott Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070907010304.GK26079@localhost.localdomain \
--to=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).