Skip to contentSkip to conversation

mpc83xx: remaining 8360 libfdt fixes

PATCH New Kim Phillips 1 participant 1 message Aug 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 mpc83xx: remaining 8360 libfdt fixes

PCI clocks and QE frequencies weren't being updated, and the core clock was being updated incorrectly. This patch also adds a /memory node if it doesn't already exist prior to update.

plus some cosmetic trimming to single line comments.

---
 board/mpc8360emds/mpc8360emds.c |    8 +++++
 board/mpc8360emds/pci.c         |    8 +++-
 cpu/mpc83xx/cpu.c               |   66 +++++++++++++++++++++++++++------------
 cpu/mpc83xx/speed.c             |    1 +
 4 files changed, 61 insertions(+), 22 deletions(-)
board/mpc8360emds/mpc8360emds.c +8 -0
index 3fa093d..e37d2dc 100644
@@ -305,7 +305,15 @@ ft_board_setup(void *blob, bd_t *bd)
 	int tmp[2];
 
 	nodeoffset = fdt_find_node_by_path(blob, "/memory");
+	if (nodeoffset < 0) {
+		nodeoffset = fdt_add_subnode(blob, 0, "memory");
+		if (nodeoffset < 0)
+			printf("WARNING: failed to add /memory node: %s\n",
+				fdt_strerror(nodeoffset));
+	}
 	if (nodeoffset >= 0) {
+		fdt_setprop(blob, nodeoffset, "device_type",
+			    "memory", sizeof("memory"));
 		tmp[0] = cpu_to_be32(bd->bi_memstart);
 		tmp[1] = cpu_to_be32(bd->bi_memsize);
 		fdt_setprop(blob, nodeoffset, "reg", tmp, sizeof(tmp));
board/mpc8360emds/pci.c +6 -2
index 8f90471..7981285 100644
@@ -22,7 +22,6 @@
 #include <ft_build.h>
 #elif defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
-#include <libfdt_env.h>
 #endif
 
 #include <asm/fsl_i2c.h>
@@ -314,7 +313,12 @@ ft_pci_setup(void *blob, bd_t *bd)
 	if (nodeoffset >= 0) {
 		tmp[0] = cpu_to_be32(hose[0].first_busno);
 		tmp[1] = cpu_to_be32(hose[0].last_busno);
-		err = fdt_setprop(blob, nodeoffset, "bus-range", tmp, sizeof(tmp));
+		err = fdt_setprop(blob, nodeoffset, "bus-range",
+				  tmp, sizeof(tmp));
+
+		tmp[0] = cpu_to_be32(gd->pci_clk);
+		err = fdt_setprop(blob, nodeoffset, "clock-frequency",
+				  tmp, sizeof(tmp[0]));
 	}
 }
 #elif defined(CONFIG_OF_FLAT_TREE)
cpu/mpc83xx/cpu.c +46 -20

135 lines not on this page · raw message

cpu/mpc83xx/speed.c +1 -0
index bf30616..cba57fa 100644
@@ -351,6 +351,7 @@ int get_clocks(void)
 	gd->qe_clk = qe_clk;
 	gd->brg_clk = brg_clk;
 #endif
+	gd->pci_clk = pci_sync_in;
 	gd->cpu_clk = gd->core_clk;
 	gd->bus_clk = gd->csb_clk;
 	return 0;
Signature · 1 line
1.5.2.2