summaryrefslogtreecommitdiff
path: root/lib_ppc
diff options
context:
space:
mode:
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/Makefile2
-rw-r--r--lib_ppc/board.c8
-rw-r--r--lib_ppc/kgdb.c5
-rw-r--r--lib_ppc/time.c16
4 files changed, 12 insertions, 19 deletions
diff --git a/lib_ppc/Makefile b/lib_ppc/Makefile
index 399b41e..60a7625 100644
--- a/lib_ppc/Makefile
+++ b/lib_ppc/Makefile
@@ -35,7 +35,7 @@ COBJS-y += bootm.o
COBJS-y += cache.o
COBJS-y += extable.o
COBJS-y += interrupts.o
-COBJS-y += kgdb.o
+COBJS-$(CONFIG_CMD_KGDB) += kgdb.o
COBJS-y += time.o
SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 765f97a..dd22f99 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -645,6 +645,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
/* The Malloc area is immediately below the monitor copy in DRAM */
malloc_start = dest_addr - TOTAL_MALLOC_LEN;
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+ /*
+ * The gd->cpu pointer is set to an address in flash before relocation.
+ * We need to update it to point to the same CPU entry in RAM.
+ */
+ gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+
#ifdef CONFIG_SERIAL_MULTI
serial_initialize();
#endif
diff --git a/lib_ppc/kgdb.c b/lib_ppc/kgdb.c
index 78c2f0c..d3eb1f3 100644
--- a/lib_ppc/kgdb.c
+++ b/lib_ppc/kgdb.c
@@ -1,8 +1,5 @@
#include <common.h>
#include <command.h>
-
-#if defined(CONFIG_CMD_KGDB)
-
#include <kgdb.h>
#include <asm/signal.h>
#include <asm/processor.h>
@@ -322,5 +319,3 @@ kgdb_breakpoint(int argc, char *argv[])
breakinst: .long 0x7d821008\n\
");
}
-
-#endif
diff --git a/lib_ppc/time.c b/lib_ppc/time.c
index 173ffab..2909961 100644
--- a/lib_ppc/time.c
+++ b/lib_ppc/time.c
@@ -23,10 +23,6 @@
#include <common.h>
-#ifndef CONFIG_WD_PERIOD
-# define CONFIG_WD_PERIOD (10 * 1000 * 1000) /* 10 seconds default*/
-#endif
-
/* ------------------------------------------------------------------------- */
/*
@@ -54,16 +50,10 @@ unsigned long usec2ticks(unsigned long usec)
* microseconds to wait) into a number of time base ticks; then we
* watch the time base until it has incremented by that amount.
*/
-void udelay(unsigned long usec)
+void __udelay(unsigned long usec)
{
- ulong ticks, kv;
-
- do {
- kv = usec > CONFIG_WD_PERIOD ? CONFIG_WD_PERIOD : usec;
- ticks = usec2ticks (kv);
- wait_ticks (ticks);
- usec -= kv;
- } while(usec);
+ ulong ticks = usec2ticks (usec);
+ wait_ticks (ticks);
}
/* ------------------------------------------------------------------------- */