uint32_t version = DTBH_VERSION;
unsigned blob_sz = 0;
char fname[PATH_MAX];
+ const unsigned *model;
const unsigned *prop_chip;
const unsigned *prop_platform;
const unsigned *prop_subtype;
}
offset = fdt_path_offset(dtb, "/");
+
+#ifdef DTBH_MODEL
+ model = fdt_getprop(dtb, offset, "model", &len);
+ if (strstr((char *)&model[0], DTBH_MODEL) == NULL) {
+ warnx("model of %s is invalid, skipping (expected *%s* but got %s)",
+ fname, DTBH_MODEL, (char *)&model[0]);
+ free(dtb);
+ continue;
+ }
+#endif
+
prop_chip = fdt_getprop(dtb, offset, "model_info-chip", &len);
if (len % (sizeof(uint32_t)) != 0) {
warnx("model_info-chip of %s is of invalid size, skipping", fname);