From patchwork Mon Jul 14 01:36:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Fritz X-Patchwork-Id: 4542191 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6256A9F295 for ; Mon, 14 Jul 2014 01:36:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DB0E20149 for ; Mon, 14 Jul 2014 01:36:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B502F20145 for ; Mon, 14 Jul 2014 01:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462AbaGNBgY (ORCPT ); Sun, 13 Jul 2014 21:36:24 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:61408 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691AbaGNBgX (ORCPT ); Sun, 13 Jul 2014 21:36:23 -0400 Received: by mail-la0-f53.google.com with SMTP id gl10so346511lab.26 for ; Sun, 13 Jul 2014 18:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=subject:from:to:cc:content-type:date:message-id:mime-version :content-transfer-encoding; bh=T/WGlrlJuqxHB/nk+/Dj0afIIheE4dRle3nFg596Qs0=; b=glirtKDtJSVbtjYWSnbo0lmt4ClAk+MKnAFtmZly7AUAhwZgaIgrdLAdFDOf7xndQ2 l0kL79BxGo5ieDCq67Ls2N8WxtEDDBtq53CKzjXBS8ZbP0M5eD3+wui+k9j98YW+V5g4 GujwacCDcQMlZRSjpr8orAmE1jRXlpP4HfuI66wTwPSZSkxF9lCGFebjL3cxYwT7Px+J L3GXPTVohD1Oji54JbYTK5kIEF8xvyCw/urctPWXLUT6KkYVqy4wYLL1ZNhYvZudd2oN 4UdgqpNSQd9S9JAnKNWtUw2XM4v3iWIYHT4BmoxI8VLmJUNX8v0ZL0z+NQwY+nCzFpTt IG7w== X-Received: by 10.112.126.38 with SMTP id mv6mr4155556lbb.54.1405301782139; Sun, 13 Jul 2014 18:36:22 -0700 (PDT) Received: from [46.246.36.234] (anon-36-234.vpn.ipredator.se. [46.246.36.234]) by mx.google.com with ESMTPSA id v4sm4602473lav.44.2014.07.13.18.36.19 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 13 Jul 2014 18:36:21 -0700 (PDT) Subject: ARM: OMAP2+: gpmc: fix gpmc_hwecc_bch_capable() From: Christoph Fritz To: "Gupta, Pekon" , Tony Lindgren Cc: Daniel Mack , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "Strashko, Grygorii" , =?ISO-8859-1?Q?Beno=EEt?= Cousson , "Javier Martinez Canillas (javier@dowhile0.org)" , "Ash Charles (ashcharles@gmail.com)" Date: Mon, 14 Jul 2014 03:36:18 +0200 Message-ID: <1405301778.29716.72.camel@mars> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 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=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 This patch adds bch8 ecc software fallback which is mostly used by omap3s because they lack hardware elm support. Fixes: 0611c41934ab35ce84dea34ab291897ad3cbc7be (ARM: OMAP2+: gpmc: update gpmc_hwecc_bch_capable() for new platforms and ECC schemes) Cc: # 3.15.x+ Signed-off-by: Christoph Fritz Reviewed-by: Pekon Gupta --- arch/arm/mach-omap2/gpmc-nand.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 17cd393..93914d2 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -50,6 +50,16 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) soc_is_omap54xx() || soc_is_dra7xx()) return 1; + if (ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW || + ecc_opt == OMAP_ECC_BCH8_CODE_HW_DETECTION_SW) { + if (cpu_is_omap24xx()) + return 0; + else if (cpu_is_omap3630() && (GET_OMAP_REVISION() == 0)) + return 0; + else + return 1; + } + /* OMAP3xxx do not have ELM engine, so cannot support ECC schemes * which require H/W based ECC error detection */ if ((cpu_is_omap34xx() || cpu_is_omap3630()) && @@ -57,14 +67,6 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) (ecc_opt == OMAP_ECC_BCH8_CODE_HW))) return 0; - /* - * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1 - * and AM33xx derivates. Other chips may be added if confirmed to work. - */ - if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW) && - (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0))) - return 0; - /* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */ if (ecc_opt == OMAP_ECC_HAM1_CODE_HW) return 1;