Re: [U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul

2011-10-23 Thread Wolfgang Denk
Dear Simon Glass,

In message 1318552994-6653-9-git-send-email-...@chromium.org you wrote:
 This changes the board code to use the new getenv_ulong() function.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
  arch/powerpc/lib/board.c |   33 -
  1 files changed, 8 insertions(+), 25 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The universe is all a spin-off of the Big Bang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul

2011-10-14 Thread Stefan Roese
On Friday 14 October 2011 02:43:12 Simon Glass wrote:
 This changes the board code to use the new getenv_ulong() function.

 Signed-off-by: Simon Glass s...@chromium.org

Nice patch series. Thanks.

Acked-by: Stefan Roese s...@denx.de

Cheers,
Stefan

--
DENX Software Engineering GmbH,  MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 08/10] powerpc: Use getenv_ulong() in place of getenv(), strtoul

2011-10-13 Thread Simon Glass
This changes the board code to use the new getenv_ulong() function.

Signed-off-by: Simon Glass s...@chromium.org
---
 arch/powerpc/lib/board.c |   33 -
 1 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 4fd0149..f7325c8 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -158,13 +158,8 @@ typedef int (init_fnc_t) (void);
 
 static int init_baudrate (void)
 {
-   char tmp[64];   /* long enough for environment variables */
-   int i = getenv_f(baudrate, tmp, sizeof (tmp));
-
-   gd-baudrate = (i  0)
-   ? (int) simple_strtoul (tmp, NULL, 10)
-   : CONFIG_BAUDRATE;
-   return (0);
+   gd-baudrate = getenv_ulong(baudrate, 10, CONFIG_BAUDRATE);
+   return 0;
 }
 
 /***/
@@ -374,9 +369,7 @@ void board_init_f (ulong bootflag)
gd_t *id;
init_fnc_t **init_fnc_ptr;
 #ifdef CONFIG_PRAM
-   int i;
ulong reg;
-   uchar tmp[64];  /* long enough for environment variables */
 #endif
 
/* Pointer is writable since we allocated a register for it */
@@ -448,10 +441,9 @@ void board_init_f (ulong bootflag)
/*
 * reserve protected RAM
 */
-   i = getenv_f(pram, (char *)tmp, sizeof (tmp));
-   reg = (i  0) ? simple_strtoul ((const char *)tmp, NULL, 10) : 
CONFIG_PRAM;
+   reg = getenv_ulong(pram, 10, CONFIG_PRAM);
addr -= (reg  10);/* size is in kB */
-   debug (Reserving %ldk for protected RAM at %08lx\n, reg, addr);
+   debug(Reserving %ldk for protected RAM at %08lx\n, reg, addr);
 #endif /* CONFIG_PRAM */
 
/* round down to next 4 kB limit */
@@ -933,9 +925,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
udelay (20);
 
/* Initialize from environment */
-   if ((s = getenv (loadaddr)) != NULL) {
-   load_addr = simple_strtoul (s, NULL, 16);
-   }
+   load_addr = getenv_ulong(loadaddr, 16, load_addr);
 #if defined(CONFIG_CMD_NET)
if ((s = getenv (bootfile)) != NULL) {
copy_filename (BootFile, s, sizeof (BootFile));
@@ -1018,18 +1008,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 * taking into account the protected RAM at top of memory
 */
{
-   ulong pram;
+   ulong pram = 0;
uchar memsz[32];
-#ifdef CONFIG_PRAM
-   char *s;
 
-   if ((s = getenv (pram)) != NULL) {
-   pram = simple_strtoul (s, NULL, 10);
-   } else {
-   pram = CONFIG_PRAM;
-   }
-#else
-   pram=0;
+#ifdef CONFIG_PRAM
+   pram = getenv_ulong(pram, 10, CONFIG_PRAM);
 #endif
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot