]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
m68k: add generic-board support
authorangelo@sysam.it <angelo@sysam.it>
Thu, 12 Feb 2015 00:40:17 +0000 (01:40 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:22:29 +0000 (14:22 +0200)
Add generic-board support for the m68k architecture.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
arch/m68k/config.mk
arch/m68k/include/asm/config.h
arch/m68k/include/asm/u-boot.h
arch/m68k/lib/Makefile
common/board_f.c
common/board_r.c
include/asm-generic/u-boot.h

index 3b3a7e88ab6077eb9de13dcbc4e0073b1787194b..a629b68d6190a1227afc57d85d15b5102710b4a0 100644 (file)
@@ -11,6 +11,9 @@ endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000
 
+# Support generic board on m68k
+__HAVE_ARCH_GENERIC_BOARD := y
+
 PLATFORM_CPPFLAGS += -D__M68K__
 PLATFORM_LDFLAGS  += -n
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
index 9c4d3fb8fd7e905fe9ba2bf598d095fea86e8e43..75908428819b464a792e1c6d519bdd2b0c1675c0 100644 (file)
@@ -7,6 +7,9 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_SYS_GENERIC_GLOBAL_DATA
+
 #define CONFIG_NEEDS_MANUAL_RELOC
 
 #define CONFIG_LMB
index 983cb2d9671c8aebc37fbe1ed6a7577ae4b15373..911c0d398c503acaa4c936ebc3dda4bdccba1e00 100644 (file)
  * include/asm-ppc/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
+
 #ifndef __ASSEMBLY__
 
 typedef struct bd_info {
@@ -48,6 +53,9 @@ typedef struct bd_info {
 
 #endif                         /* __ASSEMBLY__ */
 
+#endif                         /* !CONFIG_SYS_GENERIC_BOARD */
+
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_M68K
 
index 65867d6e4711b42d7b98cdceecb8098d7a1a9548..d0e1a845dd1c5cf733d35d5d6317f39ebc728739 100644 (file)
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:     GPL-2.0+
 #
 
-obj-y  += board.o
+ifndef CONFIG_SYS_GENERIC_BOARD
+obj-y   += board.o
+endif
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y  += cache.o
 obj-y  += interrupts.o
index 762e97cb9e5734493224401f38cd30b2a23d240e..d8c12a0f83670c3ac5a35f7d1bc45c13956bc803 100644 (file)
@@ -174,7 +174,7 @@ static int announce_dram_init(void)
        return 0;
 }
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_PPC)
+#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)
 static int init_func_ram(void)
 {
 #ifdef CONFIG_BOARD_TYPES
@@ -615,7 +615,7 @@ static int display_new_sp(void)
        return 0;
 }
 
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
 static int setup_board_part1(void)
 {
        bd_t *bd = gd->bd;
@@ -636,7 +636,7 @@ static int setup_board_part1(void)
                defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
        bd->bi_immr_base = CONFIG_SYS_IMMR;     /* base  of IMMR register     */
 #endif
-#if defined(CONFIG_MPC5xxx)
+#if defined(CONFIG_MPC5xxx) || defined(CONFIG_M68K)
        bd->bi_mbar_base = CONFIG_SYS_MBAR;     /* base of internal registers */
 #endif
 #if defined(CONFIG_MPC83xx)
@@ -725,11 +725,16 @@ static int reloc_fdt(void)
 static int setup_reloc(void)
 {
 #ifdef CONFIG_SYS_TEXT_BASE
-#ifndef CONFIG_ARM
-       gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
-#else
+#if defined(CONFIG_M68K)
+       /*
+        * On all ColdFire arch cpu, monitor code starts always
+        * just after the default vector table location, so at 0x400
+        */
+       gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
+#elif defined(CONFIG_ARM)
        gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
-#endif
+#else
+       gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
 #endif
        memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
 
@@ -854,6 +859,9 @@ static init_fnc_t init_sequence_f[] = {
 #endif
 #ifdef CONFIG_FSL_ESDHC
        get_clocks,
+#endif
+#ifdef CONFIG_M68K
+       get_clocks,
 #endif
        env_init,               /* initialize environment */
 #if defined(CONFIG_8xx_CPUCLK_DEFAULT)
@@ -881,7 +889,7 @@ static init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_MPC83xx)
        prt_83xx_rsr,
 #endif
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
        checkcpu,
 #endif
        print_cpuinfo,          /* display cpu info (and speed) */
@@ -907,7 +915,7 @@ static init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
        dram_init,              /* configure available RAM banks */
 #endif
-#if defined(CONFIG_MIPS) || defined(CONFIG_PPC)
+#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)
        init_func_ram,
 #endif
 #ifdef CONFIG_POST
@@ -975,7 +983,7 @@ static init_fnc_t init_sequence_f[] = {
        reserve_stacks,
        setup_dram_config,
        show_dram_config,
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
        setup_board_part1,
        INIT_FUNC_WATCHDOG_RESET
        setup_board_part2,
index 4fcd4f6a7057e3ba8afeb985869f358718fa7c66..826b94e98009988e18243f9d04b728653007553e 100644 (file)
@@ -167,14 +167,17 @@ static int initr_serial(void)
        return 0;
 }
 
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
 static int initr_trap(void)
 {
        /*
         * Setup trap handlers
         */
+#if defined(CONFIG_PPC)
        trap_init(gd->relocaddr);
-
+#else
+       trap_init(CONFIG_SYS_SDRAM_BASE);
+#endif
        return 0;
 }
 #endif
@@ -268,14 +271,6 @@ static int initr_malloc(void)
        return 0;
 }
 
-#ifdef CONFIG_SYS_NONCACHED_MEMORY
-static int initr_noncached(void)
-{
-       noncached_init();
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_DM
 static int initr_dm(void)
 {
@@ -703,9 +698,6 @@ init_fnc_t init_sequence_r[] = {
 #endif
        initr_barrier,
        initr_malloc,
-#ifdef CONFIG_SYS_NONCACHED_MEMORY
-       initr_noncached,
-#endif
        bootstage_relocate,
 #ifdef CONFIG_DM
        initr_dm,
@@ -729,7 +721,7 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
        initr_manual_reloc_cmdtable,
 #endif
-#ifdef CONFIG_PPC
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
        initr_trap,
 #endif
 #ifdef CONFIG_ADDR_MAP
@@ -831,7 +823,8 @@ init_fnc_t init_sequence_r[] = {
 #if defined(CONFIG_ARM) || defined(CONFIG_AVR32)
        initr_enable_interrupts,
 #endif
-#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
+#if defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) \
+       || defined(CONFIG_M68K)
        timer_init,             /* initialize timer */
 #endif
 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
index a63a87a2871e52d19f0fb597c5fc7cd4ee58bc62..ff697aa90c3f8b29bcc9d34bd61537308856f30a 100644 (file)
@@ -45,7 +45,7 @@ typedef struct bd_info {
        || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
        unsigned long   bi_immr_base;   /* base of IMMR register */
 #endif
-#if defined(CONFIG_MPC5xxx)
+#if defined(CONFIG_MPC5xxx) || defined(CONFIG_M68K)
        unsigned long   bi_mbar_base;   /* base of internal registers */
 #endif
 #if defined(CONFIG_MPC83xx)