Message ID | 20220721064435.2456601-13-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBCQ4XFG47UFRB4XL4OLAMGQEUBTLNDI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 24D8C44190 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 21 Jul 2022 08:45:07 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id h189-20020a1c21c6000000b003a2fdf9bd2asf567094wmh.8 for <linux-amarula@patchwork.amarulasolutions.com>; Wed, 20 Jul 2022 23:45:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658385907; cv=pass; d=google.com; s=arc-20160816; b=zXa4Em/klKEKvMYxocIoP0KLjtqsj0HvC8B87Ffu743vUKPjwFRMJbNat8t8/dWvYa XdcDO4GJDTJ4gSEc483lziSYrdatZTCN2FEgRHmWBNaEAjW57X2GfebFiHhXuRMSvTRr FS6qETlfENFRoQxQOJ3NpO6FIRiA5cpki9mnAcc6PjvPhZ2vOCJ1R0IJ3ES21f29iWVX p3xwUyXSRCoWGti8Mh4F7fCAqOzb9jOtjS4RYf7IukxsKwBLA3LPcqVhmCJay4ononT+ njBPVoQ0kYTfzoOI/7aF967OsWyzNgeFg/F8PfhNYV6PlkxGWiR2eGjC0pC1fSU/6XP3 McCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AA1i+EToWE0n1FqLJTOeU8TQI//J9XLEtARYqN6n4hk=; b=OAGIvmS3KyGle/KNS2qBW3Y1G6USY9I8lw1mhyLVyR8yzhkeg3LxSVKfQWaLUCFPU3 nNn7XtIrDL3GKSMQRdgqYGLtimCxfSUIfRAI9ERRjl0otyKnCM/Vt8+bFN067UO2BdmN vzF7RAENkUs2nUJM1sUF9HVLedhv8GfQuSIEp5t7izgeVhKBcAeicYNjne/pUkKfdmg6 eDtAGtz8KXVWoG9PNn+ZJiLUw/UciO8Z79Ir/YnqnshO9BE8JOPL4CESx7EaCuqnfFIQ 10mgsy3XkoO/nq272RrqOP3J406TiYNgL7g4rDJjrgTXVynawzPYQi6zmQBHZ+7ckhxi yS+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SM973YcK; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=AA1i+EToWE0n1FqLJTOeU8TQI//J9XLEtARYqN6n4hk=; b=YXZNTOdmCXzhnePDszRIRopCxBtflJWg3KQFYOi2FlTBYnC4v3/vZ5EUbqFiOEqOig +zEEVQbybual87Lpy3UTvZqkv93KSZv+VzoSnV+d+IjCBo+5L5J9YfO9SqhrZi2xZhsG XuruiBjybxeAOhsXybtFvtOFQj77McI9Jdv7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=AA1i+EToWE0n1FqLJTOeU8TQI//J9XLEtARYqN6n4hk=; b=5la59OlwUabTfce2kx/AXxJnVbbuGvn7UKQK62logVQH0oQpF2xYh3tL8zb6jgwuwy vbEfeeorY6Q8DdBHYZfgHl6xJNPfbgueEc91U7W+mg0r+2XkSQT06yPhO+yVHaL4SczC MHx7G+fG+/TkeJWm653NqQxVH/WhuG1IaU4wtn7rXiNWAUF6NVU2xvIJ2EeTQPRxoaqs B0wILVDoozEE+laIILXM5o3iGKAyMizdFjVXtaL/aUo46Cq+w7zQl2ny/JUe+se2YWsZ QY8xUuE6G58/hXbxbnBSFrFhRS+oscwPVZqZV+MlOvyYH/e6e20qx4LCrE8lSSrQQ5cl D8Ew== X-Gm-Message-State: AJIora8n13EyRycj1sGnBJhygZyXX2rVI4zQxYCOmtHxvQcpRG4AAJGQ v5nIUa67xlbMgaCp0r1+P6WNy793 X-Google-Smtp-Source: AGRyM1tRA+zwWqzKvzDK5P+D7h+8dKeojQklxHibXvFP9ms1AxKC9N634Vs6vg7HC2TY/lp3cVQz9A== X-Received: by 2002:a5d:6252:0:b0:21e:4457:1bca with SMTP id m18-20020a5d6252000000b0021e44571bcamr7177016wrv.287.1658385907026; Wed, 20 Jul 2022 23:45:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:a42:b0:39c:5927:3fa0 with SMTP id c2-20020a05600c0a4200b0039c59273fa0ls1448870wmq.2.-pod-canary-gmail; Wed, 20 Jul 2022 23:45:06 -0700 (PDT) X-Received: by 2002:a1c:21c3:0:b0:3a2:fdba:3f39 with SMTP id h186-20020a1c21c3000000b003a2fdba3f39mr7018959wmh.194.1658385905887; Wed, 20 Jul 2022 23:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658385905; cv=none; d=google.com; s=arc-20160816; b=aXmIRdSpFwwRK1BXTDR+J8s0ZkTsSlLOzRYLmZ+bePaVptMFO7s+8ZrhFeIrBRJzOT uabyP1le90vzuxqN7HjoJkSAo584XWJaqLSKBoyd4Sdz3iQ/nmrmXd1+HQvVOIkn8e3i 7vsYnFNkdfIkV49kl5sQ1n7CYdv0rilw1/YuMLqjByMw1m6pFOjbpLMxRy7sHZ5iRATI XTWUMC4J3qwfRDaOpchuBx1tAglfX+fppe/W60DYDb4MjQii0kXpPNhIO+DO6qjy09Vx sNvAjhx1wMyKeAhHGEfXyifWIFGuFlgpcmMqPYtmvFlVGnJzp+sp8DYy+6qhqy8NtiXX wTOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4XPtI2gySozaT1bhKNHj4Zg6C0g/GthDeXBCI412vEo=; b=luuREgNiZKktx2EagZc9W3jpVzAsYBlwNd31ku1yi3pzv8wWT/SnxQvEaOzNxHMO56 X6gh1cxo6Am3D6ZVE8/FWqUbK/dw6j//fTSe3B78mIeOUjkmZvfkSMNIgw08ZGLnHtds 1GZUmQsRl36Hu0gfDOZVsXTgrcZ+fxO5uo5KzqXMviCKqIGv/WPEn27DX7PZxTeaTT3K vm0fDXgwK6aBymY5mQg6pTKFxeKR8JfzTvOcYdFUfAndkfHnskoFO1J1kDmV+cp+IYZJ xTrzTnA4YQh+eLI6ytiYlcCkg6wIR2FC5Px1O/upHSTc/pSt0p7jZuWNNko/hw46FOef Q7yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SM973YcK; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p125-20020a1c2983000000b003a3262d9c61sor185722wmp.35.2022.07.20.23.45.05 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Wed, 20 Jul 2022 23:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:600c:3ba3:b0:3a3:5dd:f10f with SMTP id n35-20020a05600c3ba300b003a305ddf10fmr6827723wms.185.1658385905669; Wed, 20 Jul 2022 23:45:05 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (mob-5-90-140-42.net.vodafone.it. [5.90.140.42]) by smtp.gmail.com with ESMTPSA id c18-20020a056000105200b0021e4f446d43sm903711wrx.58.2022.07.20.23.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:45:05 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: u-boot@lists.denx.de Cc: Amarula patchwork <linux-amarula@amarulasolutions.com>, michael@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com> Subject: [PATCH v3 12/13] mtd: nand: toshiba: Retrieve ECC requirements from extended ID Date: Thu, 21 Jul 2022 08:44:34 +0200 Message-Id: <20220721064435.2456601-13-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220721064435.2456601-1-dario.binacchi@amarulasolutions.com> References: <20220721064435.2456601-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SM973YcK; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/mtd/nand/raw/nand_toshiba.c b/drivers/mtd/nand/raw/nand_toshiba.c index f7426fa59f51..99dc44df671a 100644 --- a/drivers/mtd/nand/raw/nand_toshiba.c +++ b/drivers/mtd/nand/raw/nand_toshiba.c @@ -37,6 +37,32 @@ static void toshiba_nand_decode_id(struct nand_chip *chip) (chip->id.data[5] & 0x7) == 0x6 /* 24nm */ && !(chip->id.data[4] & 0x80) /* !BENAND */) mtd->oobsize = 32 * mtd->writesize >> 9; + + /* + * Extract ECC requirements from 6th id byte. + * For Toshiba SLC, ecc requrements are as follows: + * - 43nm: 1 bit ECC for each 512Byte is required. + * - 32nm: 4 bit ECC for each 512Byte is required. + * - 24nm: 8 bit ECC for each 512Byte is required. + */ + if (chip->id.len >= 6 && nand_is_slc(chip)) { + chip->ecc_step_ds = 512; + switch (chip->id.data[5] & 0x7) { + case 0x4: + chip->ecc_strength_ds = 1; + break; + case 0x5: + chip->ecc_strength_ds = 4; + break; + case 0x6: + chip->ecc_strength_ds = 8; + break; + default: + WARN(1, "Could not get ECC info"); + chip->ecc_step_ds = 0; + break; + } + } } static int toshiba_nand_init(struct nand_chip *chip)