[U-Boot-Users] [PATCH] kvme080 device tree support

Sangmoon Kim dogoil at etinsys.com
Thu Jan 11 07:45:12 CET 2007


Hi,

This patch adds device tree support for kvme080 board.

Regards,
Sangmoon Kim

Signed-off-by: Sangmoon Kim <dogoil at etinsys.com>

diff --git a/board/etin/kvme080/kvme080.c b/board/etin/kvme080/kvme080.c
index de62fa0..920f55f 100644
--- a/board/etin/kvme080/kvme080.c
+++ b/board/etin/kvme080/kvme080.c
@@ -27,6 +27,10 @@ #include <pci.h>
 #include <i2c.h>
 #include <asm/processor.h>
 
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+#endif
+
 int checkboard(void)
 {
 	puts ("Board: KVME080\n");
@@ -191,3 +195,18 @@ void nvram_write(long dest, const void *
 		asm volatile("sync");
 	}
 }
+
+#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_board_setup(void *blob, bd_t *bd)
+{
+	u32 *p;
+	int len;
+
+	p = ft_get_prop(blob, "/memory/reg", &len);
+	if (p != NULL) {
+		*p++= cpu_to_be32(bd->bi_memstart);
+		*p = cpu_to_be32(bd->bi_memsize);
+	}
+}
+#endif
diff --git a/include/configs/kvme080.h b/include/configs/kvme080.h
index 61cf705..0450f70 100644
--- a/include/configs/kvme080.h
+++ b/include/configs/kvme080.h
@@ -259,4 +259,12 @@ #define CFG_DBAT3U	CFG_IBAT3U
 #define BOOTFLAG_COLD	0x01
 #define BOOTFLAG_WARM	0x02
 
+#define CONFIG_OF_FLAT_TREE	1
+#define CONFIG_OF_BOARD_SETUP	1
+
+#define OF_FLAT_TREE_MAX_SIZE	8192
+
+#define OF_CPU			"PowerPC,8245 at 0"
+#define OF_TBCLK		(bd->bi_busfreq/4)
+
 #endif	/* __CONFIG_H */





More information about the U-Boot mailing list