Add Flat Dev Tree construction for MPC85xx ADS and CDS boards.
PATCH 3/4 Add Flat Dev Tree construction for MPC85xx ADS and CDS boards.
* Add Flat Dev Tree construction for MPC85xx ADS and CDS boards. Patch by Jon Loeliger 17-Jan-2006
---
board/cds/common/ft_board.c | 37 +++++++++ board/cds/mpc8541cds/Makefile | 14 +++- board/cds/mpc8541cds/oftree.dts | 137 +++++++++++++++++++++++++++++++++++ board/cds/mpc8548cds/Makefile | 14 +++- board/cds/mpc8548cds/oftree.dts | 137 +++++++++++++++++++++++++++++++++++ board/cds/mpc8555cds/Makefile | 14 +++- board/cds/mpc8555cds/oftree.dts | 137 +++++++++++++++++++++++++++++++++++ board/mpc8540ads/Makefile | 13 +++ board/mpc8540ads/mpc8540ads.c | 15 ++++ board/mpc8540ads/oftree.dts | 137 +++++++++++++++++++++++++++++++++++ board/mpc8560ads/Makefile | 12 +++ board/mpc8560ads/mpc8560ads.c | 9 ++ board/mpc8560ads/oftree.dts | 153 +++++++++++++++++++++++++++++++++++++++ cpu/mpc85xx/cpu.c | 50 ++++++++++++- cpu/mpc85xx/cpu_init.c | 1 include/configs/MPC8540ADS.h | 15 ++++ include/configs/MPC8541CDS.h | 12 +++ include/configs/MPC8548CDS.h | 12 +++ include/configs/MPC8555CDS.h | 12 +++ include/configs/MPC8560ADS.h | 12 +++ 20 files changed, 932 insertions(+), 11 deletions(-)
board/cds/common/ft_board.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* 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) +{ +ft_cpu_setup (blob, bd); +} +#endif
board/cds/mpc8541cds/Makefile +12 -2
@@ -28,15 +28,25 @@ LIB = lib$(BOARD).a OBJS := $(BOARD).o \ ../common/cadmus.o \ - ../common/eeprom.o + ../common/eeprom.o \ + ../common/ft_board.o \ + oftree.o SOBJS := init.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) +%.dtb: %.dts + dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb + xxd -i $< \ + | sed -e "s/^unsigned char/const unsigned char/g" \ + | sed -e "s/^unsigned int/const unsigned int/g" > $@ + clean: - rm -f $(OBJS) $(SOBJS) + rm -f $(OBJS) $(SOBJS) *.dtb oftree.c .PHONY: distclean distclean: clean
board/cds/mpc8541cds/oftree.dts new file +137 -0
137 lines not on this page · raw message
board/cds/mpc8548cds/Makefile +12 -2
@@ -28,15 +28,25 @@ LIB = lib$(BOARD).a OBJS := $(BOARD).o \ ../common/cadmus.o \ - ../common/eeprom.o + ../common/eeprom.o \ + ../common/ft_board.o \ + oftree.o SOBJS := init.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) +%.dtb: %.dts + dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb + xxd -i $< \ + | sed -e "s/^unsigned char/const unsigned char/g" \ + | sed -e "s/^unsigned int/const unsigned int/g" > $@ + clean: - rm -f $(OBJS) $(SOBJS) + rm -f $(OBJS) $(SOBJS) *.dtb oftree.c .PHONY: distclean distclean: clean
board/cds/mpc8548cds/oftree.dts new file +137 -0
137 lines not on this page · raw message
board/cds/mpc8555cds/Makefile +12 -2
@@ -28,15 +28,25 @@ LIB = lib$(BOARD).a OBJS := $(BOARD).o \ ../common/cadmus.o \ - ../common/eeprom.o + ../common/eeprom.o \ + ../common/ft_board.o \ + oftree.o SOBJS := init.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) +%.dtb: %.dts + dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb + xxd -i $< \ + | sed -e "s/^unsigned char/const unsigned char/g" \ + | sed -e "s/^unsigned int/const unsigned int/g" > $@ + clean: - rm -f $(OBJS) $(SOBJS) + rm -f $(OBJS) $(SOBJS) *.dtb oftree.c .PHONY: distclean distclean: clean
board/cds/mpc8555cds/oftree.dts new file +137 -0
137 lines not on this page · raw message
board/mpc8540ads/Makefile +11 -2
@@ -25,14 +25,23 @@ include $(TOPDIR)/config.mk LIB = lib$(BOARD).a -OBJS := $(BOARD).o +OBJS := $(BOARD).o oftree.o SOBJS := init.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) +%.dtb: %.dts + dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb + xxd -i $< \ + | sed -e "s/^unsigned char/const unsigned char/g" \ + | sed -e "s/^unsigned int/const unsigned int/g" > $@ + +.PHONY: clean clean: - rm -f $(OBJS) $(SOBJS) + rm -f $(OBJS) $(SOBJS) *.dtb oftree.c .PHONY: distclean distclean: clean
board/mpc8540ads/mpc8540ads.c +15 -0
@@ -31,6 +31,12 @@#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,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
board/mpc8540ads/oftree.dts new file +137 -0
137 lines not on this page · raw message
board/mpc8560ads/Makefile +10 -2
@@ -25,14 +25,22 @@ include $(TOPDIR)/config.mk LIB = lib$(BOARD).a -OBJS := $(BOARD).o +OBJS := $(BOARD).o oftree.o SOBJS := init.o $(LIB): $(OBJS) $(SOBJS) $(AR) crv $@ $(OBJS) +%.dtb: %.dts + dtc -f -V 0x10 -I dts -O dtb $< >$@ + +%.c: %.dtb + xxd -i $< \ + | sed -e "s/^unsigned char/const unsigned char/g" \ + | sed -e "s/^unsigned int/const unsigned int/g" > $@ + clean: - rm -f $(OBJS) $(SOBJS) + rm -f $(OBJS) $(SOBJS) *.dtb oftree.c .PHONY: distclean distclean: clean
board/mpc8560ads/mpc8560ads.c +9 -0
@@ -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
board/mpc8560ads/oftree.dts new file +153 -0
153 lines not on this page · raw message
cpu/mpc85xx/cpu.c +49 -1
59 lines not on this page · raw message
cpu/mpc85xx/cpu_init.c +1 -0
@@ -30,6 +30,7 @@#include <ioports.h> #include <asm/io.h> +#ifdef CONFIG_CPM2 static void config_8560_ioports (volatile immap_t * immr) {
include/configs/MPC8540ADS.h +15 -0
@@ -293,6 +293,21 @@#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 at 0" +#define OF_SOC "soc8540 at e0000000" +#define OF_TBCLK (bd->bi_busfreq / 8) +#define OF_STDOUT_PATH "/soc8540 at e0000000/serial at 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 */
include/configs/MPC8541CDS.h +12 -0
@@ -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 at 0" +#define OF_SOC "soc8541 at e0000000" +#define OF_TBCLK (bd->bi_busfreq / 8) +#define OF_STDOUT_PATH "/soc8541 at e0000000/serial at 4500" +/* I2C */ #define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* I2C bit-banged */
include/configs/MPC8548CDS.h +12 -0
@@ -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 at 0" +#define OF_SOC "soc8548 at e0000000" +#define OF_TBCLK (bd->bi_busfreq / 8) +#define OF_STDOUT_PATH "/soc8548 at e0000000/serial at 4500" +/* I2C */ #define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* I2C bit-banged */
include/configs/MPC8555CDS.h +12 -0
@@ -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 at 0" +#define OF_SOC "soc8555 at e0000000" +#define OF_TBCLK (bd->bi_busfreq / 8) +#define OF_STDOUT_PATH "/soc8555 at e0000000/serial at 4500" +/* I2C */ #define CONFIG_HARD_I2C /* I2C with hardware support */ #undef CONFIG_SOFT_I2C/* I2C bit-banged */
include/configs/MPC8560ADS.h +12 -0
@@ -290,6 +290,18 @@#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 at 0" +#define OF_SOC "soc8560 at e0000000" +#define OF_TBCLK (bd->bi_busfreq / 8) +#define OF_STDOUT_PATH "/soc8560 at e0000000/serial at 4500" +/* I2C */ #define CONFIG_HARD_I2C /* I2C with hardware support*/ #undef CONFIG_SOFT_I2C/* I2C bit-banged */
PATCH 3/4 Add Flat Dev Tree construction for MPC85xx ADS and CDS boards.
Quoted 5 lines · Jon Loeliger
board/mpc8560ads/oftree.dts new file +0
-0
...
Quoted 7 lines
board/mpc8560ads/oftree.dts new file +7
-0+ serial at 4500 { + device_type = "serial"; + compatible = "ns16550"; + reg = <4500 100>; // reg base, size + clock-frequency = <0>; // should we fill in in uboot? + interrupts = <1a 3>; + interrupt-parent = <40000>;
board/mpc8560ads/oftree.dts
Quoted 10 lines
board/mpc8560ads/oftree.dts new file +10
-0+ }; + + serial at 4600 { + device_type = "serial"; + compatible = "ns16550"; + reg = <4600 100>; // reg base, size + clock-frequency = <0>; // should we fill in in uboot? + interrupts = <1a 3>; + interrupt-parent = <40000>; + };
Doesn't the 8560 have SCC serial ports only, and not a DUART?
- Nathan
PATCH 3/4 Add Flat Dev Tree construction for MPC85xx ADS and CDS boards.
Quoted 5 lines · Nathan J. Williams
Jon Loeliger <[email protected]> writes:
Doesn't the 8560 have SCC serial ports only, and not a DUART?
- Nathan
Not to worry. This is just first shot across the bow. Andy will be following up with more details and more features (like the CPM) in a couple days.
Thanks,
jdl