From 4c52783b3d024e153c4972b97332e314bc3bdc46 Mon Sep 17 00:00:00 2001 From: roy zang Date: Thu, 2 Nov 2006 18:49:51 +0800 Subject: General code modification for mpc7448hpc2 board support. 1. Add 7447A and 7448 processor support. 2. Add the following flags. CFG_CONFIG_BUS_CLK : If the 74xx bus frequency can be configured dynamically (such as by switch on board), this flag should be set. CFG_EXCEPTION_AFTER_RELOCATE: If an exception occurs after the u-boot relocates to RAM, this flag should be set. CFG_SERIAL_HANG_IN_EXCEPTION: If the print out function will cause the system hang in exception, this flag should be set. There is a design issue for tsi108/109 pci configure read. When pci scan the slots, if there is no pci card, the tsi108/9 will cause a machine check exception for mpc7448 processor. Signed-off-by: Alexandre Bounine Signed-off-by: Roy Zang --- lib_ppc/extable.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib_ppc') diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c index d92f14270ef..34b5d460cf5 100644 --- a/lib_ppc/extable.c +++ b/lib_ppc/extable.c @@ -50,14 +50,22 @@ search_one_table(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) { + DECLARE_GLOBAL_DATA_PTR; + while (first <= last) { const struct exception_table_entry *mid; long diff; mid = (last - first) / 2 + first; +#ifdef CFG_EXCEPTION_AFTER_RELOCATE + diff = (mid->insn + gd->reloc_off) - value; + if (diff == 0) + return (mid->fixup + gd->reloc_off); +#else diff = mid->insn - value; if (diff == 0) return mid->fixup; +#endif else if (diff < 0) first = mid+1; else @@ -75,8 +83,10 @@ search_exception_table(unsigned long addr) /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); +#if !defined(CFG_SERIAL_HANG_IN_EXCEPTION) if (ex_tab_message) printf("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret); +#endif if (ret) return ret; return 0; -- cgit v1.3.1 From c9c1eeed7dd193fa65fb194654132040d49d4d3a Mon Sep 17 00:00:00 2001 From: roy zang Date: Fri, 1 Dec 2006 19:01:25 +0800 Subject: Fix the exception occuring in RAM table search issue. The original search_one_table() function code can only processes the search for the exception occurring in FLASH/ROM, because the exception and fixup table usually locate in FLASH. If the exception address is also in FLASH, it will be OK. If the exception occurs in RAM, after the u-boot relocation, a relocation offset should be added. clean up the code in cpu/74xx_7xx/cpu.c Signed-off-by: Roy Zang --- cpu/74xx_7xx/cpu.c | 16 ++++++---------- include/configs/mpc7448hpc2.h | 1 - lib_ppc/extable.c | 27 +++++++++++++++++---------- 3 files changed, 23 insertions(+), 21 deletions(-) (limited to 'lib_ppc') diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c index ca45ca0457f..84d5da3116b 100644 --- a/cpu/74xx_7xx/cpu.c +++ b/cpu/74xx_7xx/cpu.c @@ -108,11 +108,11 @@ get_cpu_type(void) case 0x8003: type = CPU_7447A; break; - + case 0x8004: type = CPU_7448; break; - + default: break; } @@ -164,6 +164,10 @@ int checkcpu (void) str = "MPC7410"; break; + case CPU_7447A: + str = "MPC7447A"; + break; + case CPU_7448: str = "MPC7448"; break; @@ -180,14 +184,6 @@ int checkcpu (void) str = "MPC7457"; break; - case CPU_7447A: - str = "MPC7447A"; - break; - - case CPU_7448: - str = "MPC7448"; - break; - default: printf("Unknown CPU -- PVR: 0x%08x\n", pvr); return -1; diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h index b13b699b593..c9131a432ce 100644 --- a/include/configs/mpc7448hpc2.h +++ b/include/configs/mpc7448hpc2.h @@ -439,6 +439,5 @@ */ #define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */ #define BOOTFLAG_WARM 0x02 /* Software reboot */ -#define CFG_EXCEPTION_AFTER_RELOCATE #define CFG_SERIAL_HANG_IN_EXCEPTION #endif /* __CONFIG_H */ diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c index 34b5d460cf5..623b5f129cb 100644 --- a/lib_ppc/extable.c +++ b/lib_ppc/extable.c @@ -57,16 +57,22 @@ search_one_table(const struct exception_table_entry *first, long diff; mid = (last - first) / 2 + first; -#ifdef CFG_EXCEPTION_AFTER_RELOCATE - diff = (mid->insn + gd->reloc_off) - value; - if (diff == 0) - return (mid->fixup + gd->reloc_off); -#else - diff = mid->insn - value; - if (diff == 0) - return mid->fixup; -#endif - else if (diff < 0) + if (mid > CFG_MONITOR_BASE){ + /* exception occurs in FLASH, before u-boot relocation. + * No relocation offset is needed. + */ + diff = mid->insn - value; + if (diff == 0) + return mid->fixup; + } else { + /* exception occurs in RAM, after u-boot relocation. + * A relocation offset should be added. + */ + diff = (mid->insn + gd->reloc_off) - value; + if (diff == 0) + return (mid->fixup + gd->reloc_off); + } + if (diff < 0) first = mid+1; else last = mid-1; @@ -83,6 +89,7 @@ search_exception_table(unsigned long addr) /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); + /* if the serial port does not hang in exception, printf can be used */ #if !defined(CFG_SERIAL_HANG_IN_EXCEPTION) if (ex_tab_message) printf("Bus Fault @ 0x%08lx, fixup 0x%08lx\n", addr, ret); -- cgit v1.3.1 From 9d27b3a0685ff99fc477983f315c04d49f657a8a Mon Sep 17 00:00:00 2001 From: roy zang Date: Mon, 4 Dec 2006 17:56:59 +0800 Subject: Slight code clean up. Add comments, delete duplicate define and remove spaces. Signed-off-by: Roy Zang --- board/mpc7448hpc2/tsi108_init.c | 4 ++-- include/74xx_7xx.h | 3 +-- lib_ppc/extable.c | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'lib_ppc') diff --git a/board/mpc7448hpc2/tsi108_init.c b/board/mpc7448hpc2/tsi108_init.c index fdb53653d14..e3b09cfad36 100644 --- a/board/mpc7448hpc2/tsi108_init.c +++ b/board/mpc7448hpc2/tsi108_init.c @@ -147,7 +147,7 @@ int board_early_init_f (void) gd->mem_clk = 0; i = in32 (CFG_TSI108_CSR_BASE + TSI108_CLK_REG_OFFSET + CG_PWRUP_STATUS); - i = (i >> 20) & 0x07; /* value of SW4[4:7] */ + i = (i >> 20) & 0x07; /* Get GD PLL multiplier */ switch (i) { case 0: /* external clock */ printf ("Using external clock\n"); @@ -229,7 +229,7 @@ int board_early_init_r (void) __asm__ __volatile__ ("sync"); - /* Base addresses for Cs0, CS1, CS2, CS3 */ + /* Base addresses for CS0, CS1, CS2, CS3 */ out32 (CFG_TSI108_CSR_BASE + TSI108_HLP_REG_OFFSET + HLP_B0_ADDR, 0x00000000); diff --git a/include/74xx_7xx.h b/include/74xx_7xx.h index 8eccac8d592..ba73bae9e5f 100644 --- a/include/74xx_7xx.h +++ b/include/74xx_7xx.h @@ -111,9 +111,8 @@ typedef enum __cpu_t { CPU_750CX, CPU_750FX, CPU_750GX, CPU_7400, CPU_7410, - CPU_7448, - CPU_7450, CPU_7455, CPU_7457, CPU_7447A, CPU_7448, + CPU_7450, CPU_7455, CPU_7457, CPU_UNKNOWN} cpu_t; extern cpu_t get_cpu_type(void); diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c index 623b5f129cb..fe856ffbb52 100644 --- a/lib_ppc/extable.c +++ b/lib_ppc/extable.c @@ -37,6 +37,8 @@ * on our cache or tlb entries. */ +DECLARE_GLOBAL_DATA_PTR; + struct exception_table_entry { unsigned long insn, fixup; @@ -50,22 +52,20 @@ search_one_table(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value) { - DECLARE_GLOBAL_DATA_PTR; - while (first <= last) { const struct exception_table_entry *mid; long diff; mid = (last - first) / 2 + first; - if (mid > CFG_MONITOR_BASE){ + if (mid > CFG_MONITOR_BASE) { /* exception occurs in FLASH, before u-boot relocation. - * No relocation offset is needed. + * No relocation offset is needed. */ diff = mid->insn - value; if (diff == 0) return mid->fixup; } else { - /* exception occurs in RAM, after u-boot relocation. + /* exception occurs in RAM, after u-boot relocation. * A relocation offset should be added. */ diff = (mid->insn + gd->reloc_off) - value; -- cgit v1.3.1 From 14da5f7675bbb427c469e3f45006e027b6e21db9 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Fri, 20 Apr 2007 17:43:28 +0200 Subject: Cleanup compiler warnings, update CHANGELOG Signed-off-by: Wolfgang Denk --- CHANGELOG | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ board/nc650/nc650.c | 6 ++---- lib_ppc/extable.c | 18 +++++++++--------- 3 files changed, 59 insertions(+), 13 deletions(-) (limited to 'lib_ppc') diff --git a/CHANGELOG b/CHANGELOG index fa6c8843691..a18bb06511d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,43 @@ +commit 6923565db12af34fd5e02d354ee65a8c78ac460f +Author: Detlev Zundel +Date: Fri Apr 20 12:01:47 2007 +0200 + + Fix breakage of NC650 board with respect to nand support. + + Signed-off-by: Detlev Zundel + +commit 39f23cd90947639ac278a18ff277ec786b5ac167 +Author: Domen Puncer +Date: Fri Apr 20 11:13:16 2007 +0200 + + [RFC PATCH] icecube/lite5200b: fix OF_TBCLK (timebase-frequency) calculation + + G2 core reference manual says decrementer and time base + are decreasing/increasing once every 4 bus clock cycles. + Lets fix it, so time in Linux won't run twice as fast + + Signed-off-by: Domen Puncer + Acked-by: Grant Likely + +commit 7651f8bdbba03bb0b4f241e2d2c4cb65b230bd56 +Author: Gerald Van Baren +Date: Thu Apr 19 23:14:39 2007 -0400 + + Fix serious pointer bug with bootm and reserve map. + + What was suppose to be a stack variable was declared as a pointer, + overwriting random memory. + Also moved the libfdt.a requirement into the main Makefile. That is + The U-Boot Way. + +commit 37837828d89084879bee2f2b8c7c68d4695940df +Author: Wolfgang Denk +Date: Wed Apr 18 17:49:29 2007 +0200 + + Clenaup, update CHANGELOG + + Signed-off-by: Wolfgang Denk + commit fd094c6379e2ef8a4d0ceb5640b24cb0c8d04449 Author: Wolfgang Denk Date: Wed Apr 18 17:20:58 2007 +0200 @@ -62,6 +102,14 @@ Date: Wed Apr 18 12:05:59 2007 +0200 Signed-off-by: Stefan Roese +commit 9c00dfb0bf89c8c23e8af5b5bdf49cf66d769f85 +Author: Peter Pearse +Date: Tue Apr 17 13:30:33 2007 +0100 + + Move ppearse to ARM board list + Add Konstantin Kletschke for scb9328. + Signed-off-by: Peter Pearse + commit d3832e8fe1b214ec62424eac36cfda9fc56d21b3 Author: Domen Puncer Date: Mon Apr 16 14:00:13 2007 +0200 diff --git a/board/nc650/nc650.c b/board/nc650/nc650.c index 8a6b5b00a9c..707e4b97d17 100644 --- a/board/nc650/nc650.c +++ b/board/nc650/nc650.c @@ -177,16 +177,14 @@ long int initdram (int board_type) * * try 8 column mode */ - size8 = dram_size (CFG_MAMR_8COL, (ulong *) SDRAM_BASE3_PRELIM, - SDRAM_MAX_SIZE); + size8 = dram_size (CFG_MAMR_8COL, SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE); udelay (1000); /* * try 9 column mode */ - size9 = dram_size (CFG_MAMR_9COL, (ulong *) SDRAM_BASE3_PRELIM, - SDRAM_MAX_SIZE); + size9 = dram_size (CFG_MAMR_9COL, SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE); udelay (1000); diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c index fe856ffbb52..b14d661bbea 100644 --- a/lib_ppc/extable.c +++ b/lib_ppc/extable.c @@ -57,25 +57,25 @@ search_one_table(const struct exception_table_entry *first, long diff; mid = (last - first) / 2 + first; - if (mid > CFG_MONITOR_BASE) { - /* exception occurs in FLASH, before u-boot relocation. - * No relocation offset is needed. - */ + if ((ulong) mid > CFG_MONITOR_BASE) { + /* exception occurs in FLASH, before u-boot relocation. + * No relocation offset is needed. + */ diff = mid->insn - value; if (diff == 0) return mid->fixup; } else { - /* exception occurs in RAM, after u-boot relocation. - * A relocation offset should be added. - */ + /* exception occurs in RAM, after u-boot relocation. + * A relocation offset should be added. + */ diff = (mid->insn + gd->reloc_off) - value; if (diff == 0) return (mid->fixup + gd->reloc_off); } if (diff < 0) - first = mid+1; + first = mid + 1; else - last = mid-1; + last = mid - 1; } return 0; } -- cgit v1.3.1