From patchwork Mon Mar 12 08:47:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 884338 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 400BV95lsNz9sRN for ; Mon, 12 Mar 2018 19:48:49 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5F49FC21DEC; Mon, 12 Mar 2018 08:47:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A69B1C21DF9; Mon, 12 Mar 2018 08:47:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87807C21D72; Mon, 12 Mar 2018 08:47:27 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 46A96C21BE5 for ; Mon, 12 Mar 2018 08:47:27 +0000 (UTC) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w2C8iE9Y005519; Mon, 12 Mar 2018 09:47:26 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2gm5c88pgn-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 12 Mar 2018 09:47:26 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E51DE31; Mon, 12 Mar 2018 08:47:25 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C6C37161E; Mon, 12 Mar 2018 08:47:25 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 12 Mar 2018 09:47:25 +0100 Received: from localhost (10.201.23.85) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 12 Mar 2018 09:47:25 +0100 From: Patrick Delaunay To: Date: Mon, 12 Mar 2018 09:47:16 +0100 Message-ID: <1520844439-12094-2-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520844439-12094-1-git-send-email-patrick.delaunay@st.com> References: <1520844439-12094-1-git-send-email-patrick.delaunay@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.85] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-12_04:, , signatures=0 Cc: benjamin.gaignard@st.com, Stefan Roese Subject: [U-Boot] [PATCH 1/4] common: move board_f.c prototypes in init.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move prototypes for function used in common/board_f.c from common.h to init.h Remove weak for arch_reserve_stacks (checkpatch issue) Signed-off-by: Patrick Delaunay --- include/common.h | 70 +++----------------------------------------------------- include/init.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 67 deletions(-) diff --git a/include/common.h b/include/common.h index 11e5459..6176195 100644 --- a/include/common.h +++ b/include/common.h @@ -62,34 +62,16 @@ typedef void (interrupt_handler_t)(void *); #define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN #endif -/* startup functions */ +/* startup functions, used in: + * common/board_f.c + */ #include /* * Function Prototypes */ -int dram_init(void); - -/** - * dram_init_banksize() - Set up DRAM bank sizes - * - * This can be implemented by boards to set up the DRAM bank information in - * gd->bd->bi_dram(). It is called just before relocation, after dram_init() - * is called. - * - * If this is not provided, a default implementation will try to set up a - * single bank. It will do this if CONFIG_NR_DRAM_BANKS and - * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of - * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to - * get_effective_memsize(). - * - * @return 0 if OK, -ve on error - */ -int dram_init_banksize(void); - void hang (void) __attribute__ ((noreturn)); -int timer_init(void); int cpu_init(void); #include @@ -113,7 +95,6 @@ int run_command_repeatable(const char *cmd, int flag); int run_command_list(const char *cmd, int len, int flag); /* arch/$(ARCH)/lib/board.c */ -void board_init_f(ulong); void board_init_r(gd_t *, ulong) __attribute__ ((noreturn)); /** @@ -163,7 +144,6 @@ extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */ int set_cpu_clk_info(void); int mdm_init(void); -int print_cpuinfo(void); int update_flash_size(int flash_size); int arch_early_init_r(void); @@ -175,44 +155,6 @@ int arch_early_init_r(void); int setup_board_extra(void); /** - * arch_fsp_init() - perform firmware support package init - * - * Where U-Boot relies on binary blobs to handle part of the system init, this - * function can be used to set up the blobs. This is used on some Intel - * platforms. - */ -int arch_fsp_init(void); - -/** - * arch_cpu_init_dm() - init CPU after driver model is available - * - * This is called immediately after driver model is available before - * relocation. This is similar to arch_cpu_init() but is able to reference - * devices - * - * @return 0 if OK, -ve on error - */ -int arch_cpu_init_dm(void); - -/** - * Reserve all necessary stacks - * - * This is used in generic board init sequence in common/board_f.c. Each - * architecture could provide this function to tailor the required stacks. - * - * On entry gd->start_addr_sp is pointing to the suggested top of the stack. - * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures - * require only this can leave it untouched. - * - * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective - * positions of the stack. The stack pointer(s) will be set to this later. - * gd->irq_sp is only required, if the architecture needs it. - * - * @return 0 if no error - */ -__weak int arch_reserve_stacks(void); - -/** * Show the DRAM size in a board-specific way * * This is used by boards to display DRAM information in their own way. @@ -231,7 +173,6 @@ void board_show_dram(phys_size_t size); */ int arch_fixup_fdt(void *blob); -int reserve_mmu(void); /* common/flash.c */ void flash_perror (int); @@ -361,11 +302,6 @@ int get_env_id (void); void pci_init (void); void pci_init_board(void); -#if defined(CONFIG_DTB_RESELECT) -int embedded_dtb_select(void); -#endif - -int misc_init_f (void); int misc_init_r (void); #if defined(CONFIG_VID) int init_func_vid(void); diff --git a/include/init.h b/include/init.h index 324fbe0..f57a438 100644 --- a/include/init.h +++ b/include/init.h @@ -18,6 +18,7 @@ */ /* common/board_f.c */ +void board_init_f(ulong dummy); /** * arch_cpu_init() - basic cpu-dependent setup for an architecture @@ -32,6 +33,17 @@ int arch_cpu_init(void); /** + * arch_cpu_init_dm() - init CPU after driver model is available + * + * This is called immediately after driver model is available before + * relocation. This is similar to arch_cpu_init() but is able to reference + * devices + * + * @return 0 if OK, -ve on error + */ +int arch_cpu_init_dm(void); + +/** * mach_cpu_init() - SoC/machine dependent CPU setup * * This is called after arch_cpu_init(). It should handle any @@ -43,6 +55,60 @@ int arch_cpu_init(void); */ int mach_cpu_init(void); +/** + * arch_fsp_init() - perform firmware support package init + * + * Where U-Boot relies on binary blobs to handle part of the system init, this + * function can be used to set up the blobs. This is used on some Intel + * platforms. + */ +int arch_fsp_init(void); + +int dram_init(void); + +/** + * dram_init_banksize() - Set up DRAM bank sizes + * + * This can be implemented by boards to set up the DRAM bank information in + * gd->bd->bi_dram(). It is called just before relocation, after dram_init() + * is called. + * + * If this is not provided, a default implementation will try to set up a + * single bank. It will do this if CONFIG_NR_DRAM_BANKS and + * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of + * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to + * get_effective_memsize(). + * + * @return 0 if OK, -ve on error + */ +int dram_init_banksize(void); + +/** + * Reserve all necessary stacks + * + * This is used in generic board init sequence in common/board_f.c. Each + * architecture could provide this function to tailor the required stacks. + * + * On entry gd->start_addr_sp is pointing to the suggested top of the stack. + * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures + * require only this can leave it untouched. + * + * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective + * positions of the stack. The stack pointer(s) will be set to this later. + * gd->irq_sp is only required, if the architecture needs it. + * + * @return 0 if no error + */ +int arch_reserve_stacks(void); + +int print_cpuinfo(void); +int timer_init(void); +int reserve_mmu(void); +int misc_init_f(void); +#if defined(CONFIG_DTB_RESELECT) +int embedded_dtb_select(void); +#endif + /* common/board_r.c */ #endif /* __ASSEMBLY__ */