16 Jan, 2011

1 commit


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.

    Linus Torvalds
     

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

    Grant Likely
     

02 Jan, 2011

1 commit


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

    Stephen Neuendorffer
     
  • Move unflatten_dt_node to be grouped with non-__init functions.

    Signed-off-by: Stephen Neuendorffer
    Signed-off-by: Grant Likely

    Stephen Neuendorffer
     
  • 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

    Stephen Neuendorffer
     
  • 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
    Signed-off-by: Grant Likely

    Stephen Neuendorffer
     
  • 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

    Stephen Neuendorffer
     

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

    David Daney
     
  • 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

    David Daney
     
  • 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

    Sebastian Andrzej Siewior
     

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

    David Daney
     

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

    David Daney
     
  • 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

    Grant Likely
     
  • 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

    Grant Likely
     

13 Oct, 2010

5 commits


11 Oct, 2010

1 commit


09 Oct, 2010

1 commit


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_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

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.

    Grant Likely
     

30 Jul, 2010

2 commits


25 Jul, 2010

3 commits


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 it

    Passing 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

    Jonas Bonn
     
  • 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

    Jonas Bonn
     
  • 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

    Grant Likely
     
  • 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

    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

    Grant Likely
     

19 Jul, 2010

2 commits


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.h

    Signed-off-by: Grant Likely
    Acked-By: Jeremy Kerr
    Acked-by: Benjamin Herrenschmidt

    Grant Likely
     
  • 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

    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

    Andres Salomon