All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr-l0cyMroinI0@public.gmane.org>
To: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>,
	"linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Cc: Graham Moore
	<grmoore-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>,
	Alan Tull
	<atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>,
	Brian Norris
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Dinh Nguyen
	<dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>,
	Yves Vandervennet
	<yvanderv-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH V12 2/2] mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller
Date: Thu, 16 Jun 2016 12:13:36 +0530	[thread overview]
Message-ID: <57624A98.4060308@ti.com> (raw)
In-Reply-To: <575FFF97.7040104-ynQEQJNshbs@public.gmane.org>



On Tuesday 14 June 2016 06:29 PM, Marek Vasut wrote:

>> I was wondering if its better to use direct access mode[1].
> 
> The link leads to altera documentation front page, but I have an idea
> what you mean. You might want to refer to [2] instead.
> 
> [2] https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cv_5v4.pdf
> 

My link was suppose to point to html edition of above document.

>> With this
>> mode there is no need to wait for IRQ or monitor sdram level. By setting
>> up QSPI in direct access mode, this entire function can be replaced by:
>> memcpy(buf, cqspi->ahb_base + from, n_rx)
> 
> The altera docs, page 993, show how to use the direct access mode. The
> idea is to map 1 MiB blocks of the flash in the address space, one at a
> time and then do IO into those. I don't like such solution:
> 
> - I didn't find any way to find when all the data in the current 1 MiB
>   block were written and you can remap another 1 MiB block in place.

I believe this constraint only applies if enahbremap bit is set in cfg
register, if not, then the entire memory map can be accessed.


> - Since the controller doesn't use the internal buffer in direct
>   operation mode, it will block the AHB bus during it's operation.

I agree, this is a disadvantage.

> - I didn't find how IO errors get handled in this case, but maybe I
>   didn't drill deep enough on this one.
> 
> Moreover, page 991 bottom of [2] states that the indirect mode is
> "high-performance". I am inclined to believe that as it uses the
> internal buffer of the QSPI controller, which is tightly coupled to the
> block,
> so the data are available immediately when the flash is ready instead
> of having to wait for the next AHB turn.
> 

Indirect mode may be the better option when using DMA. But, my thinking
was that, for CPU copy, the interrupt overhead and the fact that sdram
level needs to be monitored constantly might affect throughput badly
while using indirect mode.

> My impression is that the Direct mode is great when the system boots
> from the QSPI because it can "map" the flash and just execute code from
> it. But for normal operation, the indirect mode seems the better choice.
> 
>> IMO, this might give better throughput. Have tested this mode?
> 
> I haven't tested it, no.
> 

Anyways, direct mode support can be added (if required) at later point
of time. I have no objection for current approach as such.

Thanks for the reply!


-- 
Regards
Vignesh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Vignesh R <vigneshr@ti.com>
To: Marek Vasut <marex@denx.de>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Cc: Graham Moore <grmoore@opensource.altera.com>,
	Alan Tull <atull@opensource.altera.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Dinh Nguyen <dinguyen@opensource.altera.com>,
	Yves Vandervennet <yvanderv@opensource.altera.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH V12 2/2] mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller
Date: Thu, 16 Jun 2016 12:13:36 +0530	[thread overview]
Message-ID: <57624A98.4060308@ti.com> (raw)
In-Reply-To: <575FFF97.7040104@denx.de>



On Tuesday 14 June 2016 06:29 PM, Marek Vasut wrote:

>> I was wondering if its better to use direct access mode[1].
> 
> The link leads to altera documentation front page, but I have an idea
> what you mean. You might want to refer to [2] instead.
> 
> [2] https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cv_5v4.pdf
> 

My link was suppose to point to html edition of above document.

>> With this
>> mode there is no need to wait for IRQ or monitor sdram level. By setting
>> up QSPI in direct access mode, this entire function can be replaced by:
>> memcpy(buf, cqspi->ahb_base + from, n_rx)
> 
> The altera docs, page 993, show how to use the direct access mode. The
> idea is to map 1 MiB blocks of the flash in the address space, one at a
> time and then do IO into those. I don't like such solution:
> 
> - I didn't find any way to find when all the data in the current 1 MiB
>   block were written and you can remap another 1 MiB block in place.

I believe this constraint only applies if enahbremap bit is set in cfg
register, if not, then the entire memory map can be accessed.


> - Since the controller doesn't use the internal buffer in direct
>   operation mode, it will block the AHB bus during it's operation.

I agree, this is a disadvantage.

> - I didn't find how IO errors get handled in this case, but maybe I
>   didn't drill deep enough on this one.
> 
> Moreover, page 991 bottom of [2] states that the indirect mode is
> "high-performance". I am inclined to believe that as it uses the
> internal buffer of the QSPI controller, which is tightly coupled to the
> block,
> so the data are available immediately when the flash is ready instead
> of having to wait for the next AHB turn.
> 

Indirect mode may be the better option when using DMA. But, my thinking
was that, for CPU copy, the interrupt overhead and the fact that sdram
level needs to be monitored constantly might affect throughput badly
while using indirect mode.

> My impression is that the Direct mode is great when the system boots
> from the QSPI because it can "map" the flash and just execute code from
> it. But for normal operation, the indirect mode seems the better choice.
> 
>> IMO, this might give better throughput. Have tested this mode?
> 
> I haven't tested it, no.
> 

Anyways, direct mode support can be added (if required) at later point
of time. I have no objection for current approach as such.

Thanks for the reply!


-- 
Regards
Vignesh

  parent reply	other threads:[~2016-06-16  6:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-04  0:39 [PATCH V8 1/2] mtd: spi-nor: Bindings for Cadence Quad SPI Flash Controller driver Marek Vasut
2016-06-04  0:39 ` Marek Vasut
     [not found] ` <1465000774-7762-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2016-06-04  0:39   ` [PATCH V12 2/2] mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller Marek Vasut
2016-06-04  0:39     ` Marek Vasut
     [not found]     ` <1465000774-7762-2-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2016-06-14  5:10       ` Vignesh R
2016-06-14  5:10         ` Vignesh R
2016-06-14 12:59         ` Marek Vasut
2016-06-14 12:59           ` Marek Vasut
     [not found]           ` <575FFF97.7040104-ynQEQJNshbs@public.gmane.org>
2016-06-16  6:43             ` Vignesh R [this message]
2016-06-16  6:43               ` Vignesh R
     [not found]               ` <57624A98.4060308-l0cyMroinI0@public.gmane.org>
2016-06-16 13:21                 ` Marek Vasut
2016-06-16 13:21                   ` Marek Vasut
     [not found]                   ` <5762A7E6.8000109-ynQEQJNshbs@public.gmane.org>
2016-06-17  4:43                     ` Vignesh R
2016-06-17  4:43                       ` Vignesh R
     [not found]                       ` <57637FF1.9030802-l0cyMroinI0@public.gmane.org>
2016-06-17  9:09                         ` Marek Vasut
2016-06-17  9:09                           ` Marek Vasut
2016-07-18  0:52       ` Brian Norris
2016-07-18  0:52         ` Brian Norris
     [not found]         ` <20160718005238.GA80196-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2016-07-18  9:35           ` Marek Vasut
2016-07-18  9:35             ` Marek Vasut
     [not found]             ` <be1a637c-7d86-df4e-0d47-8516ec639974-ynQEQJNshbs@public.gmane.org>
2016-07-18 16:58               ` Brian Norris
2016-07-18 16:58                 ` Brian Norris
2016-07-18 17:02           ` Brian Norris
2016-07-18 17:02             ` Brian Norris
2016-06-07 14:00   ` [PATCH V8 1/2] mtd: spi-nor: Bindings for Cadence Quad SPI Flash Controller driver Rob Herring
2016-06-07 14:00     ` Rob Herring
2016-07-18 17:00     ` Brian Norris
2016-07-18 17:00       ` Brian Norris

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=57624A98.4060308@ti.com \
    --to=vigneshr-l0cymroini0@public.gmane.org \
    --cc=atull-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dinguyen-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=grmoore-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=marex-ynQEQJNshbs@public.gmane.org \
    --cc=yvanderv-yzvPICuk2ABMcg4IHK0kFoH6Mc4MB0Vx@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.