From patchwork Fri Feb 5 14:37:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 8235561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DBBD19F6DA for ; Fri, 5 Feb 2016 14:39:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDADC20384 for ; Fri, 5 Feb 2016 14:39:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22CB02025B for ; Fri, 5 Feb 2016 14:39:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRhW2-0001VT-Lw; Fri, 05 Feb 2016 14:37:42 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRhVz-0001OZ-W2 for linux-arm-kernel@lists.infradead.org; Fri, 05 Feb 2016 14:37:40 +0000 Received: by mail-wm0-x242.google.com with SMTP id r129so3300044wmr.0 for ; Fri, 05 Feb 2016 06:37:19 -0800 (PST) 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; bh=KENW0K3o3K2pM6c1smLFqE1ieHfs9UKKTxY1eT7WTMA=; b=N6m66F0a41jLJsvpB3NRAIJrkFELIQED/PAc3yhhAYPM5qGzM1tsGF2Bh/jQj2G6et B6ROALVHjOuxgMiOUSK1iEFBqo6qEOaXrbIiT0G6MFXSmN9bOu74HbPs7u1M7LVoXvFI JdHJwGXsCtl2UreWTgxZ9e5423lmSj0mAUaEWSOPexV5CzgvS8gZUmh/e+5IyXE0qDDg TDayFcyHDQ3iJp/ijbI/DlFKQAtzIVGp11GAeteai+i12qLByQS5TgM8XwLqKQQ2HvOA dykHmXpswgHh4n6H4tHYIdyNQVEu3F2qSGROb9T20Amm4+AeiGmgv4+1sXy04A9W4RG7 iIdQ== 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; bh=KENW0K3o3K2pM6c1smLFqE1ieHfs9UKKTxY1eT7WTMA=; b=ErzY3YTE6BzIJangp89+S8bNIcn9iFAtz8wcHrOPNfQ4V0cRiK29mff6K2JwX0O/Q0 IqgeJXZwBkd2BHNOpJsbr0EHRZLhFSZ6OM3UD7cSxyCKbS4AxdzCj3+D88cQ29jpRC+j qPWr9O5G4GVGGTd+juYeAFFp7YqXdZ3V+N58LitQ6jvUi831mBh/iUKSLV80u0MWQHU1 xGUTMZfH2sNY5xD6D/pcCf4DHR4ElnQHxfeOEm08eVtvtnNahuODHYpFRFyh6x0kYMXs xRuHeZVeS1q5xj0QZd3jwWzL1Q8Jtl07cOhz1sBSJNRkSo4vkMRlngKWLjIuHSaqIYZ5 gTAQ== X-Gm-Message-State: AG10YOR9PP5VhuYzZjJKZoMMo0XW9WzT3Jdbb1QsQLd5C8JhjXzqtdLtF/blbD1e7jDGBA== X-Received: by 10.28.103.197 with SMTP id b188mr10700786wmc.4.1454683038125; Fri, 05 Feb 2016 06:37:18 -0800 (PST) Received: from localhost.localdomain ([46.249.74.23]) by smtp.gmail.com with ESMTPSA id v66sm13708577wmb.18.2016.02.05.06.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Feb 2016 06:37:17 -0800 (PST) From: Ivaylo Dimitrov To: tony@atomide.com Subject: [PATCH] ARM: OMAP2+: Fix onenand initialization to avoid filesystem corruption Date: Fri, 5 Feb 2016 16:37:08 +0200 Message-Id: <1454683028-4193-1-git-send-email-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160205_063740_299254_FB01B3BF X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, Ivaylo Dimitrov , linux@arm.linux.org.uk, aaro.koskinen@iki.fi, khilman@deeprootsystems.com, sre@kernel.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, pali.rohar@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rogerq@ti.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit ("ARM: OMAP2+: Fix onenand rate detection to avoid filesystem corruption") partially fixed onenand configuration when GPMC module is reset. Finish the job by also providing the correct values in ONENAND_REG_SYS_CFG1 register. Signed-off-by: Ivaylo Dimitrov Tested-by: Aaro Koskinen --- arch/arm/mach-omap2/gpmc-onenand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 7b76ce0..8633c70 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c @@ -101,10 +101,8 @@ static void omap2_onenand_set_async_mode(void __iomem *onenand_base) static void set_onenand_cfg(void __iomem *onenand_base) { - u32 reg; + u32 reg = ONENAND_SYS_CFG1_RDY | ONENAND_SYS_CFG1_INT; - reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); - reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9)); reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) | ONENAND_SYS_CFG1_BL_16; if (onenand_flags & ONENAND_FLAG_SYNCREAD) @@ -123,6 +121,7 @@ static void set_onenand_cfg(void __iomem *onenand_base) reg |= ONENAND_SYS_CFG1_VHF; else reg &= ~ONENAND_SYS_CFG1_VHF; + writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); } @@ -289,6 +288,7 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base) } } + onenand_async.sync_write = true; omap2_onenand_calc_async_timings(&t); ret = gpmc_cs_program_settings(gpmc_onenand_data->cs, &onenand_async);