From patchwork Sun Apr 22 15:23:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 154288 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 E6147B6FD3 for ; Mon, 23 Apr 2012 01:24:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 561332819E; Sun, 22 Apr 2012 17:24:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 jAqo57PvGxUK; Sun, 22 Apr 2012 17:24:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6734B281AC; Sun, 22 Apr 2012 17:23:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 989EB2812F for ; Sun, 22 Apr 2012 17:23:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 lwv1NRQOkFdV for ; Sun, 22 Apr 2012 17:23:38 +0200 (CEST) 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 mail-pz0-f49.google.com (mail-pz0-f49.google.com [209.85.210.49]) by theia.denx.de (Postfix) with ESMTPS id 53EA128178 for ; Sun, 22 Apr 2012 17:23:26 +0200 (CEST) Received: by dadq36 with SMTP id q36so14340996dad.22 for ; Sun, 22 Apr 2012 08:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=D1khvLGh33wgAS74/ip/bP7XMGS/ne0VFMXz7js94nk=; b=Zav2w4pCJ0eiobqCSFfpOr/kq3xrpIhfoN3/lcIIbS3hxj70lrrOLrbVf2tuOBLYcD IQumzB1ys/mYCjLvnXpjOm/Gn00hRmBcC6tLytMVf42I0puG7BPNwj3bAydlodK/42UD 4jXp0Gd4D9MB63TlCy1WaxJzNZTPxL8zkZKOZMMmdtkZlFolo+kuWhM6ZXX3k0NJO5A7 x3jTddInfAajwVKIKP8ilHYCvs0N9/CVAbLmKl/SJFaKYdQ0VeXdJ8V/Y8WHtGMgtUfc +g7FWdQypW4cRDuAT4o8IIDv5s1ZgU3FkAw8d141w3giNL+zLXV33bvHhOL8zuSsczsg wGjQ== Received: by 10.68.194.72 with SMTP id hu8mr5581321pbc.26.1335108204031; Sun, 22 Apr 2012 08:23:24 -0700 (PDT) Received: from dingo.localhost (d110-32-170-80.sbr801.nsw.optusnet.com.au. [110.32.170.80]) by mx.google.com with ESMTPS id wn3sm11636628pbc.74.2012.04.22.08.23.22 (version=SSLv3 cipher=OTHER); Sun, 22 Apr 2012 08:23:23 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Mon, 23 Apr 2012 01:23:08 +1000 Message-Id: <1335108188-21875-4-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1335108188-21875-1-git-send-email-graeme.russ@gmail.com> References: <1335108188-21875-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 3/3] init_func: Use for eNET board X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Graeme Russ --- arch/x86/cpu/cpu.c | 3 +++ arch/x86/cpu/sc520/sc520_sdram.c | 3 +++ arch/x86/cpu/sc520/sc520_timer.c | 2 ++ arch/x86/lib/init_helpers.c | 14 ++++++++++++++ arch/x86/lib/init_wrappers.c | 11 ++++++++++- arch/x86/lib/pcat_interrupts.c | 2 ++ arch/x86/lib/relocate.c | 4 ++++ board/eNET/eNET.c | 5 +++++ common/console.c | 3 +++ common/env_dataflash.c | 1 + common/env_eeprom.c | 1 + common/env_fat.c | 1 + common/env_flash.c | 2 ++ common/env_mgdisk.c | 1 + common/env_mmc.c | 1 + common/env_nand.c | 1 + common/env_nowhere.c | 1 + common/env_nvram.c | 1 + common/env_onenand.c | 1 + common/env_sf.c | 1 + common/serial.c | 2 ++ common/stdio.c | 2 ++ include/configs/eNET.h | 1 + 23 files changed, 63 insertions(+), 1 deletions(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index e9bb0d7..263df28 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -33,6 +33,7 @@ */ #include +#include #include #include #include @@ -137,6 +138,7 @@ int x86_cpu_init_f(void) return 0; } int cpu_init_f(void) __attribute__((weak, alias("x86_cpu_init_f"))); +INIT_FUNC(cpu_init_f, cpu_f, RESET, , SDRAM); int x86_cpu_init_r(void) { @@ -145,6 +147,7 @@ int x86_cpu_init_r(void) return 0; } int cpu_init_r(void) __attribute__((weak, alias("x86_cpu_init_r"))); +INIT_FUNC(cpu_init_r, cpu_r, mem_malloc_init_r, , ); void x86_enable_caches(void) { diff --git a/arch/x86/cpu/sc520/sc520_sdram.c b/arch/x86/cpu/sc520/sc520_sdram.c index 9dc1334..7033e18 100644 --- a/arch/x86/cpu/sc520/sc520_sdram.c +++ b/arch/x86/cpu/sc520/sc520_sdram.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -51,6 +52,7 @@ int dram_init_f(void) return 0; } +INIT_FUNC(dram_init_f, dram_f, console_init_f, , SDRAM); static inline void sc520_dummy_write(void) { @@ -477,3 +479,4 @@ int dram_init(void) return 0; } +INIT_FUNC(dram_init, dram_r, , board_early_init_r, ); diff --git a/arch/x86/cpu/sc520/sc520_timer.c b/arch/x86/cpu/sc520/sc520_timer.c index 41f121f..7b25c08 100644 --- a/arch/x86/cpu/sc520/sc520_timer.c +++ b/arch/x86/cpu/sc520/sc520_timer.c @@ -25,6 +25,7 @@ */ #include +#include #include #include #include @@ -69,6 +70,7 @@ int timer_init(void) return 0; } +INIT_FUNC(timer_init, timer, interrupt_init, , ); /* Allow boards to override udelay implementation */ void __udelay(unsigned long usec) diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c index 9f4dee0..aa88048 100644 --- a/arch/x86/lib/init_helpers.c +++ b/arch/x86/lib/init_helpers.c @@ -21,6 +21,7 @@ * MA 02111-1307 USA */ #include +#include #include #include #include @@ -50,6 +51,7 @@ int display_banner(void) return 0; } +INIT_FUNC(display_banner, banner, timer_init, , ); int display_dram_config(void) { @@ -64,12 +66,14 @@ int display_dram_config(void) return 0; } +INIT_FUNC(display_dram_config, display_dram, display_banner, , ); int init_baudrate_f(void) { gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE); return 0; } +INIT_FUNC(init_baudrate_f, display_dram, env_init, , ); int calculate_relocation_address(void) { @@ -106,6 +110,7 @@ int calculate_relocation_address(void) return 0; } +INIT_FUNC(calculate_relocation_address, calc_reloc, dram_init_f, , ); int copy_gd_to_ram_f_r(void) { @@ -131,12 +136,14 @@ int copy_gd_to_ram_f_r(void) return 0; } +INIT_FUNC(copy_gd_to_ram_f_r, copy_gd, SDRAM, , RELOC); int init_cache_f_r(void) { /* Initialise the CPU cache(s) */ return init_cache(); } +INIT_FUNC(init_cache_f_r, cache_f_r, copy_gd_to_ram_f_r, , RELOC); int set_reloc_flag_r(void) { @@ -144,6 +151,7 @@ int set_reloc_flag_r(void) return 0; } +INIT_FUNC(set_reloc_flag_r, reloc_flag, RELOC, , ); int mem_malloc_init_r(void) { @@ -152,6 +160,7 @@ int mem_malloc_init_r(void) return 0; } +INIT_FUNC(mem_malloc_init_r, malloc, init_bd_struct_r, , ); bd_t bd_data; @@ -162,6 +171,7 @@ int init_bd_struct_r(void) return 0; } +INIT_FUNC(init_bd_struct_r, bd_struct, set_reloc_flag_r, , ); #ifndef CONFIG_SYS_NO_FLASH int flash_init_r(void) @@ -177,6 +187,7 @@ int flash_init_r(void) return 0; } +INIT_FUNC(flash_init_r, flash_r, RELOC, serial_initialize_r display_dram_config, ); #endif int init_ip_address_r(void) @@ -186,6 +197,7 @@ int init_ip_address_r(void) return 0; } +INIT_FUNC(init_ip_address_r, ip_address, env_relocate_r, , pci_init_r stdio_init); #ifdef CONFIG_STATUS_LED int status_led_set_r(void) @@ -207,6 +219,7 @@ int set_bootfile_r(void) return 0; } +INIT_FUNC(set_bootfile_r, set_bootfile, set_load_addr_r, , ); int set_load_addr_r(void) { @@ -215,3 +228,4 @@ int set_load_addr_r(void) return 0; } +INIT_FUNC(set_load_addr_r, set_load_addr, enable_interrupts_r, , ); diff --git a/arch/x86/lib/init_wrappers.c b/arch/x86/lib/init_wrappers.c index 71449fe..87ca713 100644 --- a/arch/x86/lib/init_wrappers.c +++ b/arch/x86/lib/init_wrappers.c @@ -21,6 +21,7 @@ * MA 02111-1307 USA */ #include +#include #include #include #include @@ -35,6 +36,7 @@ int serial_initialize_r(void) return 0; } +INIT_FUNC(serial_initialize_r, serial_multi, RELOC, display_dram_config, ); int env_relocate_r(void) { @@ -43,7 +45,7 @@ int env_relocate_r(void) return 0; } - +INIT_FUNC(env_relocate_r, env_reloc, RELOC env_init, display_dram_config serial_initialize_r flash_init_r, ); int pci_init_r(void) { @@ -52,6 +54,7 @@ int pci_init_r(void) return 0; } +INIT_FUNC(pci_init_r, pci, cpu_r, init_ip_address_r env_relocate_r, stdio_init); int jumptable_init_r(void) { @@ -59,6 +62,7 @@ int jumptable_init_r(void) return 0; } +INIT_FUNC(jumptable_init_r, jumptable, stdio_init, , ); int pcmcia_init_r(void) { @@ -83,6 +87,7 @@ int enable_interrupts_r(void) return 0; } +INIT_FUNC(enable_interrupts_r, enable_interrupts, , kgdb_init_r pci_init_r misc_init_r console_init_r, ); int eth_initialize_r(void) { @@ -91,7 +96,9 @@ int eth_initialize_r(void) return 0; } +INIT_FUNC(eth_initialize_r, eth, pci, bb_miiphy_init_r doc_init_r scsi_init_r ide_init_r set_bootfile_r set_load_addr_r, ); +#ifdef CONFIG_RESET_PHY_R int reset_phy_r(void) { #ifdef DEBUG @@ -101,6 +108,8 @@ int reset_phy_r(void) return 0; } +INIT_FUNC(reset_phy_r, phy_reset, eth, eth_initialize_r, ); +#endif int ide_init_r(void) { diff --git a/arch/x86/lib/pcat_interrupts.c b/arch/x86/lib/pcat_interrupts.c index 5dac498..a403b7b 100644 --- a/arch/x86/lib/pcat_interrupts.c +++ b/arch/x86/lib/pcat_interrupts.c @@ -31,6 +31,7 @@ */ #include +#include #include #include #include @@ -82,6 +83,7 @@ int interrupt_init(void) return 0; } +INIT_FUNC(interrupt_init, pcat_interrupt, , dram_init, ); void mask_irq(int irq) { diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 200baab..69b0fd6 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -45,6 +46,7 @@ int copy_uboot_to_ram(void) return 0; } +INIT_FUNC(copy_uboot_to_ram, copy_to_ram, SDRAM, init_cache_f_r, RELOC); int clear_bss(void) { @@ -55,6 +57,7 @@ int clear_bss(void) return 0; } +INIT_FUNC(clear_bss, clear_bss, SDRAM, copy_uboot_to_ram, RELOC); int do_elf_reloc_fixups(void) { @@ -89,3 +92,4 @@ int do_elf_reloc_fixups(void) return 0; } +INIT_FUNC(do_elf_reloc_fixups, elf_reloc, clear_bss, , RELOC); diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c index 2f26470..19bbbe4 100644 --- a/board/eNET/eNET.c +++ b/board/eNET/eNET.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -106,6 +107,7 @@ int board_early_init_f(void) return 0; } +INIT_FUNC(board_early_init_f, board_early_f, cpu_init_f, , SDRAM); static void enet_setup_pars(void) { @@ -161,6 +163,7 @@ int board_early_init_r(void) return 0; } +INIT_FUNC(board_early_init_r, board_early_r, cpu_init_r, , pci); void show_boot_progress(int val) { @@ -186,6 +189,8 @@ int last_stage_init(void) return 0; } +INIT_FUNC(last_stage_init, last_stage, , eth_initialize_r reset_phy_r, ); + ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) { diff --git a/common/console.c b/common/console.c index 1177f7d..01e6450 100644 --- a/common/console.c +++ b/common/console.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -588,6 +589,7 @@ int console_init_f(void) return 0; } +INIT_FUNC(console_init_f, console_f, serial_init, , SDRAM); void stdio_print_current_devices(void) { @@ -775,5 +777,6 @@ int console_init_r(void) return 0; } +INIT_FUNC(console_init_r, console_r, stdio_init, jumptable_init_r, ); #endif /* CONFIG_SYS_CONSOLE_IS_IN_ENV */ diff --git a/common/env_dataflash.c b/common/env_dataflash.c index 3c5af37..423e0ad 100644 --- a/common/env_dataflash.c +++ b/common/env_dataflash.c @@ -114,3 +114,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_eeprom.c b/common/env_eeprom.c index b66bba2..75b4e11 100644 --- a/common/env_eeprom.c +++ b/common/env_eeprom.c @@ -289,3 +289,4 @@ int env_init(void) return 0; } #endif +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_fat.c b/common/env_fat.c index bad92aa..d218094 100644 --- a/common/env_fat.c +++ b/common/env_fat.c @@ -53,6 +53,7 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); #ifdef CONFIG_CMD_SAVEENV int saveenv(void) diff --git a/common/env_flash.c b/common/env_flash.c index aa970d4..5714b5b 100644 --- a/common/env_flash.c +++ b/common/env_flash.c @@ -27,6 +27,7 @@ /* #define DEBUG */ #include +#include #include #include #include @@ -117,6 +118,7 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); #ifdef CMD_SAVEENV int saveenv(void) diff --git a/common/env_mgdisk.c b/common/env_mgdisk.c index d00e141..e5ffaad 100644 --- a/common/env_mgdisk.c +++ b/common/env_mgdisk.c @@ -74,3 +74,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_mmc.c b/common/env_mmc.c index 0c58ae1..dc8a21a 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -62,6 +62,7 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); static int init_mmc_for_env(struct mmc *mmc) { diff --git a/common/env_nand.c b/common/env_nand.c index e8daec9..10e84f0 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -134,6 +134,7 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); #ifdef CMD_SAVEENV /* diff --git a/common/env_nowhere.c b/common/env_nowhere.c index 18fcf2c..04d35e5 100644 --- a/common/env_nowhere.c +++ b/common/env_nowhere.c @@ -49,3 +49,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_nvram.c b/common/env_nvram.c index 6483db3..0487de0 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -134,3 +134,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_onenand.c b/common/env_onenand.c index 652665a..ec98de5 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -135,3 +135,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/env_sf.c b/common/env_sf.c index bbd472f..84fd3b2 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -349,3 +349,4 @@ int env_init(void) return 0; } +INIT_FUNC(env_init, env_init, cpu_init_f, board_early_init_f, SDRAM); diff --git a/common/serial.c b/common/serial.c index 75cc1bb..920c5d3 100644 --- a/common/serial.c +++ b/common/serial.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -190,6 +191,7 @@ int serial_init(void) { return get_current()->init(); } +INIT_FUNC(serial_init, serial_f, init_baudrate_f, , SDRAM); void serial_setbrg(void) { diff --git a/common/stdio.c b/common/stdio.c index 1bf9ba0..6472259 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -242,3 +243,4 @@ int stdio_init (void) return (0); } +INIT_FUNC(stdio_init, stdio, env_relocate_r, , ); diff --git a/include/configs/eNET.h b/include/configs/eNET.h index d5c9cad..57cecff 100644 --- a/include/configs/eNET.h +++ b/include/configs/eNET.h @@ -29,6 +29,7 @@ #ifndef __CONFIG_H #define __CONFIG_H +#define CONFIG_INIT_FUNC /* * High Level Configuration Options * (easy to change)