]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
sparc: Initial ground work for generic board initialization
authorFrancois Retief <fgretief@spaceteq.co.za>
Wed, 28 Oct 2015 12:29:32 +0000 (14:29 +0200)
committerFrancois Retief <fgretief@spaceteq.co.za>
Thu, 3 Dec 2015 11:15:48 +0000 (13:15 +0200)
Initial ground work in preperation for generic board initialization
code for the SPARC architecture.

Signed-off-by: Francois Retief <fgretief@spaceteq.co.za>
arch/Kconfig
arch/sparc/cpu/leon2/cpu.c
arch/sparc/cpu/leon2/cpu_init.c
arch/sparc/cpu/leon3/cpu.c
arch/sparc/cpu/leon3/cpu_init.c
arch/sparc/include/asm/config.h
arch/sparc/include/asm/u-boot.h
arch/sparc/lib/Makefile
common/board_r.c

index 25dcf4a1a3b1a131104887020a58a8f8069c8132..6489cc9406bcd771b03b29d6f480eb73d6271d17 100644 (file)
@@ -97,6 +97,7 @@ config SH
 
 config SPARC
        bool "SPARC architecture"
+       select HAVE_GENERIC_BOARD
        select CREATE_ARCH_SYMLINK
 
 config X86
index 380c397be04224d4034a69a5dc07ba6cf5dc9183..22e63e386978f4c37101a34101b26e56af5ebb4c 100644 (file)
@@ -1,7 +1,7 @@
 /* CPU specific code for the LEON2 CPU
  *
- * (C) Copyright 2007
- * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ * (C) Copyright 2007, 2015
+ * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
index 695ee028b36e1539c9e4e9c50c3520179d45de19..581f05726996dd4f1a8515b5ddf75106e1fcfa56 100644 (file)
@@ -1,8 +1,8 @@
 /* Initializes CPU and basic hardware such as memory
  * controllers, IRQ controller and system timer 0.
  *
- * (C) Copyright 2007
- * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ * (C) Copyright 2007, 2015
+ * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* reset CPU (jump to 0, without reset) */
-void start(void);
-
-struct {
-       gd_t gd_area;
-       bd_t bd;
-} global_data;
-
 /*
  * Breath some life into the CPU...
  *
@@ -69,6 +61,15 @@ void cpu_init_f2(void)
 
 }
 
+int arch_cpu_init(void)
+{
+       gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
+       gd->bus_clk = CONFIG_SYS_CLK_FREQ;
+       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+       return 0;
+}
+
 /*
  * initialize higher level parts of CPU like time base and timers
  */
index 8ab315016b689e44f1d539016790af94214fd218..d57bf2fc8710955c73484abb039ec04306031cb5 100644 (file)
@@ -1,7 +1,7 @@
 /* CPU specific code for the LEON3 CPU
  *
- * (C) Copyright 2007
- * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ * (C) Copyright 2007, 2015
+ * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
index b140da31b13bfe6077464190a514eb0a3e81ecae..a0526cd36c5bf0a9b8aea64fcbb2bf0a424e5c42 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* reset CPU (jump to 0, without reset) */
-void start(void);
-
 ambapp_dev_irqmp *irqmp = NULL;
 ambapp_dev_gptimer *gptimer = NULL;
 unsigned int gptimer_irq = 0;
 int leon3_snooping_avail = 0;
 
-struct {
-       gd_t gd_area;
-       bd_t bd;
-} global_data;
-
 /*
  * Breath some life into the CPU...
  *
@@ -71,6 +63,15 @@ void cpu_init_f2(void)
        ambapp_bus_init(CONFIG_AMBAPP_IOAREA, CONFIG_SYS_CLK_FREQ, &ambapp_plb);
 }
 
+int arch_cpu_init(void)
+{
+       gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
+       gd->bus_clk = CONFIG_SYS_CLK_FREQ;
+       gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+       return 0;
+}
+
 /*
  * initialize higher level parts of CPU like time base and timers
  */
index fd0b5513ee8fa69fe656191f970c529d8ea18904..c884b250fe61586748f8770d7052a7de66359656 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2015,
+ * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com.
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -7,6 +8,7 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_NEEDS_MANUAL_RELOC
 
 #define CONFIG_LMB
index 5f12e581316b2a7316592e83e4e7341b46dd446f..4c4b5f218a15ffc7ba815b4498fc965cf10d6d0a 100644 (file)
 #ifndef __U_BOOT_H__
 #define __U_BOOT_H__
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
 /*
  * Currently, this Board information is not passed to
  * Linux kernel from U-Boot, but may be passed to other
@@ -44,6 +49,8 @@ typedef struct bd_info {
 
 #endif                         /* __ASSEMBLY__ */
 
+#endif /* !CONFIG_SYS_GENERIC_BOARD */
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_SPARC
 
index e69b9ba4262010cf634eb4a952e57ff4fa7e3a77..6bddd4c8a1cae0e4f55456bcf48eef2217ad2efe 100644 (file)
@@ -1,9 +1,13 @@
 #
-# (C) Copyright 2000-2006
+# (C) Copyright 2000-2015
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  = board.o cache.o interrupts.o time.o
+obj-y = cache.o interrupts.o time.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
+
+ifndef CONFIG_SYS_GENERIC_BOARD
+obj-y += board.o
+endif
index a41fb547a3c95d6d4e3182716846e6407fd21ff0..f1dfa68fd55f84198be61e31c2cad19f9f6c2461 100644 (file)
@@ -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