Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1700619imu; Thu, 17 Jan 2019 01:41:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN4KU2irYq93Q6J6k2h4Aqh3srfYH2piYa+i7aBW2yOJtrWo6/DbFuJweCVMxuZof2RYHBBC X-Received: by 2002:a62:fc52:: with SMTP id e79mr14421943pfh.8.1547718087202; Thu, 17 Jan 2019 01:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547718087; cv=none; d=google.com; s=arc-20160816; b=tsKbpVZLkDJ9BvWJH2LyDuGq5xpf0q6iMW6f+Nn5ari4Fg2BmUOp0qqr4Odqr41LcX Vov50G4ai0f0TTbaaOuuP3PBaCqTwdWlnDrwxyRZ9oMvKoUirjQQRyxbxix6HbaZQc/e 8YpaEZgE7127mUamK6m9mYt7gfoir0FPspd2DfEn0zzifaqcqMu1ESNsSDKNyhG5+8Uu p941LxK6WNuOXXUEXehUs4KdpEWl+jLwiHafjI+i592ZOhEKRxEKfLU3OIM6OD5ugddW R6rJFniWVBNBMe6DB2/cGAbDVd/mJsIGDwkzHJqu5vfpoo1R90RuhlD/VUhy37xzZUY3 i0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to; bh=GznjEkx6aANltMFhYPaPRAbARBFwNpHDJR1jH/itRcI=; b=R4l3l4ldrEJ659G4OUxTOIZ9QbeIOmAMa4LMm00MMeRoVIHWXkpSLsXMUSdyDcymdP obxysV9bEBzQFw7gllORZrOdn3RNUBo5dahA1kc2cB+bbkmm7uKtTcZ2s/GOei7R1tpw AR9L7eVmoi1ioP5KbRWkNlx0LyyILauXW+KA59MwB2b6G+OcKIn+hRIdmIC1XC0JvVCd YLoH652XTaZRPwIU/DisaPG0A2Iq1/jzuhFWs3jkWXeTOxi9Zg/ztTFya6KsFLUplR6a Py4xNnsQbSyu1sVUzKQJGEzXxytSXM7fjbisbG9TVJEe8KJXKrLcZY+Ms5aKnFCyfuHN 6QpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=toshiba.co.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144si1163204pga.322.2019.01.17.01.41.11; Thu, 17 Jan 2019 01:41:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=toshiba.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729080AbfAQImb (ORCPT + 99 others); Thu, 17 Jan 2019 03:42:31 -0500 Received: from mo-csw1115.securemx.jp ([210.130.202.157]:58504 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728259AbfAQImb (ORCPT ); Thu, 17 Jan 2019 03:42:31 -0500 Received: by mo-csw.securemx.jp (mx-mo-csw1115) id x0H8fdNm022623; Thu, 17 Jan 2019 17:41:40 +0900 X-Iguazu-Qid: 2wGqmlbH9TVgC0r5TF X-Iguazu-QSIG: v=2; s=0; t=1547714499; q=2wGqmlbH9TVgC0r5TF; m=WN6ym3wujnZFL+Xkjeai3fFXBiTNnGD8gNF4Ays+bJE= Received: from imx2.toshiba.co.jp (imx2.toshiba.co.jp [106.186.93.51]) by relay.securemx.jp (mx-mr1111) id x0H8fTuH036348; Thu, 17 Jan 2019 17:41:29 +0900 Received: from enc03.localdomain ([106.186.93.13]) by imx2.toshiba.co.jp with ESMTP id x0H8fSEX026706; Thu, 17 Jan 2019 17:41:28 +0900 (JST) Received: from hop001.toshiba.co.jp ([133.199.164.63]) by enc03.localdomain with ESMTP id x0H8fSbZ026843; Thu, 17 Jan 2019 17:41:28 +0900 Reply-To: tmcmc-mb-yfuruyama7@ml.toshiba.co.jp Subject: Re: [PATCH] mtd: spinand: Add support for all Toshiba Memory products To: Schrempf Frieder , "bbrezillon@kernel.org" , "miquel.raynal@bootlin.com" Cc: "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "peron.clem@gmail.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20190116055319.2755-1-tmcmc-mb-yfuruyama7@ml.toshiba.co.jp> From: posting test X-TSB-HOP: ON Message-ID: Date: Tue, 25 Dec 2018 12:25:19 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Schrempf, Miquel, Thanks a lot. On 2019年01月16日 21:58, Schrempf Frieder wrote: > On 16.01.19 06:53, Yoshio Furuyama wrote: >> Add device table for Toshiba Memory products. >> Also, generalize OOB layout structure and function names. >> >> Signed-off-by: Yoshio Furuyama > Reviewed-by: Frieder Schrempf > >> --- >> drivers/mtd/nand/spi/toshiba.c | 79 +++++++++++++++++++++++++++++++++------- >> 1 file changed, 65 insertions(+), 14 deletions(-) >> >> diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c >> index 0812655..0916962 100644 >> --- a/drivers/mtd/nand/spi/toshiba.c >> +++ b/drivers/mtd/nand/spi/toshiba.c >> @@ -25,19 +25,19 @@ static SPINAND_OP_VARIANTS(write_cache_variants, >> static SPINAND_OP_VARIANTS(update_cache_variants, >> SPINAND_PROG_LOAD(false, 0, NULL, 0)); >> >> -static int tc58cvg2s0h_ooblayout_ecc(struct mtd_info *mtd, int section, >> +static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section, >> struct mtd_oob_region *region) >> { >> - if (section > 7) >> + if (section > 0) >> return -ERANGE; >> >> - region->offset = 128 + 16 * section; >> - region->length = 16; >> + region->offset = mtd->oobsize / 2; >> + region->length = mtd->oobsize / 2; >> >> return 0; >> } >> >> -static int tc58cvg2s0h_ooblayout_free(struct mtd_info *mtd, int section, >> +static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section, >> struct mtd_oob_region *region) >> { >> if (section > 0) >> @@ -45,17 +45,17 @@ static int tc58cvg2s0h_ooblayout_free(struct mtd_info *mtd, int section, >> >> /* 2 bytes reserved for BBM */ >> region->offset = 2; >> - region->length = 126; >> + region->length = mtd->oobsize / 2 - 2; >> >> return 0; >> } >> >> -static const struct mtd_ooblayout_ops tc58cvg2s0h_ooblayout = { >> - .ecc = tc58cvg2s0h_ooblayout_ecc, >> - .free = tc58cvg2s0h_ooblayout_free, >> +static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = { >> + .ecc = tc58cxgxsx_ooblayout_ecc, >> + .free = tc58cxgxsx_ooblayout_free, >> }; >> >> -static int tc58cvg2s0h_ecc_get_status(struct spinand_device *spinand, >> +static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand, >> u8 status) >> { >> struct nand_device *nand = spinand_to_nand(spinand); >> @@ -94,15 +94,66 @@ static int tc58cvg2s0h_ecc_get_status(struct spinand_device *spinand, >> } >> >> static const struct spinand_info toshiba_spinand_table[] = { >> - SPINAND_INFO("TC58CVG2S0H", 0xCD, >> + /* 3.3V 1Gb */ >> + SPINAND_INFO("TC58CVG0S3", 0xC2, >> + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), >> + NAND_ECCREQ(8, 512), >> + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> + &write_cache_variants, >> + &update_cache_variants), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> + /* 3.3V 2Gb */ >> + SPINAND_INFO("TC58CVG1S3", 0xCB, >> + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), >> + NAND_ECCREQ(8, 512), >> + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> + &write_cache_variants, >> + &update_cache_variants), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> + /* 3.3V 4Gb */ >> + SPINAND_INFO("TC58CVG2S0", 0xCD, >> + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), >> + NAND_ECCREQ(8, 512), >> + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> + &write_cache_variants, >> + &update_cache_variants), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> + /* 1.8V 1Gb */ >> + SPINAND_INFO("TC58CYG0S3", 0xB2, >> + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), >> + NAND_ECCREQ(8, 512), >> + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> + &write_cache_variants, >> + &update_cache_variants), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> + /* 1.8V 2Gb */ >> + SPINAND_INFO("TC58CYG1S3", 0xBB, >> + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), >> + NAND_ECCREQ(8, 512), >> + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> + &write_cache_variants, >> + &update_cache_variants), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> + /* 1.8V 4Gb */ >> + SPINAND_INFO("TC58CYG2S0", 0xBD, >> NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), >> NAND_ECCREQ(8, 512), >> SPINAND_INFO_OP_VARIANTS(&read_cache_variants, >> &write_cache_variants, >> &update_cache_variants), >> - SPINAND_HAS_QE_BIT, >> - SPINAND_ECCINFO(&tc58cvg2s0h_ooblayout, >> - tc58cvg2s0h_ecc_get_status)), >> + 0, >> + SPINAND_ECCINFO(&tc58cxgxsx_ooblayout, >> + tc58cxgxsx_ecc_get_status)), >> }; >> >> static int toshiba_spinand_detect(struct spinand_device *spinand) >> >