diff options
author | Tom Rini <trini@konsulko.com> | 2015-11-05 07:46:28 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-11-05 07:46:28 -0500 |
commit | 28824407f341fa424535e18e164ea94b5e2cfa8a (patch) | |
tree | e6b0e14c4845444645b28ae3a104deb3f6a8a809 /lib | |
parent | 8168ee38c26be586012743ded262145081d49d05 (diff) | |
parent | a55f28624e97e1e43ac333c39713b8b9435fcbd3 (diff) | |
download | u-boot-imx-28824407f341fa424535e18e164ea94b5e2cfa8a.zip u-boot-imx-28824407f341fa424535e18e164ea94b5e2cfa8a.tar.gz u-boot-imx-28824407f341fa424535e18e164ea94b5e2cfa8a.tar.bz2 |
Merge git://git.denx.de/u-boot-socfpga
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fdtdec_common.c | 18 |
1 files changed, 18 insertions, 0 deletions
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; +} |