]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
[PATCH] Enable the IceCube/lite5200 variants to pass a device tree to Linux.
authorStefan Roese <sr@denx.de>
Tue, 28 Nov 2006 16:55:49 +0000 (17:55 +0100)
committerStefan Roese <sr@denx.de>
Tue, 28 Nov 2006 16:55:49 +0000 (17:55 +0100)
This patch adds the code and configuration necessary to boot with an
arch/powerpc Linux kernel.

Signed-off-by: Grant Likely <grant.likely@gmail.com>
Acked-by: Jon Loeliger <jdl@freescale.com>
board/icecube/icecube.c
cpu/mpc5xxx/cpu.c
include/configs/IceCube.h

index f958b32dbd8149f2de7ab14062c69495c062c342..ddad1bbb9e534f325786074d2de82eb7aacdfc43 100644 (file)
 #include <pci.h>
 #include <asm/processor.h>
 
 #include <pci.h>
 #include <asm/processor.h>
 
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+#endif
+
 #if defined(CONFIG_LITE5200B)
 #include "mt46v32m16.h"
 #else
 #if defined(CONFIG_LITE5200B)
 #include "mt46v32m16.h"
 #else
@@ -332,3 +336,11 @@ void ide_set_reset (int idereset)
        }
 }
 #endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
        }
 }
 #endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+
+#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+}
+#endif
index 6b6f8282cf36e8515b0ab13cdd94ee7544f9b12e..20e6735de4f6eaf7b52ac0b03894df1b8305e068 100644 (file)
 #include <mpc5xxx.h>
 #include <asm/processor.h>
 
 #include <mpc5xxx.h>
 #include <asm/processor.h>
 
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 int checkcpu (void)
 DECLARE_GLOBAL_DATA_PTR;
 
 int checkcpu (void)
@@ -102,3 +106,27 @@ unsigned long get_tbclk (void)
 }
 
 /* ------------------------------------------------------------------------- */
 }
 
 /* ------------------------------------------------------------------------- */
+
+#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 "/bus-frequency", &len);
+       if (p != NULL)
+               *p = cpu_to_be32(clock);
+
+       p = ft_get_prop(blob, "/" OF_SOC "/ethernet@3000/mac-address", &len);
+       if (p != NULL)
+               memcpy(p, bd->bi_enetaddr, 6);
+
+}
+#endif
index 1152f838d9880682e3e7652bd76582e8bfb05d60..0d3825413eac04421ab77264ca1552543266f52d 100644 (file)
 #undef CFG_IPBSPEED_133        /* define for 133MHz speed */
 #endif
 #endif /* CONFIG_MPC5200 */
 #undef CFG_IPBSPEED_133        /* define for 133MHz speed */
 #endif
 #endif /* CONFIG_MPC5200 */
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_FLAT_TREE    1
+#define CONFIG_OF_BOARD_SETUP  1
+
+/* maximum size of the flat tree (8K) */
+#define OF_FLAT_TREE_MAX_SIZE  8192
+
+#define OF_CPU                 "PowerPC,5200@0"
+#define OF_SOC                 "soc5200@f0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc5200@f0000000/serial@2000"
+
 /*
  * I2C configuration
  */
 /*
  * I2C configuration
  */