From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] bus: introduce an Marvell EBU MBus driver
Date: Thu, 7 Mar 2013 10:37:36 -0700 [thread overview]
Message-ID: <20130307173736.GA20840@obsidianresearch.com> (raw)
In-Reply-To: <20130307115817.3b3cad20@skate>
On Thu, Mar 07, 2013 at 11:58:17AM +0100, Thomas Petazzoni wrote:
> Please always think about this PCIe use case when proposing any sort of
> solution about address decoding windows. Any solution that doesn't take
> into account the dynamic nature of PCIe windows is simply useless.
PCIe is not a problem, it continues to use the dynamic interface!
This is all about how do you connect the DT stanzas that are already
in the DT to the dynamic window mbus system - and you do that via
ranges. The ranges only need to cover the needs of the static elements
of the DT - they do not need to extend beyond to fully dynamic
elements like PCI-E - those cases are *totally* different and must be
handled in code.
The reason for this is quite simply to avoid this ugly boiler plate in
every mbus driver:
> struct resource nor_resource;
>
> /* Get the size of the NOR from DT */
> of_address_to_resource(np, 0, &nor_resource);
>
> /* Find an available physical range to map the NOR */
> allocate_resource(&iomem_res, &nor_resource,
> resource_size(&nor_resource),
> 0, 0, 0, NULL, NULL);
>
> /* Create the address decoding window */
> mvebu_mbus_add_window(nor, nor_resource.start,
> resource_size(&nor_resource));
>
Not only does this violate encapsulate principles, it breaks the DT
modeling because there is no place in the DT that has the base
address!!
The PCI system allocates and assigns BAR prior to probing the driver -
that is the Linux convention. The mbus driver needs to do the same
thing. The window must be setup prior to calling a child's probe, and
the DT must be correct at that time.
> It really strikes me that in the name of the Device Tree, we would have
> to hardcode in stone things that are inherently dynamic.
What do you mean? The suggestion is to describe all in-DT elements
with a ranges like this:
> ranges =<MAPDEF(1, 0xe0, MAPDEF_NOMASK) 0xFE000000 0x10000
Which directly models the HW MBUS system. The target-id is set in
stone by the SOC, the window size is based on what is described in the
DT - so there is no need for it to be smaller/larger, and the base
address can be run-time altered to the true window base by the mbus
driver.
There is nothing inherently dynamic that is set in stone. The base
address *is not set in stone* - it is just refactored out of the
individual stanzas and placed into a single common place that is easy
to find pragmatically.
This is not about PCI-E - PCI-E continues to use the full dynamic
interface, nothing major changes there.
> Would it be possible to agree that this driver is a first step that
> consolidates the existing address decoding code, which doesn't prevent
> further improvements, and get the driver code merged in this current
> state (of course, after fixing all the bugs, issues, that will be
> discovered during review and testing) ?
I continue to agree with this.
However, I think Ezequiel's driver should be held up pending a
decision if mvebu_mbus_add_window is appropriate for it to call.
Regards,
Jason
next prev parent reply other threads:[~2013-03-07 17:37 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 13:43 [PATCH 3.10] Introduce a Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 01/10] arm: plat-orion: only build addr-map.c when needed Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 02/10] arm: plat-orion: use mv_mbus_dram_info() in PCIe code Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 03/10] arm: mach-orion5x: use mv_mbus_dram_info() in PCI code Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 04/10] bus: introduce an Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 19:08 ` Jason Gunthorpe
2013-03-06 19:27 ` Thomas Petazzoni
2013-03-06 20:24 ` Jason Gunthorpe
2013-03-06 20:40 ` Thomas Petazzoni
2013-03-06 21:50 ` Jason Gunthorpe
2013-03-06 22:27 ` Jason Cooper
2013-03-06 23:04 ` Jason Gunthorpe
2013-03-07 10:39 ` Thomas Petazzoni
2013-03-08 13:50 ` Arnd Bergmann
2013-03-08 14:06 ` Thomas Petazzoni
2013-03-08 15:41 ` Arnd Bergmann
2013-03-08 17:50 ` Jason Gunthorpe
2013-03-08 19:42 ` Arnd Bergmann
2013-03-08 20:05 ` Jason Gunthorpe
2013-03-08 22:46 ` Arnd Bergmann
2013-03-08 17:43 ` Jason Gunthorpe
2013-03-08 22:58 ` Arnd Bergmann
2013-03-07 22:20 ` Ezequiel Garcia
2013-03-07 23:05 ` Jason Gunthorpe
2013-03-08 1:02 ` Ezequiel Garcia
2013-03-08 8:10 ` Thomas Petazzoni
2013-03-08 17:29 ` Jason Gunthorpe
2013-03-08 17:59 ` Ezequiel Garcia
2013-03-08 18:31 ` Jason Gunthorpe
2013-03-08 18:53 ` Ezequiel Garcia
2013-03-18 16:27 ` Thomas Petazzoni
2013-03-18 17:18 ` Jason Gunthorpe
2013-03-08 15:59 ` Maxime Bizon
2013-03-08 16:48 ` Jason Gunthorpe
2013-03-08 17:12 ` Ezequiel Garcia
2013-03-08 8:14 ` Thomas Petazzoni
2013-03-08 18:26 ` Jason Gunthorpe
2013-03-07 3:50 ` Arnd Bergmann
2013-03-07 3:37 ` Arnd Bergmann
2013-03-07 6:35 ` Jason Gunthorpe
2013-03-08 16:48 ` Jason Cooper
2013-03-08 19:47 ` Jason Gunthorpe
2013-03-08 22:54 ` Arnd Bergmann
2013-03-07 10:58 ` Thomas Petazzoni
2013-03-07 17:37 ` Jason Gunthorpe [this message]
2013-03-07 19:11 ` Thomas Petazzoni
2013-03-07 19:55 ` Jason Gunthorpe
2013-03-07 20:28 ` Thomas Petazzoni
2013-03-07 20:47 ` Jason Gunthorpe
2013-03-06 13:43 ` [PATCH 05/10] arm: mach-mvebu: convert to use mvebu-mbus driver Thomas Petazzoni
2013-03-06 13:58 ` Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 06/10] arm: mach-kirkwood: " Thomas Petazzoni
2013-03-06 19:09 ` Jason Gunthorpe
2013-03-06 19:31 ` Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 07/10] arm: mach-dove: " Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 08/10] arm: mach-orion5x: " Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 09/10] arm: mach-mv78xx0: convert to use the " Thomas Petazzoni
2013-03-06 13:43 ` [PATCH 10/10] arm: plat-orion: remove addr-map code Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2013-03-06 16:59 [PATCH v2 for 3.10] Introduce a Marvell EBU MBus driver Thomas Petazzoni
2013-03-06 16:59 ` [PATCH 04/10] bus: introduce an " Thomas Petazzoni
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=20130307173736.GA20840@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.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).