devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	workgroup.linux-kQvG35nSl+M@public.gmane.org,
	weizeng.he-kQvG35nSl+M@public.gmane.org,
	tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2] ARM: CSR: Adding CSR SiRFprimaII board support
Date: Wed, 6 Jul 2011 13:58:10 +0800	[thread overview]
Message-ID: <CAGsJ_4xV7ecdqnB5gJDUDSg4nvebgubBj4qGJGaCtcpbj-b0gQ@mail.gmail.com> (raw)
In-Reply-To: <20110706053026.GB9978-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>

2011/7/6 Grant Likely <grant.likely@secretlab.ca>:
> On Tue, Jul 05, 2011 at 04:34:05PM +0800, Barry Song wrote:
>> Hi Arnd,
>>
>> 2011/7/1 Barry Song <21cnbao@gmail.com>:
>> > Hi Arnd,
>> >
>> > 2011/6/30 Arnd Bergmann <arnd@arndb.de>:
>> >> On Thursday 30 June 2011, Barry Song wrote:
>> >>
>> >>> > Is this really just one bus with a huge address space, or rather some
>> >>> > nested buses? I'd prefer to have the device tree representation as
>> >>> > close as possible to the actual layout.
>> >>>
>> >>> there are two AXI buses in prima2. AXI-1 connect to memory, AXI-2 is
>> >>> transferred to CSR self-defined IOBUS by CPUIF, then 1 intterupt
>> >>> controller and 9 IO bridges are connected to the IOBUS .
>> >>> The 9 IO bridges are SYSIOBG, PERIIOBG,CPURTCIOBG, UUSIOBG, GRAPHIOBG,
>> >>> MEDIAIOBG, DSPIOBG, DISPIOBG, MEMIOBG. Every iobrg connect to a group
>> >>> of controllers.
>> >>> For example, DISPIOBG connect to VPP and LCD, SYSIOBG connect to CLKC,
>> >>> RSTC, RSC and CPHIFBG, DSPIOBG connect to DSPIF, GPS and DSP.
>> >>> PERIIOBG connect to TIMER, NAND, AUDIO, UART0, UART1, UART2, USP0,
>> >>> USP1, USP2, SPI0, I2C0, I2C1, GPIO, *SYS2PCI* and so on. Then
>> >>> *SYS2PCI* connect to SD.
>> >>>
>> >>> The indendation descible the device hierarchy
>> >>> AXI-1
>> >>>          Memory
>> >>> AXI-2
>> >>>          interrupt controller
>> >>>          IOBG...
>> >>>                   xxxx
>> >>>          IOBG...
>> >>>                   xxxx
>> >>>          IOBG...
>> >>>                   xxxx
>> >>>          IOBG...
>> >>>                   xxxx
>> >>>          IOBG...
>> >>>                   xxxx
>> >>>          IOBG...
>> >>>                   SYS2PCI
>> >>>                             SD
>> >>>
>> >>> i have get the IC guy Weizeng involved, maybe he can explain better than me :-)
>> >>
>> >> I think it would be good to represent the IOBG devices in the device tree then.
>> >> You don't need to represent AXI-1 because memory is special anyway, and I would
>> >> not bother to list SYS2PCI if the intention of that block was to hide the fact
>> >> that it's PCI behind it. Properly instantiating it as a PCI bridge would be
>> >> a lot of work that is probably not worth it.
>> >>
>> >> My usual plea to hardware developers: Please make the registers
>> >> autodiscoverable from software! On an AMBA bus, please use the PrimeCell
>> >> register layout. If you always have an IOBG device behind, they should
>> >> all have the same identifier for that kind of bus bridge.
>> >>
>> >> For the IOBG, it would be ideal to have a similar way of finding and
>> >> configuring the connected hardware, including:
>> >>
>> >> * unique identifier for each distinct IP block
>> >> * revision of that block
>> >> * MMIO ranges and sizes, relative to the bus
>> >> * interrupt numbers, relative to a local interrupt controller
>> >> * location identifier (like PCI bus/device/fn number) that can be
>> >>  referred to by other devices
>> >> * clock management for that device
>> >> * power management for that device
>> >>
>> >> If your IODB infrastructure already has this, you should create a new
>> >> bus-type for this in Linux, which will let you detect all devices
>> >> in a consistent manner without having to list them in the device tree.
>> >
>> > IO bridges in prima2 don't have that. Configuration is hardcoded now.
>> > but we have learned so much from you and hope to improve our future IC
>> > design.
>>
>>
>> i have tried to figure out the full DT:
>>
>> /dts-v1/;
>> / {
>>       model = "SiRF Prima2 EVB";
>>       compatible = "sirf,prima2-cb", "sirf,prima2";
>>       #address-cells = <1>;
>>       #size-cells = <1>;
>>       interrupt-parent = <&intc>;
>>
>>       memory {
>
> memory@0
>
>>               reg = <0x00000000 0x20000000>;
>>       };
>>
>>       chosen {
>>               bootargs = "mem=512M real_root=/dev/mmcblk0p2 console=ttyS0 panel=1
>> bootsplash=true bpp=16 androidboot.console=ttyS1";
>>               linux,stdout-path = &uart1;
>>       };
>>
>>       cpus {
>>               #address-cells = <1>;
>>               #size-cells = <0>;
>>
>>               ARM-CortexA9,SiRFprimaII@0 {
>
> cpu@0 {
>
> Don't duplicate the crack that powerpc did for cpu node names.  Use a
> compatible property to identify the specific CPU model.
>
>>                       device_type = "cpu";
>
> Drop device_type here.
>
>>                       reg = <0x0>;
>>                       d-cache-line-size = <32>;
>>                       i-cache-line-size = <32>;
>>                       d-cache-size = <32768>;
>>                       i-cache-size = <32768>;
>>                       /* from bootloader */
>>                       timebase-frequency = <0>;
>>                       bus-frequency = <0>;
>>                       clock-frequency = <0>;
>>               };
>>       };
>>
>>       axi {
>>               compatible = "simple-bus";
>>               #address-cells = <1>;
>>               #size-cells = <1>;
>>               ranges = <0x40000000 0x40000000 0x80000000>;
>>
>>               l2-cache-controller@0x80040000 {
>
> l2-cache-controller@80040000  (Drop the '0x' from node names; address
> in the node name is always hex.
>
>>                       compatible = "arm,pl310-cache", "cache";
>
> Drop the "cache" compatible value here.
>
>>                       reg = <0x80040000 0x1000>;
>>                       interrupts = <59>;
>>               };
>>
>>               sirfsoc-iobus {
>>                       compatible = "simple-bus";
>>                       #address-cells = <1>;
>>                       #size-cells = <1>;
>>                       ranges = <0x56000000 0x56000000 0x1b0000
>>                               0x80010000 0x80010000 0x30000
>>                               0x88000000 0x88000000 0x40040000>;
>>
>>                       intc: interrupt-controller@0x80020000 {
>>                               #interrupt-cells = <1>;
>>                               interrupt-controller;
>>                               compatible = "sirf,intc", "sirf,prima2-intc";
>
> This looks backwards.  Most specific values should appear first.
> "sirf,intc" looks to be generic when compared to "sirf,prima2-intc".
> I'm also concerned that "sirf,intc" is trying to be too generic.  As
> much as possible compatible values should reflect a real
> implementation of the interface, not a generic abstract name.  Future
> hardware can always claim compatibility with existing older hardware.
> You're probably better off dropping "sirf,intc" entirely, and doing
> the same for similar properties throughout the file.

i have been confused by compatible in dts and drivers for some time.
if an intc ip core is shared by two chips, for example, prima2 and
atlas6. is the following right?

in dts for prima2: compatible = "sirf,prima2-intc";
in dts for atlas6:  compatible = "sirf,prima2-atlas6";
in intc drivers shared for both:     compatible = "sirf,prima2-intc",
"sirf,prima2-atlas6";

in my understanding, dts for special soc/board contains special
compatible for the chip, drivers shared by multi-soc/board contain all
compatible lists which can be supported by them?

what's the generic way for this?

>
> Also, for every new compatible value make sure you add documentation
> for it to Documentation/devicetree/bindings. (You may have already
> done so, it's just something I remind people about a lot).
>
> These comments also apply through the rest of the file.
>
>
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

  parent reply	other threads:[~2011-07-06  5:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1309231954-23260-1-git-send-email-bs14@csr.com>
     [not found] ` <1309231954-23260-1-git-send-email-bs14-kQvG35nSl+M@public.gmane.org>
2011-06-29 21:29   ` [PATCH v2] ARM: CSR: Adding CSR SiRFprimaII board support Arnd Bergmann
     [not found]     ` <201106292329.44447.arnd-r2nGTMty4D4@public.gmane.org>
2011-06-30  3:39       ` Barry Song
2011-06-30  7:19     ` Barry Song
     [not found]       ` <BANLkTinfKCMcutMDQ+mpdD4EUy9mCpZs+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-30 10:36         ` Arnd Bergmann
     [not found]           ` <201106301236.25822.arnd-r2nGTMty4D4@public.gmane.org>
2011-06-30 15:03             ` Rob Herring
2011-07-01  6:20             ` Barry Song
     [not found]               ` <BANLkTikoMu3ccUxj5KRmKzdReQcBqK4Y9Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-01 16:19                 ` Arnd Bergmann
2011-07-02 12:25                   ` Russell King - ARM Linux
     [not found]                     ` <20110702122527.GH21898-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-07-02 19:34                       ` Arnd Bergmann
     [not found]                   ` <201107011819.43316.arnd-r2nGTMty4D4@public.gmane.org>
2011-07-04  2:55                     ` Barry Song
2011-07-04 14:53                       ` Arnd Bergmann
     [not found]                         ` <201107041653.50962.arnd-r2nGTMty4D4@public.gmane.org>
2011-07-05  1:32                           ` Barry Song
     [not found]                             ` <CAGsJ_4wf0Lhe2yHg1fE2QAF40=J6ZoubpfLFWQ6X9o3db0O8LQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-05 11:10                               ` Arnd Bergmann
2011-07-05  8:34               ` Barry Song
2011-07-06  2:10                 ` Barry Song
     [not found]                 ` <CAGsJ_4wSKP6EUihOVbUJJ+HUynWGp8PA=8J_WhgmOtVhpd5_Lg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  5:30                   ` Grant Likely
     [not found]                     ` <20110706053026.GB9978-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-07-06  5:58                       ` Barry Song [this message]
     [not found]                         ` <CAGsJ_4xV7ecdqnB5gJDUDSg4nvebgubBj4qGJGaCtcpbj-b0gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  6:01                           ` Barry Song
     [not found]                             ` <CAGsJ_4yxUzMr4EJd5i0oW1tOa2oK7jicAehKVXXiU_SMDpTQ0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  6:28                               ` Grant Likely
     [not found]                                 ` <20110706062838.GI9978-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-07-06  7:03                                   ` Barry Song
     [not found]                                     ` <CAGsJ_4xUsw21EM2GXMt4i27MGjCP_h46tCzhDqo-MCZkAVsEiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  7:40                                       ` Arnd Bergmann
2011-07-01  0:04           ` Barry Song
2011-07-01 16:26             ` Arnd Bergmann
     [not found]             ` <BANLkTinkHcuXuWpCxq3tnU_10trPTjDucg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-04 14:59               ` Grant Likely

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=CAGsJ_4xV7ecdqnB5gJDUDSg4nvebgubBj4qGJGaCtcpbj-b0gQ@mail.gmail.com \
    --to=21cnbao-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=weizeng.he-kQvG35nSl+M@public.gmane.org \
    --cc=workgroup.linux-kQvG35nSl+M@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;
as well as URLs for NNTP newsgroup(s).