devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Branden <sbranden@broadcom.com>
To: Brian Norris <computersforpeace@gmail.com>,
	Anup Patel <anup.patel@broadcom.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Ray Jui <rjui@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Pramod Kumar <pramodku@broadcom.com>,
	Vikram Prakash <vikramp@broadcom.com>,
	Sandeep Tripathy <tripathy@broadcom.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	Rafal Milecki <zajec5@gmail.com>
Subject: Re: [PATCH 3/5] mtd: brcmnand: Optional DT flag to reset IPROC NAND controller
Date: Tue, 6 Oct 2015 15:25:38 -0700	[thread overview]
Message-ID: <56144A62.70300@broadcom.com> (raw)
In-Reply-To: <20151006134119.GB26818@localhost>

Hi Brian,

On 15-10-06 06:41 AM, Brian Norris wrote:

>>>
>>> Is there a reason not to do this reset unconditionally? I recall this came up in
>>> discussion previously, when the OpenWRT folks were trying to integrate with
>>> BCMA, where this reset was one of the few differences between the platform-
>>> device-based driver (i.e., this one) and the BCMA based driver. Might it help
>>> simplify things a bit if we just did the same thing everywhere?
>>
>> This driver is currently shared by Cygnus and NS2.
>>
>> We had similar suggestion when this patch was reviewed
>> internally in Broadcom.
>>
>> The rationale for adding optional DT flag is as follows:
>> 1. The NAND controller reset is currently required for NS2 only so
>> that it is in sane state before any NAND commands are issued. We
>> are not sure if Cygnus and all future iProc SoCs will require NAND
>> controller reset.
>
> I'm not sure this is a very strong reason. It seems fairly reasonable in
> general to reset a HW block before using it.

Efficient Boot time is a very strong reason for needing this actually. 
We use the NAND controller in the bootROM, boot1/BL1, u-boot/UEFI, and 
then Kernel stage.  By properly initializing the controller once we do 
not need to reset it 4 different times.

>
>> 2. The NAND controller reset in probe would certainly increase
>> Linux boot time so for certain iProc SoCs we might choose avoid
>> NAND controller reset to reduce boot time if possible.
>
> I recall this reason being mentioned before. I believe this only happens
> because the brcmnand driver doesn't yet handle configuring the timing
> registers, so iProc is implicitly relying on the bootloader to configure
> the NAND timings. Perhaps it's time that we fix that. I'd rather not add
> extra DT properties unless we actually need to [1]. And having proper
> timing configuration in the Linux driver will help improve speeds for
> all users (whose timings may not be configured in the bootloader).

This is the very reason we need the optional reset property.  We need to 
have timings configured by the linux driver or not.  Yes, in some cases 
we will be relying on earlier boot stages to configure some of the hardware.

>
> I actually had some preliminary work to do some timing configuration
> according to the new timing information from nand_base.c/nand_timing.c.
> Unfortunately, I didn't complete this, and I'm no longer working at
> Broadcom, so I don't exactly have access to the HW docs for all the NAND
> controller revisions, nor do I have access to as much HW for testing...
>
> Brian
>
> [1] If we really do need a device tree differentiation, perhaps it would
> be better to just differentiate the compatible string than to have
> individual boolean properties. e.g.:
>
> 	compatible = "brcm,iproc-nand-ns2", ...;
>
As described above - the option is not SoC specific.  It is system 
specific.  In some systems we may wish to reset the NAND controller in 
linux.  In some we may wish to rely on initialization that has already 
been done to speed up boot times.



Regards,
  Scott

  reply	other threads:[~2015-10-06 22:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02 17:56 [PATCH 0/5] NAND support for Broadcom NS2 SoC Anup Patel
2015-10-02 17:56 ` [PATCH 1/5] mtd: brcmnand: Fix pointer type-cast in brcmnand_write() Anup Patel
     [not found]   ` <1443808606-21203-2-git-send-email-anup.patel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-10-12 21:20     ` Brian Norris
2015-10-02 17:56 ` [PATCH 2/5] mtd: nand: Allow MTD_NAND_BRCMNAND to be selected for ARM64 Anup Patel
2015-10-12 21:20   ` Brian Norris
2015-10-02 17:56 ` [PATCH 3/5] mtd: brcmnand: Optional DT flag to reset IPROC NAND controller Anup Patel
2015-10-04 21:49   ` Brian Norris
2015-10-05  6:27     ` Anup Patel
2015-10-06 13:41       ` Brian Norris
2015-10-06 22:25         ` Scott Branden [this message]
     [not found]           ` <56144A62.70300-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-10-06 23:20             ` Florian Fainelli
2015-10-07  3:33               ` Anup Patel
     [not found]                 ` <39063E8F96E11742B35A201CC5D095B7AD8ADD-HXj2mutaA2qau4nib9vn7Zr/X4hKkxxPpWgKQ6/u3Fg@public.gmane.org>
2015-10-12 21:27                   ` Brian Norris
     [not found]                     ` <20151012212742.GQ107187-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-10-16  6:46                       ` Anup Patel
2015-10-12 21:54                 ` Josh Cartwright
2015-10-13 17:35                   ` Florian Fainelli
2015-10-02 17:56 ` [PATCH 4/5] Documentation: dt-bindings: Add info about brcm,nand-iproc-reset DT flag Anup Patel
2015-10-02 17:56 ` [PATCH 5/5] arm64: dts: Add BRCM IPROC NAND DT node for NS2 Anup Patel

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=56144A62.70300@broadcom.com \
    --to=sbranden@broadcom.com \
    --cc=anup.patel@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=f.fainelli@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pramodku@broadcom.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=tripathy@broadcom.com \
    --cc=vikramp@broadcom.com \
    --cc=will.deacon@arm.com \
    --cc=zajec5@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).