summaryrefslogtreecommitdiff
path: root/lib_ppc
diff options
context:
space:
mode:
authorroy zang <tie-fei.zang@freescale.com>2006-11-02 18:49:51 +0800
committerZang Tiefei <roy@bus.ap.freescale.net>2006-11-02 18:49:51 +0800
commit4c52783b3d024e153c4972b97332e314bc3bdc46 (patch)
treeffc40c217c1b6b32e47837edaa0981f6e62403f5 /lib_ppc
parent69366bf42f22d67efce8da3f8c40a43d4a3c2695 (diff)
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 <alexandreb@tundra.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/extable.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c
index d92f14270e..34b5d460cf 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;