summaryrefslogtreecommitdiff
path: root/cpu/mpc85xx/cpu.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-10-20 23:52:58 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-10-20 23:52:58 +0200
commitd67c14c0f4e390dc7069bbe852f5ec8ea1acc8fc (patch)
tree8eecbb0f2c98e2619abe8eafb3cbae188d4e6e30 /cpu/mpc85xx/cpu.c
parentba999c531ed16ec749b2b6f4b0133cee38842b91 (diff)
parent3acb7727ce6aa403e938e7cf3761924590bead47 (diff)
downloadu-boot-imx-d67c14c0f4e390dc7069bbe852f5ec8ea1acc8fc.zip
u-boot-imx-d67c14c0f4e390dc7069bbe852f5ec8ea1acc8fc.tar.gz
u-boot-imx-d67c14c0f4e390dc7069bbe852f5ec8ea1acc8fc.tar.bz2
Merge with http://www.jdl.com/software/u-boot-86xx.git
Diffstat (limited to 'cpu/mpc85xx/cpu.c')
-rw-r--r--cpu/mpc85xx/cpu.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c
index f7fe22e..0507c47 100644
--- a/cpu/mpc85xx/cpu.c
+++ b/cpu/mpc85xx/cpu.c
@@ -30,7 +30,10 @@
#include <command.h>
#include <asm/cache.h>
-/* ------------------------------------------------------------------------- */
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+#endif
+
int checkcpu (void)
{
@@ -227,3 +230,48 @@ int dma_xfer(void *dest, uint count, void *src) {
return dma_check();
}
#endif
+
+
+#ifdef CONFIG_OF_FLAT_TREE
+void
+ft_cpu_setup(void *blob, bd_t *bd)
+{
+ u32 *p;
+ ulong clock;
+ int len;
+
+ 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@4500/clock-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+ p = ft_get_prop(blob, "/" OF_SOC "/serial@4600/clock-frequency", &len);
+ if (p != NULL)
+ *p = cpu_to_be32(clock);
+
+#if defined(CONFIG_MPC85XX_TSEC1)
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/mac-address", &len);
+ memcpy(p, bd->bi_enetaddr, 6);
+#endif
+
+#if defined(CONFIG_HAS_ETH1)
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/mac-address", &len);
+ memcpy(p, bd->bi_enet1addr, 6);
+#endif
+
+#if defined(CONFIG_HAS_ETH2)
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@26000/mac-address", &len);
+ memcpy(p, bd->bi_enet2addr, 6);
+#endif
+
+#if defined(CONFIG_HAS_ETH3)
+ p = ft_get_prop(blob, "/" OF_SOC "/ethernet@27000/mac-address", &len);
+ memcpy(p, bd->bi_enet3addr, 6);
+#endif
+
+}
+#endif