mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Artur Jedrysek <jartur@cadence.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	Dinh Nguyen <dinguyen@kernel.org>
Subject: Re: [v2, 2/4] mtd: spi-nor: Add Octal SPI support to Cadence QSPI driver.
Date: Fri, 10 Mar 2017 15:15:13 +0100	[thread overview]
Message-ID: <23371579-495a-1336-cce9-3860a2e2a4c1@gmail.com> (raw)
In-Reply-To: <DM5PR07MB2780DC9981927880E1ED1B37D4200@DM5PR07MB2780.namprd07.prod.outlook.com>

On 03/10/2017 03:09 PM, Artur Jedrysek wrote:

CCing Dinh.

[...]

>>>>> +	/* Determine, whether or not octal transfer MAY be supported */
>>>>
>>>> But you already know that from DT, no ?
>>>>
>>>
>>> Cadence Octal (formerly Quad) SPI Controller is sold as an IP, and is
>>> configurable. This includes max SPI mode. It is possible to detect, that
>>> Octal SPI controller is configured (during hardware compilation) to support
>>> up to Quad mode, using revision register.
>>
>> So the octal-spi controller always has this config register, but the
>> quad-spi controller may or may not have this register ?
>>
> 
> This register was always present. In Quad-SPI, however, it didn't contain
> information about maximum possible mode, as only quad was possible, and
> meaning of bits checked here was different.

OK

>>>>> +	rev_reg = readl(cqspi->iobase + CQSPI_REG_MODULEID);
>>>>> +	dev_info(dev, "CQSPI Module id %x\n", rev_reg);
>>>>> +
>>>>> +	switch (rev_reg & CQSPI_REG_MODULEID_CONF_ID_MASK) {
>>>>> +	case CQSPI_REG_MODULEID_CONF_ID_OCTAL_PHY:
>>>>> +	case CQSPI_REG_MODULEID_CONF_ID_OCTAL:
>>>>> +		mode = SPI_NOR_OCTAL;
>>>>> +		break;
>>>>> +	case CQSPI_REG_MODULEID_CONF_ID_QUAD:
>>>>> +	case CQSPI_REG_MODULEID_CONF_ID_QUAD_PHY:
>>>>
>>>> Does this work on all revisions of CQSPI ?
>>>>
>>>
>>> After having a more thorough look at specification of older IP version
>>> (quad only) it seems, that revision register format has indeed changed.
>>> This will be fixed in the next version of the patch.
>>
>> Can the quad-spi controller be configured only as dual or single ?
>> What about the octal one ? These cases should probably be handled
>> somehow too, right ?
>>
> 
> Quad-SPI controller can always support single, dual and quad. There was
> no option to configure max mode. Octal-SPI controller can be configured
> to support either octal or quad mode. No controller could be configured 
> (during hardware compilation/synthesis) to support only single/dual 
> SPI mode. To put it shortly: single, dual and quad is always supported.

So basically the whole check you need to perform here is

mode = quad;
if (controller->flags & CAN_DO_OCTAL) {
 if (readl(ID_REGISTER) & IS_CONFIGURED_AS_OCTAL)
   mode = octal;
}

-- 
Best regards,
Marek Vasut

  reply	other threads:[~2017-03-10 14:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06 12:30 [PATCH 1/3] mtd: spi-nor: Add support for Octal SPI mode Artur Jedrysek
2017-03-06 21:11 ` Boris Brezillon
2017-03-08  7:58 ` [v2, 1/4] " Artur Jedrysek
2017-03-08  8:02   ` [v2, 2/4] mtd: spi-nor: Add Octal SPI support to Cadence QSPI driver Artur Jedrysek
2017-03-10  3:37     ` Marek Vasut
2017-03-10 12:00       ` Artur Jedrysek
2017-03-10 12:49         ` Marek Vasut
2017-03-10 14:09           ` Artur Jedrysek
2017-03-10 14:15             ` Marek Vasut [this message]
2017-03-10 14:22               ` Artur Jedrysek
2017-03-08  8:03   ` [v2, 3/4] mtd: spi-nor: Add Xtensa CPU support for cadence-quadspi Artur Jedrysek
2017-03-08  8:05   ` [v2, 4/4] dt-bindings: mtd: Add Octal SPI support to Cadence QSPI Artur Jedrysek
2017-03-10  3:39     ` Marek Vasut
2017-03-10 12:03       ` Artur Jedrysek
2017-03-10 12:52         ` Marek Vasut
2017-03-15 20:23           ` Rob Herring
2017-03-20 11:22   ` [PATCH v3, 1/4] mtd: spi-nor: Add support for Octal SPI mode Artur Jedrysek
2017-03-20 11:25     ` [PATCH v3, 2/4] mtd: spi-nor: Add Octal SPI support to Cadence QSPI driver Artur Jedrysek
2017-03-22 10:07       ` Marek Vasut
2017-03-20 11:26     ` [PATCH v3, 3/4] mtd: spi-nor: Add Xtensa CPU support for cadence-quadspi Artur Jedrysek
2017-03-22 10:02       ` Marek Vasut
2017-03-20 11:27     ` [PATCH v3, 4/4] dt-bindings: mtd: Add Octal SPI support to Cadence QSPI Artur Jedrysek
2017-03-24 15:56       ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23371579-495a-1336-cce9-3860a2e2a4c1@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dinguyen@kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=jartur@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®