fdt: Add function to get a config string from device tree

Add a function to look up a configuration string such as board name
and returns its value. We look in the "/config" node for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2012-10-25 16:30:59 +00:00
committed by Gerald Van Baren
parent 09258f1e8b
commit 332ab0d54a
2 changed files with 28 additions and 10 deletions

View File

@@ -367,6 +367,16 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
int fdtdec_get_config_int(const void *blob, const char *prop_name,
int default_val);
/**
* Look in the FDT for a config item with the given name and return its value
* as a string.
*
* @param blob FDT blob
* @param prop_name property name to look up
* @returns property string, NULL on error.
*/
char *fdtdec_get_config_string(const void *blob, const char *prop_name);
/*
* Look up a property in a node and return its contents in a byte
* array of given length. The property must have at least enough data for