public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: "Hauke Mehrtens" <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>,
	"Brian Norris"
	<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	bcm-kernel-feedback-list
	<bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
	Florian Fainelli
	<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 5/7] mtd: brcmnand: add bcma driver
Date: Wed, 20 May 2015 15:48:23 -0700	[thread overview]
Message-ID: <555D0F37.3010609@broadcom.com> (raw)
In-Reply-To: <555D066C.6080200-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>

Hi Hauke,

On 5/20/2015 3:10 PM, Hauke Mehrtens wrote:
> On 05/20/2015 08:40 PM, Brian Norris wrote:
>> On Wed, May 20, 2015 at 08:39:06AM +0200, Rafał Miłecki wrote:
>>> On 20 May 2015 at 02:34, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On Sun, May 17, 2015 at 05:41:04PM +0200, Hauke Mehrtens wrote:
>>>>> This driver registers at the bcma bus and drives the NAND core if it
>>>>> was found on this bus. The bcma bus with this NAND core is used on the
>>>>> bcm53xx and bcm47xx Northstar SoC with ARM CPU cores. The memory ranges
>>>>> are automatically detected by bcma and the irq numbers read from device
>>>>> tree by bcma bus driver.
>>>>
>>>> If you're going to use device tree for part of it (IRQs) why not the
>>>> whole thing?
>>>>
>>>>> This is based on the iproc driver.
>>>>
>>>> This looks like you could probably get by with just using iproc_nand.c
>>>> as-is. The main NAND core is apparently MMIO-accessible on your chips,
>>>> so aren't the BCMA bits you're touching also?
> 
> I will try this, I do not know if I have to reset or active the core
> before using it, at least the vendor driver does so and I added it also.
> 
>>> That's right, in case of SoCs cores are MMIO-accessible, however I see
>>> few reasons for writing this driver as bcma based:
>>> 1) MMIO access isn't available for bcma bus /hosted/ on PCIe devices.
>>> By using bcma layer we write generic drivers.
>>
>> I strongly doubt that this NAND core is ever put on a PCIe endpoint.
> 
> Me too and then my driver would not work, because I am forwarding the
> memory directly to the driver and nothing would change the active core.
> 
>>> 2) bcma detects cores and their MMIO addresses automatically, if we
>>> are a bit lazy, it's easier to use it rather than keep hardcoding all
>>> addresses
>>
>> Laziness is a pretty bad excuse. You already have to do 60% of the work
>> by putting the IRQs and base NAND register range into the device tree.
>> Finding those remaining two register addresses is not so hard.
>>
>>> 3) There are some dependencies in cores initialization, e.g.
>>> ChipCommon core usually has to be initialized first
>>
>> Are you aware of any important dependencies? Isn't it safe to assume
>> that the ChipCommon core would have to be initialized way before any
>> peripherals?
> 
> I think ChipCommon is less important on ARM, I do not came up with an
> dependencies.
> 
>>
>>> 4) bcma provides some helpers like bcma_core_enable so we don't have
>>> to duplicate it in driver code
>>
>> I don't see why we need to reset/re-enable the NAND core in the kernel
>> at all, but if we do, this is touching the exact same registers as
>> iproc_nand.c is already. So it makes sense to *share* that code, and do
>> the same thing on both Cygnus and Northstar, etc. (And no, Cygnus can't
>> convert to BCMA, so we can't do 100% sharing either way.)
> 
> Will this Broadcom plugin to the AXI bus which bcma uses be removed from
> all newer SoCs or just from some SoC lines? If it will not be there in
> any more recent SoC then we should also go for the older arm SoCs to a
> more device tree only approach. Is Cygnus related to Northstar Plus or
> Northstar 2?

I don't think I can give you a certain answer on this. But to my best
knowledge, I don't think we have BCMA for several of our next gen ARMv8
based SoCs.

A set of peripherals (e.g., NAND, PCIe RC, I2C, etc) are shared between
Cygnus, NS+, and NS2.

Thanks,

Ray
--
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

  parent reply	other threads:[~2015-05-20 22:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-17 15:40 [PATCH 0/7] mtd: brcmnand: add support for NAND core on bcma bus Hauke Mehrtens
     [not found] ` <1431877266-28566-1-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-17 15:41   ` [PATCH 1/7] mtd: brcmnand: remove double new line from print Hauke Mehrtens
     [not found]     ` <1431877266-28566-2-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-18 18:09       ` Brian Norris
2015-05-17 15:41   ` [PATCH 2/7] mtd: brcmnand: do not make local variable static Hauke Mehrtens
     [not found]     ` <1431877266-28566-3-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-18 18:13       ` Brian Norris
2015-05-17 15:41   ` [PATCH 3/7] mtd: brcmnand: use struct device and not platform_device Hauke Mehrtens
2015-05-17 15:41   ` [PATCH 4/7] mtd: brcmnand: add methods to register struct device Hauke Mehrtens
2015-05-17 15:41   ` [PATCH 5/7] mtd: brcmnand: add bcma driver Hauke Mehrtens
     [not found]     ` <1431877266-28566-6-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-20  0:34       ` Brian Norris
2015-05-20  6:39         ` Rafał Miłecki
     [not found]           ` <CACna6rzBn3yzzER56aAmk+VPNiMh9ikA3B1YZmMesF=3DWdq+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-20 18:40             ` Brian Norris
2015-05-20 22:10               ` Hauke Mehrtens
     [not found]                 ` <555D066C.6080200-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-20 22:48                   ` Ray Jui [this message]
2015-05-21  7:51               ` Rafał Miłecki
     [not found]                 ` <CACna6rwc=Qudqw8e3N9SO7xEGZCx=LgwrBEVqzJHi9KMSjhyVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-27  0:18                   ` Brian Norris
2015-05-27 22:18                     ` Hauke Mehrtens
2015-05-17 15:41   ` [PATCH 6/7] mtd: brcmnand: run bcm47xxpart part parser in addition Hauke Mehrtens
     [not found]     ` <1431877266-28566-7-git-send-email-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2015-05-17 16:05       ` Jonas Gorski
     [not found]         ` <CAOiHx=kGrsxLRT_Lf7PGm=hHm8azQYu5_AQVd6q+oOh2EXawsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-17 16:14           ` Hauke Mehrtens
2015-05-17 15:41   ` [PATCH 7/7] ARM: BCM5301X: add NAND flash chip description Hauke Mehrtens

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=555D0F37.3010609@broadcom.com \
    --to=rjui-dy08kvg/lbpwk0htik3j/w@public.gmane.org \
    --cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox