From patchwork Tue Nov 21 17:38:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 840125 X-Patchwork-Delegate: yamada.m@jp.panasonic.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="F//ENyM+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yhCXh2HPFz9s8J for ; Wed, 22 Nov 2017 04:40:20 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EC37FC2202B; Tue, 21 Nov 2017 17:39:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C1027C21E4B; Tue, 21 Nov 2017 17:39:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 44D7CC21EDC; Tue, 21 Nov 2017 17:39:08 +0000 (UTC) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lists.denx.de (Postfix) with ESMTPS id 91B79C21EE7 for ; Tue, 21 Nov 2017 17:39:06 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id vALHcbtw001225; Wed, 22 Nov 2017 02:38:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com vALHcbtw001225 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511285921; bh=1QaXQ1MrlG92tduZMe459UA13Y3YeIMEcxABALM5b8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F//ENyM+R7PddsQfVPFeKiUg68FOJ8/Kp0FqjLkWK+LBwV3WOBbb6YfT6Ogb8JcJc ykMg9UesycPaCbBIGR9S992c/4xDnn/08nPx/U/qDJY10KNbj+Fe3Cfjw07m7eB2xi 9TsWNJcPbVSkT4ilcRDSzakuwLt9W4mUoYGC16LquG4PMdatqK4bXP194bccTiuTCA SkjymRSjzvl5UNGSeuRzx2BYU2qxUilHAOdNRYBoBwJfv6S68YGmhr7Mdhc994JMoQ XEh5F5bZGw3YKXuEB9SDJdu8CeeNuDVkcmEyQBpyVaZbCxT9Ny5LyvD72/+T/uC2cc Qpg+uO8cMh0Lw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 22 Nov 2017 02:38:18 +0900 Message-Id: <1511285912-12452-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511285912-12452-1-git-send-email-yamada.masahiro@socionext.com> References: <1511285912-12452-1-git-send-email-yamada.masahiro@socionext.com> Cc: Scott Wood Subject: [U-Boot] [PATCH 08/22] mtd: nand: Expose data interface for ONFI mode 0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Sascha Hauer The nand layer will need ONFI mode 0 to use it as timing mode before and right after reset. Signed-off-by: Sascha Hauer Signed-off-by: Boris Brezillon [Linux commit: 6e1f9708dbf3c50a8da93c1952a01a7a2acb5e66] Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/nand_timings.c | 11 +++++++++++ include/linux/mtd/nand.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c index b055d27..ba4f22f 100644 --- a/drivers/mtd/nand/nand_timings.c +++ b/drivers/mtd/nand/nand_timings.c @@ -297,3 +297,14 @@ int onfi_init_data_interface(struct nand_chip *chip, return 0; } EXPORT_SYMBOL(onfi_init_data_interface); + +/** + * nand_get_default_data_interface - [NAND Interface] Retrieve NAND + * data interface for mode 0. This is used as default timing after + * reset. + */ +const struct nand_data_interface *nand_get_default_data_interface(void) +{ + return &onfi_sdr_timings[0]; +} +EXPORT_SYMBOL(nand_get_default_data_interface); diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index a633fd0..0b9fe3f 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -1183,6 +1183,8 @@ uint8_t nand_read_byte(struct mtd_info *mtd); /* get timing characteristics from ONFI timing mode. */ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode); +/* get data interface from ONFI timing mode 0, used after reset. */ +const struct nand_data_interface *nand_get_default_data_interface(void); int nand_check_erased_ecc_chunk(void *data, int datalen, void *ecc, int ecclen,