summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/Makefile2
-rw-r--r--arch/powerpc/lib/board.c18
-rw-r--r--arch/powerpc/lib/ticks.S17
3 files changed, 19 insertions, 18 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 86cf02ace..59c723b07 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -59,8 +59,10 @@ SOBJS-y += reloc.o
COBJS-$(CONFIG_BAT_RW) += bat_rw.o
ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_SYS_GENERIC_BOARD
COBJS-y += board.o
endif
+endif
COBJS-y += bootm.o
COBJS-y += cache.o
COBJS-y += extable.o
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 12270a453..422b4a39b 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -123,7 +123,7 @@ DECLARE_GLOBAL_DATA_PTR;
#endif
extern ulong __init_end;
-extern ulong __bss_end__;
+extern ulong __bss_end;
ulong monitor_flash_len;
#if defined(CONFIG_CMD_BEDBUG)
@@ -237,25 +237,18 @@ static int init_func_spi(void)
/***********************************************************************/
#if defined(CONFIG_WATCHDOG)
-static int init_func_watchdog_init(void)
+int init_func_watchdog_init(void)
{
puts(" Watchdog enabled\n");
WATCHDOG_RESET();
return 0;
}
-#define INIT_FUNC_WATCHDOG_INIT init_func_watchdog_init,
-
-static int init_func_watchdog_reset(void)
+int init_func_watchdog_reset(void)
{
WATCHDOG_RESET();
return 0;
}
-
-#define INIT_FUNC_WATCHDOG_RESET init_func_watchdog_reset,
-#else
-#define INIT_FUNC_WATCHDOG_INIT /* undef */
-#define INIT_FUNC_WATCHDOG_RESET /* undef */
#endif /* CONFIG_WATCHDOG */
/*
@@ -326,7 +319,8 @@ static init_fnc_t *init_sequence[] = {
#ifdef CONFIG_POST
post_init_f,
#endif
- INIT_FUNC_WATCHDOG_RESET init_func_ram,
+ INIT_FUNC_WATCHDOG_RESET
+ init_func_ram,
#if defined(CONFIG_SYS_DRAM_TEST)
testdram,
#endif /* CONFIG_SYS_DRAM_TEST */
@@ -419,7 +413,7 @@ void board_init_f(ulong bootflag)
* - monitor code
* - board info struct
*/
- len = (ulong)&__bss_end__ - CONFIG_SYS_MONITOR_BASE;
+ len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
/*
* Subtract specified amount of memory to hide so that it won't
diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S
index 17810395b..63114bb0c 100644
--- a/arch/powerpc/lib/ticks.S
+++ b/arch/powerpc/lib/ticks.S
@@ -50,19 +50,24 @@ wait_ticks:
stwu r1, -16(r1)
mflr r0 /* save link register */
stw r0, 20(r1) /* Use r0 or GDB will be unhappy */
- mr r7, r3 /* save tick count */
+ stw r14, 12(r1) /* save used registers */
+ stw r15, 8(r1)
+ mr r14, r3 /* save tick count */
bl get_ticks /* Get start time */
/* Calculate end time */
- addc r7, r4, r7 /* Compute end time lower */
- addze r6, r3 /* and end time upper */
+ addc r14, r4, r14 /* Compute end time lower */
+ addze r15, r3 /* and end time upper */
WATCHDOG_RESET /* Trigger watchdog, if needed */
1: bl get_ticks /* Get current time */
- subfc r4, r4, r7 /* Subtract current time from end time */
- subfe. r3, r3, r6
+ subfc r4, r4, r14 /* Subtract current time from end time */
+ subfe. r3, r3, r15
bge 1b /* Loop until time expired */
- mtlr r0 /* restore link register */
+ lwz r15, 8(r1) /* restore saved registers */
+ lwz r14, 12(r1)
+ lwz r0, 20(r1)
addi r1,r1,16
+ mtlr r0
blr