All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] libfdt: make fdt_increase_size() available to everyone
Date: Mon, 17 May 2010 07:25:21 -0400	[thread overview]
Message-ID: <4BF127A1.5070802@gmail.com> (raw)
In-Reply-To: <1273526815-1091-1-git-send-email-timur@freescale.com>

Timur Tabi wrote:
> The function fdt_increase_size() increases the size of the device tree by the
> given amount.  This is useful for any code that wants to add a node or large
> property, to avoid the possibility of running out of space.  It's much smarter
> to have U-Boot increase the size of device tree when it knows it's going to
> add data, instead of hoping that the DTS was compiled with the right -p value.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>

Acked-by: Gerald Van Baren <vanbaren@cideas.com>

> ---
> 
>  common/fdt_support.c  |   20 ++++++++++----------
>  include/fdt_support.h |    1 +
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index b6f252a..01d635b 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -645,6 +645,16 @@ int fdt_resize(void *blob)
>  	return actualsize;
>  }
>  
> +int fdt_increase_size(void *fdt, int add_len)
> +{
> +	int newlen;
> +
> +	newlen = fdt_totalsize(fdt) + add_len;
> +
> +	/* Open in place with a new len */
> +	return fdt_open_into(fdt, fdt, newlen);
> +}
> +
>  #ifdef CONFIG_PCI
>  #define CONFIG_SYS_PCI_NR_INBOUND_WIN 4
>  
> @@ -792,16 +802,6 @@ int fdt_del_subnodes(const void *blob, int parent_offset)
>  	return 0;
>  }
>  
> -int fdt_increase_size(void *fdt, int add_len)
> -{
> -	int newlen;
> -
> -	newlen = fdt_totalsize(fdt) + add_len;
> -
> -	/* Open in place with a new len */
> -	return fdt_open_into(fdt, fdt, newlen);
> -}
> -
>  int fdt_del_partitions(void *blob, int parent_offset)
>  {
>  	const void *prop;
> diff --git a/include/fdt_support.h b/include/fdt_support.h
> index 9a453af..d70627d 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -78,6 +78,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
>  
>  void set_working_fdt_addr(void *addr);
>  int fdt_resize(void *blob);
> +int fdt_increase_size(void *fdt, int add_len);
>  
>  int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size);
>  

      parent reply	other threads:[~2010-05-17 11:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 21:26 [U-Boot] [PATCH 2/3] libfdt: make fdt_increase_size() available to everyone Timur Tabi
2010-05-10 21:30 ` Timur Tabi
2010-05-13 17:46 ` Kumar Gala
2010-05-16  2:11 ` [U-Boot] " Gerald Van Baren
2010-05-16  4:13   ` Timur Tabi
2010-05-17 11:24     ` Jerry Van Baren
2010-05-17 13:16     ` Wolfgang Denk
2010-05-17 14:16       ` Timur Tabi
2010-05-17 20:33         ` Wolfgang Denk
2010-05-18 14:10           ` Timur Tabi
2010-05-18 15:18             ` Wolfgang Denk
2010-05-18 15:32               ` Timur Tabi
2010-05-18 22:20                 ` Wolfgang Denk
2010-05-19  0:51                   ` Timur Tabi
2010-05-19  6:54                     ` Wolfgang Denk
2010-05-19 14:57                       ` Timur Tabi
2010-05-19 15:14                         ` Wolfgang Denk
2010-05-19 15:34                           ` Timur Tabi
2010-05-19 15:44                             ` Wolfgang Denk
2010-05-19 21:46                               ` Kumar Gala
2010-05-19 22:06                                 ` Wolfgang Denk
2010-05-19 22:12                                   ` Timur Tabi
2010-05-20  8:28                                     ` Wolfgang Denk
2010-05-20 11:44                                       ` Timur Tabi
2010-05-25 16:07                                       ` Timur Tabi
2010-05-25 17:50                                         ` Wolfgang Denk
2010-05-25 18:01                                           ` Timur Tabi
2010-05-25 19:15                                             ` Wolfgang Denk
2010-05-25 19:28                                               ` Timur Tabi
2010-05-25 22:11                                                 ` Wolfgang Denk
2010-05-26 15:11                                                   ` Timur Tabi
2010-05-26 16:11                                                     ` Wolfgang Denk
2010-05-26 16:38                                                       ` Timur Tabi
2010-05-26 17:23                                                         ` Scott Wood
2010-05-26 17:56                                                           ` Timur Tabi
2010-05-26 18:06                                                             ` Scott Wood
2010-05-26 18:23                                                               ` Timur Tabi
2010-05-26 19:14                                                                 ` Wolfgang Denk
2010-05-26 19:08                                                         ` Wolfgang Denk
2010-05-20 13:34                                   ` Kumar Gala
2010-05-20 12:58                                 ` Timur Tabi
2010-05-17 11:25 ` Jerry Van Baren [this message]

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=4BF127A1.5070802@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.