]> git.sur5r.net Git - u-boot/blobdiff - common/fdt_support.c
powerpc: Zero out board info struct on bootup
[u-boot] / common / fdt_support.c
index 0ed6e77292df179b953f6d1ad760bd9e4a236ac5..9b65a8adfdec5f80423ecfd6e32c32da710e3db2 100644 (file)
@@ -1189,3 +1189,32 @@ int fdt_alloc_phandle(void *blob)
 
        return phandle + 1;
 }
+
+#if defined(CONFIG_VIDEO)
+int fdt_add_edid(void *blob, const char *compat, unsigned char *edid_buf)
+{
+       int noff;
+       int ret;
+
+       noff = fdt_node_offset_by_compatible(blob, -1, compat);
+       if (noff != -FDT_ERR_NOTFOUND) {
+               debug("%s: %s\n", fdt_get_name(blob, noff, 0), compat);
+add_edid:
+               ret = fdt_setprop(blob, noff, "edid", edid_buf, 128);
+               if (ret == -FDT_ERR_NOSPACE) {
+                       ret = fdt_increase_size(blob, 512);
+                       if (!ret)
+                               goto add_edid;
+                       else
+                               goto err_size;
+               } else if (ret < 0) {
+                       printf("Can't add property: %s\n", fdt_strerror(ret));
+                       return ret;
+               }
+       }
+       return 0;
+err_size:
+       printf("Can't increase blob size: %s\n", fdt_strerror(ret));
+       return ret;
+}
+#endif