From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 04/10] bus: introduce an Marvell EBU MBus driver
Date: Thu, 7 Mar 2013 11:39:17 +0100 [thread overview]
Message-ID: <20130307113917.0b751a75@skate> (raw)
In-Reply-To: <20130306230412.GA5870@obsidianresearch.com>
Dear Jason Gunthorpe,
On Wed, 6 Mar 2013 16:04:12 -0700, Jason Gunthorpe wrote:
> I'm not sure this is what we are discussing, certainly it isn't what I
> was talking about...
>
> The discussion was around the SOC specific tables in the driver and if
> they should be in DT or C code. These tables very much describe the
> hardware, and are copied from similar tables in the Marvell manuals.
>
> For instance I repeated this idea:
>
> ranges =<MAPDEF(1, 0xe0, MAPDEF_NOMASK) 0xFE000000 0x10000 // boot rom
> MAPDEF(1, 0x3f, MAPDEF_NOMASK) 0xFD000000 0x10000 // devbus-boot
> MAPDEF(1, 0xxx, MAPDEF_NOMASK) 0xFF000000 0x10000 // internal-regs
> [..]
This doesn't work for PCIe interfaces. The PCIe windows cannot be
described in the DT, because they are inherently dynamic, and depend on
which PCIe devices are plugged into the PCIe slots, and how much I/O
and memory space each of those devices require.
This means that regardless of what you think, *some* windows will have
to be created dynamically during the system initialization, and we will
*not* be able to describe all windows in the Device Tree.
And to me, it seems completely stupid to have some windows defined
statically in the Device Tree, and some other windows set up
dynamically when the system initializes.
> At the stanza of MBUS driver's bus. Each line represents a MBUS target
> (this is a physical HW IP block). The MAPDEF is a SOC specific 'target
> id' that is currently living in tables in the driver. This value is
> directly compatible with the mbus window register and is defined by
> Marvell. The 2nd number is the CPU base address of that window, and
> the last is the size.
Please explain how you handle PCIe windows.
> Per OF conventions the base address should be the value the bootloader
> left it at - but that is not important, the value could be 0. A
> dynamic MBUS driver would go through each item in the ranges, find
> an address range and program a window with the MAPDEF from the DT. It
> would then write the base address back into the DT (at runtime!) so
> that the entire DT remains conistent with the current state of the
> hardware.
Why the heck would the kernel need to rewrite the DT ?
Just like a driver does an ioremap() to create a virtual -> physical
mapping, the driver can just as well do mvebu_mbus_add_window() to
create a physical -> device mapping. It doesn't have to be hardcoded
into the Device Tree.
> An initial implementation without dynamic address allocation would
> just have the mbus driver directly use the 2nd value as the base
> address.
>
> The attraction to this model is that the association of later DT
> stanza's to MBUS targets is extremely clear:
>
> nor at 0 {
> compatible = 'linux mtd nor driver';
> regs = <MAPDEF(1, 0xab, MAPDEF_NOMASK) 0x10000>;
> }
>
> We can now tell directly that 'linux mtd nor driver' is behind MBUS
> target 0xab, and the OF code already knows the base for this MBUS
> target from the ranges property, as modified by the MBUS driver. The
> MBUS driver also knows which targets to configure windows for
> immediately at boot without having to consult internal tables. Plus we
> don't need to modify the NOR driver to call out to MBUS window
> functions to fetch an address.
Please take the PCIe example instead. Thanks.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2013-03-07 10:39 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 [this message]
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
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=20130307113917.0b751a75@skate \
--to=thomas.petazzoni@free-electrons.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).