]> git.sur5r.net Git - u-boot/commitdiff
* Add Flat Dev Tree construction for MPC85xx ADS and CDS boards Patch by Jon Loeliger...
authorMatthew McClintock <msm@freescale.com>
Wed, 28 Jun 2006 15:43:36 +0000 (10:43 -0500)
committerJon Loeliger <jdl@freescale.com>
Wed, 9 Aug 2006 18:50:30 +0000 (13:50 -0500)
Signed-off-by: Jon Loeliger <jdl@freescale.com>
13 files changed:
board/cds/common/ft_board.c [new file with mode: 0644]
board/cds/mpc8541cds/Makefile
board/cds/mpc8548cds/Makefile
board/cds/mpc8555cds/Makefile
board/mpc8540ads/mpc8540ads.c
board/mpc8560ads/mpc8560ads.c
cpu/mpc85xx/cpu.c
cpu/mpc85xx/cpu_init.c
include/configs/MPC8540ADS.h
include/configs/MPC8541CDS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h

diff --git a/board/cds/common/ft_board.c b/board/cds/common/ft_board.c
new file mode 100644 (file)
index 0000000..73eca5e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2004 Freescale Semiconductor.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+extern void ft_cpu_setup(void *blob, bd_t *bd);
+#endif
+
+
+#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_board_setup(void *blob, bd_t *bd)
+{
+       u32 *p;
+       int len;
+
+       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
index 0d4abbd71d87bad5c4af58b96349c23e40751961..aea61360a5fd9e4858bfa757db6cd05c82024212 100644 (file)
@@ -28,7 +28,8 @@ LIB   = lib$(BOARD).a
 
 OBJS   := $(BOARD).o \
           ../common/cadmus.o \
-          ../common/eeprom.o
+          ../common/eeprom.o \
+          ../common/ft_board.o
 
 SOBJS  := init.o
 
index 0d4abbd71d87bad5c4af58b96349c23e40751961..aea61360a5fd9e4858bfa757db6cd05c82024212 100644 (file)
@@ -28,7 +28,8 @@ LIB   = lib$(BOARD).a
 
 OBJS   := $(BOARD).o \
           ../common/cadmus.o \
-          ../common/eeprom.o
+          ../common/eeprom.o \
+          ../common/ft_board.o
 
 SOBJS  := init.o
 
index 0d4abbd71d87bad5c4af58b96349c23e40751961..aea61360a5fd9e4858bfa757db6cd05c82024212 100644 (file)
@@ -28,7 +28,8 @@ LIB   = lib$(BOARD).a
 
 OBJS   := $(BOARD).o \
           ../common/cadmus.o \
-          ../common/eeprom.o
+          ../common/eeprom.o \
+          ../common/ft_board.o
 
 SOBJS  := init.o
 
index d0eb6904ada1b26c13b1b89829a000c4ab1c85cc..855888d2761347a5cddaf3e38f829261f039dc06 100644 (file)
 #include <asm/immap_85xx.h>
 #include <spd.h>
 
+#if defined(CONFIG_OF_FLAT_TREE)
+#include <ft_build.h>
+extern void ft_cpu_setup(void *blob, bd_t *bd);
+#endif
+
+
 #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
 extern void ddr_enable_ecc(unsigned int dram_size);
 #endif
@@ -342,3 +348,21 @@ pci_init_board(void)
        pci_mpc85xx_init(&hose);
 #endif /* CONFIG_PCI */
 }
+
+
+#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+void
+ft_board_setup(void *blob, bd_t *bd)
+{
+       u32 *p;
+       int len;
+
+       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
index 25f69a0bf5db8cfe3c257f8f892672adf249c897..f9d75e80510aae6c63d6169a08cb014b54c5a788 100644 (file)
@@ -544,3 +544,12 @@ pci_init_board(void)
        pci_mpc85xx_init(&hose);
 #endif /* CONFIG_PCI */
 }
+
+
+#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 f7fe22e3e1e1da1e28a651780e56ed2ead5f7a22..0507c47e6e74dc66d04adffe35631138be9dc302 100644 (file)
 #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
index c12b47b589d8795c657d559dd40dcb7257c25f40..9f4d36c1ab45d744b6a224c6e0a6e6af419a8fa7 100644 (file)
@@ -32,6 +32,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+
 #ifdef CONFIG_CPM2
 static void config_8560_ioports (volatile immap_t * immr)
 {
index 131c83224260e4472cec9220bc5b7cd9eafe547c..d31a18b794884b7e7f3081286814effef8c3154f 100644 (file)
 #define CFG_PROMPT_HUSH_PS2 "> "
 #endif
 
+/* 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,8540@0"
+#define OF_SOC                 "soc8540@e0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc8540@e0000000/serial@4500"
+
+#define CFG_64BIT_VSPRINTF     1
+#define CFG_64BIT_STRTOUL      1
+
 /* I2C */
 #define  CONFIG_HARD_I2C               /* I2C with hardware support*/
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
index c96b98b54d3c3da837e729288763bce1496edc14..86bcfe324c84d4ca18ccab87e57033b4bbe83d5b 100644 (file)
@@ -308,6 +308,18 @@ extern unsigned long get_clock_freq(void);
 #define CFG_PROMPT_HUSH_PS2 "> "
 #endif
 
+/* 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,8541@0"
+#define OF_SOC                 "soc8541@e0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc8541@e0000000/serial@4500"
+
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
index 4ca8bc35db16ba2eac3d18fc86a64426ef0d52af..b1f8a192dff9ca07623c1a89e09a34bb5558bb0f 100644 (file)
@@ -314,6 +314,18 @@ extern unsigned long get_clock_freq(void);
 #define CFG_PROMPT_HUSH_PS2 "> "
 #endif
 
+/* 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,8548@0"
+#define OF_SOC                 "soc8548@e0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc8548@e0000000/serial@4500"
+
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
index a44e3ec84534022506b6194b6ddcb46eabbfced9..b725dac52b648c55d49f822ac511a0033cd50671 100644 (file)
@@ -308,6 +308,18 @@ extern unsigned long get_clock_freq(void);
 #define CFG_PROMPT_HUSH_PS2 "> "
 #endif
 
+/* 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,8555@0"
+#define OF_SOC                 "soc8555@e0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc8555@e0000000/serial@4500"
+
 /* I2C */
 #define CONFIG_HARD_I2C                        /* I2C with hardware support */
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged */
index 2d5031b77d30e7fee8faa37cf8c1ec9863e50cc3..1c684f2fd105738cc47a056e72cde82dba815f76 100644 (file)
 #define CFG_PROMPT_HUSH_PS2 "> "
 #endif
 
+/* 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,8560@0"
+#define OF_SOC                 "soc8560@e0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 8)
+#define OF_STDOUT_PATH         "/soc8560@e0000000/serial@4500"
+
 /* I2C */
 #define  CONFIG_HARD_I2C               /* I2C with hardware support*/
 #undef CONFIG_SOFT_I2C                 /* I2C bit-banged */