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.2.3