summaryrefslogtreecommitdiff
path: root/lib_ppc
diff options
context:
space:
mode:
authorroy zang <tie-fei.zang@freescale.com>2006-12-04 23:57:35 +0800
committerZang Tiefei <roy@bus.ap.freescale.net>2006-12-04 23:57:35 +0800
commitd3bb5ec198edad4869ac5276a5899881b7bf5433 (patch)
tree409a70e937d5f826df7929d11cb08a7cd207f5cd /lib_ppc
parent41862d13a87ec58c21166b10fcb754c963bc46f2 (diff)
parent9d27b3a0685ff99fc477983f315c04d49f657a8a (diff)
downloadu-boot-imx-d3bb5ec198edad4869ac5276a5899881b7bf5433.zip
u-boot-imx-d3bb5ec198edad4869ac5276a5899881b7bf5433.tar.gz
u-boot-imx-d3bb5ec198edad4869ac5276a5899881b7bf5433.tar.bz2
Merge /home/roy/CVS/7448/Open_Source/u-boot.git.dev
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/board.c24
-rw-r--r--lib_ppc/extable.c31
2 files changed, 31 insertions, 24 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 844bbc9..a11d3c0 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -511,7 +511,7 @@ void board_init_f (ulong bootflag)
bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
#endif
#if defined(CONFIG_MPC83XX)
- bd->bi_immrbar = CFG_IMMRBAR;
+ bd->bi_immrbar = CFG_IMMR;
#endif
#if defined(CONFIG_MPC8220)
bd->bi_mbar_base = CFG_MBAR; /* base of internal registers */
@@ -521,17 +521,17 @@ void board_init_f (ulong bootflag)
bd->bi_pevfreq = gd->pev_clk;
bd->bi_flbfreq = gd->flb_clk;
- /* store bootparam to sram (backward compatible), here? */
- {
- u32 *sram = (u32 *)CFG_SRAM_BASE;
- *sram++ = gd->ram_size;
- *sram++ = gd->bus_clk;
- *sram++ = gd->inp_clk;
- *sram++ = gd->cpu_clk;
- *sram++ = gd->vco_clk;
- *sram++ = gd->flb_clk;
- *sram++ = 0xb8c3ba11; /* boot signature */
- }
+ /* store bootparam to sram (backward compatible), here? */
+ {
+ u32 *sram = (u32 *)CFG_SRAM_BASE;
+ *sram++ = gd->ram_size;
+ *sram++ = gd->bus_clk;
+ *sram++ = gd->inp_clk;
+ *sram++ = gd->cpu_clk;
+ *sram++ = gd->vco_clk;
+ *sram++ = gd->flb_clk;
+ *sram++ = 0xb8c3ba11; /* boot signature */
+ }
#endif
bd->bi_bootflags = bootflag; /* boot / reboot flag (for LynxOS) */
diff --git a/lib_ppc/extable.c b/lib_ppc/extable.c
index 34b5d46..fe856ff 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,23 +52,27 @@ 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)
+ 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);