From patchwork Thu Sep 26 13:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Raghavendra, Vignesh" X-Patchwork-Id: 1167916 X-Patchwork-Delegate: jagannadh.teki@gmail.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; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="Fhi3H79f"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46fGBf5tsHz9sCJ for ; Thu, 26 Sep 2019 23:35:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3444BC221A6; Thu, 26 Sep 2019 13:34:24 +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 8E9E0C220FC; Thu, 26 Sep 2019 13:34:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 84668C220DC; Thu, 26 Sep 2019 13:34:01 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 76391C21FED for ; Thu, 26 Sep 2019 13:34:00 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8QDXvqs072788; Thu, 26 Sep 2019 08:33:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569504837; bh=DX4gfW1gk9R/HOhqm45HGqChIvt2KqmR1jWTIe1KqK4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Fhi3H79f6O0IwXWJ2s+ccV+A3t1vvrwMkIUKdwfZvqy0gvfC+6+7wS9HNltgKBlKZ FpHjMjsTK9aUsLOcquhtjKGtryl79jy4VfzkgdHnfX/IUAKKihuVfhLiFVScRk3nHQ JQRmkphletl4Gz1BDE53/SpLtTNqrlMXsbti9/2k= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8QDXviN074147 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Sep 2019 08:33:57 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 26 Sep 2019 08:33:57 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 26 Sep 2019 08:33:50 -0500 Received: from a0132425.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8QDXqLX082107; Thu, 26 Sep 2019 08:33:55 -0500 From: Vignesh Raghavendra To: Jagan Teki , Eugeniy Paltsev Date: Thu, 26 Sep 2019 19:04:26 +0530 Message-ID: <20190926133427.17635-2-vigneshr@ti.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926133427.17635-1-vigneshr@ti.com> References: <20190926133427.17635-1-vigneshr@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de, Tom Rini Subject: [U-Boot] [PATCH 1/2] mtd: spi-nor-core: Use dev_err for reporting erase/write failures 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Use dev_err() when reporting reason for erase/write failures so that users can be made aware of the reason for failure. Signed-off-by: Vignesh Raghavendra --- drivers/mtd/spi/spi-nor-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 1acff745d1a2..22915c23edff 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -380,12 +380,12 @@ static int spi_nor_fsr_ready(struct spi_nor *nor) if (fsr & (FSR_E_ERR | FSR_P_ERR)) { if (fsr & FSR_E_ERR) - dev_dbg(nor->dev, "Erase operation failed.\n"); + dev_err(nor->dev, "Erase operation failed.\n"); else - dev_dbg(nor->dev, "Program operation failed.\n"); + dev_err(nor->dev, "Program operation failed.\n"); if (fsr & FSR_PT_ERR) - dev_dbg(nor->dev, + dev_err(nor->dev, "Attempted to modify a protected sector.\n"); nor->write_reg(nor, SPINOR_OP_CLFSR, NULL, 0); From patchwork Thu Sep 26 13:34:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Raghavendra, Vignesh" X-Patchwork-Id: 1167915 X-Patchwork-Delegate: jagannadh.teki@gmail.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; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="IjnaoFTr"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46fGBF1XMqz9sCJ for ; Thu, 26 Sep 2019 23:34:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EBE88C2214B; Thu, 26 Sep 2019 13:34:12 +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 EF4BCC220FC; Thu, 26 Sep 2019 13:34:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B3EEBC220BB; Thu, 26 Sep 2019 13:34:04 +0000 (UTC) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lists.denx.de (Postfix) with ESMTPS id 38823C220BB for ; Thu, 26 Sep 2019 13:34:02 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8QDY02v057852; Thu, 26 Sep 2019 08:34:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569504840; bh=yMtuBXqaudEjGbzcazrk23r57USAReo5iq8zIfZ1aQM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IjnaoFTrLwcafAEmFeMRG6GykYLRjD/hT5fYlkAtHKUX5ucRTXlyBj4DYamD4zAxQ j7jaaTbHXm0k58InbozzUr1LfawmHOZ0E4bGMf/MrEh8q0nRmr6yU4pJuM5eAfd7lB J6zHCdyg5HjVYY8DxYWyd6lgkmzNp5nguMzR8+Fg= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8QDXx1S074181 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 26 Sep 2019 08:34:00 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 26 Sep 2019 08:33:52 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 26 Sep 2019 08:33:52 -0500 Received: from a0132425.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8QDXqLY082107; Thu, 26 Sep 2019 08:33:57 -0500 From: Vignesh Raghavendra To: Jagan Teki , Eugeniy Paltsev Date: Thu, 26 Sep 2019 19:04:27 +0530 Message-ID: <20190926133427.17635-3-vigneshr@ti.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190926133427.17635-1-vigneshr@ti.com> References: <20190926133427.17635-1-vigneshr@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de, Tom Rini Subject: [U-Boot] [PATCH 2/2] mtd: spi-nor-core: Replace MTD_SPI_NOR_USE_4K_SECTORS with SPI_FLASH_USE_4K_SECTORS 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" U-Boot uses CONFIG_SPI_FLASH_USE_4K_SECTORS to enable 4K small sector support. Use that instead of MTD_SPI_NOR_USE_4K_SECTORS. Reported-by: Eugeniy Paltsev Signed-off-by: Vignesh Raghavendra --- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-ids.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 22915c23edff..8412e5e8515f 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -1745,7 +1745,7 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor, erasesize = 1U << erasesize; opcode = (half >> 8) & 0xff; -#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS +#ifdef CONFIG_SPI_FLASH_USE_4K_SECTORS if (erasesize == SZ_4K) { nor->erase_opcode = opcode; mtd->erasesize = erasesize; diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index ba154709f880..2e0aebbc44aa 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -58,7 +58,7 @@ * All newly added entries should describe *hardware* and should use SECT_4K * (or SECT_4K_PMC) if hardware supports erasing 4 KiB sectors. For usage * scenarios excluding small sectors there is config option that can be - * disabled: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS. + * disabled: CONFIG_SPI_FLASH_USE_4K_SECTORS. * For historical (and compatibility) reasons (before we got above config) some * old entries may be missing 4K flag. */