Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542AbbFSTaU (ORCPT ); Fri, 19 Jun 2015 15:30:20 -0400 Received: from mail-bn1on0072.outbound.protection.outlook.com ([157.56.110.72]:1160 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755509AbbFSTaK (ORCPT ); Fri, 19 Jun 2015 15:30:10 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.227) smtp.mailfrom=opensource.altera.com; xilinx.com; dkim=none (message not signed) header.d=none; Authentication-Results: xilinx.com; dkim=none (message not signed) header.d=none; Message-ID: <5584695E.1090906@opensource.altera.com> Date: Fri, 19 Jun 2015 14:11:26 -0500 From: Graham Moore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Anurag Kumar Vulisha CC: , , , , , , , =?UTF-8?B?IkJlYW4gSHVvIOmcjeaWjOaWjCAoYg==?= =?UTF-8?B?ZWFuaHVvKSI=?= , , Anurag Kumar Vulisha , , , , , , Subject: Re: [RFC PATCH] mtd: spi-nor: Added flag check for quad io protocol for micron flash parts References: <1434639539-7517-1-git-send-email-anuragku@xilinx.com> In-Reply-To: <1434639539-7517-1-git-send-email-anuragku@xilinx.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BLUPR05CA0048.namprd05.prod.outlook.com (10.141.20.18) To DM2PR03MB446.namprd03.prod.outlook.com (10.141.85.17) X-Microsoft-Exchange-Diagnostics-untrusted: 1;DM2PR03MB446;2:JhycLKjIodDyyawillzoHdjI+nwAzLReO12HeMwNLwfH+qQTXN7XUGbnf2VgHj9L;3:CQvBDuN3rXGrRHQ3x6NzOSjD5Hb71eF6me0L0rvo9xxNHflFGknTw+ZzJ3lY33uDsth64MC+oLbqz7IMyufMflXN67O0WFwcX+h/c48ZEafqFL8LPu7pmE2x+AKSTtSXZ2WYw1apeq8MFRMsbqmSJQ==;20:sT/abGPI7yelsthqs04pxIjZ/BHls5csVA6Zrbk7Z8Sqdns1R9o6vX56c/sumxHSB71O52pI5mzCQghP4fvx3JIytNbDDTo9QN8UT7/wIf2syvefQ6y4nnClkr/tDuksxWZW0TlJU4mP3y2eaAXSzZiYZS8KGjY37b/V2mWIvxQ=;4:iFv0UN4xyQshNsZ2RAfNxE78jIx2I2lmho9oO6mQtL/KB75JGbmFfGYWTrz05XwIyIH6CNOtaeyY1TeyGDEl8tfNIvkvtT1MjB9vx/avsW5+uubGDXvkkjpsgDSsSIt9SzOPkauXrX4RXtRi1iKn2uDwEUWLyZJ0Qz1/Pf78AKi4BG3N5gSsA+WQ2vQwgdjT2QV/sAoroFqRyI1ugn1l33xw++cpwYLwrOM6d5+qJw4JDFwpMnVwX7u9XBFI2K8rZwwUOd6ewlAuKPqouJ43JPjTE35rEqJzZsiXXIz1U/M= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB446;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DM2PR03MB446;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB446;BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1PR03MB233;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; X-Forefront-PRVS: 0612E553B4 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(6049001)(164054003)(377454003)(479174004)(51704005)(24454002)(42186005)(54356999)(65816999)(50986999)(87266999)(76176999)(47776003)(66066001)(83506001)(59896002)(62966003)(46102003)(77156002)(99136001)(33656002)(122386002)(40100003)(65806001)(77096005)(64126003)(189998001)(5001960100002)(110136002)(86362001)(92566002)(65956001)(50466002)(19580405001)(2950100001)(4001350100001)(19580395003)(23676002)(87976001)(4580500001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR03MB446;H:[137.57.160.195];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?utf-8?B?MTtETTJQUjAzTUI0NDY7MjM6Z2hPaERRZ0o5ZWg5WDFya3RZSnJVa053cEhO?= =?utf-8?B?anEwdWQ3a0J0L3NrYXh2eXZBNGs4SG1wZU8zcUxwSDlFQVZCVVJzaGhGRTRG?= =?utf-8?B?UWc4aS9EMTlKWTZDWFVuSGkxMjlGdEFWTktFQkVCcDY0TU40ZFdvWnFqUVJF?= =?utf-8?B?OFBrMEpETk1zbnVabWhFaXIwNXpvYVY4NHZVc2pzOTdaVFRMdmZGRHV1Yjdx?= =?utf-8?B?SXlCTmZCcXRFTFA3cWw0MnRtcE1kdVFqRVJQSWRxMHNmY214aXJHTXZRNTAv?= =?utf-8?B?QnZ2Q2VvRFhnS0pUS1gyemM2ay9xZFVvVDhYWEFIbndYNUg0NVJ5dUtKZi95?= =?utf-8?B?WDdTcXdPeUhTY29GSzFXNS92NU43WjZhZXBJSlM5VzFqNGtsU242aE1paXVD?= =?utf-8?B?U050TXJGRmJNR2ltTG9SM3RVekFLNUFJSlF6cUpxbG1oYXRtR1dYZmNhM0Zz?= =?utf-8?B?OGZqTDZFcVh3NEg3TlZHcEFhYUFydXpUS0IrM29uemliM0VYSGFXVmFxbG5R?= =?utf-8?B?NERxUUZoblZLVjNKa0w3WFdEYkI5Z3M4NWVWckpybVQxOHhvbWVVQ0pOK01O?= =?utf-8?B?NllRR2oxSTlGZU5yMUFNZzJkOStoVlVKcmo5aElYMjJOWG8rTFhiVVZzWUZT?= =?utf-8?B?M2RKaXRFWjIvUWoxMmNYYTZWcVpWeWhXQVVRY0hGRDZpby9GeFNxeHdjU0pW?= =?utf-8?B?UzBxcTZHVzI2V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mw/HRenmWvqcDD1nSfawo189VtKFklQ9ZwRsq9DZn+FxV9VBwIMV20pr/ZAtzjlg==;24:piUZ6st+yp8UR1LZ0kdmHNHVV3tGg/utuZ/G8x/MfJYVoShRce0RRYroSYkJA7N1U2NJgFh7bhA17bDDZqU8giRPaZcxIhV1HhrIkIQGr5g=;20:zZxStusPr8llyT5e13H3IXPHDsUSemdluJBFoem/qDI/ksesaLKr1G8ngU9ZTN6fCH2Wlfuj231VZ/UnuYMi/1QiKi4l1DffPtaelrk7mPzfjOZWCw2v4ro8EYxUFGUWJMsYN79mol4qnHMitODISx9zK1d5zSFTkC7S170Ce00= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB446 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BL2FFO11FD041.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD041;1:MK/Y4dQ5cx/6geKco1/9QBBvRNatxQgZ9Ji38+fKjwsReagYix9k0SGevqcS57sqq6e7w5u5drrYavl5rT7R5BG63Y+HAfRIcmHGQ+zxeffcVAKPAc6VTyjY4CnxH96ok9+iWOK0sgItpBFQhkCKhZXRdDkJcR5u0Dk5Fykj/yxbxBvBHBDcnVtbpN7D4hODZ09g/5Y47IWKIwTnYJj87hWggvo2KL3mrRDBr2DMmEbQSeVMuJYbJlFes2Ij//31aL26BzKiSZPHeQzuShGtKo9ojaWRAan3xr7OF4Q1hjul4Giz4MPEwuByZ1Hwj6ym X-Forefront-Antispam-Report: CIP:66.35.236.227;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2970300002)(339900001)(199003)(51704005)(24454002)(377454003)(164054003)(479174004)(189002)(77096005)(50466002)(4001350100001)(105606002)(2950100001)(64126003)(5001960100002)(80316001)(92566002)(189998001)(85426001)(83506001)(6806004)(110136002)(106466001)(19580405001)(19580395003)(40100003)(59896002)(46102003)(65806001)(66066001)(65956001)(47776003)(23676002)(65816999)(50986999)(33656002)(76176999)(87936001)(87266999)(90366008)(122386002)(54356999)(86362001)(77156002)(62966003)(99136001)(16796002)(7099028)(4580500001)(7059030);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB233;H:sj-itexedge03.altera.priv.altera.com;FPR:;SPF:Fail;MLV:ovrnspm;A:0;MX:3;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB233;2:NRSIMykRjFM4RRulpmLiFcrtSBfNZ3XId4brpyorgewiiyagmgmjQoVVxXKsm42H;3:xSIx6Zw/qNJOakgMLXxiVbbVJSalYYtgUIJ89btVh/xNJTLF4QplgK5ht1zcK2hFJnPmqQE01IQGPThaDh+sJSc1L5UrZp7lpYopyCCSyrDA8T1RShpQ9rt3GPtaSkqahnfVgGGjDjVs5er5bm8dgc5c9rULVuyTgLsV29PUW6rteUtG/OtgWnMwgyB5dNzW0RpT0pk+cicNlXI1WvRSuaPoY3gCU6KbLkkNShB5u4k=;20:JaHMm0pKWxwVWPe5mkMz7hIHJ8OE9Ze5JuPA6ufXt+5rwfehIzaYdDVt5/y4E7HDy3YFXLOZOf6Z7ac3vGj9z03xWeMWSGhT3Afb09lCWnWacdxmmqtYaVsOxDhVFTdHHZOD0r0D3NJQUbFak50PzdbwafG8FqyJn6SKiqTTZrY=;4:zva2c8ungxF/NuFyriFPSn27NGE1r3NAil+EX4WFaOsujaol2ZJ3oYFoQX9ZZFFCD+DagBM8AiN9Hgu/owVKkOIVvGeLkv8Ekj4TcQorSd80keXDAmnv3UmgoVaj2u1zTYfmyaMGJStbKrqAiw7sVe6oEFYACykc8yn6tx3fkzOhNROUXDlrkg2/DDR1Cf89Wp/BjDjo0XOphF778aOcrRVZEeXN5J51172V/LR5urwX4XIWLte9graS0xuLCDRtxv/yxJo3VrotVJ9vawQGe0skvyAhqqT2tpdsO/B3M0Q= X-Forefront-PRVS: 0612E553B4 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjFQUjAzT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03MB233;5:bvW1X3YgpCY5KpcutI4DTrPO77Wkq+6Q2Rv6cpxVK7CbDpMWw3LUPBPi9yoQ7uTTKWqefmQDqcP4FRTzudLHVh8pqGF8Fi9VvLCoKCyJD4RKpDEPrlXXKC2Zy/7DSJ0u1EBeTtXIWe4hOlNBm2R5qg==;24:LeiSDidP3NYUnItSMtxvRs3GSr00ysY00Up2uF6OH8W9L1s9RlSwE+JTGf9k+hu3DXFOhW1eJikrjPmkdgJM8Z0wKIY8SD+EXbJQewpaSXU=;20:9ZSoO9manGI4OftayuLQYPJMg5JSpQ1y8hoG0rgg2VLkWd1l/c90WipDSJqYF2CKN2rjjnctD1kWEl05Sqz9mKGnXcYC78HgPrljJFsahiH7VcNBdkvQJtyrwxY8fjRzx9Bg+PWY3xs+mEoez7dH3Nl2ysOYc6fJ+K8zGVtJfSk= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2015 19:15:26.9085 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.227];Helo=[sj-itexedge03.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB233 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2585 Lines: 62 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. 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"); > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/