Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDDEEC433EF for ; Mon, 10 Jan 2022 05:27:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E389381428; Mon, 10 Jan 2022 06:27:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="BmpU/rXL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E13581428; Mon, 10 Jan 2022 06:27:44 +0100 (CET) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 249A780335 for ; Mon, 10 Jan 2022 06:27:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=p.yadav@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20A5R7E3031040; Sun, 9 Jan 2022 23:27:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1641792428; bh=aTjEqUqYVmluTPEAbYPJO6f06dd16Q4hrprIXypcZfw=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=BmpU/rXLpNoN6UkL7OUbkePyXWDsFU7QRACqgZZgiTczTFrj+a0nLXKq/X7uqaZCv A02Kaw5Y/sdgRfAdRfi5kUTP8zIn4JDJ06ZoEOooNeUljIQdhqHKbMVZlDVVu1W3L+ wPJm9pNpmsa1lsO8EDGNWnG9VpKXdAB4ygE1/3NQ= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20A5R77c045484 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 9 Jan 2022 23:27:07 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) 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.2308.14; Sun, 9 Jan 2022 23:27:07 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Sun, 9 Jan 2022 23:27:07 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20A5R6gI088561; Sun, 9 Jan 2022 23:27:06 -0600 Date: Mon, 10 Jan 2022 10:57:05 +0530 From: Pratyush Yadav To: CC: , , , , , , Subject: Re: [PATCH v6 1/4] mtd: spi-nor: macronix: add support for Macronix Octal Message-ID: <20220110052703.a4m6gmebns6gys4w@ti.com> References: <20211229055620.1466-1-jaimeliao.tw@gmail.com> <20211229055620.1466-2-jaimeliao.tw@gmail.com> <1d15222f-15f9-3d60-75d8-320c882a60b9@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1d15222f-15f9-3d60-75d8-320c882a60b9@microchip.com> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 03/01/22 10:38AM, Tudor.Ambarus@microchip.com wrote: > Hi, > > On 12/29/21 7:56 AM, JaimeLiao wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > > Follow patch "f6adec1af4b2f5d3012480c6cdce7743b74a6156" for adding > > Macronix flash in Octal DTR mode. > > > > Enable Octal DTR mode with 20 dummy cycles to allow running at the > > maximum supported frequency. > > -https://www.mxic.com.tw/Lists/Datasheet/Attachments/7841/MX25LM51245G,%203V,%20512Mb,%20v1.1.pdf > > > > Signed-off-by: JaimeLiao > > --- > > drivers/mtd/spi/spi-nor-core.c | 83 ++++++++++++++++++++++++++++++++++ > > include/linux/mtd/spi-nor.h | 12 ++++- > > 2 files changed, 93 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > > index d5d905fa5a..0a6550984b 100644 > > --- a/drivers/mtd/spi/spi-nor-core.c > > +++ b/drivers/mtd/spi/spi-nor-core.c > > @@ -3489,6 +3489,85 @@ static struct spi_nor_fixups mt35xu512aba_fixups = { > > }; > > #endif /* CONFIG_SPI_FLASH_MT35XU */ > > > > +#if CONFIG_IS_ENABLED(SPI_FLASH_MACRONIX) > > +/** > > + * spi_nor_macronix_octal_dtr_enable() - set DTR OPI Enable bit in Configuration Register 2. > > + * @nor: pointer to a 'struct spi_nor' > > + * > > + * Set the DTR OPI Enable (DOPI) bit in Configuration Register 2. > > + * Bit 2 of Configuration Register 2 is the DOPI bit for Macronix like OPI memories. > > + * > > + * Return: 0 on success, -errno otherwise. > > + */ > > +static int spi_nor_macronix_octal_dtr_enable(struct spi_nor *nor) > > This method should be called just for the flashes that do not define the > JESD216 "Command Sequences to Change to Octal DDR (8D-8D-8D) mode" table. > Or where SFDP is skipped intentionally. When adding Octal DTR support to kernel and U-Boot SPI NOR, I did consider parsing this table. But I dropped the idea at the time because the table guarantees to only use 20 dummy cycles for reads and operation at 100 MHz (or higher if supported). But this does not guarantee that we can run the flash at the maximum speed possible. For example, for Spansion S28 flash we can only go up to 166 MHz with 20 dummy cycles. For getting 200 MHz we need at least 23 dummy cycles. -- Regards, Pratyush Yadav Texas Instruments Inc.