| 107 | } |
| 108 | |
| 109 | static void image_node(struct device_tree_node *node) |
| 110 | { |
| 111 | struct fit_image_node *image = xzalloc(sizeof(*image)); |
| 112 | |
| 113 | image->compression = CBFS_COMPRESS_NONE; |
| 114 | image->name = node->name; |
| 115 | |
| 116 | struct device_tree_property *prop; |
| 117 | list_for_each(prop, node->properties, list_node) { |
| 118 | if (!strcmp("data", prop->prop.name)) { |
| 119 | image->data = prop->prop.data; |
| 120 | image->size = prop->prop.size; |
| 121 | } else if (!strcmp("compression", prop->prop.name)) { |
| 122 | if (!strcmp("none", prop->prop.data)) |
| 123 | image->compression = CBFS_COMPRESS_NONE; |
| 124 | else if (!strcmp("lzma", prop->prop.data)) |
| 125 | image->compression = CBFS_COMPRESS_LZMA; |
| 126 | else if (!strcmp("lz4", prop->prop.data)) |
| 127 | image->compression = CBFS_COMPRESS_LZ4; |
| 128 | else |
| 129 | image->compression = -1; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | list_insert_after(&image->list_node, &image_nodes); |
| 134 | } |
| 135 | |
| 136 | static void config_node(struct device_tree_node *node) |
| 137 | { |
no test coverage detected