public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
       [not found] <1444987253-2893-1-git-send-email-clsee@altera.com>
@ 2015-10-16 10:16 ` Chin Liang See
  2015-10-16 23:08   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Chin Liang See @ 2015-10-16 10:16 UTC (permalink / raw)
  To: u-boot



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
  2015-10-16 10:16 ` [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function Chin Liang See
@ 2015-10-16 23:08   ` Marek Vasut
  2015-10-17 13:07     ` Chin Liang See
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2015-10-16 23:08 UTC (permalink / raw)
  To: u-boot

On Friday, October 16, 2015 at 12:16:15 PM, Chin Liang See wrote:
> From 3b86e60182b87a96f2e5e2236df7a877c9a8c468 Mon Sep 17 00:00:00 2001
> From: Chin Liang See <clsee@altera.com>
> Date: Thu, 15 Oct 2015 14:04:39 +0800
> Subject: [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
> 
> Adding fdtdec_get_u32 function which is the
> unsigned version for fdtdec_get_int

But the function you added is named fdtdec_get_uint() , not fdtdec_get_u32() ;-)

> Signed-off-by: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: Dinh Nguyen <dinh.linux@gmail.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Vikas Manocha <vikas.manocha@st.com>
> Cc: Jagannadh Teki <jteki@openedev.com>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> ---
> Changes for v4
> - Drop idea on enabling fdt_support in SPL build
> ---
>  include/fdtdec.h    | 13 +++++++++++++
>  lib/fdtdec_common.c | 18 ++++++++++++++++++
>  2 files changed, 31 insertions(+)
> 
> diff --git a/include/fdtdec.h b/include/fdtdec.h
> index 2de6dda..d51e643 100644
> --- a/include/fdtdec.h
> +++ b/include/fdtdec.h
> @@ -490,6 +490,19 @@ s32 fdtdec_get_int(const void *blob, int node,
> const char *prop_name,
>  		s32 default_val);
> 
>  /**
> + * Unsigned version of fdtdec_get_int. The property must have at least
> + * 4 bytes of data. The value of the first cell is returned.
> + *
> + * @param blob	FDT blob
> + * @param node	node to examine
> + * @param prop_name	name of property to find
> + * @param default_val	default value to return if the property is not
> found
> + * @return unsigned integer value, if found, or default_val if not
> + */
> +unsigned int fdtdec_get_uint(const void *blob, int node, const char
> *prop_name,
> +			unsigned int default_val);
> +
> +/**
>   * Get a variable-sized number from a property
>   *
>   * This reads a number from one or more cells.
> diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
> index 757931a..63b704a 100644
> --- a/lib/fdtdec_common.c
> +++ b/lib/fdtdec_common.c
> @@ -36,3 +36,21 @@ int fdtdec_get_int(const void *blob, int node, const
> char *prop_name,
>  	debug("(not found)\n");
>  	return default_val;
>  }
> +
> +unsigned int fdtdec_get_uint(const void *blob, int node, const char
> *prop_name,
> +			unsigned int default_val)
> +{
> +	const int *cell;
> +	int len;
> +
> +	debug("%s: %s: ", __func__, prop_name);
> +	cell = fdt_getprop(blob, node, prop_name, &len);
> +	if (cell && len >= sizeof(unsigned int)) {
> +		unsigned int val = fdt32_to_cpu(cell[0]);
> +
> +		debug("%#x (%d)\n", val, val);
> +		return val;
> +	}
> +	debug("(not found)\n");
> +	return default_val;
> +}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
  2015-10-16 23:08   ` Marek Vasut
@ 2015-10-17 13:07     ` Chin Liang See
  2015-10-17 13:52       ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Chin Liang See @ 2015-10-17 13:07 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On Sat, 2015-10-17 at 01:08 +0200, marex at denx.de wrote:
> On Friday, October 16, 2015 at 12:16:15 PM, Chin Liang See wrote:
> > From 3b86e60182b87a96f2e5e2236df7a877c9a8c468 Mon Sep 17 00:00:00 2001
> > From: Chin Liang See <clsee@altera.com>
> > Date: Thu, 15 Oct 2015 14:04:39 +0800
> > Subject: [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
> >
> > Adding fdtdec_get_u32 function which is the
> > unsigned version for fdtdec_get_int
>
> But the function you added is named fdtdec_get_uint() , not fdtdec_get_u32() ;-)

Good catch, miss out this.
Will fix this.

Thanks
Chin Liang

>
> > Signed-off-by: Chin Liang See <clsee@altera.com>
> > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > Cc: Dinh Nguyen <dinh.linux@gmail.com>
> > Cc: Marek Vasut <marex@denx.de>
> > Cc: Stefan Roese <sr@denx.de>
> > Cc: Vikas Manocha <vikas.manocha@st.com>
> > Cc: Jagannadh Teki <jteki@openedev.com>
> > Cc: Pavel Machek <pavel@denx.de>
> > Cc: Heiko Schocher <hs@denx.de>
> > ---
> > Changes for v4
> > - Drop idea on enabling fdt_support in SPL build
> > ---
> >  include/fdtdec.h    | 13 +++++++++++++
> >  lib/fdtdec_common.c | 18 ++++++++++++++++++
> >  2 files changed, 31 insertions(+)
> >
> > diff --git a/include/fdtdec.h b/include/fdtdec.h
> > index 2de6dda..d51e643 100644
> > --- a/include/fdtdec.h
> > +++ b/include/fdtdec.h
> > @@ -490,6 +490,19 @@ s32 fdtdec_get_int(const void *blob, int node,
> > const char *prop_name,
> >             s32 default_val);
> >
> >  /**
> > + * Unsigned version of fdtdec_get_int. The property must have at least
> > + * 4 bytes of data. The value of the first cell is returned.
> > + *
> > + * @param blob     FDT blob
> > + * @param node     node to examine
> > + * @param prop_name        name of property to find
> > + * @param default_val      default value to return if the property is not
> > found
> > + * @return unsigned integer value, if found, or default_val if not
> > + */
> > +unsigned int fdtdec_get_uint(const void *blob, int node, const char
> > *prop_name,
> > +                   unsigned int default_val);
> > +
> > +/**
> >   * Get a variable-sized number from a property
> >   *
> >   * This reads a number from one or more cells.
> > diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
> > index 757931a..63b704a 100644
> > --- a/lib/fdtdec_common.c
> > +++ b/lib/fdtdec_common.c
> > @@ -36,3 +36,21 @@ int fdtdec_get_int(const void *blob, int node, const
> > char *prop_name,
> >     debug("(not found)\n");
> >     return default_val;
> >  }
> > +
> > +unsigned int fdtdec_get_uint(const void *blob, int node, const char
> > *prop_name,
> > +                   unsigned int default_val)
> > +{
> > +   const int *cell;
> > +   int len;
> > +
> > +   debug("%s: %s: ", __func__, prop_name);
> > +   cell = fdt_getprop(blob, node, prop_name, &len);
> > +   if (cell && len >= sizeof(unsigned int)) {
> > +           unsigned int val = fdt32_to_cpu(cell[0]);
> > +
> > +           debug("%#x (%d)\n", val, val);
> > +           return val;
> > +   }
> > +   debug("(not found)\n");
> > +   return default_val;
> > +}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
  2015-10-17 13:07     ` Chin Liang See
@ 2015-10-17 13:52       ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2015-10-17 13:52 UTC (permalink / raw)
  To: u-boot

On Saturday, October 17, 2015 at 03:07:37 PM, Chin Liang See wrote:
> Hi Marek,

Hi!

> On Sat, 2015-10-17 at 01:08 +0200, marex at denx.de wrote:
> > On Friday, October 16, 2015 at 12:16:15 PM, Chin Liang See wrote:
> > > From 3b86e60182b87a96f2e5e2236df7a877c9a8c468 Mon Sep 17 00:00:00 2001
> > > From: Chin Liang See <clsee@altera.com>
> > > Date: Thu, 15 Oct 2015 14:04:39 +0800
> > > Subject: [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function
> > > 
> > > Adding fdtdec_get_u32 function which is the
> > > unsigned version for fdtdec_get_int
> > 
> > But the function you added is named fdtdec_get_uint() , not
> > fdtdec_get_u32() ;-)
> 
> Good catch, miss out this.
> Will fix this.

Thanks ! :)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-17 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1444987253-2893-1-git-send-email-clsee@altera.com>
2015-10-16 10:16 ` [U-Boot] [PATCH v4 5/5] lib, fdt: Adding fdtdec_get_u32 function Chin Liang See
2015-10-16 23:08   ` Marek Vasut
2015-10-17 13:07     ` Chin Liang See
2015-10-17 13:52       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox