From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734AbdDBTgb (ORCPT ); Sun, 2 Apr 2017 15:36:31 -0400 Received: from 6.mo69.mail-out.ovh.net ([46.105.50.107]:42028 "EHLO 6.mo69.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751588AbdDBTga (ORCPT ); Sun, 2 Apr 2017 15:36:30 -0400 X-Greylist: delayed 6600 seconds by postgrey-1.27 at vger.kernel.org; Sun, 02 Apr 2017 15:36:29 EDT Subject: Re: [PATCH v5 3/6] mtd: spi-nor: add spi_nor_init() function To: Cyrille Pitchen , marek.vasut@gmail.com, linux-mtd@lists.infradead.org, jartur@cadence.com, kdasu.kdev@gmail.com, mar.krzeminski@gmail.com References: <8d88fd247815979bee2a6d3be50fa57a80c2f229.1490220411.git.cyrille.pitchen@atmel.com> Cc: boris.brezillon@free-electrons.com, richard@nod.at, nicolas.ferre@microchip.com, linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org From: Cyrille Pitchen Message-ID: <8648b581-d279-3d89-2a28-271e76cdbf73@wedev4u.fr> Date: Sun, 2 Apr 2017 19:06:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8d88fd247815979bee2a6d3be50fa57a80c2f229.1490220411.git.cyrille.pitchen@atmel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3440468641391728485 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrleehgdduuddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 23/03/2017 à 00:33, Cyrille Pitchen a écrit : > This patch extracts some chunks from spi_nor_scan() and moves them into > a new spi_nor_init() function. > > Indeed, spi_nor_init() regroups all the required SPI flash commands to be > sent to the SPI flash memory before performing any runtime operations > (Fast Read, Page Program, Sector Erase, ...). Hence spi_nor_init(): > 1) removes the flash protection if applicable for certain vendors. > 2) sets the Quad Enable bit, if needed, before using Quad SPI protocols. > 3) makes the memory enter its (stateful) 4-byte address mode, if needed, > for SPI flash memory > 128Mbits not supporting the 4-byte address > instruction set. > > spi_nor_scan() now ends by calling spi_nor_init() once the probe phase has > completed. Further patches could also use spi_nor_init() to implement the > mtd->_resume() handler for the spi-nor framework. > > Signed-off-by: Kamal Dasu > Signed-off-by: Cyrille Pitchen Applied to github/spi-nor