From: Grant Likely <grant.likely@secretlab.ca>
To: David Daney <david.daney@cavium.com>,
Rob Herring <robherring2@gmail.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"ralf@linux-mips.org" <ralf@linux-mips.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 2/4] MIPS: Octeon: Setup irq_domains for interrupts.
Date: Wed, 28 Mar 2012 16:08:39 -0600 [thread overview]
Message-ID: <20120328220839.599E13E0C26@localhost> (raw)
In-Reply-To: <4F733945.6000804@cavium.com>
On Wed, 28 Mar 2012 09:16:05 -0700, David Daney <david.daney@cavium.com> wrote:
> On 03/28/2012 07:21 AM, Rob Herring wrote:
> > On 03/27/2012 05:31 PM, David Daney wrote:
> >> On 03/27/2012 03:05 PM, Rob Herring wrote:
> >>> On 03/27/2012 01:24 PM, David Daney wrote:
> >>>> On 03/26/2012 06:56 PM, Rob Herring wrote:
> >>>>> On 03/26/2012 02:31 PM, David Daney wrote:
> >>>>>> From: David Daney<david.daney@cavium.com>
> >>>> [...]
> >>>>>> +static bool octeon_irq_ciu_is_edge(unsigned int line, unsigned int
> >>>>>> bit)
> >>>>>> +{
> >>>>>> + bool edge = false;
> >>>>>> +
> >>>>>> + if (line == 0)
> >>>>>> + switch (bit) {
> >>>>>> + case 48 ... 49: /* GMX DRP */
> >>>>>> + case 50: /* IPD_DRP */
> >>>>>> + case 52 ... 55: /* Timers */
> >>>>>> + case 58: /* MPI */
> >>>>>> + edge = true;
> >>>>>> + break;
> >>>>>> + default:
> >>>>>> + break;
> >>>>>> + }
> >>>>>> + else /* line == 1 */
> >>>>>> + switch (bit) {
> >>>>>> + case 47: /* PTP */
> >>>>>> + edge = true;
> >>>>>> + break;
> >>>>>> + default:
> >>>>>> + break;
> >>>>>> + }
> >>>>>> + return edge;
> >>>>>
> >>>>> Moving in the right direction, but I still don't get why this is not in
> >>>>> the CIU binding as a 3rd cell?
> >>>>
> >>>> There are a several reasons, in no particular order they are:
> >>>>
> >>>> o There is no 3rd cell. The bindings were discussed with Grant here:
> >>>> http://www.linux-mips.org/archives/linux-mips/2011-05/msg00355.html
> >>>>
> >>>
> >>> Then add one.
> >>
> >> I can't. The dtb is already programmed into the bootloader ROMs,
> >> changing the kernel code will not change that. It is fait accompli.
> >>
> >>>
> >>>> o The edge/level thing cannot be changed, and the irq lines don't leave
> >>>> the SOC, so hard coding it is possible.
> >>>
> >>> Right, but DT describes h/w connections and this is an aspect of the
> >>> connection. This may be fixed for the SOC, but it's not fixed for the
> >>> CIU (i.e. could change in future chips), right?
> >>
> >> In theory yes. However:
> >>
> >> 1) The chip designers will not change it.
> >>
> >> 2) There will likely be no more designs with either CIU or CIU2, so we
> >> know what all the different possibilities are today.
> >>
> >> When CIU3 is deployed, we will use the lessons we have learned to do
> >> things the Right Way.
> >>
> >>>
> >>> There's 2 reasons why you would not put this into DTS:
> >>>
> >>> - All irq lines' trigger type are the same, fixed and known.
> >>> - You can read a register to tell you the trigger type.
> >>>
> >>> Even if it's not going to change ever, it's still worth putting into the
> >>> DTS as it is well suited for holding that data and it is just data.
> >>
> >> Agreed that it could be in the DTS, and retrospect it probably should
> >> have been put in the DTS, but it wasn't. So I think what we have now is
> >> a workable solution, and has the added attraction of working with
> >> already deployed boards.
> >
> > Aren't you building in the dtb to the kernel?
>
> No. This seems like a bit of a disconnect in this discussion. From the
> cover-letter:
>
> o A device tree template is statically linked into the kernel image.
> Based on SOC type and board type, legacy configuration probing code
> is used to prune and patch the device tree template.
>
> o New SOCs and boards will directly use a device tree passed by the
> bootloader.
I think the real surprise here is that Octeron is depending on a
masked-in copy of the device tree. It has alwasy been a strong
recommendation to store the .dtb along side the kernel in reflashable
storage for exactly the reason that updates may be required. Review
is vitally important, but nobody can foresee all the implications
until the bindings are actually used.
I'm not going to harp over this, I understand that you're hamstrung
here, but please do pass on to the firmware engineers that storing the
.dtb in masked rom is risky.
>
>
> >
> > It could be argued it doesn't matter what you deployed without upstream
> > review.
>
> A moot point, as all the bindings were reviewed with Grant Likely
> precisely for the reason of minimizing surprises when merging upstream.
> In the intervening months, we have found a few rough edges like this,
> but we cannot say that there was no upstream review.
Yes, you've been good about this and I much appreciate it.
g.
next prev parent reply other threads:[~2012-03-28 22:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 19:31 [PATCH v7 0/4] MIPS: OCTEON: Use Device Tree David Daney
2012-03-26 19:31 ` [PATCH v7 1/4] MIPS: Don't define early_init_devtree() and device_tree_init() in prom.c for CPU_CAVIUM_OCTEON David Daney
2012-03-26 19:31 ` [PATCH v7 2/4] MIPS: Octeon: Setup irq_domains for interrupts David Daney
[not found] ` <1332790281-9648-3-git-send-email-ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-27 1:56 ` Rob Herring
2012-03-27 18:24 ` David Daney
2012-03-27 22:05 ` Rob Herring
2012-03-27 22:31 ` David Daney
2012-03-28 14:21 ` Rob Herring
2012-03-28 16:16 ` David Daney
2012-03-28 22:08 ` Grant Likely [this message]
2012-03-29 1:46 ` David Daney
2012-03-28 22:22 ` Grant Likely
2012-03-29 1:41 ` David Daney
[not found] ` <4F73BDAF.7020206-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2012-03-30 21:54 ` Grant Likely
2012-03-28 22:31 ` Grant Likely
2012-03-29 1:33 ` David Daney
2012-03-26 19:31 ` [PATCH v7 3/4] MIPS: Octeon: Add device tree source files David Daney
2012-03-27 2:38 ` Rob Herring
2012-03-27 18:45 ` David Daney
2012-03-26 19:31 ` [PATCH v7 4/4] MIPS: Octeon: Initialize and fixup device tree David Daney
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=20120328220839.599E13E0C26@localhost \
--to=grant.likely@secretlab.ca \
--cc=david.daney@cavium.com \
--cc=ddaney.cavm@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=robherring2@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).