From patchwork Tue Mar 13 12:57:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 885103 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 400w050FMLz9sBL for ; Tue, 13 Mar 2018 23:58:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9C6FEC21E0F; Tue, 13 Mar 2018 12:57:59 +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=none 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 A25DEC21E02; Tue, 13 Mar 2018 12:57:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1DC74C21DD4; Tue, 13 Mar 2018 12:57:21 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 0F853C21D4A for ; Tue, 13 Mar 2018 12:57:21 +0000 (UTC) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w2DCrnJt012477; Tue, 13 Mar 2018 13:57:16 +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 2gpc6w8xsw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 13:57:16 +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 B977A34; Tue, 13 Mar 2018 12:57:15 +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 9BB8A155E; Tue, 13 Mar 2018 12:57:15 +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; Tue, 13 Mar 2018 13:57:15 +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; Tue, 13 Mar 2018 13:57:14 +0100 From: Patrick Delaunay To: Date: Tue, 13 Mar 2018 13:57:00 +0100 Message-ID: <1520945824-10620-2-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520945824-10620-1-git-send-email-patrick.delaunay@st.com> References: <1520945824-10620-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-13_06:, , signatures=0 Cc: Thomas Petazzoni , Stefan Roese , benjamin.gaignard@st.com Subject: [U-Boot] [PATCH v2 1/5] 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 in prototype (checkpatch issue) Signed-off-by: Patrick Delaunay --- Changes in v2: - solve compilation error: add weak for arch_reserve_stacks in board_f.c as it is no more present in init.h common/board_f.c | 2 +- include/common.h | 70 +++----------------------------------------------------- include/init.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 68 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index c6bc53e..4df52f1 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -489,7 +489,7 @@ static int reserve_bootstage(void) return 0; } -int arch_reserve_stacks(void) +__weak int arch_reserve_stacks(void) { return 0; } 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__ */ From patchwork Tue Mar 13 12:57:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 885104 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 400w0Q0jFYz9sB8 for ; Tue, 13 Mar 2018 23:59:01 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3DF87C21D4A; Tue, 13 Mar 2018 12:57:40 +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=none 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 D0A9DC21DB3; Tue, 13 Mar 2018 12:57:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5D5EAC21C8B; Tue, 13 Mar 2018 12:57:20 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 1E15FC21C27 for ; Tue, 13 Mar 2018 12:57:20 +0000 (UTC) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w2DCrnqB012480; Tue, 13 Mar 2018 13:57:18 +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 2gpc6w8xsy-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 13:57:18 +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 19FF034; Tue, 13 Mar 2018 12:57:17 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E908A1553; Tue, 13 Mar 2018 12:57:16 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Mar 2018 13:57:16 +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; Tue, 13 Mar 2018 13:57:16 +0100 From: Patrick Delaunay To: Date: Tue, 13 Mar 2018 13:57:01 +0100 Message-ID: <1520945824-10620-3-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520945824-10620-1-git-send-email-patrick.delaunay@st.com> References: <1520945824-10620-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-13_06:, , signatures=0 Cc: benjamin.gaignard@st.com, Stefan Roese Subject: [U-Boot] [PATCH v2 2/5] common: move board_init.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 function prototypes for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay --- Changes in v2: None include/common.h | 38 +------------------------------------- include/init.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/include/common.h b/include/common.h index 6176195..62630db 100644 --- a/include/common.h +++ b/include/common.h @@ -64,6 +64,7 @@ typedef void (interrupt_handler_t)(void *); /* startup functions, used in: * common/board_f.c + * common/init/board_init.c */ #include @@ -97,48 +98,11 @@ int run_command_list(const char *cmd, int len, int flag); /* arch/$(ARCH)/lib/board.c */ void board_init_r(gd_t *, ulong) __attribute__ ((noreturn)); -/** - * ulong board_init_f_alloc_reserve - allocate reserved area - * - * This function is called by each architecture very early in the start-up - * code to allow the C runtime to reserve space on the stack for writable - * 'globals' such as GD and the malloc arena. - * - * @top: top of the reserve area, growing down. - * @return: bottom of reserved area - */ -ulong board_init_f_alloc_reserve(ulong top); - -/** - * board_init_f_init_reserve - initialize the reserved area(s) - * - * This function is called once the C runtime has allocated the reserved - * area on the stack. It must initialize the GD at the base of that area. - * - * @base: top from which reservation was done - */ -void board_init_f_init_reserve(ulong base); - -/** - * arch_setup_gd() - Set up the global_data pointer - * - * This pointer is special in some architectures and cannot easily be assigned - * to. For example on x86 it is implemented by adding a specific record to its - * Global Descriptor Table! So we we provide a function to carry out this task. - * For most architectures this can simply be: - * - * gd = gd_ptr; - * - * @gd_ptr: Pointer to global data - */ -void arch_setup_gd(gd_t *gd_ptr); - int checkboard(void); int show_board_info(void); int checkflash(void); int checkdram(void); int last_stage_init(void); -extern ulong monitor_flash_len; int mac_read_from_eeprom(void); extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */ diff --git a/include/init.h b/include/init.h index f57a438..f952602 100644 --- a/include/init.h +++ b/include/init.h @@ -109,6 +109,45 @@ int misc_init_f(void); int embedded_dtb_select(void); #endif +/* common/init/board_init.c */ +extern ulong monitor_flash_len; + +/** + * ulong board_init_f_alloc_reserve - allocate reserved area + * + * This function is called by each architecture very early in the start-up + * code to allow the C runtime to reserve space on the stack for writable + * 'globals' such as GD and the malloc arena. + * + * @top: top of the reserve area, growing down. + * @return: bottom of reserved area + */ +ulong board_init_f_alloc_reserve(ulong top); + +/** + * board_init_f_init_reserve - initialize the reserved area(s) + * + * This function is called once the C runtime has allocated the reserved + * area on the stack. It must initialize the GD at the base of that area. + * + * @base: top from which reservation was done + */ +void board_init_f_init_reserve(ulong base); + +/** + * arch_setup_gd() - Set up the global_data pointer + * + * This pointer is special in some architectures and cannot easily be assigned + * to. For example on x86 it is implemented by adding a specific record to its + * Global Descriptor Table! So we we provide a function to carry out this task. + * For most architectures this can simply be: + * + * gd = gd_ptr; + * + * @gd_ptr: Pointer to global data + */ +void arch_setup_gd(gd_t *gd_ptr); + /* common/board_r.c */ #endif /* __ASSEMBLY__ */ From patchwork Tue Mar 13 12:57:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 885100 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 400vyh0jlYz9sTj for ; Tue, 13 Mar 2018 23:57:30 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1A6D1C21E12; Tue, 13 Mar 2018 12:57:23 +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=none 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 095CDC21CB6; Tue, 13 Mar 2018 12:57:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 19D8AC21C8B; Tue, 13 Mar 2018 12:57:20 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id BA7E4C21C27 for ; Tue, 13 Mar 2018 12:57:19 +0000 (UTC) Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w2DCrn4T012483; Tue, 13 Mar 2018 13:57:18 +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 2gpc6w8xt1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 13:57:18 +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 32F993A; Tue, 13 Mar 2018 12:57:18 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 18FFD154E; Tue, 13 Mar 2018 12:57:18 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Mar 2018 13:57:18 +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; Tue, 13 Mar 2018 13:57:17 +0100 From: Patrick Delaunay To: Date: Tue, 13 Mar 2018 13:57:02 +0100 Message-ID: <1520945824-10620-4-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520945824-10620-1-git-send-email-patrick.delaunay@st.com> References: <1520945824-10620-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-13_06:, , signatures=0 Cc: benjamin.gaignard@st.com, Stefan Roese Subject: [U-Boot] [PATCH v2 3/5] common: move board_r.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 function prototypes used in common/board_r.c from common.h to init.h Signed-off-by: Patrick Delaunay --- Changes in v2: None include/common.h | 17 +---------------- include/init.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/common.h b/include/common.h index 62630db..7d181da 100644 --- a/include/common.h +++ b/include/common.h @@ -65,6 +65,7 @@ typedef void (interrupt_handler_t)(void *); /* startup functions, used in: * common/board_f.c * common/init/board_init.c + * common/board_r.c */ #include @@ -95,21 +96,13 @@ 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_r(gd_t *, ulong) __attribute__ ((noreturn)); - int checkboard(void); int show_board_info(void); int checkflash(void); int checkdram(void); -int last_stage_init(void); -int mac_read_from_eeprom(void); 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 update_flash_size(int flash_size); -int arch_early_init_r(void); /* * setup_board_extra() - Fill in extra details in the bd_t structure @@ -263,14 +256,8 @@ int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf); #endif int get_env_id (void); -void pci_init (void); void pci_init_board(void); -int misc_init_r (void); -#if defined(CONFIG_VID) -int init_func_vid(void); -#endif - /* common/exports.c */ void jumptable_init(void); @@ -396,8 +383,6 @@ int get_clocks (void); ulong get_bus_freq (ulong); int get_serial_clock(void); -int cpu_init_r (void); - /* $(CPU)/interrupts.c */ int interrupt_init (void); void timer_interrupt (struct pt_regs *); diff --git a/include/init.h b/include/init.h index f952602..89e48f2 100644 --- a/include/init.h +++ b/include/init.h @@ -149,6 +149,20 @@ void board_init_f_init_reserve(ulong base); void arch_setup_gd(gd_t *gd_ptr); /* common/board_r.c */ +void board_init_r(gd_t *id, ulong dest_addr) __attribute__ ((noreturn)); + +int cpu_init_r(void); +int last_stage_init(void); +int mac_read_from_eeprom(void); +int set_cpu_clk_info(void); +int update_flash_size(int flash_size); +int arch_early_init_r(void); +void pci_init(void); +int misc_init_r(void); +#if defined(CONFIG_VID) +int init_func_vid(void); +#endif + #endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ From patchwork Tue Mar 13 12:57:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 885107 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 400w1w4pz3z9sDT for ; Wed, 14 Mar 2018 00:00:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3D1A1C21E0B; Tue, 13 Mar 2018 12:58:21 +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=none 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 93F75C21E18; Tue, 13 Mar 2018 12:57:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6D950C21DDC; Tue, 13 Mar 2018 12:57:21 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id DE71BC21C8B for ; Tue, 13 Mar 2018 12:57:20 +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 w2DCrfxG002347; Tue, 13 Mar 2018 13:57:20 +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 2gpc7ygx3f-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 13:57:20 +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 8B06838; Tue, 13 Mar 2018 12:57:19 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 391C4155E; Tue, 13 Mar 2018 12:57:19 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Mar 2018 13:57:19 +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; Tue, 13 Mar 2018 13:57:18 +0100 From: Patrick Delaunay To: Date: Tue, 13 Mar 2018 13:57:03 +0100 Message-ID: <1520945824-10620-5-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520945824-10620-1-git-send-email-patrick.delaunay@st.com> References: <1520945824-10620-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-13_06:, , signatures=0 Cc: benjamin.gaignard@st.com, Stefan Roese Subject: [U-Boot] [PATCH v2 4/5] common: move board_info.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 function prototype for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay --- Changes in v2: None include/common.h | 3 +-- include/init.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/common.h b/include/common.h index 7d181da..a0633f3 100644 --- a/include/common.h +++ b/include/common.h @@ -66,6 +66,7 @@ typedef void (interrupt_handler_t)(void *); * common/board_f.c * common/init/board_init.c * common/board_r.c + * common/board_info.c */ #include @@ -96,8 +97,6 @@ int run_command_repeatable(const char *cmd, int flag); */ int run_command_list(const char *cmd, int len, int flag); -int checkboard(void); -int show_board_info(void); int checkflash(void); int checkdram(void); extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ diff --git a/include/init.h b/include/init.h index 89e48f2..d54d519 100644 --- a/include/init.h +++ b/include/init.h @@ -163,6 +163,9 @@ int misc_init_r(void); int init_func_vid(void); #endif +/* common/board_info.c */ +int checkboard(void); +int show_board_info(void); #endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ From patchwork Tue Mar 13 12:57:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 885105 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 400w1958Vhz9sB8 for ; Tue, 13 Mar 2018 23:59:41 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 24B79C21E0B; Tue, 13 Mar 2018 12:58:38 +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=none 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 F0D6DC21DB6; Tue, 13 Mar 2018 12:57:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6AEC5C21D4A; Tue, 13 Mar 2018 12:57:35 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lists.denx.de (Postfix) with ESMTPS id 9BA59C21DB6 for ; Tue, 13 Mar 2018 12:57:31 +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 w2DCrfxH002347; Tue, 13 Mar 2018 13:57:21 +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 2gpc7ygx3j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2018 13:57:21 +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 9CEBA3F; Tue, 13 Mar 2018 12:57:20 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 495801561; Tue, 13 Mar 2018 12:57:20 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Mar 2018 13:57:20 +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; Tue, 13 Mar 2018 13:57:19 +0100 From: Patrick Delaunay To: Date: Tue, 13 Mar 2018 13:57:04 +0100 Message-ID: <1520945824-10620-6-git-send-email-patrick.delaunay@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520945824-10620-1-git-send-email-patrick.delaunay@st.com> References: <1520945824-10620-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-13_06:, , signatures=0 Cc: Thomas Petazzoni , benjamin.gaignard@st.com, Stefan Roese Subject: [U-Boot] [PATCH v2 5/5] common: move init_helpers.h 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" Merge init_helpers.h in the new file init.h with only prototypes for init_cache_f_r used in common/board_f.c Signed-off-by: Patrick Delaunay --- modification introduced after Tom Rimi review of V1 Changes in v2: None arch/x86/lib/spl.c | 1 - common/board_f.c | 1 - common/board_r.c | 1 - include/init.h | 7 +++++++ include/init_helpers.h | 18 ------------------ 5 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 include/init_helpers.h diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index 832a5d7..7c32245 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/common/board_f.c b/common/board_f.c index 4df52f1..62588c5 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/common/board_r.c b/common/board_r.c index 482f506..89f2e16 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef CONFIG_PS2KBD #include #endif diff --git a/include/init.h b/include/init.h index d54d519..147ae6b 100644 --- a/include/init.h +++ b/include/init.h @@ -101,6 +101,13 @@ int dram_init_banksize(void); */ int arch_reserve_stacks(void); +/** + * init_cache_f_r() - Turn on the cache in preparation for relocation + * + * @return 0 if OK, -ve on error + */ +int init_cache_f_r(void); + int print_cpuinfo(void); int timer_init(void); int reserve_mmu(void); diff --git a/include/init_helpers.h b/include/init_helpers.h deleted file mode 100644 index 3efcfdd..0000000 --- a/include/init_helpers.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * (C) Copyright 2011 - * Graeme Russ, - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _INIT_HELPERS_H_ -#define _INIT_HELPERS_H_ - -/** - * init_cache_f_r() - Turn on the cache in preparation for relocation - * - * @return 0 if OK, -ve on error - */ -int init_cache_f_r(void); - -#endif /* _INIT_HELPERS_H_ */