Skip to contentSkip to conversation

Flat device tree support for 85xx ADS and CDS boards

PATCH New Andy Fleming 1 participant 1 message Mar 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 3/7 Flat device tree support for 85xx ADS and CDS boards

This is a new version of the previous patch, which modifies the board files, instead.

* Fixed a bug where memory size was not passed through the flat device tree on 85xx boards
Patch by Andy Fleming 22-Mar-2006

---

 board/cds/common/ft_board.c   |   10 ++++++++++
 board/mpc8540ads/mpc8540ads.c |   10 ++++++++++

4837c2c0333264cd7454a1d57950cf50e7bec5f3

board/cds/common/ft_board.c +10 -0
index f167e5f..1a9ccb9 100644
@@ -32,9 +32,19 @@ extern void ft_cpu_setup(void *blob, bd_
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
+	u32 *p;
+	int len;
+
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 #endif
 	ft_cpu_setup(blob, bd);
+
+	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
board/mpc8540ads/mpc8540ads.c +10 -0
index e7db14b..01723f6 100644
@@ -338,9 +338,19 @@ pci_init_board(void)
 void
 ft_board_setup(void *blob, bd_t *bd)
 {
+	u32 *p;
+	int len;
+
 #ifdef CONFIG_PCI
 	ft_pci_setup(blob, bd);
 #endif
 	ft_cpu_setup(blob, bd);
+
+	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