1. 24 Oct, 2013 3 commits
    • Grant Likely's avatar
      of/irq: simplify args to irq_create_of_mapping · e6d30ab1
      Grant Likely authored
      All the callers of irq_create_of_mapping() pass the contents of a struct
      of_phandle_args structure to the function. Since all the callers already
      have an of_phandle_args pointer, why not pass it directly to
      irq_create_of_mapping()?
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Acked-by: default avatarMichal Simek <monstr@monstr.eu>
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      e6d30ab1
    • Grant Likely's avatar
      of/irq: Replace of_irq with of_phandle_args · 530210c7
      Grant Likely authored
      struct of_irq and struct of_phandle_args are exactly the same structure.
      This patch makes the kernel use of_phandle_args everywhere. This in
      itself isn't a big deal, but it makes some follow-on patches simpler.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Acked-by: default avatarMichal Simek <monstr@monstr.eu>
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      530210c7
    • Grant Likely's avatar
      of/irq: Rename of_irq_map_* functions to of_irq_parse_* · 0c02c800
      Grant Likely authored
      The OF irq handling code has been overloading the term 'map' to refer to
      both parsing the data in the device tree and mapping it to the internal
      linux irq system. This is probably because the device tree does have the
      concept of an 'interrupt-map' function for translating interrupt
      references from one node to another, but 'map' is still confusing when
      the primary purpose of some of the functions are to parse the DT data.
      
      This patch renames all the of_irq_map_* functions to of_irq_parse_*
      which makes it clear that there is a difference between the parsing
      phase and the mapping phase. Kernel code can make use of just the
      parsing or just the mapping support as needed by the subsystem.
      
      The patch was generated mechanically with a handful of sed commands.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Acked-by: default avatarMichal Simek <monstr@monstr.eu>
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      0c02c800
  2. 15 Oct, 2013 4 commits
    • Tomasz Figa's avatar
      of/irq: Pass trigger type in IRQ resource flags · 4a43d686
      Tomasz Figa authored
      Some drivers might rely on availability of trigger flags in IRQ
      resource, for example to configure the hardware for particular interrupt
      type. However current code creating IRQ resources from data in device
      tree does not configure trigger flags in resulting resources.
      
      This patch tries to solve the problem, based on the fact that
      irq_of_parse_and_map() configures the trigger based on DT interrupt
      specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
      and we can get correct trigger flags by calling irqd_get_trigger_type()
      after mapping the interrupt.
      Signed-off-by: default avatarTomasz Figa <tomasz.figa@gmail.com>
      [grant.likely: Merged the two assignments to r->flags]
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      4a43d686
    • Grant Likely's avatar
      of: Fix dereferencing node name in debug output to be safe · 8804827b
      Grant Likely authored
      Several locations in the of_address and of_irq code dereference the
      full_name parameter from a device_node pointer without checking if the
      pointer is valid.  This patch switches to use of_node_full_name() which
      always checks the pointer.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      8804827b
    • Grant Likely's avatar
      of: Fix iteration bug over CPU reg properties · f3cea45a
      Grant Likely authored
      The size of each hwid in a cpu nodes 'reg' property is defined by the
      parents #address-cells property in the normal way. The cpu parsing code
      has a bug where it will overrun the end of the property if
      address-cells is greater than one. This commit fixes the problem by
      adjusting the array size by the number of address cells. It also makes
      sure address-cells isn't zero for that would cause an infinite loop.
      
      v2: bail if #address-cells is zero instead of forcing to
          OF_ROOT_NODE_ADDR_CELLS_DEFAULT. Forcing it will cause the reg
          property to be parsed incorrectly.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      f3cea45a
    • David Miller's avatar
      of: Make cpu node handling more portable. · d1cb9d1a
      David Miller authored
      Use for_each_node_by_type() to iterate all cpu nodes in the
      system.
      
      Provide and overridable function arch_find_n_match_cpu_physical_id,
      which sees if the given device node matches 'cpu' and if so sets
      '*thread' when non-NULL to the cpu thread number within the core.
      
      The default implementation behaves the same as the existing code.
      
      Add a sparc64 implementation.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Tested-by: default avatarSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      d1cb9d1a
  3. 14 Oct, 2013 1 commit
    • Grant Likely's avatar
      of: fix unnecessary warning on missing /cpus node · 444c91e5
      Grant Likely authored
      Not all DT platforms have all the cpus collected under a /cpus node.
      That just happens to be a details of FDT, ePAPR and PowerPC platforms.
      Sparc does something different, but unfortunately the current code
      complains with a warning if /cpus isn't there. This became a problem
      with commit f86e4718, "driver/core cpu: initialize of_node in cpu's
      device structure", which caused the function to get called for all
      architectures.
      
      This commit is a temporary fix to fail silently if the cpus node isn't
      present. A proper fix will come later to allow arch code to provide a
      custom mechanism for decoding the CPU hwid if the 'reg' property isn't
      appropriate.
      Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      444c91e5
  4. 13 Oct, 2013 17 commits
  5. 12 Oct, 2013 10 commits
  6. 11 Oct, 2013 5 commits