diff options
author | T Karthik Reddy <t.karthik.reddy@xilinx.com> | 2019-09-02 17:34:30 +0300 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2019-09-06 05:39:15 +0300 |
commit | 3f3d77158b8452a16dca4a6966217b344f77f9b7 (patch) | |
tree | 288f1972b58bbce69e34ccc2fe5c9e328b7f3a17 /drivers | |
parent | d3302395e7b3deef1d7bb3eeb0c904e97ad7937d (diff) | |
download | u-boot-3f3d77158b8452a16dca4a6966217b344f77f9b7.tar.xz |
dm: core: Add functions to read 64-bit dt properties
This patch adds functions dev_read_u64_default & dev_read_u64
to read unsigned 64-bit values from devicetree.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/core/ofnode.c | 2 | ||||
-rw-r--r-- | drivers/core/read.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index e74a662d1d..7eca00cd66 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -79,7 +79,7 @@ int ofnode_read_u64(ofnode node, const char *propname, u64 *outp) return 0; } -int ofnode_read_u64_default(ofnode node, const char *propname, u64 def) +u64 ofnode_read_u64_default(ofnode node, const char *propname, u64 def) { assert(ofnode_valid(node)); ofnode_read_u64(node, propname, &def); diff --git a/drivers/core/read.c b/drivers/core/read.c index 8b5502de11..fb3dcd9a79 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -44,6 +44,16 @@ int dev_read_u32u(struct udevice *dev, const char *propname, uint *outp) return 0; } +int dev_read_u64(struct udevice *dev, const char *propname, u64 *outp) +{ + return ofnode_read_u64(dev_ofnode(dev), propname, outp); +} + +u64 dev_read_u64_default(struct udevice *dev, const char *propname, u64 def) +{ + return ofnode_read_u64_default(dev_ofnode(dev), propname, def); +} + const char *dev_read_string(struct udevice *dev, const char *propname) { return ofnode_read_string(dev_ofnode(dev), propname); |