16 Jan, 2011
1 commit
-
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
11 Jan, 2011
1 commit
-
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (29 commits)
of/flattree: forward declare struct device_node in of_fdt.h
ipmi: explicitly include of_address.h and of_irq.h
sparc: explicitly cast negative phandle checks to s32
powerpc/405: Fix missing #{address,size}-cells in i2c node
powerpc/5200: dts: refactor dts files
powerpc/5200: dts: Change combatible strings on localbus
powerpc/5200: dts: remove unused properties
powerpc/5200: dts: rename nodes to prepare for refactoring dts files
of/flattree: Update dtc to current mainline.
of/device: Don't register disabled devices
powerpc/dts: fix syntax bugs in bluestone.dts
of: Fixes for OF probing on little endian systems
of: make drivers depend on CONFIG_OF instead of CONFIG_PPC_OF
of/flattree: Add of_flat_dt_match() helper function
of_serial: explicitly include of_irq.h
of/flattree: Refactor unflatten_device_tree and add fdt_unflatten_tree
of/flattree: Reorder unflatten_dt_node
of/flattree: Refactor unflatten_dt_node
of/flattree: Add non-boottime device tree functions
of/flattree: Add Kconfig for EARLY_FLATTREE
...Fix up trivial conflict in arch/sparc/prom/tree_32.c as per Grant.
04 Jan, 2011
1 commit
-
Device nodes with the property status="disabled" are not usable and so
don't register them when parsing the device tree for devices.Signed-off-by: Grant Likely
Cc: Hollis Blanchard
Cc: Deepak Saxena
Cc: Scott Wood ,
Cc: David Gibson
Cc: Benjamin Herrenschmidt
02 Jan, 2011
1 commit
-
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
Reviewed-by: Stephen Neuendorffer
30 Dec, 2010
5 commits
-
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
Signed-off-by: Grant Likely -
Move unflatten_dt_node to be grouped with non-__init functions.
Signed-off-by: Stephen Neuendorffer
Signed-off-by: Grant Likely -
unflatten_dt_node is a helper function that does most of the work to
convert a device tree blob into tree of device nodes. This code
now uses a passed-in blob instead of using the single boot-time blob,
allowing it to be called in more contexts.Signed-off-by: Stephen Neuendorffer
Signed-off-by: Grant Likely -
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 firstSigned-off-by: Stephen Neuendorffer
Signed-off-by: Grant Likely -
The device tree code is now in two pieces: some which can be used generically
on any platform which selects CONFIG_OF_FLATTREE, and some early which is used
at boot time on only a few architectures. This patch segregates the early
code so that only those architectures which care about it need compile it.
This also means that some of the requirements in the early code (such as
a cmd_line variable) that most architectures (e.g. X86) don't provide
can be ignored.Signed-off-by: Stephen Neuendorffer
[grant.likely@secretlab.ca: remove extra blank line addition]
[grant.likely@secretlab.ca: fixed incorrect #ifdef CONFIG_EARLY_FLATTREE check]
[grant.likely@secretlab.ca: Made OF_EARLY_FLATTREE select instead of depend
on OF_FLATTREE]
Signed-off-by: Grant Likely
24 Dec, 2010
3 commits
-
If we are registering an i2c device that has a device tree node like
this real-world example:rtc@68 {
compatible = "dallas,ds1337";
reg = ;
};of_i2c_register_devices() will try to load a module called ds1337.ko.
There is no such module, so it will fail. If we look in modules.alias
we will find entries like these:.
.
.
alias i2c:ds1339 rtc_ds1307
alias i2c:ds1338 rtc_ds1307
alias i2c:ds1337 rtc_ds1307
alias i2c:ds1307 rtc_ds1307
alias i2c:ds1374 rtc_ds1374
.
.
.The module we want is really called rtc_ds1307.ko. If we request a
module called "i2c:ds1337", the userspace module loader will do the
right thing (unless it is busybox) and load rtc_ds1307.ko. So we add
the I2C_MODULE_PREFIX to the request_module() string.Signed-off-by: David Daney
Signed-off-by: Grant Likely -
In of_mdiobus_register(), the __be32 *addr variable is dereferenced.
This will not work on little-endian targets. Also since it is
unsigned, checking for less than zero is redundant.Fix these two issues.
Signed-off-by: David Daney
[grant.likely@secretlab.ca: removed goto]
Signed-off-by: Grant Likely -
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
Acked-by: Benjamin Herrenschmidt
Signed-off-by: Grant Likely
01 Nov, 2010
1 commit
-
There are two identical implementations of of_get_mac_address(), one
each in arch/powerpc/kernel/prom_parse.c and
arch/microblaze/kernel/prom_parse.c. Move this function to a new
common file of_net.{c,h} and adjust all the callers to include the new
header.Signed-off-by: David Daney
[grant.likely@secretlab.ca: protect header with #ifdef]
Signed-off-by: Grant Likely
22 Oct, 2010
3 commits
-
The __init directives should go on the definitions of things, not the
declaration, also __init is meaningless for inline functions, so
remove it from prom.h. This allows us to get rid of a useless
#include, but most of the rest of them are useless too, so kill them
as well.If of_i2c.c needs irq definitions, it should include linux/irq.h
directly, not assume indirect inclusion via asm/prom.h.Signed-off-by: David Daney
Acked-by: Ralf Baechle
Signed-off-by: Grant Likely -
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
Tested-by: David Daney -
The current code allocates and manages platform_devices created from
the device tree manually. It also uses an unsafe shortcut for
allocating the platform_device and the resource table at the same
time. (which I added in the last rework; sorry).This patch refactors the code to use platform_device_alloc() for
allocating new devices. This reduces the amount of custom code
implemented by of_platform, eliminates the unsafe alloc trick, and has
the side benefit of letting the platform_bus code manage freeing the
device data and resources when the device is freed.Signed-off-by: Grant Likely
Cc: Benjamin Herrenschmidt
Cc: Greg Kroah-Hartman
Cc: "David S. Miller"
Cc: Michal Simek
13 Oct, 2010
5 commits
-
Use the sparse annotations so we can keep track of endianness.
Signed-off-by: Jeremy Kerr
Signed-off-by: Grant Likely -
Instead of referencing NO_IRQ in platform.c, define some helper functions
in irq.c to call instead from platform.c. Keep NO_IRQ usage local to
irq.c, and define NO_IRQ if not defined in headers.Signed-off-by: Andres Salomon
Signed-off-by: Grant Likely -
package-to-path is a PROM function which tells us the real (full) name of the
node. This provides a hook for that in the prom ops struct, and makes use
of it in the pdt code when attempting to determine a node's name. If the
hook is available, try using it (falling back to looking at the "name"
property if it fails).Signed-off-by: Andres Salomon
Signed-off-by: Grant Likely -
For symbols still lacking namespace qualifiers, add an of_pdt_ prefix.
Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely -
Rather than assuming an architecture defines prom_getchild and friends,
define an ops struct with hooks for the various prom functions that
pdt.c needs. This ops struct is filled in by the
arch-(and sometimes firmware-)specific code, and passed to
of_pdt_build_devicetree.Update sparc code to define the ops struct as well.
Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely
11 Oct, 2010
1 commit
-
Clean up pdt.c:
- make build dependent upon config OF_PROMTREE
- #ifdef out the sparc-specific stuff
- create pdt-specific headerSigned-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely
09 Oct, 2010
1 commit
-
Transitioning into making this useful for architectures other than sparc.
This is a verbatim copy of all functions/variables that've been moved.Signed-off-by: Andres Salomon
Acked-by: David S. Miller
Signed-off-by: Grant Likely
06 Aug, 2010
1 commit
-
of_device is just an alias for platform_device, so remove it entirely. Also
replace to_of_device() with to_platform_device() and update comment blocks.This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.@@
@@
-struct of_device
+struct platform_deviceSigned-off-by: Grant Likely
Reviewed-by: David S. Miller
01 Aug, 2010
1 commit
-
Currently there are some drivers in tree which register both a
platform_driver and an of_platform_driver with the same name. This is
a temporary situation until all the relevant of_platform_drivers are
converted to be normal platform_drivers. Until then, this patch gives
all the of_platform_drivers an "of:" prefix to protect against bogus
matches and namespace conflicts.
30 Jul, 2010
2 commits
-
Move of_register_spi_devices() call from drivers to
spi_register_master(). Also change the function to use
the struct device_node pointer from master spi device
instead of passing it as function argument.Signed-off-by: Anatolij Gustschin
Signed-off-by: Grant Likely -
The AMBA bus should also use of_device_make_bus_id() when populating device
out of device tree data. This patch makes the function non-static, and
adds a suitable prototype in of_device.hSigned-off-by: Grant Likely
25 Jul, 2010
3 commits
-
This patch fixes some instances where interrupt specifiers are
dereferenced directly instead of doing a be32_to_cpu() conversion first.Signed-off-by: Grant Likely
-
The flat tree code wasn't fixing the endianness on phandle values when
unflattening the tree, and the code in drivers/of wasn't always doing a
be32_to_cpu before trying to dereference the phandle values. This patch
fixes them.Signed-off-by: Grant Likely
-
With the current string comparison, a device tree compatible of "foo-bar"
would match as compatible with a driver looking for "foo". This patch
fixes the function to use the of_compat_cmp() macro so that it does the
right thing on all platforms (If sparc ever uses this code, it will still
want the strncasecmp() behaviour).Signed-off-by: Stuart Yoder
Signed-off-by: Grant Likely
24 Jul, 2010
5 commits
-
This list used was by only two platforms with all other platforms defining an
own list of valid bus id's to pass to of_platform_bus_probe. This patch:i) copies the default list to the two platforms that depended on it (powerpc)
ii) remove the usage of of_default_bus_ids in of_platform_bus_probe
iii) removes the definition of the list from all architectures that defined itPassing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the
function returns no error in that case as the NULL value is equivalent to an
empty list.Signed-off-by: Jonas Bonn
[grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors]
Signed-off-by: Grant Likely -
There's no need for this function to be architecture specific and all four
architectures defining it had the same definition. The function has been
moved to drivers/of/platform.c.Signed-off-by: Jonas Bonn
[grant.likely@secretlab.ca: moved to drivers/of/platform.c, simplified code, and added kerneldoc comment]
Signed-off-by: Grant Likely
Acked-by: David S. Miller -
of_device is currently just an #define alias to platform_device until it
gets removed entirely. This patch removes references to it from the
include directories and the core drivers/of code.Signed-off-by: Grant Likely
Acked-by: David S. Miller -
There is an unlikely chance of this situation is occurring, but it is
easy to protect against. If a matching entry cannot be found in the
of_match_table, then don't bind the driver.Signed-off-by: Grant Likely
-
of_platform_bus was being used in the same manner as the platform_bus.
The only difference being that of_platform_bus devices are generated
from data in the device tree, and platform_bus devices are usually
statically allocated in platform code. Having them separate causes
the problem of device drivers having to be registered twice if it
was possible for the same device to appear on either bus.This patch removes of_platform_bus_type and registers all of_platform
bus devices and drivers on the platform bus instead. A previous patch
made the of_device structure an alias for the platform_device structure,
and a shim is used to adapt of_platform_drivers to the platform bus.After all of of_platform_bus drivers are converted to be normal platform
drivers, the shim code can be removed.Signed-off-by: Grant Likely
Acked-by: David S. Miller
19 Jul, 2010
2 commits
-
Only powerpc and microblaze supply (struct device *)->archdata.dma_mask.
This patch stops referencing it on other architectures.Signed-off-by: Grant Likely
-
This patch fixes the condition where device tree support is compiled
in, but no device tree was proved by firmware. It makes
of_platform_bus_probe() explicitly check for a NULL device tree
pointer.Signed-off-by: Grant Likely
15 Jul, 2010
2 commits
-
There's no reason to use the powerpc-specific _ALIGN macro in the fdt
code. Replace it with ALIGN() from kernel.hSigned-off-by: Grant Likely
Acked-By: Jeremy Kerr
Acked-by: Benjamin Herrenschmidt -
Commit 94c0931983ee9d1cd96c32d52ac64c17464f0bbd (of:
Merge of_device_alloc() and of_device_make_bus_id()) moved code that
does calls a dcr routine without including the correct header which
causes the following build error on some powerpc configurations:drivers/of/platform.c: In function 'of_device_make_bus_id':
drivers/of/platform.c:437: error: implicit declaration of function 'of_translate_dcr_address'This patch adds the appropriate header to drivers/of/platform.c
Signed-off-by: Grant Likely
06 Jul, 2010
1 commit
-
Microblaze and PPC both use PROC_DEVICETREE, and OLPC will as well.. put
the Kconfig option into fs/ rather than in arch/*/Kconfig.Signed-off-by: Andres Salomon
[grant.likely@secretlab.ca: changed depends to PROC_FS && !SPARC]
[grant.likely@secretlab.ca: moved to drivers/of/Kconfig]
Signed-off-by: Grant Likely