Add getenv_ulong() to read an integer from an environment variable

This is not an uncommon operation in U-Boot, so let's put it in a common
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
diff --git a/include/common.h b/include/common.h
index db1c7d0..a1683a20 100644
--- a/include/common.h
+++ b/include/common.h
@@ -297,6 +297,7 @@
 int	envmatch     (uchar *, int);
 char	*getenv	     (const char *);
 int	getenv_f     (const char *name, char *buf, unsigned len);
+ulong getenv_ulong(const char *name, int base, ulong default_val);
 int	saveenv	     (void);
 #ifdef CONFIG_PPC		/* ARM version to be fixed! */
 int inline setenv    (const char *, const char *);