[U-Boot-Users] [PATCH] Add helper function for generic flat device tree fixups for 83xx

Kumar Gala galak at gate.crashing.org
Tue Dec 13 18:14:00 CET 2005


Add helper function for generic flat device tree fixups for 83xx

Signed-off-by: Kumar Gala <galak at kernel.crashing.org>

CHANGELOG:
* Add helper function for generic flat device tree fixups for 83xx

  Patch by Kumar Gala 13 Dec 2005

---
commit b0ffe0fd03bdd3118a2261e183387110c7f98b62
tree 7e533ce44581532f5aefc00a7fbc805690e6815d
parent dbd0923389252c41a48ed9827b2359af9d52567e
author Kumar Gala <galak at kernel.crashing.org> Tue, 13 Dec 2005 11:17:24 -0600
committer Kumar Gala <galak at kernel.crashing.org> Tue, 13 Dec 2005 11:17:24 -0600

 cpu/mpc83xx/cpu.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 8c9b515..f20d584 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -151,3 +151,36 @@ void watchdog_reset (void)
 	hang();		/* FIXME: implement watchdog_reset()? */
 }
 #endif /* CONFIG_WATCHDOG */
+
+#if defined(CONFIG_OF_FLAT_TREE)
+void
+ft_cpu_setup(void *blob, bd_t *bd)
+{
+	u32 *p;
+	int len;
+	ulong clock;
+
+	clock = bd->bi_busfreq;
+	p = ft_get_prop(blob, "/cpus/" OF_CPU "/bus-frequency", &len);
+	if (p != NULL)
+		*p = cpu_to_be32(clock);
+
+	p = ft_get_prop(blob, "/" OF_SOC "/serial at 4500/clock-frequency", &len);
+	if (p != NULL)
+		*p = cpu_to_be32(clock);
+
+	p = ft_get_prop(blob, "/" OF_SOC "/serial at 4600/clock-frequency", &len);
+	if (p != NULL)
+		*p = cpu_to_be32(clock);
+
+#ifdef CONFIG_MPC83XX_TSEC1
+	p = ft_get_prop(blob, "/" OF_SOC "/ethernet at 24000/address", &len);
+		memcpy(p, bd->bi_enetaddr, 6);
+#endif
+
+#ifdef CONFIG_MPC83XX_TSEC2
+	p = ft_get_prop(blob, "/" OF_SOC "/ethernet at 25000/address", &len);
+		memcpy(p, bd->bi_enet1addr, 6);
+#endif
+}
+#endif





More information about the U-Boot mailing list