Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754568AbbFTCaS (ORCPT ); Fri, 19 Jun 2015 22:30:18 -0400 Received: from mail-bn1on0093.outbound.protection.outlook.com ([157.56.110.93]:15040 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753535AbbFTCaL (ORCPT ); Fri, 19 Jun 2015 22:30:11 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none; From: Punnaiah Choudary Kalluri To: Graham Moore , Anurag Kumar Vulisha CC: "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marex@denx.de" , "shijie.huang@intel.com" , "zajec5@gmail.com" , "ben@decadent.org.uk" , "mika.westerberg@linux.intel.com" , =?utf-8?B?IkJlYW4gSHVvIOmcjeaWjOaWjCAoYmVhbmh1byki?= , Harini Katakam , Anurag Kumar Vulisha , Srikanth Vemula , "linux-kernel@vger.kernel.org" , "broonie@kernel.org" , "linux-mtd@lists.infradead.org" , Anirudha Sarangi , Michal Simek , "Mark Brown (broonie@kernel.org)" Subject: RE: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts Thread-Topic: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts Thread-Index: AQHQqddTRV92zi+jfE2lDVi8ELZSpJ2zra8AgADfDzA= Date: Sat, 20 Jun 2015 02:30:01 +0000 Message-ID: <03CA77BA8AF6F1469AEDFBDA1322A7B7495B3042@XAP-PVEXMBX02.xlnx.xilinx.com> References: <1434639539-7517-1-git-send-email-anuragku@xilinx.com> <5584695E.1090906@opensource.altera.com> In-Reply-To: <5584695E.1090906@opensource.altera.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.231.8] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21622.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD031;1:svsnxmWOolRPsaV46AJX14BNB0XQOSzb0MlJlMiDgIZVi3SoReOafUE168yecmXC1qsXqz//zJDV3D/nH3NcxYrAypr4Cvs/yU/JhB9QYyqJeVu3UWhBM7pNl25hx6nczfqzRofk6yY2TdJ99bcbh8a8wIsy0FuT7Lo8EOjTaoEQYHRi/ISuTf45W6oV6QKEj1JBfg4mdbdPJKkocEgtb8VsB3V4Ax92sfPkKu+JMf/remGdfpvLQyyvS+eGx9mBW9PJRrcKaHQ2aReVECNrmwNCGFuOQiIA23ibP06a1IN3ET0wZ2uKf+DiiCv8Tl5cIdur8M8Bj5tuxbTGCiNp4ik95uNKLqKp1wEncBAfzck= X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(6009001)(2980300002)(438002)(199003)(377454003)(51704005)(164054003)(24454002)(13464003)(479174004)(189002)(4001540100001)(87936001)(5250100002)(5003600100002)(33656002)(92566002)(2656002)(62966003)(19580395003)(19580405001)(77156002)(5001960100002)(5001830100001)(5001770100001)(47776003)(55846006)(5001860100001)(6806004)(63266004)(106466001)(2920100001)(2950100001)(102836002)(2900100001)(86362001)(54356999)(76176999)(50986999)(46102003)(106116001)(189998001)(50466002)(23676002)(107986001)(4001450100001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1AFFO11HUB050;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:ovrnspm;A:1;MX:1;PTR:unknown-60-83.xilinx.com;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB050;2:bmh26uopqzIXW5liMCHxcYYqgv3+tPHwukPu5MEI9jL4tap5OwXpmJ7fNhmNm4u5;2:erWjZO9X51ivuTNIyH4kmZBsGsluhooRmkcosFAPD0If5KJOwzJfKm01fw6uk12CRKhGtTf12uLdjZY7KO2BMjgMmR/7jUjArZPX1GNmnTv4NJldOis+LU97xLZA2bTpBhkV2tg5dIcA8d8/2dH7BHG7+ceuWW1kqdlmaeCf4VfpPi3LNxgw+qc1fSYY+7hS/OBaSGocXTqkc84SlO3PSpguW6Srjz1s1t7Icn0G1no=;6:jq6N/7D/7+gwON4rMJGpaKCSSplqHmRLRfr3vs4nBbxwFWf1pB/gx2i/EjtGzrfNWhe2TWv+YltHdEjM5sHnpH0ANazIWUAgL+5lvxVawiYpFTQKtNXcD2pumfoEX4R2IN/MXIvnkltTEUHLi0A1d4/9sNllssetD1pO+7RuQooPabztuXxTYBkcRxz+bDglQivURR1qi/UYjHMo2I2NQ0Kp0DIrI8FDqxKMCpPK6UGcTIkn77ny5aeLDoxxZWjJRBgPUoMeUWsska5UC2SDF3QQbw8nYKmBZMGmyPIT6DR+3NaTT0l9FCoEy2BRB0ALSgfIY2fFaFdxTi/Pf98WHOv+kRNrRRDvlJkNqT1abpj2ORiDc3XTR4An3JYjyT5A+ZZ2Y0RYBSBeIxJ90uKnbXG0eoeJzw/EZJy0lSy9hDqsNAqWNyNs+t5DQLKIV9j6fpb0NOgPNJJEc0itTBkiuWzkQczuVpTuBmimdN9vVUQunbW+F5ogu0Fc1s+bfxJ9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB050; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1AFFO11HUB050;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB050; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB050;3:9qkUsAp143V5oD9owPHBPLKQ6BKT3mD6YK30lFWZ28mHVhFzrZ1VOaA1XqLX/WdHmoJw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BhWHJjbktvZW0yQlh5YVJNQ3pj?= =?utf-8?B?TWYra2ZlQlpOb3d2NFZNZ2NNcFJkYUJUMTI2WG9RQTA3VzNNR0J4Z0lLcDYw?= =?utf-8?B?Rm0zeGp3Z1FnRnZ4MWswbzQvbGhzTENISTdSQ2V5VjRZYk5JdERtOUZzeTR2?= =?utf-8?B?dzJRUmdnQWE3QXdMNzJ0WTFpV3pIdDM5WUlVbE9IYWRUejJzOW56THJob2Rr?= =?utf-8?B?Skhsekh4MkttTlY4VStwczdXWE4vaVh6TXVSU1RIOTg3dXRGbUdSQ2JUL0ti?= =?utf-8?Q?ATM+A4IGemqz2c?= X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB050;3:nXGxXq0aYbpkw2q6/opvJ+bnbKNbJD7+Pi0183XMfMavU5b8KmhkFdQch8c5F5J37rb7lSADtAZJJQjyZGtvHB2Ho9yfktnG9kH7Lb2MUDoIfoQjTgZN6zoNfnOZkqVZXqOWDDFIFSwviBLsg4qfAA==;10:2ZvMqPEQNqwd9sl82XHh1SQshw7JM99B4/L6F0iHCmlTRlAR2NSsYcpcQkFsfUb3eVxsOCOXBmm0Kc3RHNSFoxxABwhMAr95k/azxeHaVfI= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2015 02:30:08.9098 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB050 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t5K2Udlb030086 Content-Length: 4547 Lines: 118 Hi Graham, > -----Original Message----- > From: Graham Moore [mailto:grmoore@opensource.altera.com] > Sent: Saturday, June 20, 2015 12:41 AM > To: Anurag Kumar Vulisha > Cc: dwmw2@infradead.org; computersforpeace@gmail.com; > marex@denx.de; shijie.huang@intel.com; zajec5@gmail.com; > ben@decadent.org.uk; mika.westerberg@linux.intel.com; "Bean Huo 霍斌 > 斌 (beanhuo)"; Harini Katakam; Anurag Kumar Vulisha; Srikanth Vemula; > linux-kernel@vger.kernel.org; broonie@kernel.org; linux- > mtd@lists.infradead.org; Anirudha Sarangi; Punnaiah Choudary Kalluri > Subject: Re: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol > for micron flash parts > > Hi Anurag, > > We're struggling with the same issue, our Cadence QSPI controller *does* > handle four-line command, address, and data, but has to be configured > for it. The setting of quad-io-protocol mode in micron_quad_enable is > really jacking up our code. We have to snoop the command stream and > configure the controller as soon as we see the quad-io-protocol command > go to the Micron chip. Ugly. > > I'd like to point out that this flag is also dependent upon the > particular controller in use, not just the Micron chip. In fact, it may > be more of a controller thing than a chip thing. Agree, QUAD IO protocol is different to supporting QUAD IO read command. In QUAD IO Protocol mode, all the commands including register read, erase, read, Program... will be using the four lines. Enabling the QUAD IO Protocol in flash should ensure that both the controller and flash have this support otherwise the result is unpredictable. So, now m25p80 driver should check the number bits to use depending on the Protocol it uses. Literally we need another mode i.e protocol mode. The possible values for this modes are Dual Io protocol - all the commands will be sent using 2 lines Quad Io protocol - all the commands will be send using 4 lines. Extended spi protocol - number of data lines to use will depends on the data command. If the protocol is extended spi protocol, m25p80 should select the rx and tx bits to use for data operations depends on the "mode" i.e. quad/dual If the protocol is Quad IO/dual Io, m2p80 should select the rx and tx bits either 4/2 for All the commands. Data operations in the above context means read, page program operation. Suggest if we have any other acceptable solutions for implementing the quad/dual io Protocol support. Regards, Punnaiah > > Maybe this flag should actually be an enum read_mode value, and passed > into spi_nor_scan by the controller? > > Thanks, > Graham > > > On 06/18/2015 09:58 AM, Anurag Kumar Vulisha wrote: > > micron flash parts by default operates in extended spi protocol,which > accepts > > command on single line and can accept address & data on one,two and four > lines > > depending on the command sent.In set_quad_enable() we are enabling > the quad io > > protocol for micron flash parts by updating the EVCR register,in this method > the > > flash expects the command,address and data to be transmitted on all four > data > > lines which may not be supported on all qspi controllers.So READ_1_1_4 > command > > does not necessarily go out using those bus widths. > > > > So i have added SPI_QUAD_IO_PROTOCOL flag,which should be checked > before enabling > > the quad io protocol. > > > > Signed-off-by: Anurag Kumar Vulisha > > --- > > drivers/mtd/spi-nor/spi-nor.c | 3 +++ > > 1 files changed, 3 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > > index 14a5d23..a6fa8dc 100644 > > --- a/drivers/mtd/spi-nor/spi-nor.c > > +++ b/drivers/mtd/spi-nor/spi-nor.c > > @@ -55,6 +55,7 @@ struct flash_info { > > #define SPI_NOR_DUAL_READ 0x20 /* Flash supports Dual Read */ > > #define SPI_NOR_QUAD_READ 0x40 /* Flash supports Quad Read > */ > > #define USE_FSR 0x80 /* use flag status > register */ > > +#define SPI_QUAD_IO_PROTOCOL 0x100 /* use quad io protocol */ > > }; > > > > #define JEDEC_MFR(info) ((info)->id[0]) > > @@ -962,6 +963,8 @@ static int set_quad_mode(struct spi_nor *nor, > struct flash_info *info) > > } > > return status; > > case CFI_MFR_ST: > > + if (!(info->flags & SPI_QUAD_IO_PROTOCOL)) > > + return 0; > > status = micron_quad_enable(nor); > > if (status) { > > dev_err(nor->dev, "Micron quad-read not > enabled\n"); > > ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????s?y??杶????i??????????i