m68k: add generic-board support
Subsystems (2)
PATCH 3/3 m68k: add generic-board support
Add generic-board support for the m68k architecture.
--- arch/m68k/config.mk | 3 +++ arch/m68k/include/asm/config.h | 3 +++ arch/m68k/include/asm/u-boot.h | 8 ++++++++ arch/m68k/lib/Makefile | 4 +++- common/board_f.c | 22 ++++++++++++++++------ common/board_r.c | 22 +++++++--------------- include/asm-generic/u-boot.h | 2 +- 7 files changed, 41 insertions(+), 23 deletions(-)
arch/m68k/config.mk +3 -0
@@ -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
arch/m68k/include/asm/config.h +3 -0
@@ -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
arch/m68k/include/asm/u-boot.h +8 -0
@@ -20,6 +20,11 @@* 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
arch/m68k/lib/Makefile +3 -1
@@ -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
common/board_f.c +16 -6
@@ -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
@@ -624,7 +624,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;
@@ -645,7 +645,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)
@@ -735,6 +735,13 @@ static int setup_reloc(void) {#ifdef CONFIG_SYS_TEXT_BASE gd->reloc_off = gd->relocaddr -CONFIG_SYS_TEXT_BASE ; +#ifdef 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 ); +#endif #endif memcpy (gd->new_gd, (char *)gd,sizeof (gd_t));
@@ -860,6 +867,9 @@ static init_fnc_t init_sequence_f[] = {#ifdef CONFIG_FSL_ESDHC get_clocks,#endif +#ifdef CONFIG_M68K + get_clocks, +#endif env_init, /* initialize environment */#if defined(CONFIG_8xx_CPUCLK_DEFAULT)/* get CPU and bus clocks according to the environment variable */
@@ -886,7 +896,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) */
@@ -912,7 +922,7 @@ static init_fnc_t init_sequence_f[] = {#if defined(CONFIG_ARM ) || defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) 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
@@ -980,7 +990,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,
common/board_r.c +7 -15
@@ -164,14 +164,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
@@ -265,14 +268,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 ) {
@@ -688,9 +683,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,
@@ -714,7 +706,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
@@ -813,7 +805,7 @@ init_fnc_t init_sequence_r[] = {#if defined(CONFIG_ARM ) initr_enable_interrupts,#endif -#if defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) +#if defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) || defined(CONFIG_M68K ) timer_init, /* initialize timer */#endif #if defined(CONFIG_STATUS_LED ) && defined(STATUS_LED_BOOT )
include/asm-generic/u-boot.h +1 -1
@@ -41,7 +41,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)
Signature · 1 line
2.1.4
PATCH 3/3 m68k: add generic-board support
Quoted 3 lines · angelo at sysam.it
Add generic-board support for the m68k architecture.
Signed-off-by Angelo Dureghello <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150306/9960e086/attachment.sig>
PATCH 3/3 m68k: add generic-board support
In reply to Angelo DureghelloQuoted 190 lines · Angelo Dureghello
Add generic-board support for the m68k architecture.
Signed-off-by Angelo Dureghello <[email protected]>--- arch/m68k/config.mk | 3 +++ arch/m68k/include/asm/config.h | 3 +++ arch/m68k/include/asm/u-boot.h | 8 ++++++++ arch/m68k/lib/Makefile | 4 +++- common/board_f.c | 22 ++++++++++++++++------ common/board_r.c | 22 +++++++--------------- include/asm-generic/u-boot.h | 2 +- 7 files changed, 41 insertions(+), 23 deletions(-)arch/m68k/config.mk +3
-0@@ -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-sectionsarch/m68k/include/asm/config.h +3
-0@@ -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 arch/m68k/include/asm/u-boot.h +8
-0@@ -20,6 +20,11 @@* 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_M68Karch/m68k/lib/Makefile +3
-1@@ -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.ocommon/board_f.c +16
-6@@ -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 @@ -624,7 +624,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;@@ -645,7 +645,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)@@ -735,6 +735,13 @@ static int setup_reloc(void) {#ifdef CONFIG_SYS_TEXT_BASE gd->reloc_off = gd->relocaddr -CONFIG_SYS_TEXT_BASE ; +#ifdef 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 ); +#endif #endif memcpy (gd->new_gd, (char *)gd,sizeof (gd_t));@@ -860,6 +867,9 @@ static init_fnc_t init_sequence_f[] = {#ifdef CONFIG_FSL_ESDHC get_clocks,#endif +#ifdef CONFIG_M68K + get_clocks, +#endif env_init, /* initialize environment */#if defined(CONFIG_8xx_CPUCLK_DEFAULT)/* get CPU and bus clocks according to the environment variable */ @@ -886,7 +896,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) */@@ -912,7 +922,7 @@ static init_fnc_t init_sequence_f[] = {#if defined(CONFIG_ARM ) || defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) 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 @@ -980,7 +990,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,common/board_r.c +5
-2@@ -164,14 +164,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 @@ -265,14 +268,6 @@ static int initr_malloc(void)return 0 ;
common/board_r.c static int initr_malloc(void) · line 275
Quoted 10 lines
common/board_r.c +0
-8} -#ifdef CONFIG_SYS_NONCACHED_MEMORY -static int initr_noncached (void ) -{ -noncached_init (); -return 0 ; -} -#endif -
Why did this patch remove this hunk and the one below? This breaks Ethernet for the Jetson TK1 which uses non-cached memory.
Jan
Quoted 37 lines
common/board_r.c +2
-5#ifdef CONFIG_DM static int initr_dm (void ) {@@ -688,9 +683,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,@@ -714,7 +706,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 @@ -813,7 +805,7 @@ init_fnc_t init_sequence_r[] = {#if defined(CONFIG_ARM ) initr_enable_interrupts,#endif -#if defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) +#if defined(CONFIG_X86 ) || defined(CONFIG_MICROBLAZE ) || defined(CONFIG_M68K ) timer_init, /* initialize timer */#endif #if defined(CONFIG_STATUS_LED ) && defined(STATUS_LED_BOOT )include/asm-generic/u-boot.h +0
-0
include/asm-generic/u-boot.h typedef struct bd_info { · line 47
Quoted 8 lines
include/asm-generic/u-boot.h +1
-1@@ -41,7 +41,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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150307/4d391fe9/attachment.sig>