public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] fdt_support: support adding EDID property to FDT display nodes
@ 2010-08-16 12:52 Anatolij Gustschin
  2010-08-16 12:52 ` [U-Boot] [PATCH 2/2] pdm360ng: add EDID property to FDT display node Anatolij Gustschin
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Anatolij Gustschin @ 2010-08-16 12:52 UTC (permalink / raw)
  To: u-boot

Boards can pass display timing info for drivers using EDID
block. Provide common function to add board specific EDID
data to the device tree. Subsequent patch makes use of this
functionality.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Gerald Van Baren <vanbaren@cideas.com>
---
 common/fdt_support.c  |   29 +++++++++++++++++++++++++++++
 include/fdt_support.h |    1 +
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 33336be..13c8882 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1171,3 +1171,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
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 871ef45..b2a7a0c 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -87,6 +87,7 @@ u64 fdt_translate_address(void *blob, int node_offset, const u32 *in_addr);
 int fdt_node_offset_by_compat_reg(void *blob, const char *compat,
 					phys_addr_t compat_off);
 int fdt_alloc_phandle(void *blob);
+int fdt_add_edid(void *blob, const char *compat, unsigned char *buf);
 
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-10-12 19:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 12:52 [U-Boot] [PATCH 1/2] fdt_support: support adding EDID property to FDT display nodes Anatolij Gustschin
2010-08-16 12:52 ` [U-Boot] [PATCH 2/2] pdm360ng: add EDID property to FDT display node Anatolij Gustschin
2010-08-16 14:02   ` Wolfgang Denk
2010-08-17  8:18     ` Anatolij Gustschin
2010-08-17 12:17       ` Detlev Zundel
2010-08-17 15:46   ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2010-08-18  8:11     ` Detlev Zundel
2010-10-12 19:07     ` Wolfgang Denk
2010-08-18  8:16 ` [U-Boot] [PATCH 1/2] fdt_support: support adding EDID property to FDT display nodes Detlev Zundel
2010-08-18  9:25 ` [U-Boot] [PATCH v2 " Anatolij Gustschin
2010-10-12 19:06   ` Wolfgang Denk
2010-10-12 19:11     ` Jerry Van baren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox