From patchwork Wed Nov 5 16:59:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 40211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7752240A6 for ; Wed, 5 Nov 2014 17:02:16 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf768255lbj.3 for ; Wed, 05 Nov 2014 09:02:15 -0800 (PST) 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=TSYk6E4D/T3BjCWLU4TD9TMeDJPsCI8QCBhJH5dqlgk=; b=hS17HT+c51ZDtzfh0ANywGxAIs2N0K6pNzXmwJWhmeMI5YD2NKkcXVOVNdNMo2bKhq Phk/G0hoQ4kopxLvBe1Kt1EO3FFYohGjamAt0U65h13gy9P+Yy9VtQpCy0hHUbR6Un0n 3nHZz9hUnfAWK9qa+Tz83qJ+vqrP9jvfBGy7hj0TefxPaL3RBkjbo74iOUfbFyz5Y37p +pPoydvooNKjPlMMuAVYfzX0x4Kh/S5QggfHIcDU5RhniZKvl+I+diu2Fn60XdrqPQmK saXr9y2QUPAoVR1CrhMkpsUPC3kew1pGvWwW3qf+1USVj7k1/kQIgYZ922+dK+Ynetfr jKyQ== X-Gm-Message-State: ALoCoQn9l1bmA7Oiykzk52iCHEddUFwk6wIlMzVgEeT0A6tcaKPStMN23wB3aDCCzMviAXepypnL X-Received: by 10.112.32.163 with SMTP id k3mr37624lbi.17.1415206935032; Wed, 05 Nov 2014 09:02:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.40 with SMTP id p8ls862826lah.106.gmail; Wed, 05 Nov 2014 09:02:14 -0800 (PST) X-Received: by 10.112.168.97 with SMTP id zv1mr43490701lbb.6.1415206934864; Wed, 05 Nov 2014 09:02:14 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id k3si7265919lbd.26.2014.11.05.09.02.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Nov 2014 09:02:14 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id mc6so1036965lab.26 for ; Wed, 05 Nov 2014 09:02:14 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr68765315lbc.23.1415206934549; Wed, 05 Nov 2014 09:02:14 -0800 (PST) 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.112.184.201 with SMTP id ew9csp316206lbc; Wed, 5 Nov 2014 09:02:13 -0800 (PST) X-Received: by 10.68.219.35 with SMTP id pl3mr16784030pbc.143.1415206932737; Wed, 05 Nov 2014 09:02:12 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zu3si3419535pbc.209.2014.11.05.09.02.12 for ; Wed, 05 Nov 2014 09:02:12 -0800 (PST) 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 S1755158AbaKERCH (ORCPT + 25 others); Wed, 5 Nov 2014 12:02:07 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:47497 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932123AbaKERAm (ORCPT ); Wed, 5 Nov 2014 12:00:42 -0500 Received: by mail-ie0-f173.google.com with SMTP id tr6so1107442ieb.32 for ; Wed, 05 Nov 2014 09:00:42 -0800 (PST) X-Received: by 10.50.43.200 with SMTP id y8mr33290542igl.7.1415206841963; Wed, 05 Nov 2014 09:00:41 -0800 (PST) Received: from localhost.localdomain (host86-129-140-59.range86-129.btcentralplus.com. [86.129.140.59]) by mx.google.com with ESMTPSA id rj6sm6663489igc.0.2014.11.05.09.00.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Nov 2014 09:00:41 -0800 (PST) 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 v4 09/11] mtd: nand: stm_nand_bch: adding BBT header Date: Wed, 5 Nov 2014 16:59:51 +0000 Message-Id: <1415206793-25670-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415206793-25670-1-git-send-email-lee.jones@linaro.org> References: <1415206793-25670-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.215.53 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 | 22 ++++++++++++++++++++++ 1 file changed, 22 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..8f5deaa --- /dev/null +++ b/include/linux/mtd/stm_nand_bbt.h @@ -0,0 +1,22 @@ +#ifndef __LINUX_MTD_STM_BBT_H +#define __LINUX_MTD_STM_BBT_H + +#include + +/* BCH ECC sizes */ +static int bch_ecc_sizes[] = { + [BCH_18BIT_ECC] = 32, + [BCH_30BIT_ECC] = 54, + [BCH_NO_ECC] = 0, +}; + +#if IS_ENABLED(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 +static inline void nandi_dump_bad_blocks(struct nandi_controller *nandi) {} +#endif + +#endif /* __LINUX_MTD_STM_BBT_H */