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: 8235531 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA9C1BEEE5 for ; Fri, 5 Feb 2016 14:37:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10B3020397 for ; Fri, 5 Feb 2016 14:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 192BF2025B for ; Fri, 5 Feb 2016 14:37:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751586AbcBEOhW (ORCPT ); Fri, 5 Feb 2016 09:37:22 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33124 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbcBEOhT (ORCPT ); Fri, 5 Feb 2016 09:37:19 -0500 Received: by mail-wm0-f68.google.com with SMTP id r129so3300012wmr.0; Fri, 05 Feb 2016 06:37:18 -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=b61zyhpLEo82Ip8U/+Nuo5Y1SI+S+0B3MBYeY5wt0o/z+Q072QMPsX2UOh5FDJaHRb IFBbtDRHdX/SsualSQyfGZd2ZrVaEMxNikV4nqsxPWTnnxPPzFoCkJNiJNsqZLgvvlxt MDsXI9g1XIaIZEo9MBlzvupFTmkx8CSBx0FfFDlep9yavOWYR5XbhdvrQZiyvm4VU3sK puUlyZ9bE24sXXeCQOqu40NGVn54+iG28OiIOXq2pay57InVEHjiNJHNagkZ53ImPtyc Bthnw8gQT1W/cPBko7dDzRsTUiprmhuQLVYZrLhwME1sHlvMxQd1LUQoCDm6duD6IKUt Lxxg== X-Gm-Message-State: AG10YORZPMC7mlizamYcEXBGDCEGKO/U8yk7RvLiwFUDtX/nulxkgNfqXMI40vPK491FqQ== 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 Cc: rogerq@ti.com, khilman@deeprootsystems.com, linux@arm.linux.org.uk, pali.rohar@gmail.com, sre@kernel.org, aaro.koskinen@iki.fi, pavel@ucw.cz, nm@ti.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ivaylo Dimitrov 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: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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);