From patchwork Sun May 24 18:42:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 6472221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28E99C0020 for ; Sun, 24 May 2015 18:49:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53E43205F2 for ; Sun, 24 May 2015 18:49:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F32E20608 for ; Sun, 24 May 2015 18:49:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YwauL-0002Kb-Me; Sun, 24 May 2015 18:45:57 +0000 Received: from mail-wi0-f175.google.com ([209.85.212.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YwauF-00023C-IZ for linux-arm-kernel@lists.infradead.org; Sun, 24 May 2015 18:45:55 +0000 Received: by wichy4 with SMTP id hy4so31110337wic.1 for ; Sun, 24 May 2015 11:45:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=/Fb1SgqfY2TOMTl1j2oi4mEf0F7fjtGLM+GSMA5LcHs=; b=GAwjrqyH0QK7sP9+bBDbqTHg/JDWzxgt/d0ORYe7+/hXwO1eCpTsVyHPxFHSuLyaKG RJb9dG01Jb1zJ5CJiEXlHRCZdRftj4uV4RxLxyKg8Uanu7HYgBwF5in28ImIVJFMMELB RoB7/tCX82qY/oVv3b/Xenj8ezGo2DQ5XUnGNCzaHzPcrIgYGyiXeYHSNTo8AmVj4LlC hKsUn1pYSvtlGz3bVH6U2yD/d81pNVHksoltwirTNbv6mRyaTfNStQQ92criRLPw05it 0x64Nlp4gI6uLwRzMdUUytELpFbCWM32A8cvfW4CCNdf0x9w+nEIMs6LtBre83DEOoZb JyVw== X-Gm-Message-State: ALoCoQmLWIh6VFU/7i3m79IYvCV56rDZbdd7UT5glOrEvlg7O3RdFf+JB5PfOvHuG8HPNXpzDMCp X-Received: by 10.180.94.39 with SMTP id cz7mr24518043wib.66.1432493127830; Sun, 24 May 2015 11:45:27 -0700 (PDT) Received: from [192.168.0.45] ([190.2.108.156]) by mx.google.com with ESMTPSA id g14sm13099362wjs.47.2015.05.24.11.45.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 11:45:26 -0700 (PDT) Message-ID: <55621B83.4040909@vanguardiasur.com.ar> Date: Sun, 24 May 2015 15:42:11 -0300 From: Ezequiel Garcia Organization: VanguardiaSur User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Antoine Tenart Subject: Re: [PATCH v5 07/12] mtd: nand: add Samsung K9GBG08U0A-M to nand_ids table References: <1431356341-31640-1-git-send-email-antoine.tenart@free-electrons.com> <1431356341-31640-8-git-send-email-antoine.tenart@free-electrons.com> <555792FC.8030407@vanguardiasur.com.ar> <20150520140631.GN22054@kwain> <555C9584.1030609@vanguardiasur.com.ar> <20150520142409.GP22054@kwain> <20150520144341.GQ22054@kwain> In-Reply-To: <20150520144341.GQ22054@kwain> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150524_114551_791412_A1326619 X-CRM114-Status: GOOD ( 14.07 ) X-Spam-Score: -0.7 (/) Cc: zmxu@marvell.com, boris.brezillon@free-electrons.com, Robert Jarzmik , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, jszhang@marvell.com, computersforpeace@gmail.com, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org, sebastian.hesselbarth@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Antoine, On 05/20/2015 11:43 AM, Antoine Tenart wrote: [..] >> >> I just had a look on the datasheet, and I you're right, the nand should >> support JDEC. However I get a "No NAND device found" error when >> reverting this patch. >> >> It seems nand_flash_detect_jedec() is not reading "JDEC" and is returning >> directly. I'm having a look at this. > > So, I can read 'J', 'E', 'D' and 'E' but then I got 0xff's. So I tried > to only check of JEDE in nand_flash_detect_jedec() but the JEDEC > parameter page was then not valid. > This uncovers two different bugs in the driver. 1. read_id_bytes is either '2' or '4', but JEDEC detections needs at least 5 bytes. 2. The initial buffer (to read the ID and the parameter page) has 256 bytes, but the JEDEC parameter page is 512-bytes. And while at it, the driver doesn't seem to support reading the redundant parameter pages (recently reported on barebox ML [1]). So this is a third bug. Would you try setting read_id_bytes to '5' and also increasing the READ_PARAM transfer length? Something like this: diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 1259cc5..851372f 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -48,7 +48,7 @@ * STATUS, READID and PARAM. The largest of these is the PARAM command, * needing 256 bytes. */ -#define INIT_BUFFER_SIZE 256 +#define INIT_BUFFER_SIZE 2048 /* registers and bit definitions */ #define NDCR (0x00) /* Control register */ @@ -899,18 +899,18 @@ static int prepare_set_command(struct pxa3xx_nand_info *info, int command, break; case NAND_CMD_PARAM: - info->buf_count = 256; + info->buf_count = 2048; info->ndcb0 |= NDCB0_CMD_TYPE(0) | NDCB0_ADDR_CYC(1) | NDCB0_LEN_OVRD | command; info->ndcb1 = (column & 0xFF); - info->ndcb3 = 256; - info->data_size = 256; + info->ndcb3 = 2048; + info->data_size = 2048; break; [1] http://lists.infradead.org/pipermail/barebox/2015-May/023515.html Thanks, -- Ezequiel Garcia, VanguardiaSur www.vanguardiasur.com.ar