From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Pantelis Antoniou
<panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>,
Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rabin VINCENT
<rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Koen Kooi
<koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org>,
Russ Dill <Russ.Dill-l0cyMroinI0@public.gmane.org>,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Matt Porter <mporter-l0cyMroinI0@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Linus Walleij
<linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Matt Ranostay <mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Joel A Fernandes
<agnel.joel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Guennadi Liakhovetski
<g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
Subject: Re: [PATCH 1/5] capemgr: Beaglebone DT overlay based cape manager
Date: Wed, 9 Jan 2013 11:48:09 +0000 [thread overview]
Message-ID: <201301091148.09320.arnd@arndb.de> (raw)
In-Reply-To: <CACRpkdbx7ptCugpc1+JC5Yk+n835goOuoF6q0pdizsjpZ-G9mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wednesday 09 January 2013, Linus Walleij wrote:
> On Wed, Jan 9, 2013 at 9:11 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> > On Tue, 08 Jan 2013, Arnd Bergmann wrote:
> >> I don't remember the details unfortunately. Lee should be the one who can find out.
> >> IIRC there was at least a single integeger number on them.
> >
> > Not as far as I can remember. There was (is?) a crude method of
> > identifying UIBs, but attempting to obtain certain I2C lines and
> > testing which ones were accessible. However, if there is an issue
> > with I2C, the wrong UIB was 'probed'.
>
> Right, so the UIBs had different GPIO expanders on some I2C addresses,
> so we attempt to communicate with the expander to see if it's board type A,
> and if it doesn't respond it's deemed to be board type B.
>
> This is the code:
> arch/arm/mach-ux500/board-mop500-uib.c
Ok, no idea what I was confusing it with then.
> Compare this other case: the Integrator has pluggable daughterboards,
> (called LMs, logic modules) and in that case we have specific registers
> to detect them, and register the daughter board on this specific bus
> that Russell came up with in arch/arm/mach-integrator/lm.c,
> the actual board detection is in arch/arm/mach-integrator/integrator_ap.c:
>
> static void __init ap_init(void)
> {
> unsigned long sc_dec;
> int i;
>
> platform_device_register(&cfi_flash_device);
>
> sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET);
> for (i = 0; i < 4; i++) {
> struct lm_device *lmdev;
>
> if ((sc_dec & (16 << i)) == 0)
> continue;
>
> lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL);
> if (!lmdev)
> continue;
>
> lmdev->resource.start = 0xc0000000 + 0x10000000 * i;
> lmdev->resource.end = lmdev->resource.start + 0x0fffffff;
> lmdev->resource.flags = IORESOURCE_MEM;
> lmdev->irq = IRQ_AP_EXPINT0 + i;
> lmdev->id = i;
>
> lm_device_register(lmdev);
> }
>
> integrator_init(false);
> }
>
> In this case I think the autodetect is so nice that device tree probing
> is mostly pointless. If it wasn't for the fact that we get a
> cross-depenency to defined interrupts and clocks and whatever that
> are coming from the device tree. Which is where DT shows its
> all-or-nothing face.
Well, the extension bus above can easily be represented as a single device
with four interrupts and four memory ranges. The child devices don't
have to show up in DT at all, since they can be detected, but the detection
mechanism should be there. This is the same as PCI devices, where we have
to describe the host controller, but not the add-on cards.
> So to get an elegant DT probing in this case I *guess* the right thing
> to do is to dynamically add nodes to the device tree from the board
> code, or have all alternatives inside the DT marked "disable" and then
> mark them as "okay" from the board code by modifying the DT at
> runtime.
That would also work, but I think the other way is simpler.
Arnd
next prev parent reply other threads:[~2013-01-09 11:48 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 18:51 [PATCH 0/5] DT Overlay based cape manager for TI's Beaglebone Pantelis Antoniou
2013-01-07 18:51 ` [PATCH 1/5] capemgr: Beaglebone DT overlay based cape manager Pantelis Antoniou
2013-01-07 20:09 ` Tony Lindgren
2013-01-07 20:13 ` Pantelis Antoniou
2013-01-07 20:23 ` Tony Lindgren
[not found] ` <20130107202306.GH14149-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-01-07 20:26 ` Pantelis Antoniou
2013-01-07 20:35 ` Tony Lindgren
2013-01-07 20:40 ` Pantelis Antoniou
2013-01-07 21:05 ` Tony Lindgren
2013-01-07 21:35 ` Arnd Bergmann
2013-01-08 9:15 ` Pantelis Antoniou
2013-01-08 9:51 ` Guennadi Liakhovetski
2013-01-08 10:07 ` Pantelis Antoniou
2013-01-08 10:00 ` Lee Jones
2013-01-08 10:10 ` Pantelis Antoniou
2013-01-08 10:48 ` Lee Jones
2013-01-08 12:12 ` Arnd Bergmann
2013-01-08 13:26 ` Pantelis Antoniou
2013-01-08 16:12 ` Arnd Bergmann
2013-01-09 8:11 ` Lee Jones
2013-01-09 8:29 ` Linus Walleij
[not found] ` <CACRpkdbx7ptCugpc1+JC5Yk+n835goOuoF6q0pdizsjpZ-G9mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-09 9:56 ` Pantelis Antoniou
[not found] ` <57EDCDB4-2AC9-4052-BBA6-9F4A5D3C3D8C-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2013-01-09 10:21 ` Arnd Bergmann
[not found] ` <201301091021.24147.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-09 10:24 ` Pantelis Antoniou
2013-01-09 11:48 ` Arnd Bergmann [this message]
[not found] ` <201301091148.09320.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-17 10:20 ` Linus Walleij
[not found] ` <CACRpkdZ8hgV_=ev8Kcq=i7K15jrvwW+Or7p+=8fP+8Rb7GGvTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-17 10:35 ` Arnd Bergmann
[not found] ` <201301171035.41407.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-17 14:02 ` Linus Walleij
2013-03-26 16:16 ` Grant Likely
2013-03-26 18:40 ` Greg Kroah-Hartman
2013-01-08 11:14 ` Sascha Hauer
[not found] ` <201301072135.05166.arnd-r2nGTMty4D4@public.gmane.org>
2013-04-15 10:14 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-07 18:51 ` [PATCH 2/5] capemgr: Add beaglebone's cape driver bindings Pantelis Antoniou
2013-03-26 17:36 ` Grant Likely
2013-03-27 9:26 ` Pantelis Antoniou
[not found] ` <1357584666-17374-1-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2013-01-07 18:51 ` [PATCH 3/5] capemgr: am335x-bone capemgr bindings Pantelis Antoniou
2013-01-07 18:51 ` [PATCH 4/5] capemgr: firmware makefiles for DT objects Pantelis Antoniou
2013-01-07 18:51 ` [PATCH 5/5] capemgr: Weather cape cape definition Pantelis Antoniou
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=201301091148.09320.arnd@arndb.de \
--to=arnd-r2ngtmty4d4@public.gmane.org \
--cc=Russ.Dill-l0cyMroinI0@public.gmane.org \
--cc=agnel.joel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=g.liakhovetski-Mmb7MZpHnFY@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mporter-l0cyMroinI0@public.gmane.org \
--cc=mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org \
--cc=rabin.vincent-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@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).