From patchwork Wed Oct 26 01:26:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 686845 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 3t3XTz1ZHFz9t0J for ; Wed, 26 Oct 2016 12:28:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=m9vwuxmF; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3FEDDA763B; Wed, 26 Oct 2016 03:27:41 +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 TZDrpQBVeKYR; Wed, 26 Oct 2016 03:27:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 10BFBA754A; Wed, 26 Oct 2016 03:27:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 53CA9A75E5 for ; Wed, 26 Oct 2016 03:27:15 +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 vRiVo9YU43z1 for ; Wed, 26 Oct 2016 03:27: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-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by theia.denx.de (Postfix) with ESMTPS id 39C99A75FD for ; Wed, 26 Oct 2016 03:27:02 +0200 (CEST) Received: by mail-pf0-f195.google.com with SMTP id s8so21051101pfj.2 for ; Tue, 25 Oct 2016 18:27:02 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=19DBJajecWQiAUpH0JBEuUQWsTudck6ICSaJS4nV/WQ=; b=m9vwuxmFQd/4GMVnyZ0Sb08IQlf6vRTyvB6niOrEYYpeQWZU2aB9OD3qwD2++nhF2A z+jJAMPshoEC1uS42/rQMQbcVBVbiLLxswXiisrwCTn5hC66IpJkNVogYDGoqTv67AQe jveKc5Z0YncdIBwBl1QyYUu3/pR6lBhqJ/LzRe+5iIHsWQbqufeXTC3XbtGaIde+1FXp Q5ExwO3B/Vu/ip2NJaC8YWGDSoppapVdY7232aAL1Clz0pnYSZPQ9LbZTw+Hp1h75HhP N48n2GZDxmHEe2FL3BchDWs0YU5oI8KyVFCs95zxao4zwcvjDwJjEA5JFy/o6c7JjEKP 2Suw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=19DBJajecWQiAUpH0JBEuUQWsTudck6ICSaJS4nV/WQ=; b=i3TPRRtUKbnWMSae8qhYCrlslTIYB1ByG5MlwjgdhKHuaiBzibz6zV8Wtpv6PB4VtM DynGcm9yDd5ABKrlfOXXEv/v3+FimuETMbbSQ4t8iFdR3WU8U6fVnlMTKsinbRfaqVc3 +zwuznoRMvxOB6juiOXL0n/uKz68B2Hwy81ryi8bANuW35lDBYs6dPqC8ELJPuQ183nX QOuYLLFp+ZU7DwRNjTVzrh7nxY7oK4ux0wx70xtYht0atlU8uJuUBXnbuGcPdlgVs3GY OHBc2SyNZq7cjI9LR7dbhZZwxfc8YYm95BWdoEzGblO8Dn/6uKK7zaKptajh1SoGR3Ej AUwQ== X-Gm-Message-State: ABUngvdAu+wVKTR4Zihmx0DmCy1d+h+U93sGdH4WWHWk6y8iZumXPwgcm/Wrr5rVxbpXHA== X-Received: by 10.99.174.71 with SMTP id e7mr37444570pgp.116.1477445221136; Tue, 25 Oct 2016 18:27:01 -0700 (PDT) Received: from chrisp-dl.atlnz.lc ([2001:df5:b000:22:a4a7:b31:c210:ddc6]) by smtp.gmail.com with ESMTPSA id ij5sm36231958pab.2.2016.10.25.18.26.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Oct 2016 18:27:00 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Wed, 26 Oct 2016 14:26:11 +1300 Message-Id: <20161026012612.9479-10-judge.packham@gmail.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161026012612.9479-1-judge.packham@gmail.com> References: <20161026012612.9479-1-judge.packham@gmail.com> MIME-Version: 1.0 Cc: Scott Wood , Luka Perkov , Stefan Roese , Chris Packham Subject: [U-Boot] [RFC PATCH v2 09/10] mtd: pxa3xx_nand: Simplify pxa3xx_nand_scan X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" This commit simplifies the initial configuration performed by pxa3xx_nand_scan. No functionality change is intended. [ Linux commit 154f50fbde539c20bbf74854461d932ebdace4d5 ] Cc: Ezequiel GarcĂ­a Signed-off-by: Chris Packham --- Changes in v2: - New drivers/mtd/nand/pxa3xx_nand.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 432219c78831..de897ae41d1e 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1252,7 +1252,7 @@ static void pxa3xx_nand_config_tail(struct pxa3xx_nand_info *info) info->reg_ndcr |= (mtd->writesize == 2048) ? NDCR_PAGE_SZ : 0; } -static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info) +static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info) { struct pxa3xx_nand_platform_data *pdata = info->pdata; uint32_t ndcr = nand_readl(info, NDCR); @@ -1264,7 +1264,6 @@ static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info) info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0; info->ndtr0cs0 = nand_readl(info, NDTR0CS0); info->ndtr1cs0 = nand_readl(info, NDTR1CS0); - return 0; } static int pxa3xx_nand_init_buff(struct pxa3xx_nand_info *info) @@ -1384,22 +1383,21 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd) int ret; uint16_t ecc_strength, ecc_step; - if (pdata->keep_config && !pxa3xx_nand_detect_config(info)) - goto KEEP_CONFIG; - - ret = pxa3xx_nand_config_ident(info); - if (ret) - return ret; - - ret = pxa3xx_nand_sensing(host); - if (ret) { - dev_info(&info->pdev->dev, "There is no chip on cs %d!\n", - info->cs); - - return ret; + if (pdata->keep_config) { + pxa3xx_nand_detect_config(info); + } else { + ret = pxa3xx_nand_config_ident(info); + if (ret) + return ret; + ret = pxa3xx_nand_sensing(host); + if (ret) { + dev_info(&info->pdev->dev, + "There is no chip on cs %d!\n", + info->cs); + return ret; + } } -KEEP_CONFIG: /* Device detection must be done with ECC disabled */ if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370) nand_writel(info, NDECCCTRL, 0x0);