From patchwork Wed Aug 27 12:42:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 36097 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E10272054F for ; Wed, 27 Aug 2014 12:43:18 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id at20sf587422iec.7 for ; Wed, 27 Aug 2014 05:43:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=RZx+a+39Fx1zp2KqqHT6uPNTKZLD+prTsjhmYFCmt+I=; b=RvEWgWuQZ2vFVhxdQfC1gWKUiwM0dpKgXKam9Zwb4QQrsK0yfGML35rlDl3jO0P3CB dYsQXXYFsq3VhzRRLSs3z8R4sZNKRSlYG9DMJuv25iiyovDO3s5/TbD4jeY0ME9UcBs3 aeCe+qFAC9S/+Ri0VPFOwgs9VcVYeu9ErxQmdWVY5bDGTelFqVzlgUCHiX4yNk4VG0rf 5M5QomCQBQYjgepi4r6LHCFQ0yxa0Sb++0/iC8cs5l1PozhVOtSCN3uXf+4cPE2X2HgT QmmfjztE87/PH0RYKbzddX8ZoMcKNjC2o/eo7fEqJXCpnwGjug9pqQlZjVSDTSAvBb9/ +u2A== X-Gm-Message-State: ALoCoQnsKvNI23RtwnJsdfWz6AQ11PFvLBMFDEGuydiPRJCeYDwLVco8+ybyiB4XHHD85HtvANnA X-Received: by 10.182.125.68 with SMTP id mo4mr376833obb.49.1409143398424; Wed, 27 Aug 2014 05:43:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.242 with SMTP id 105ls103113qgx.17.gmail; Wed, 27 Aug 2014 05:43:18 -0700 (PDT) X-Received: by 10.221.61.5 with SMTP id wu5mr28389066vcb.13.1409143398287; Wed, 27 Aug 2014 05:43:18 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id cm5si139394vdc.62.2014.08.27.05.43.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 05:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ij19so13137vcb.25 for ; Wed, 27 Aug 2014 05:43:18 -0700 (PDT) X-Received: by 10.220.114.66 with SMTP id d2mr16590271vcq.27.1409143398203; Wed, 27 Aug 2014 05:43:18 -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.45.67 with SMTP id uj3csp75619vcb; Wed, 27 Aug 2014 05:43:17 -0700 (PDT) X-Received: by 10.69.19.193 with SMTP id gw1mr45421464pbd.106.1409143397206; Wed, 27 Aug 2014 05:43:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pv6si40448pac.239.2014.08.27.05.43.16 for ; Wed, 27 Aug 2014 05:43:17 -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 S934219AbaH0Mm5 (ORCPT + 26 others); Wed, 27 Aug 2014 08:42:57 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:65126 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933994AbaH0Mmy (ORCPT ); Wed, 27 Aug 2014 08:42:54 -0400 Received: by mail-ie0-f178.google.com with SMTP id rd18so163932iec.23 for ; Wed, 27 Aug 2014 05:42:54 -0700 (PDT) X-Received: by 10.43.64.198 with SMTP id xj6mr2076451icb.70.1409143374052; Wed, 27 Aug 2014 05:42:54 -0700 (PDT) Received: from localhost.localdomain (host86-152-0-170.range86-152.btcentralplus.com. [86.152.0.170]) by mx.google.com with ESMTPSA id e1sm2721318igx.18.2014.08.27.05.42.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Aug 2014 05:42:53 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, kernel@stlinux.com, computersforpeace@gmail.com, pekon@pek-sem.com, linux-mtd@lists.infradead.org Subject: [PATCH 7/9] mtd: nand: stm_nand_bch: adding BBT header Date: Wed, 27 Aug 2014 13:42:22 +0100 Message-Id: <1409143344-22458-8-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409143344-22458-1-git-send-email-lee.jones@linaro.org> References: <1409143344-22458-1-git-send-email-lee.jones@linaro.org> 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: lee.jones@linaro.org 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.180 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: , This header will be used firstly by the BCH main driver, then the Bad Block Table (BBT) code which will be added immediately after. Doing it this way provides the cleanest method of keeping the patch-set bisectable. Signed-off-by: Lee Jones --- include/linux/mtd/stm_nand_bbt.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/linux/mtd/stm_nand_bbt.h diff --git a/include/linux/mtd/stm_nand_bbt.h b/include/linux/mtd/stm_nand_bbt.h new file mode 100644 index 0000000..bcb33b2 --- /dev/null +++ b/include/linux/mtd/stm_nand_bbt.h @@ -0,0 +1,17 @@ +#include + +/* BCH ECC sizes */ +static int bch_ecc_sizes[] = { + [BCH_18BIT_ECC] = 32, + [BCH_30BIT_ECC] = 54, + [BCH_NO_ECC] = 0, +}; + +#if defined(CONFIG_MTD_NAND_STM_BCH_BBT) +extern void nandi_dump_bad_blocks(struct nandi_controller *nandi); +extern int bch_scan_bbt(struct mtd_info *mtd); +extern int bch_block_isbad(struct mtd_info *mtd, loff_t offs, int getchip); +extern int bch_block_markbad(struct mtd_info *mtd, loff_t offs); +#else +inline void nandi_dump_bad_blocks(struct nandi_controller *nandi) {} +#endif