From e17c5200c7e9a802783a53d4f4457fa68f7fa074 Mon Sep 17 00:00:00 2001 From: Francois Retief Date: Wed, 28 Oct 2015 14:29:32 +0200 Subject: sparc: Initial ground work for generic board initialization Initial ground work in preperation for generic board initialization code for the SPARC architecture. Signed-off-by: Francois Retief --- common/board_r.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_r.c b/common/board_r.c index a41fb547a3..f1dfa68fd5 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -813,7 +813,8 @@ init_fnc_t init_sequence_r[] = { initr_flash, #endif INIT_FUNC_WATCHDOG_RESET -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) +#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) || \ + defined(CONFIG_SPARC) /* initialize higher level parts of CPU like time base and timers */ cpu_init_r, #endif -- cgit v1.2.1 From c97088c3cfa84e7e53fddd26896f145cc8c431a2 Mon Sep 17 00:00:00 2001 From: Francois Retief Date: Wed, 28 Oct 2015 15:18:22 +0200 Subject: sparc: Update cpu_init.c to use generic timer infrastructure Introduce the CONFIG_SYS_TIMER_* macros in include/asm/config.h to make use of the generic timer infrastructure in lib/time.c. Created a timer_init() function to initialize the timer hardware and update the #ifdef in board_init_f to allow this function to be called during the start-up sequence. Signed-off-by: Francois Retief --- common/board_f.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index b035c90ff3..2dd10b9819 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -808,7 +808,8 @@ static init_fnc_t init_sequence_f[] = { init_timebase, #endif #if defined(CONFIG_X86) || defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \ - defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) + defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \ + defined(CONFIG_SPARC) timer_init, /* initialize timer */ #endif #ifdef CONFIG_SYS_ALLOC_DPRAM -- cgit v1.2.1 From 1e85ccec536f86a96e5e317b5a59a6f5180451f3 Mon Sep 17 00:00:00 2001 From: Francois Retief Date: Mon, 23 Nov 2015 13:05:44 +0200 Subject: sparc: Update PROM initialization code for generic board Fixed the prom_relocate() function in start.S file by reserving memory in the board_init_f sequence and saving the offset to the __prom_start_reloc variable. This value is used as the destination when relocating the PROM. Add the prom_init() function to the end of the board_init_r sequence. Signed-off-by: Francois Retief --- common/board_f.c | 17 +++++++++++++++++ common/board_r.c | 7 +++++++ 2 files changed, 24 insertions(+) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index 2dd10b9819..8325dc333c 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -357,6 +357,20 @@ static int setup_dest_addr(void) return 0; } +#if defined(CONFIG_SPARC) +static int reserve_prom(void) +{ + /* defined in arch/sparc/cpu/leon?/prom.c */ + extern void *__prom_start_reloc; + int size = 8192; /* page table = 2k, prom = 6k */ + gd->relocaddr -= size; + __prom_start_reloc = map_sysmem(gd->relocaddr + 2048, size - 2048); + debug("Reserving %dk for PROM and page table at %08lx\n", size, + gd->relocaddr); + return 0; +} +#endif + #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) static int reserve_logbuffer(void) { @@ -909,6 +923,9 @@ static init_fnc_t init_sequence_f[] = { /* Blackfin u-boot monitor should be on top of the ram */ reserve_uboot, #endif +#if defined(CONFIG_SPARC) + reserve_prom, +#endif #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) reserve_logbuffer, #endif diff --git a/common/board_r.c b/common/board_r.c index f1dfa68fd5..3bf49fdfb3 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -66,6 +66,10 @@ DECLARE_GLOBAL_DATA_PTR; +#if defined(CONFIG_SPARC) +extern int prom_init(void); +#endif + ulong monitor_flash_len; __weak int board_flash_wp_on(void) @@ -933,6 +937,9 @@ init_fnc_t init_sequence_r[] = { #endif #ifdef CONFIG_PS2KBD initr_kbd, +#endif +#if defined(CONFIG_SPARC) + prom_init, #endif run_main_loop, }; -- cgit v1.2.1