mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
cros_ec: Convert to support live tree
Convert this driver to support the live device tree and remove the old fdtdec support. The keyboard is not yet converted. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
32
lib/fdtdec.c
32
lib/fdtdec.c
@@ -941,38 +941,6 @@ int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a flash entry from the fdt
|
||||
*
|
||||
* @param blob FDT blob
|
||||
* @param node Offset of node to read
|
||||
* @param name Name of node being read
|
||||
* @param entry Place to put offset and size of this node
|
||||
* @return 0 if ok, -ve on error
|
||||
*/
|
||||
int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
|
||||
struct fmap_entry *entry)
|
||||
{
|
||||
const char *prop;
|
||||
u32 reg[2];
|
||||
|
||||
if (fdtdec_get_int_array(blob, node, "reg", reg, 2)) {
|
||||
debug("Node '%s' has bad/missing 'reg' property\n", name);
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
entry->offset = reg[0];
|
||||
entry->length = reg[1];
|
||||
entry->used = fdtdec_get_int(blob, node, "used", entry->length);
|
||||
prop = fdt_getprop(blob, node, "compress", NULL);
|
||||
entry->compress_algo = prop && !strcmp(prop, "lzo") ?
|
||||
FMAP_COMPRESS_LZO : FMAP_COMPRESS_NONE;
|
||||
prop = fdt_getprop(blob, node, "hash", &entry->hash_size);
|
||||
entry->hash_algo = prop ? FMAP_HASH_SHA256 : FMAP_HASH_NONE;
|
||||
entry->hash = (uint8_t *)prop;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells)
|
||||
{
|
||||
u64 number = 0;
|
||||
|
Reference in New Issue
Block a user