From patchwork Tue Aug 5 10:11:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 34906 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3986720523 for ; Tue, 5 Aug 2014 10:12:54 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id j7sf1928132qaq.5 for ; Tue, 05 Aug 2014 03:12:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=FPe3WTRZk3FOBTxAKhlaDA8HNJy4ZUrK8TQ2XWQPSgc=; b=eSQzpTay307W6NMCPwJnKVTNaiNf/15BI5MsADt2LPQdCfNY628Fop5M8IxMFDcZsG +OaWHCepk8fjQoK09tvuUemaAvtn/NNXqqHuztuqKQ26dSrRqD/Pk9iEDLWf54zD57n6 uXoSnSN+zUMkM1duQ05TrioHSB2sf5MaGK7nQ2e/mODIwlBJGWxa2c2Zhzxbhygc7pDC EBNwkfTayvTxSWhTOeaIAjvufwdvzicsfqSmY/XbSIvGeEZQPPRhimYzP6QHowlvnVoP ZsK1XlkkFOM1cUKOBrMN1uMW9lTMuyW/BCDVCbva2W5QC6O/pYFIHSpJKs6WWfjLuC1i /J4w== X-Gm-Message-State: ALoCoQmkP5LKJJnp8fuglMtCzVkMR7vTvIzA3CdwFlhSMDgVhxrCV070Y74KmBb4wM/ALJVkT4B2 X-Received: by 10.224.127.6 with SMTP id e6mr1482852qas.3.1407233573917; Tue, 05 Aug 2014 03:12:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.35 with SMTP id g32ls225083qgd.53.gmail; Tue, 05 Aug 2014 03:12:53 -0700 (PDT) X-Received: by 10.220.114.140 with SMTP id e12mr2169530vcq.37.1407233573848; Tue, 05 Aug 2014 03:12:53 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id w4si733803vct.72.2014.08.05.03.12.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:12:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id hy10so1050448vcb.18 for ; Tue, 05 Aug 2014 03:12:53 -0700 (PDT) X-Received: by 10.52.3.40 with SMTP id 8mr1933462vdz.24.1407233573772; Tue, 05 Aug 2014 03:12:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp372242vcb; Tue, 5 Aug 2014 03:12:53 -0700 (PDT) X-Received: by 10.70.51.8 with SMTP id g8mr2642537pdo.98.1407233572776; Tue, 05 Aug 2014 03:12:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id df8si713834pdb.326.2014.08.05.03.12.52 for ; Tue, 05 Aug 2014 03:12:52 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933201AbaHEKMp (ORCPT + 21 others); Tue, 5 Aug 2014 06:12:45 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:51608 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933163AbaHEKMm (ORCPT ); Tue, 5 Aug 2014 06:12:42 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s75ABbJe009198; Tue, 5 Aug 2014 05:11:37 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s75ABb9M029457; Tue, 5 Aug 2014 05:11:37 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 5 Aug 2014 05:11:37 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s75ABRXQ030519; Tue, 5 Aug 2014 05:11:34 -0500 From: Roger Quadros To: , CC: , , , , , , , , , Roger Quadros Subject: [PATCH 2/3] ARM: OMAP2+: GPMC: Support Software ECC scheme via DT Date: Tue, 5 Aug 2014 13:11:21 +0300 Message-ID: <1407233482-11642-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1407233482-11642-1-git-send-email-rogerq@ti.com> References: <1407233482-11642-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , For v3.14 and prior, 1-bit Hamming code ECC via software was the default choice for some boards e.g. 3430sdp. Commit ac65caf514ec in v3.15 changed the behaviour to use 1-bit Hamming code via Hardware using a different ECC layout i.e. (ROM code layout) than what is used by software ECC. This ECC layout change causes NAND filesystems created in v3.14 and prior to be unusable in v3.15 and later. So don't mark "sw" scheme as deperecated and support it. Signed-off-by: Roger Quadros --- Documentation/devicetree/bindings/mtd/gpmc-nand.txt | 2 +- arch/arm/mach-omap2/gpmc.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt index 65f4f7c..ee654e9 100644 --- a/Documentation/devicetree/bindings/mtd/gpmc-nand.txt +++ b/Documentation/devicetree/bindings/mtd/gpmc-nand.txt @@ -22,7 +22,7 @@ Optional properties: width of 8 is assumed. - ti,nand-ecc-opt: A string setting the ECC layout to use. One of: - "sw" use "ham1" instead + "sw" 1-bit Hamming ecc code via software "hw" use "ham1" instead "hw-romcode" use "ham1" instead "ham1" 1-bit Hamming ecc code diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 8bc1338..9f42d54 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1403,8 +1403,11 @@ static int gpmc_probe_nand_child(struct platform_device *pdev, pr_err("%s: ti,nand-ecc-opt not found\n", __func__); return -ENODEV; } - if (!strcmp(s, "ham1") || !strcmp(s, "sw") || - !strcmp(s, "hw") || !strcmp(s, "hw-romcode")) + + if (!strcmp(s, "sw")) + gpmc_nand_data->ecc_opt = OMAP_ECC_HAM1_CODE_SW; + else if (!strcmp(s, "ham1") || + !strcmp(s, "hw") || !strcmp(s, "hw-romcode")) gpmc_nand_data->ecc_opt = OMAP_ECC_HAM1_CODE_HW; else if (!strcmp(s, "bch4"))