aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/address.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-01-04of/address: Add reg-names property to name an iomem resourceBenoit Cousson1-5/+11
Add a reg-names property to allow for reg regions to be reference by name instead of by index. Some devices have multiple register regions which are more naturally referenced by name. If the name is available, use it to name the resource when creating a devices. Otherwise keep the device name. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> [Generalized documentation to be for any -names property] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-08-01of: address: use resource_size helperFelipe Balbi1-1/+1
that should be the approved way of calculating the size of resources. No functional changes. Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-07-18of/address: Add of_find_matching_node_by_address helperGrant Likely1-0/+18
of_find_matching_node_by_address() can be used to find a device tree node for a device at a specific address. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-12-23of/address: use proper endianess in get_flagsSebastian Andrzej Siewior1-26/+28
This patch changes u32 to __be32 for all "ranges", "prop" and "addr" and such. Those variables are pointing to the device tree which contains integers in big endian format. Most functions are doing it right because of_read_number() is doing the right thing for them. of_bus_isa_get_flags(), of_bus_pci_get_flags() and of_bus_isa_map() were accessing the data directly and were doing it wrong. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-10-12of: use __be32 types for big-endian device tree dataJeremy Kerr1-1/+1
Use the sparse annotations so we can keep track of endianness. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-07-05of: Use full node name in resource structuresGrant Likely1-1/+1
Resource names appear in human readable output, so when extracting IRQ and address resources from a device tree node, use the full node name to give proper context in places like /proc/iomem. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: microblaze-uclinux@itee.uq.edu.au CC: linuxppc-dev@ozlabs.org
2010-07-05of/address: restrict 'no-ranges' kludge to powerpcGrant Likely1-1/+10
Certain Apple machines don't use the ranges property correctly, but the workaround should not be applied on other architectures. This patch disables the workaround for non-powerpc architectures. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Stephen Rothwell <sfr@canb.auug.org.au>
2010-07-05of/address: little-endian fixesGrant Likely1-5/+7
Fix some endian issues in the OF address translation code. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au>
2010-07-05of/address: Merge all of the bus translation codeGrant Likely1-3/+514
Microblaze and PowerPC share a large chunk of code for translating OF device tree data into usable addresses. Differences between the two consist of cosmetic differences, and the addition of dma-ranges support code to powerpc but not microblaze. This patch moves the powerpc version into common code and applies many of the cosmetic (non-functional) changes from the microblaze version. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Wolfram Sang <w.sang@pengutronix.de> CC: Stephen Rothwell <sfr@canb.auug.org.au>
2010-07-05of/address: merge of_address_to_resource()Grant Likely1-0/+51
Merge common code between PowerPC and Microblaze. This patch also moves the prototype of pci_address_to_pio() out of pci-bridge.h and into prom.h because the only user of pci_address_to_pio() is of_address_to_resource(). Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au>
2010-07-05of/address: merge of_iomap()Grant Likely1-0/+22
Merge common code between Microblaze and PowerPC. This patch creates new of_address.h and address.c files to containing address translation and mapping routines. First routine to be moved it of_iomap() Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au>