From 4bed9deebbd7ee6f0ba746b44d47a922156f7404 Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Wed, 10 Sep 2008 17:44:30 -0400 Subject: [PATCH 1/5] ppc4xx: Fix in-tree build for ppc440-generic boards Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Stefan Roese --- board/xilinx/ppc440-generic/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/xilinx/ppc440-generic/config.mk b/board/xilinx/ppc440-generic/config.mk index 8d220da8df..6d767552dd 100644 --- a/board/xilinx/ppc440-generic/config.mk +++ b/board/xilinx/ppc440-generic/config.mk @@ -22,4 +22,4 @@ # MA 02111-1307 USA # -sinclude $(obj)/board/$(BOARDDIR)/config.tmp +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp From 2bec498ed1164a58cd8437b561bdc4551d69f9bf Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Thu, 11 Sep 2008 19:41:25 -0400 Subject: [PATCH 2/5] ppc4xx: Fix compilation of v5fx30teval_flash Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Stefan Roese --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e8bbd7808e..116d9e7df7 100644 --- a/Makefile +++ b/Makefile @@ -1488,9 +1488,9 @@ v5fx30teval_flash_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc440-generic @mkdir -p $(obj)include $(obj)board/avnet/v5fx30teval @echo "LDSCRIPT:=$(SRCTREE)/board/xilinx/ppc440-generic/u-boot-rom.lds"\ - > $(obj)/board/avnet/v5fx30teval/config.tmp + > $(obj)board/avnet/v5fx30teval/config.tmp @echo "TEXT_BASE := 0xFF1C0000" \ - >> $(obj)/board/avnet/v5fx30teval/config.tmp + >> $(obj)board/avnet/v5fx30teval/config.tmp @$(MKCONFIG) v5fx30teval ppc ppc4xx v5fx30teval avnet VOH405_config: unconfig From 61737c59a3285f6fadf96a5836879898c04ec28d Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Thu, 11 Sep 2008 19:41:26 -0400 Subject: [PATCH 3/5] ppc4xx: Add .gitignore file to xilinx-ppc440 boards Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Stefan Roese --- board/avnet/v5fx30teval/.gitignore | 1 + board/xilinx/ml507/.gitignore | 1 + board/xilinx/ppc440-generic/.gitignore | 1 + 3 files changed, 3 insertions(+) create mode 100644 board/avnet/v5fx30teval/.gitignore create mode 100644 board/xilinx/ml507/.gitignore create mode 100644 board/xilinx/ppc440-generic/.gitignore diff --git a/board/avnet/v5fx30teval/.gitignore b/board/avnet/v5fx30teval/.gitignore new file mode 100644 index 0000000000..f6418a0c50 --- /dev/null +++ b/board/avnet/v5fx30teval/.gitignore @@ -0,0 +1 @@ +/config.tmp diff --git a/board/xilinx/ml507/.gitignore b/board/xilinx/ml507/.gitignore new file mode 100644 index 0000000000..f6418a0c50 --- /dev/null +++ b/board/xilinx/ml507/.gitignore @@ -0,0 +1 @@ +/config.tmp diff --git a/board/xilinx/ppc440-generic/.gitignore b/board/xilinx/ppc440-generic/.gitignore new file mode 100644 index 0000000000..f6418a0c50 --- /dev/null +++ b/board/xilinx/ppc440-generic/.gitignore @@ -0,0 +1 @@ +/config.tmp From 7bf5ecfa50722a9feb45ea8f04da75f5d406f20b Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 10 Sep 2008 16:53:47 +0200 Subject: [PATCH 4/5] ppc4xx: Fix SDRAM inititialization of multiple 405 based board ports This patch fixes a problem introdiced with patch bbeff30c [ppc4xx: Remove superfluous dram_init() call or replace it by initdram()]. The boards affected are: - PCI405 - PPChameleonEVB - quad100hd - taihu - zeus Signed-off-by: Stefan Roese --- board/amcc/taihu/taihu.c | 9 ------- board/dave/PPChameleonEVB/PPChameleonEVB.c | 25 ----------------- board/esd/pci405/pci405.c | 31 ---------------------- board/quad100hd/quad100hd.c | 5 ---- board/zeus/zeus.c | 23 ---------------- cpu/ppc4xx/sdram.c | 14 +++++++--- include/configs/quad100hd.h | 1 - 7 files changed, 10 insertions(+), 98 deletions(-) diff --git a/board/amcc/taihu/taihu.c b/board/amcc/taihu/taihu.c index 266f2601c5..ee0939aa3c 100644 --- a/board/amcc/taihu/taihu.c +++ b/board/amcc/taihu/taihu.c @@ -78,15 +78,6 @@ int checkboard(void) return 0; } -/************************************************************************* - * phys_size_t initdram - * - ************************************************************************/ -phys_size_t initdram(int board) -{ - return CFG_SDRAM_SIZE_PER_BANK * CFG_SDRAM_BANKS; /* 128Mbytes */ -} - static int do_sw_stat(cmd_tbl_t* cmd_tp, int flags, int argc, char *argv[]) { char stat; diff --git a/board/dave/PPChameleonEVB/PPChameleonEVB.c b/board/dave/PPChameleonEVB/PPChameleonEVB.c index c9b288a413..c715ad414a 100644 --- a/board/dave/PPChameleonEVB/PPChameleonEVB.c +++ b/board/dave/PPChameleonEVB/PPChameleonEVB.c @@ -203,31 +203,6 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ -phys_size_t initdram (int board_type) -{ - unsigned long val; - - mtdcr(memcfga, mem_mb0cf); - val = mfdcr(memcfgd); - -#if 0 /* test-only */ - for (;;) { - NAND_DISABLE_CE(1); - udelay(100); - NAND_ENABLE_CE(1); - udelay(100); - } -#endif -#if 0 - printf("\nmb0cf=%x\n", val); /* test-only */ - printf("strap=%x\n", mfdcr(strap)); /* test-only */ -#endif - - return (4*1024*1024 << ((val & 0x000e0000) >> 17)); -} - -/* ------------------------------------------------------------------------- */ - int testdram (void) { /* TODO: XXX XXX XXX */ diff --git a/board/esd/pci405/pci405.c b/board/esd/pci405/pci405.c index f740d595be..f8d7c28b83 100644 --- a/board/esd/pci405/pci405.c +++ b/board/esd/pci405/pci405.c @@ -356,37 +356,6 @@ int checkboard (void) return 0; } -/* ------------------------------------------------------------------------- */ - -phys_size_t initdram (int board_type) -{ - unsigned long val; - - mtdcr(memcfga, mem_mb0cf); - val = mfdcr(memcfgd); - -#if 0 - printf("\nmb0cf=%x\n", val); /* test-only */ - printf("strap=%x\n", mfdcr(strap)); /* test-only */ -#endif - -#if 0 /* test-only: all PCI405 version must report 16mb */ - return (4*1024*1024 << ((val & 0x000e0000) >> 17)); -#else - return (16*1024*1024); -#endif -} - -/* ------------------------------------------------------------------------- */ - -int testdram (void) -{ - /* TODO: XXX XXX XXX */ - printf ("test: 16 MB - ok\n"); - - return (0); -} - /* ------------------------------------------------------------------------- */ int wpeeprom(int wp) { diff --git a/board/quad100hd/quad100hd.c b/board/quad100hd/quad100hd.c index 81186782b2..ffc47de25d 100644 --- a/board/quad100hd/quad100hd.c +++ b/board/quad100hd/quad100hd.c @@ -86,8 +86,3 @@ int checkboard(void) return 0; } - -phys_size_t initdram(int board_type) -{ - return CFG_SDRAM_SIZE; -} diff --git a/board/zeus/zeus.c b/board/zeus/zeus.c index 33d971ab02..2a4ec5ca78 100644 --- a/board/zeus/zeus.c +++ b/board/zeus/zeus.c @@ -190,29 +190,6 @@ int checkboard(void) return (0); } -static u32 detect_sdram_size(void) -{ - u32 val; - u32 size; - - mfsdram(mem_mb0cf, val); - size = (4 << 20) << ((val & 0x000e0000) >> 17); - - /* - * Check if 2nd bank is enabled too - */ - mfsdram(mem_mb1cf, val); - if (val & 1) - size += (4 << 20) << ((val & 0x000e0000) >> 17); - - return size; -} - -phys_size_t initdram (int board_type) -{ - return detect_sdram_size(); -} - static int default_env_var(char *buf, char *var) { char *ptr; diff --git a/cpu/ppc4xx/sdram.c b/cpu/ppc4xx/sdram.c index 7d60ad667f..b5a6a4c981 100644 --- a/cpu/ppc4xx/sdram.c +++ b/cpu/ppc4xx/sdram.c @@ -209,15 +209,15 @@ phys_size_t initdram(int board_type) udelay(10000); if (get_ram_size(0, mb0cf[i].size) == mb0cf[i].size) { + phys_size_t size = mb0cf[i].size; + /* * OK, size detected. Enable second bank if * defined (assumes same type as bank 0) */ #ifdef CONFIG_SDRAM_BANK1 - u32 b1cr = mb0cf[i].size | mb0cf[i].reg; - mtsdram(mem_mcopt1, 0x00000000); - mtsdram(mem_mb1cf, b1cr); /* SDRAM0_B1CR */ + mtsdram(mem_mb1cf, mb0cf[i].size | mb0cf[i].reg); mtsdram(mem_mcopt1, 0x80800000); udelay(10000); @@ -230,13 +230,19 @@ phys_size_t initdram(int board_type) mb0cf[i].size) { mtsdram(mem_mb1cf, 0); mtsdram(mem_mcopt1, 0); + } else { + /* + * We have two identical banks, so the size + * is twice the bank size + */ + size = 2 * size; } #endif /* * OK, size detected -> all done */ - return mb0cf[i].size; + return size; } } diff --git a/include/configs/quad100hd.h b/include/configs/quad100hd.h index d464734dad..c41f5c9487 100644 --- a/include/configs/quad100hd.h +++ b/include/configs/quad100hd.h @@ -82,7 +82,6 @@ * SDRAM configuration (please see cpu/ppc/sdram.[ch]) */ #define CONFIG_SDRAM_BANK0 1 -#define CFG_SDRAM_SIZE 0x02000000 /* 32 MB */ /* FIX! SDRAM timings used in datasheet */ #define CFG_SDRAM_CL 3 /* CAS latency */ From b18410e508a12ba0a177dfc2a386857c806fa96d Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Thu, 11 Sep 2008 13:05:56 +0200 Subject: [PATCH 5/5] ppc4xx: Enable device tree (FDT) support in zeus board port Signed-off-by: Stefan Roese --- include/configs/zeus.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/configs/zeus.h b/include/configs/zeus.h index b50cba556c..b71f711da4 100644 --- a/include/configs/zeus.h +++ b/include/configs/zeus.h @@ -309,6 +309,12 @@ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* + * Pass open firmware flat tree + */ +#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP + /* ENVIRONMENT VARS */ #define CONFIG_PREBOOT "echo;echo Welcome to Bulletendpoints board v1.1;echo"