From patchwork Wed Nov 30 22:15:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 701253 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3tTZWB2rwKz9t1P for ; Thu, 1 Dec 2016 09:16:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F00ACA7594; Wed, 30 Nov 2016 23:16:03 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3ZVYiqjI3Tif; Wed, 30 Nov 2016 23:16:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8BC83A757A; Wed, 30 Nov 2016 23:16:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 541C2A757A for ; Wed, 30 Nov 2016 23:16:00 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RGjCBNtH22Uh for ; Wed, 30 Nov 2016 23:16:00 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from sysam.it (sysam.it [5.39.81.93]) by theia.denx.de (Postfix) with ESMTPS id 0D2D3A7576 for ; Wed, 30 Nov 2016 23:15:57 +0100 (CET) Received: (qmail 13631 invoked from network); 30 Nov 2016 21:55:34 -0000 Received: from host146-203-static.20-80-b.business.telecomitalia.it (HELO bethlehem.hq.mittelab.org) (angelo@sysam.it@80.20.203.146) by sysam.it with ESMTPA; 30 Nov 2016 21:55:34 -0000 From: Angelo Dureghello To: u-boot@lists.denx.de Date: Wed, 30 Nov 2016 23:15:51 +0100 Message-Id: <20161130221551.8652-1-angelo@sysam.it> X-Mailer: git-send-email 2.10.2 Cc: trini@konsulko.com, Angelo Dureghello , alison.wang@freescale.com Subject: [U-Boot] [PATCH v2 1/2] common/board_f.c: align m68k arch to use CONFIG_DISPLAY_CPUINFO X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Change all coldfire arch files to use CONFIG_DISPLAY_CPUINFO. Signed-off-by: Angelo Dureghello Reviewed-by: Tom Rini --- Changes for v2: - update common/Kconfig to add M68K to the default y list --- arch/m68k/cpu/mcf5227x/cpu.c | 4 +++- arch/m68k/cpu/mcf523x/cpu.c | 4 +++- arch/m68k/cpu/mcf52x2/cpu.c | 29 +++++++++++++++++++++-------- arch/m68k/cpu/mcf530x/cpu.c | 4 +++- arch/m68k/cpu/mcf532x/cpu.c | 4 +++- arch/m68k/cpu/mcf5445x/cpu.c | 4 +++- arch/m68k/cpu/mcf547x_8x/cpu.c | 4 +++- common/Kconfig | 2 +- common/board_f.c | 2 +- 9 files changed, 41 insertions(+), 16 deletions(-) diff --git a/arch/m68k/cpu/mcf5227x/cpu.c b/arch/m68k/cpu/mcf5227x/cpu.c index 7d611de..63cffd3 100644 --- a/arch/m68k/cpu/mcf5227x/cpu.c +++ b/arch/m68k/cpu/mcf5227x/cpu.c @@ -28,7 +28,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { ccm_t *ccm = (ccm_t *) MMAP_CCM; u16 msk; @@ -60,3 +61,4 @@ int checkcpu(void) return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ diff --git a/arch/m68k/cpu/mcf523x/cpu.c b/arch/m68k/cpu/mcf523x/cpu.c index 67879c7..2e52939 100644 --- a/arch/m68k/cpu/mcf523x/cpu.c +++ b/arch/m68k/cpu/mcf523x/cpu.c @@ -28,7 +28,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { ccm_t *ccm = (ccm_t *) MMAP_CCM; u16 msk; @@ -56,6 +57,7 @@ int checkcpu(void) return 0; }; +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_WATCHDOG) /* Called by macro WATCHDOG_RESET */ diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c index 5ec7609..7b27133 100644 --- a/arch/m68k/cpu/mcf52x2/cpu.c +++ b/arch/m68k/cpu/mcf52x2/cpu.c @@ -37,7 +37,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { char buf1[32], buf2[32]; @@ -47,6 +48,7 @@ int checkcpu(void) strmhz(buf2, gd->bus_clk)); return 0; }; +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_WATCHDOG) /* Called by macro WATCHDOG_RESET */ @@ -94,12 +96,13 @@ int watchdog_init(void) #endif /* #ifdef CONFIG_M5208 */ #ifdef CONFIG_M5271 +#if defined(CONFIG_DISPLAY_CPUINFO) /* * Both MCF5270 and MCF5271 are members of the MPC5271 family. Try to * determine which one we are running on, based on the Chip Identification * Register (CIR). */ -int checkcpu(void) +int print_cpuinfo(void) { char buf[32]; unsigned short cir; /* Chip Identification Register */ @@ -133,6 +136,7 @@ int checkcpu(void) return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -184,7 +188,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { sysctrl_t *sysctrl = (sysctrl_t *) (MMAP_CFG); uchar msk; @@ -209,6 +214,7 @@ int checkcpu(void) printf("Freescale MCF5272 %s\n", suf); return 0; }; +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_WATCHDOG) /* Called by macro WATCHDOG_RESET */ @@ -268,7 +274,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { char buf[32]; @@ -276,7 +283,7 @@ int checkcpu(void) strmhz(buf, CONFIG_SYS_CLK)); return 0; }; - +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_WATCHDOG) /* Called by macro WATCHDOG_RESET */ @@ -326,7 +333,8 @@ int watchdog_init(void) #endif /* #ifdef CONFIG_M5275 */ #ifdef CONFIG_M5282 -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { unsigned char resetsource = MCFRESET_RSR; @@ -342,6 +350,7 @@ int checkcpu(void) (resetsource & MCFRESET_RSR_LVD) ? " Low Voltage" : ""); return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -351,7 +360,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif #ifdef CONFIG_M5249 -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { char buf[32]; @@ -359,6 +369,7 @@ int checkcpu(void) strmhz(buf, CONFIG_SYS_CLK)); return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -372,7 +383,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif #ifdef CONFIG_M5253 -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { char buf[32]; @@ -389,6 +401,7 @@ int checkcpu(void) } return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { diff --git a/arch/m68k/cpu/mcf530x/cpu.c b/arch/m68k/cpu/mcf530x/cpu.c index 78f4385..3552af2 100644 --- a/arch/m68k/cpu/mcf530x/cpu.c +++ b/arch/m68k/cpu/mcf530x/cpu.c @@ -25,7 +25,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { char buf[32]; @@ -33,4 +34,5 @@ int checkcpu(void) strmhz(buf, CONFIG_SYS_CPU_CLK)); return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ #endif diff --git a/arch/m68k/cpu/mcf532x/cpu.c b/arch/m68k/cpu/mcf532x/cpu.c index 46b57e9..602c106 100644 --- a/arch/m68k/cpu/mcf532x/cpu.c +++ b/arch/m68k/cpu/mcf532x/cpu.c @@ -30,7 +30,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { ccm_t *ccm = (ccm_t *) MMAP_CCM; u16 msk; @@ -95,6 +96,7 @@ int checkcpu(void) return 0; }; +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_WATCHDOG) /* Called by macro WATCHDOG_RESET */ diff --git a/arch/m68k/cpu/mcf5445x/cpu.c b/arch/m68k/cpu/mcf5445x/cpu.c index 57bdcfb..5967043 100644 --- a/arch/m68k/cpu/mcf5445x/cpu.c +++ b/arch/m68k/cpu/mcf5445x/cpu.c @@ -31,7 +31,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { ccm_t *ccm = (ccm_t *) MMAP_CCM; u16 msk; @@ -100,6 +101,7 @@ int checkcpu(void) return 0; } +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_MCFFEC) /* Default initializations for MCFFEC controllers. To override, diff --git a/arch/m68k/cpu/mcf547x_8x/cpu.c b/arch/m68k/cpu/mcf547x_8x/cpu.c index b1ca5c6..9980967 100644 --- a/arch/m68k/cpu/mcf547x_8x/cpu.c +++ b/arch/m68k/cpu/mcf547x_8x/cpu.c @@ -34,7 +34,8 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; }; -int checkcpu(void) +#if defined(CONFIG_DISPLAY_CPUINFO) +int print_cpuinfo(void) { siu_t *siu = (siu_t *) MMAP_SIU; u16 id = 0; @@ -91,6 +92,7 @@ int checkcpu(void) return 0; }; +#endif /* CONFIG_DISPLAY_CPUINFO */ #if defined(CONFIG_HW_WATCHDOG) /* Called by macro WATCHDOG_RESET */ diff --git a/common/Kconfig b/common/Kconfig index 913d21a..6094d6c 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -369,7 +369,7 @@ config VERSION_VARIABLE config DISPLAY_CPUINFO bool "Display information about the CPU during start up" - default y if ARM || BLACKFIN || NIOS2 || X86 || XTENSA + default y if ARM || BLACKFIN || NIOS2 || X86 || XTENSA || M68K help Display information about the CPU that U-Boot is running on when U-Boot starts up. The function print_cpuinfo() is called diff --git a/common/board_f.c b/common/board_f.c index 4b74835..f2c8655 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -921,7 +921,7 @@ static init_fnc_t init_sequence_f[] = { #if defined(CONFIG_MPC83xx) prt_83xx_rsr, #endif -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) +#if defined(CONFIG_PPC) checkcpu, #endif print_cpuinfo, /* display cpu info (and speed) */