From: Robert P. J. Day <rpjday@crashcourse.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] why does fdt_fixup_ethernet() need to worry about an edited FDT?
Date: Tue, 24 May 2016 08:55:11 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.20.1605240849001.2012@localhost.localdomain> (raw)
looking at the code for fdt_fixup_ethernet() in fdt_support.c, and
i'm puzzled by the extra work being done ostensibly to take an
"edited" FDT into account:
void fdt_fixup_ethernet(void *fdt)
{
int i, j, prop;
char *tmp, *end;
char mac[16];
const char *path;
unsigned char mac_addr[6];
int offset;
if (fdt_path_offset(fdt, "/aliases") < 0)
return;
/* Cycle through all aliases */
for (prop = 0; ; prop++) {
const char *name;
int len = strlen("ethernet");
/* FDT might have been edited, recompute the offset */
offset = fdt_first_property_offset(fdt,
fdt_path_offset(fdt, "/aliases"));
/* Select property number 'prop' */
for (i = 0; i < prop; i++)
offset = fdt_next_property_offset(fdt, offset);
... snip ...
why is it that *this* routine has to worry about an edited FDT, but
nothing else i see in that entire source file has to? as a (hopefully)
relevant example:
#if defined(OF_STDOUT_PATH)
static int fdt_fixup_stdout(void *fdt, int chosenoff)
{
return fdt_setprop(fdt, chosenoff, "linux,stdout-path",
OF_STDOUT_PATH, strlen(OF_STDOUT_PATH) + 1);
}
that routine simply calls fdt_setprop() ... what is it about
fdt_fixup_ethernet() that needs to take extra care compared to every
other function in that file?
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
next reply other threads:[~2016-05-24 12:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 12:55 Robert P. J. Day [this message]
2016-05-25 2:23 ` [U-Boot] why does fdt_fixup_ethernet() need to worry about an edited FDT? Bin Meng
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=alpine.LFD.2.20.1605240849001.2012@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=u-boot@lists.denx.de \
/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