All of lore.kernel.org
 help / color / mirror / Atom feed
From: gvb.uboot <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [RFC][PATCH] fdt fixup
Date: Thu, 01 Nov 2007 19:53:54 -0400	[thread overview]
Message-ID: <472A6712.6040601@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0711011716010.12552@blarg.am.freescale.net>

Kumar Gala wrote:
> This code adds a generic fixup mechanism that allows us to get ride of
> needing explicit paths to device nodes.
> 
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index 7a81469..2c1e8ac 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -363,4 +363,125 @@ int fdt_bd_t(void *fdt)
>  }
>  #endif /* ifdef CONFIG_OF_HAS_BD_T */
> 
> +/*
> + * "Setter" functions used to add/modify FDT entries.
> + */
> +#ifdef CONFIG_HAS_ETH0
> +static int fdt_set_eth0(void *blob, int nodeoffset, const char *name, bd_t *bd)
> +{
> +	/* Fix it up if it exists, don't create it if it doesn't exist */
> +	if (fdt_get_property(blob, nodeoffset, name, 0)) {
> +		return fdt_setprop(blob, nodeoffset, name, bd->bi_enetaddr, 6);
> +	}
> +	return 0;
> +}

[snip a bunch more setter functions]

Hi Kumar,

The direction Grant Likely went with 5xxx and where Sergej was heading 
with 82xx (if only I got around to applying his patch) and where I want 
to go is to replace the table-driven methodology with direct calls to 
more generic functions, eliminating the hordes of specialized "setter" 
functions (all nearly identical).

Discussions and patches:
<http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/32573/focus=32573>
<http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/32577>

If we get the mpc5xxx style setter functions combined with your 
fdt_node_offset_by_prop_and_compat() finding changes, I think we would 
be in fat city.

Best regards,
gvb

P.S. Is David done changing libfdt yet??? ;-)  I saw you are still 
keeping up with him...

  reply	other threads:[~2007-11-01 23:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 22:17 [U-Boot-Users] [RFC][PATCH] fdt fixup Kumar Gala
2007-11-01 23:53 ` gvb.uboot [this message]
2007-11-02 15:06   ` Jon Loeliger
2007-11-02 15:41   ` Kumar Gala
2007-11-02  4:00     ` Grant Likely
2007-11-02 16:42       ` Kumar Gala
2007-11-02  4:55         ` Grant Likely
2007-11-02 18:22           ` Kumar Gala
2007-11-02 13:20             ` Grant Likely
2007-11-03  2:12               ` Kumar Gala
2007-11-02 14:56                 ` Grant Likely
2007-11-02 15:01                   ` Sergej Stepanov
2007-11-02 15:47                     ` Grant Likely
2007-11-03  6:06                       ` Kumar Gala
2007-11-02 18:59                         ` Grant Likely

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=472A6712.6040601@gmail.com \
    --to=gvb.uboot@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.