Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1323265ybh; Thu, 23 Jul 2020 06:13:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLinJeQJW3i5kcn3z9kQ36ywIW08jA+lH8TT8ZRACsPnjqah3IBDIP5+gVgXQiLO84QdmH X-Received: by 2002:a17:906:53d4:: with SMTP id p20mr4281878ejo.472.1595510027416; Thu, 23 Jul 2020 06:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595510027; cv=none; d=google.com; s=arc-20160816; b=vAeyETouOKnSuw7wopOhCXtaUD/QRmqEpcQMIBDIbdCa+aZ8zftPk9GgT8PLMwP+wh iZ4SuXzY2hMZtkoXjXOBCJJfL2WGqwuSU4bkas5/zU84hXAj2sGgVw++mayF5MNtGJL/ kpnc6phVukuHyRb3I7egiFmr+oQfiHB9iP/Uv9DRNkq1Na+yfVm17HX77sMf16OhYMiX V4Z7FNFVAZI/+uOa9rG0oY+OGlE5i0zNbzelanG7ju3YyiMQo1lAtTsmvxwuGhbsrQXh FFPraqQ7pZZodrXrLcAKkccd9WdXtIzQ98+c0cz0BGVt704CVTq9xPNtKLnVO5OGIFBY nPJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mm35kyXnTpVnyvZkpDZD2AFH+hVdTqyjZTg/PVQXlOc=; b=X3V39O8ULzxON8sT4tuVq0TalFgL0Gr3hAkSqKdOOZ/NxM4tKQm4BMNb8uJEW2Grx1 ggnBrJ5oM6fo4/m7xPbvKJjW3ix3T3k3S1J3LOgl9ub0OndB3HZFdVOrqyp79uhxdctE G5HtZD38lP0AXU3bXiFM0ZwMg/PGNZblDGwrS1dFFD4DteNg7UajHjFC0oCKiXd53CSF sVG9MiSCon9+48R/ARGWpkn8JzDA24846NwMrqeHVt0wptWqxTJmwcnFKoEDRHT1GLwZ es7TYmG1i9815S+yAT0zdHnI/ktdgrOeAXLDsI4Q8fI1UO+Fhyu0XHX6D7WIr+NTIVAO A7Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si1992871edw.426.2020.07.23.06.13.25; Thu, 23 Jul 2020 06:13:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729148AbgGWNMy (ORCPT + 99 others); Thu, 23 Jul 2020 09:12:54 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:54299 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbgGWNMv (ORCPT ); Thu, 23 Jul 2020 09:12:51 -0400 X-Originating-IP: 42.109.196.68 Received: from localhost.localdomain (unknown [42.109.196.68]) (Authenticated sender: me@yadavpratyush.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id EAA331C000C; Thu, 23 Jul 2020 13:12:46 +0000 (UTC) From: Pratyush Yadav To: Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sekhar Nori , Boris Brezillon , Pratyush Yadav , Pratyush Yadav Subject: [PATCH v11 06/14] mtd: spi-nor: core: use dummy cycle and address width info from SFDP Date: Thu, 23 Jul 2020 18:41:55 +0530 Message-Id: <20200723131203.40916-7-me@yadavpratyush.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200723131203.40916-1-me@yadavpratyush.com> References: <20200723131203.40916-1-me@yadavpratyush.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pratyush Yadav The xSPI Profile 1.0 table specifies how many dummy cycles and address bytes are needed for the Read Status Register command in octal DTR mode. Use that information to send the correct Read SR command. Signed-off-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 6dfc54ff83be..185ca1fa2b50 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -379,6 +379,11 @@ static int spi_nor_read_sr(struct spi_nor *nor, u8 *sr) SPI_MEM_OP_NO_DUMMY, SPI_MEM_OP_DATA_IN(1, sr, 1)); + if (spi_nor_protocol_is_dtr(nor->reg_proto)) { + op.addr.nbytes = nor->params->rdsr_addr_nbytes; + op.dummy.nbytes = nor->params->rdsr_dummy; + } + spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); ret = spi_mem_exec_op(nor->spimem, &op); @@ -410,6 +415,11 @@ static int spi_nor_read_fsr(struct spi_nor *nor, u8 *fsr) SPI_MEM_OP_NO_DUMMY, SPI_MEM_OP_DATA_IN(1, fsr, 1)); + if (spi_nor_protocol_is_dtr(nor->reg_proto)) { + op.addr.nbytes = nor->params->rdsr_addr_nbytes; + op.dummy.nbytes = nor->params->rdsr_dummy; + } + spi_nor_spimem_setup_op(nor, &op, nor->reg_proto); ret = spi_mem_exec_op(nor->spimem, &op); -- 2.27.0