History log of /include/linux/of_fdt.h
Revision Date Author Comments
7b482c8360d368fd495685a2c69ca4f1e7b29764 20-Dec-2011 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> ARM/of: allow *machine_desc.dt_compat to be const

This allows dt_compat to point to a constant list of compatible strings.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
fe55c1844a1c106e9d9d3dd27cbfcf8caeb9e77e 04-Aug-2011 Grant Likely <grant.likely@secretlab.ca> Revert "dt: add of_alias_scan and of_alias_get_id"

This reverts commit 750f463a749e28464151ad26938d11b07b1c43cb.

of_alias_* still needs work to be generalized for 'promtree' dt
platforms, and to no implicitly create entries for available ids.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
750f463a749e28464151ad26938d11b07b1c43cb 03-Aug-2011 Shawn Guo <shawn.guo@linaro.org> dt: add of_alias_scan and of_alias_get_id

The patch adds function of_alias_scan to populate a global lookup
table with the properties of 'aliases' node and function
of_alias_get_id for drivers to find alias id from the lookup table.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[grant.likely: add locking and rework parse loop]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
672c54466d24994eb9633f993862c89539504a42 13-Jan-2011 Grant Likely <grant.likely@secretlab.ca> dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch()

The physical address is never used by the device tree code when
allocating memory for unflattening. Change the architecture's alloc
hook to return the virutal address instead.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
a081748735c5feb96b1365e78a5ff0fb6ca7e3a4 09-Jan-2011 Grant Likely <grant.likely@secretlab.ca> of/flattree: forward declare struct device_node in of_fdt.h

This patch forward declares struct device_node to fix a compile error
when of_fdt.h is included, but of.h is not. Alternately, including
linux/of.h could have been added to of_fdt.h, but that pulls in a lot
of unnecessary declarations when only working with the flattened
form.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
a4f740cf33f7f6c164bbde3c0cdbcc77b0c4997c 30-Oct-2010 Grant Likely <grant.likely@secretlab.ca> of/flattree: Add of_flat_dt_match() helper function

This patch adds of_flat_dt_match() which tests a node for
compatibility with a list of values and converts the relevant powerpc
platform code to use it. This approach simplifies the board support
code a bit.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
fe14042358fac0673d4b6362a73796fd64379938 19-Nov-2010 Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> of/flattree: Refactor unflatten_device_tree and add fdt_unflatten_tree

unflatten_device_tree has two dependencies on things that happen
during boot time. Firstly, it references the initial device tree
directly. Secondly, it allocates memory using the early boot
allocator. This patch factors out these dependencies and uses
the new __unflatten_device_tree function to implement a driver-visible
fdt_unflatten_tree function, which can be used to unflatten a
blob after boot time.

V2:
- remove extra __va() call
- make dt_alloc functions return void *. This doesn't fix the general
strangeness in this code that constantly casts back and forth between
unsigned long and __be32 *

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
9706a36e35c4ce04f28a62cfe1205b4e3b0dd13c 19-Nov-2010 Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> of/flattree: Add non-boottime device tree functions

In preparation for providing run-time handling of device trees, factor
out some of the basic functions so that they take an arbitrary blob,
rather than relying on the single boot-time tree.

V2:
- functions have of_fdt_* names
- removed find_flat_dt_string
- blob argument is first

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
32c97689c46b272302053778f1a6c2facb0e220c 20-Oct-2010 Grant Likely <grant.likely@secretlab.ca> of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch

This patch refactors the early init parsing of the chosen node so that
architectures aren't forced to provide an empty implementation of
early_init_dt_scan_chosen_arch. Instead, if an architecture wants to
do something different, it can either use a wrapper function around
early_init_dt_scan_chosen(), or it can replace it altogether.

This patch was written in preparation to adding device tree support to
both x86 ad MIPS.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: David Daney <ddaney@caviumnetworks.com>
8bfe9b5c3a684fe39eb58a65e466c103d1c32c9a 14-Apr-2010 Grant Likely <grant.likely@secretlab.ca> of/flattree: Make unflatten_device_tree() safe to call from any arch

This patch makes unflatten_device_tree() safe to call from any arch
setup code with the following changes:
- Make sure initial_boot_params actually points to a device tree blob
before unflattening
- Make sure the initial_boot_params->magic field is correct
- If CONFIG_OF_FLATTREE is not set, then make unflatten_device_tree()
an empty static inline function.

This patch also adds some additional debug output to the top of
unflatten_device_tree().

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
cf32eb89cb4e674f88e4af5025839d85d02485c6 14-Apr-2010 Grant Likely <grant.likely@secretlab.ca> of/flattree: make of_fdt.h safe to unconditionally include.

If CONFIG_OF_FLATTREE is not set, then don't process the body of
linux/of_fdt.h

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
4ef7b373df330bc0ff037dc4792d373c9346375f 14-Feb-2010 Jeremy Kerr <jeremy.kerr@canonical.com> of/flattree: Don't assume HAVE_LMB

We don't always have lmb available, so make arches provide an
early_init_dt_alloc_memory_arch() to handle the allocation of
memory in the fdt code.

When we don't have lmb.h included, we need asm/page.h for __va.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Michal Simek <monstr@monstr.eu>
21b082ecdd7e6b8a5eba2cc013cae41b24de7f51 14-Feb-2010 Grant Likely <grant.likely@secretlab.ca> of: Remove old and misplaced function declarations

The following functions don't exist:
finish_device_tree()
print_properties()
prom_n_intr_cells()
prom_get_irq_senses()

The following functions are in drivers/of/base.c, so the declaration
belongs in of.h instead of of_fdt.h
of_machine_is_compatible()
prom_add_property()
prom_remove_property()
prom_update_property()

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Michal Simek <monstr@monstr.eu>
087f79c48c090a2c0cd9ee45231d63290d2036d2 30-Jan-2010 Jeremy Kerr <jeremy.kerr@canonical.com> of/flattree: endian-convert members of boot_param_header

The boot_param_header has big-endian fields, so change the types to
__be32, and perform endian conversion when we access them.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2e89e685a8fd0e8334de967739d11e2e28c1a4dd 30-Jan-2010 Jeremy Kerr <jeremy.kerr@canonical.com> of: use __be32 for cell value accessors

Currently, we're using u32 for cell values, and hence assuming
host-endian device trees.

As we'd like to support little-endian platforms, use a __be32 for cell
values, and convert in the cell accessors.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
1406bc2f57787797d1f6a3675c019a7093769275 30-Jan-2010 Jeremy Kerr <jeremy.kerr@canonical.com> of/flattree: use callback to setup initrd from /chosen

At present, the fdt code sets the kernel-wide initrd_start and
initrd_end variables when parsing /chosen. On ARM, we only set these
once the bootmem has been reserved.

This change adds an arch hook to setup the initrd from the device
tree:

void early_init_dt_setup_initrd_arch(unsigned long start,
unsigned long end);

The arch-specific code can then setup the initrd however it likes.

Compiled on powerpc, with CONFIG_BLK_DEV_INITRD=y and =n.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
51975db0b7333cf389b64b5040c2a910341d241a 02-Feb-2010 Grant Likely <grant.likely@secretlab.ca> of/flattree: merge early_init_dt_scan_memory() common code

Merge common code between PowerPC and Microblaze architectures.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Michal Simek <monstr@monstr.eu>
71a157e8edca55198e808f8561dd49017a54ee34 02-Feb-2010 Grant Likely <grant.likely@secretlab.ca> of: add 'of_' prefix to machine_is_compatible()

machine is compatible is an OF-specific call. It should have
the of_ prefix to protect the global namespace.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Michal Simek <monstr@monstr.eu>
86e032213424958b45564d0cc96b3316641a49d3 11-Dec-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: merge early_init_dt_scan_chosen()

Merge common code between PowerPC and Microblaze. This patch
splits the arch-specific stuff out into a new function,
early_init_dt_scan_chosen_arch().

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
83f7a06eb479e2aeb83536e77a2cb14cc2285e32 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: merge dt_mem_next_cell

Merge common code between PowerPC and Microblaze

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
f00abd94918c9780f9d2d961fc0e419c11457922 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: Merge earlyinit_dt_scan_root()

Merge common code between PowerPC and Microblaze

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
f7b3a8355ba6cad251297844a0bdd08898ea36e0 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: Merge early_init_dt_check_for_initrd()

Merge common code between PowerPC and Microblaze

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
41f880091c15b039ffcc8b3d831656b81517a6d3 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: Merge unflatten_device_tree

Merge common code between PowerPC and MicroBlaze

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
bbd33931a08362f78266a4016211a35947b91041 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: Merge unflatten_dt_node

Merge common code between PowerPC and MicroBlaze

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
31a6a87dfc34fbf02aef9a160adf558ec56d3ccd 24-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: remove __init annotations from the header file

__init annotation belongs in the .c file, not the header.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
e169cfbef46d62e042614ffafa8880eed1d894bb 23-Nov-2009 Grant Likely <grant.likely@secretlab.ca> of/flattree: merge find_flat_dt_string and initial_boot_params

Merge common code between Microblaze and PowerPC.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Tested-by: Michal Simek <monstr@monstr.eu>
82b2928c95d824afd9af3bb41660f3c3fa1f234e 15-Oct-2009 Grant Likely <grant.likely@secretlab.ca> of: merge other miscellaneous prototypes

Merge common prototypes used by Microblaze and PowerPC

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
8482f56803b9498af84bc09e7bc769a5924f6443 15-Oct-2009 Grant Likely <grant.likely@secretlab.ca> of: merge of_*_flat_dt*() functions

Merge common flattened device tree code between Microblaze and PowerPC

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
d45d94f672e3c79b0db1e6d76e1638ee521d56c0 15-Oct-2009 Grant Likely <grant.likely@secretlab.ca> of: merge struct boot_param_header from Microblaze and PowerPC

Merge common code for working with Flattened Device Tree data structure

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
d8678b58708d7e6bf947ebd03eaf44baf2adfad8 15-Oct-2009 Grant Likely <grant.likely@secretlab.ca> of: add common header for flattened device tree representation

Add a common header file for working with the flattened device tree
data structure and merge the shared data tags used by Microblaze and
PowerPC

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>