From patchwork Tue Oct 23 11:21:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Narayanan X-Patchwork-Id: 193465 X-Patchwork-Delegate: trini@ti.com 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 3D37F2C008B for ; Tue, 23 Oct 2012 22:21:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F0DE4A2F3; Tue, 23 Oct 2012 13:21:19 +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 jhDLaLtIjuH0; Tue, 23 Oct 2012 13:21:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A41AF4A303; Tue, 23 Oct 2012 13:21:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2C5DD4A303 for ; Tue, 23 Oct 2012 13:21:16 +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 BxvHcgREHM9s for ; Tue, 23 Oct 2012 13:21:15 +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-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 1E72B4A2F3 for ; Tue, 23 Oct 2012 13:21:13 +0200 (CEST) Received: by mail-pb0-f44.google.com with SMTP id ro8so350395pbb.3 for ; Tue, 23 Oct 2012 04:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=Lt4QpfvDYM3sAlJEb1vkkP0YAv2dkGhdYEAKSNXtK8E=; b=Ebl5yqNfenGf/EY63DXxdLuss2akTaBQXcCHu18LQxDicayJi6OJpg4bf76LR3T0iP LQ1esAHSuWrEqc0+jcXrdI2+tZGNeu5ooGwl0cXtJcyKaI1OsynJr4I0k3HgFi7EM7WE VcMH64KUZ/g0GMXoefxbI0mVNAj9G1jxCTCcn6s+oYZ5ozQcRf/dXa4GotFQmslSxFV3 hxvVMyYzEq8f97oQykzT1nAB6u89futcyXt1CL6PTs8KMG+2VJolpwM9mlBpiNeNlwKl N9WGwGeqpo+bucJzcNY94AVBeMovbemrhyDDyjskpg/okIALaG9OLQus828iPWfistzu Qoxw== Received: by 10.68.224.161 with SMTP id rd1mr39745785pbc.49.1350991271555; Tue, 23 Oct 2012 04:21:11 -0700 (PDT) Received: from [115.184.15.192] ([115.184.15.192]) by mx.google.com with ESMTPS id qn1sm7553769pbc.55.2012.10.23.04.21.09 (version=SSLv3 cipher=OTHER); Tue, 23 Oct 2012 04:21:11 -0700 (PDT) Message-ID: <50867DA1.5070801@gmail.com> Date: Tue, 23 Oct 2012 16:51:05 +0530 From: Vikram Narayanan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: u-boot@lists.denx.de Cc: Stefan Roese Subject: [U-Boot] [PATCH] nand_spl: Define nand_select function 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Split up the selection of nand_chip from nand_init to a separate function. This is just to make it a little consistent as we've nand_deselect function. Also use it in spl_nand_load_image function. Signed-off-by: Vikram Narayanan Cc: Stefan Roese --- common/spl/spl_nand.c | 1 + drivers/mtd/nand/nand_spl_simple.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/common/spl/spl_nand.c b/common/spl/spl_nand.c index 61de5a4..5ebeb38 100644 --- a/common/spl/spl_nand.c +++ b/common/spl/spl_nand.c @@ -34,6 +34,7 @@ void spl_nand_load_image(void) debug("spl: nand - using hw ecc\n"); nand_init(); + nand_select(); /*use CONFIG_SYS_TEXT_BASE as temporary storage area */ header = (struct image_header *)(CONFIG_SYS_TEXT_BASE); diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c index 4a4d02f..77c56fc 100644 --- a/drivers/mtd/nand/nand_spl_simple.c +++ b/drivers/mtd/nand/nand_spl_simple.c @@ -270,12 +270,16 @@ void nand_init(void) nand_chip.ecc.correct = nand_correct_data; } #endif +} +/* Select before operation */ +void nand_select(void) +{ if (nand_chip.select_chip) nand_chip.select_chip(&mtd, 0); } -/* Unselect after operation */ +/* Deselect after operation */ void nand_deselect(void) { if (nand_chip.select_chip)