From patchwork Wed Sep 21 22:40:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 115864 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 68245B6F82 for ; Thu, 22 Sep 2011 08:42:15 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A6C628340; Thu, 22 Sep 2011 00:42:04 +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 5s3F9EjvDyR9; Thu, 22 Sep 2011 00:42:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3767C28341; Thu, 22 Sep 2011 00:41:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F79828325 for ; Thu, 22 Sep 2011 00:41:26 +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 IpCMwEELN6c6 for ; Thu, 22 Sep 2011 00:41:24 +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 smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by theia.denx.de (Postfix) with ESMTPS id 0749528297 for ; Thu, 22 Sep 2011 00:41:21 +0200 (CEST) Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p8LMfDuq004494; Wed, 21 Sep 2011 15:41:13 -0700 Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by hpaq1.eem.corp.google.com with ESMTP id p8LMfBrs002354; Wed, 21 Sep 2011 15:41:11 -0700 Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id E60A5140AD8; Wed, 21 Sep 2011 15:41:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 21 Sep 2011 15:40:03 -0700 Message-Id: <1316644807-26972-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1316644807-26972-1-git-send-email-sjg@chromium.org> References: <1316644807-26972-1-git-send-email-sjg@chromium.org> X-System-Of-Record: true Cc: Tom Warren Subject: [U-Boot] [PATCH v2 2/6] tegra2: Clean up board code a little X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 This removes clock_init() and pinmux_init() which are names better suited to those respective modules. By moving board_init_f() to the bottom of the file we can remove the need for so many functions in the board.h header file. The only clock/pinmux/gpio init we need to do prior to relocation is for the UART. Signed-off-by: Simon Glass Tested-by: Tom Warren --- board/nvidia/common/board.c | 65 +++++++++++++----------------------------- board/nvidia/common/board.h | 3 -- 2 files changed, 20 insertions(+), 48 deletions(-) diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index 32d3cfb..5e28b4c 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -43,24 +43,6 @@ const struct tegra2_sysinfo sysinfo = { CONFIG_TEGRA2_BOARD_STRING }; -#ifdef CONFIG_BOARD_EARLY_INIT_F -int board_early_init_f(void) -{ - /* Initialize periph clocks */ - clock_init(); - - /* Initialize periph pinmuxes */ - pinmux_init(); - - /* Initialize periph GPIOs */ - gpio_init(); - - /* Init UART, scratch regs, and start CPU */ - tegra2_start(); - return 0; -} -#endif /* EARLY_INIT */ - /* * Routine: timer_init * Description: init the timestamp and lastinc value @@ -155,6 +137,7 @@ static void pin_mux_uart(void) #endif /* CONFIG_TEGRA2_ENABLE_UARTD */ } +#ifdef CONFIG_TEGRA2_MMC /* * Routine: clock_init_mmc * Description: init the PLL and clocks for the SDMMC controllers @@ -235,33 +218,7 @@ static void pin_mux_mmc(void) pinmux_tristate_disable(PIN_SDD); pinmux_tristate_disable(PIN_SDB); } - -/* - * Routine: clock_init - * Description: Do individual peripheral clock reset/enables - */ -void clock_init(void) -{ - clock_init_uart(); -} - -/* - * Routine: pinmux_init - * Description: Do individual peripheral pinmux configs - */ -void pinmux_init(void) -{ - pin_mux_uart(); -} - -/* - * Routine: gpio_init - * Description: Do individual peripheral GPIO configs - */ -void gpio_init(void) -{ - gpio_config_uart(); -} +#endif /* * Routine: board_init @@ -307,3 +264,21 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc) return 0; } #endif + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ + /* Initialize UART clocks */ + clock_init_uart(); + + /* Initialize periph pinmuxes */ + pin_mux_uart(); + + /* Initialize periph GPIOs */ + gpio_config_uart(); + + /* Init UART, scratch regs, and start CPU */ + tegra2_start(); + return 0; +} +#endif /* EARLY_INIT */ diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h index 4334c02..d649eb7 100644 --- a/board/nvidia/common/board.h +++ b/board/nvidia/common/board.h @@ -25,9 +25,6 @@ #define _BOARD_H_ void tegra2_start(void); -void clock_init(void); -void pinmux_init(void); -void gpio_init(void); void gpio_config_uart(void); int tegra2_mmc_init(int dev_index, int bus_width);