From patchwork Thu Apr 15 11:11:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Rubini X-Patchwork-Id: 71755 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 7A233EEE8D9 for ; Thu, 15 Apr 2010 13:13:40 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 6CEF9C912DD7 for ; Thu, 15 Apr 2010 13:13:40 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.9) for (single-drop); Thu, 15 Apr 2010 13:13:40 +0200 (CEST) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Thu, 15 Apr 2010 13:12:30 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Thu, 15 Apr 2010 13:12:29 +0200 Received: from scanner-4.m-online.net (scanner-4.m-online.net [192.168.1.18]) by mail.m-online.net (Postfix) with ESMTP id A53B52001B0; Thu, 15 Apr 2010 13:12:29 +0200 (CEST) Received: from mxin-2.m-online.net ([192.168.1.21]) by scanner-4.m-online.net (scanner-4.m-online.net [192.168.1.18]) (amavisd-new, port 10026) with ESMTP id 19526-06-2; Thu, 15 Apr 2010 13:12:27 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-2.m-online.net (Postfix) with ESMTP id 0146D47CE6F; Thu, 15 Apr 2010 13:12:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6ABAD280A2; Thu, 15 Apr 2010 13:12:12 +0200 (CEST) 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 r6-oq16zBHxp; Thu, 15 Apr 2010 13:12:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33EB7280A6; Thu, 15 Apr 2010 13:12:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3DCCC2808C for ; Thu, 15 Apr 2010 13:12:04 +0200 (CEST) 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 MqixrF2CQTDn for ; Thu, 15 Apr 2010 13:12:04 +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.gnudd.com (mail2.gnudd.com [213.203.150.91]) by theia.denx.de (Postfix) with ESMTPS id 9B8C428099 for ; Thu, 15 Apr 2010 13:12:00 +0200 (CEST) Received: from mail.gnudd.com (localhost [127.0.0.1]) by mail.gnudd.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o3FBBvjD029111; Thu, 15 Apr 2010 13:11:57 +0200 Received: (from rubini@localhost) by mail.gnudd.com (8.14.3/8.14.3/Submit) id o3FBBv1W029110; Thu, 15 Apr 2010 13:11:57 +0200 Date: Thu, 15 Apr 2010 13:11:57 +0200 From: Alessandro Rubini To: u-boot@lists.denx.de Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Face: #Q; A)@_4.#>0+_%y]7aBr:c"ndLp&#+2?]J; lkse\^)FP^Lr5@O0{)J; 'nny4%74.fM'n)M >ISCj.KmsL/HTxz!:Ju'pnj'Gz&. Organization: GnuDD, Device Drivers, Embedded Systems, Courses References: In-Reply-To: Cc: STEricsson_nomadik_linux@list.st.com, andrea.gallo@stericsson.com Subject: [U-Boot] [PATCH 1/7] nhk8815: change the order of initialization 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Virus-Scanned: by amavisd-new at m-online.net From: Alessandro Rubini Some inizialization was in board_late_init(), but to satisfy drivers added in the next patches must be performed in normal board_init. This patch leaves board_late_init() empty, but later patches fill it. Signed-off-by: Alessandro Rubini Acked-by: Andrea Gallo --- board/st/nhk8815/nhk8815.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c index faef810..eadce40 100644 --- a/board/st/nhk8815/nhk8815.c +++ b/board/st/nhk8815/nhk8815.c @@ -60,22 +60,26 @@ int board_init(void) writel(0x02100551, NOMADIK_FSMC_BASE + 0x04); /* FSMC_BTR0 */ icache_enable(); - return 0; -} -int board_late_init(void) -{ + /* + * Configure I2C pins, as we will use I2C in a later commit + */ + /* Set the two I2C gpio lines to be gpio high */ nmk_gpio_set(__SCL, 1); nmk_gpio_set(__SDA, 1); nmk_gpio_dir(__SCL, 1); nmk_gpio_dir(__SDA, 1); nmk_gpio_af(__SCL, GPIO_GPIO); nmk_gpio_af(__SDA, GPIO_GPIO); - /* Reset the I2C port expander, on GPIO77 */ - nmk_gpio_af(77, GPIO_GPIO); - nmk_gpio_dir(77, 1); - nmk_gpio_set(77, 0); - udelay(10); - nmk_gpio_set(77, 1); + /* Put the two I2C port expanders out of reset, on GPIO77 and 79 */ + { + int n[2]={77, 79}; + int i; + for (i = 0; i < ARRAY_SIZE(n); i++) { + nmk_gpio_af(n[i], GPIO_GPIO); + nmk_gpio_dir(n[i], 1); + nmk_gpio_set(n[i], 1); + } + } return 0; } @@ -101,3 +105,10 @@ int board_eth_init(bd_t *bis) return rc; } #endif + +/* Initialization callback, from lib_arm/board.c */ +int board_late_init(void) +{ + return 0; +} +