1. 21 1月, 2015 1 次提交
  2. 18 1月, 2015 1 次提交
    • M
      ARM: OMAP: Work around hardcoded interrupts · 0fb22a8f
      Marc Zyngier 提交于
      Commit 9a1091ef ("irqchip: gic: Support hierarchy irq domain")
      changed the GIC driver to use a non-legacy IRQ domain on DT
      platforms. This patch assumes that DT-driven systems are getting
      all of their interrupts from device tree.
      
      Turns out that OMAP has quite a few hidden gems, and still uses
      hardcoded interrupts despite having fairly complete DTs.
      
      This patch attempts to work around these by offering a translation
      method that can be called directly from the hwmod code, if present.
      The same hack is sprinkled over PRCM and TWL.
      
      It isn't pretty, but it seems to do the job without having to add
      more hacks to the interrupt controller code.
      
      Tested on OMAP4 (Panda-ES) and OMAP5 (UEVM5432).
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NNishanth Menon <nm@ti.com>
      [tony@atomide.com: updated to fix make randconfig issue]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      0fb22a8f
  3. 20 11月, 2014 1 次提交
  4. 14 11月, 2014 1 次提交
    • F
      ARM: OMAP2+: hwmod: drop unnecessary list initialization · 79005fbd
      Felipe Balbi 提交于
      ml->node and sl->node are currently initialized
      by means of INIT_LIST_HEAD(). That initialiation
      is followed by a list_add() call.
      
      Looking at what both these functions do we will have:
      
      	ml->node.next = &ml->node;
      	ml->node.prev = &ml->node;
      	oi->master->master_ports.next.prev = &ml->node;
      	ml->node.next = &oi->master->master_ports.next;
      	ml->node.prev = &oi->master->master_ports;
      	oi->master->master_ports.next = &ml->node;
      
      from this, it's clear that both INIT_LIST_HEAD() calls
      are unnecessary and can be safely removed.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      79005fbd
  5. 27 10月, 2014 12 次提交
  6. 19 9月, 2014 1 次提交
  7. 18 9月, 2014 1 次提交
  8. 17 9月, 2014 1 次提交
    • T
      ARM: OMAP3: Fix I/O chain clock line assertion timed out error · 7db143b8
      Tony Lindgren 提交于
      We are getting "PRM: I/O chain clock line assertion timed out" errors
      on early omaps for device tree based booting. This is because we are
      unconditionally calling reconfigure_io_chain while legacy booting
      has omap3_has_io_chain_ctrl() checks in place in omap_hwmod.c.
      
      For device tree based booting, we are calling reconfigure_io_chain
      unconditionally from pinctrl framework. So we need to add a check for
      omap3_has_io_chain_ctrl() to avoid the errors for trying to access
      a register that does not exist.
      
      For es3.0, the documentation in "4.11.2 Device Off-Mode Configuration"
      just mentions PM_WKEN_WKUP[8] bit. For es3.1, there's a new chapter in
      documentation for "4.11.2.2 I/O Wake-Up Mechanism" that describes the
      PM_WKEN_WKUP[16] ST_IO_CHAIN bit. So PM_WKEN_WKUP[16] bit did not get
      added until in es3.1 probaly to fix issues with flakey wake-up events.
      
      We are doing proper checks for ST_IO_CHAIN already in id.c and with
      omap3_has_io_chain_ctrl(). For more information, see also commit
      b02b9172 ("ARM: OMAP3: PM: fix I/O wakeup and I/O chain clock
      control detection").
      
      Let's fix the issue by selecting the right function during init for
      reconfigure_io_chain depending on the omap revision. For es3.0 and
      earlier we need to just toggle EN_IO. By doing this, we can move the
      check for omap3_has_io_chain_ctrl() from omap_hwmod.c to the init code
      in prm_3xxx.c. And then we can unconditionally call reconfigure_io_chain.
      
      Thanks to Paul Walmsley and Nishanth Menon for help with debugging the
      issue.
      
      Fixes: 30a69ef7 ("ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap")
      Cc: Kevin Hilman <khilman@kernel.org>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Reviewed-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      7db143b8
  9. 28 8月, 2014 1 次提交
  10. 26 8月, 2014 1 次提交
    • T
      ARM: OMAP2+: hwmod: Rearm wake-up interrupts for DT when MUSB is idled · cc824534
      Tony Lindgren 提交于
      Looks like MUSB cable removal can cause wake-up interrupts to
      stop working for device tree based booting at least for UART3
      even as nothing is dynamically remuxed. This can be fixed by
      calling reconfigure_io_chain() for device tree based booting
      in hwmod code. Note that we already do that for legacy booting
      if the legacy mux is configured.
      
      My guess is that this is related to UART3 and MUSB ULPI
      hsusb0_data0 and hsusb0_data1 support for Carkit mode that
      somehow affect the configured IO chain for UART3 and require
      rearming the wake-up interrupts.
      
      In general, for device tree based booting, pinctrl-single
      calls the rearm hook that in turn calls reconfigure_io_chain
      so calling reconfigure_io_chain should not be needed from the
      hwmod code for other events.
      
      So let's limit the hwmod rearming of iochain only to
      HWMOD_FORCE_MSTANDBY where MUSB is currently the only user
      of it. If we see other devices needing similar changes we can
      add more checks for it.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: stable@vger.kernel.org # v3.16
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      cc824534
  11. 16 6月, 2014 1 次提交
  12. 08 5月, 2014 1 次提交
  13. 12 4月, 2014 1 次提交
  14. 20 2月, 2014 1 次提交
  15. 22 1月, 2014 1 次提交
    • S
      arch/arm/mach-omap2/omap_hwmod.c: use memblock apis for early memory allocations · b6cb5bab
      Santosh Shilimkar 提交于
      Switch to memblock interfaces for early memory allocator instead of
      bootmem allocator.  No functional change in beahvior than what it is in
      current code from bootmem users points of view.
      
      Archs already converted to NO_BOOTMEM now directly use memblock
      interfaces instead of bootmem wrappers build on top of memblock.  And
      the archs which still uses bootmem, these new apis just fallback to
      exiting bootmem APIs.
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b6cb5bab
  16. 18 1月, 2014 2 次提交
  17. 10 12月, 2013 2 次提交
    • N
      ARM: OMAP2+: hwmod: Fix usage of invalid iclk / oclk when clock node is not present · 0e7dc862
      Nishanth Menon 提交于
      commit dc75925d(OMAP: hwmod: Fix the missing braces) introduced
      missing braces, however, we just set return result if clk_get fail
      and we populate the error pointer in clk pointer and pass it along to
      clk_prepare. This is wrong. The intent seems to be retry remaining
      clocks if they are available and warn the ones we cant find clks for.
      
      With the current logic, we see the following crash:
      omap_hwmod: l3_main: cannot clk_get interface_clk emac_ick
      Unable to handle kernel NULL pointer dereference at virtual address 00000032
      pgd = c0004000
      [00000032] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-rc1-00044-gcc9fd5a-dirty #19
      task: ce0c3440 ti: ce0c4000 task.ti: ce0c4000
      PC is at __clk_prepare+0x10/0x74
      LR is at clk_prepare+0x14/0x24
        <snip>
      [<c044d59c>] (__clk_prepare+0x10/0x74) from [<c044d9b0>] (clk_prepare+0x14/0x24)
      [<c044d9b0>] (clk_prepare+0x14/0x24) from [<c077d8c4>] (_init+0x24c/0x3bc)
      [<c077d8c4>] (_init+0x24c/0x3bc) from [<c0027328>] (omap_hwmod_for_each+0x34/0x5c)
      [<c0027328>] (omap_hwmod_for_each+0x34/0x5c) from [<c077dfa0>] (__omap_hwmod_setup_all+0x24/0x40)
      [<c077dfa0>] (__omap_hwmod_setup_all+0x24/0x40) from [<c0008928>] (do_one_initcall+0x38/0x168)
      [<c0008928>] (do_one_initcall+0x38/0x168) from [<c0771be8>] (kernel_init_freeable+0xfc/0x1cc)
      [<c0771be8>] (kernel_init_freeable+0xfc/0x1cc) from [<c0521064>] (kernel_init+0x8/0x110)
      [<c0521064>] (kernel_init+0x8/0x110) from [<c000e568>] (ret_from_fork+0x14/0x2c)
      Code: e92d4038 e2504000 01a05004 0a000005 (e5943034)
      
      So, just warn and continue instead of proceeding and crashing, with
      missing clock nodes/bad data, we will eventually fail, however we
      should now have enough information to identify the culprit.
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      0e7dc862
    • R
      ARM: OMAP2+: hwmod: Fix SOFTRESET logic · 313a76ee
      Roger Quadros 提交于
      In _ocp_softreset(), after _set_softreset() + write_sysconfig(),
      the hwmod's sysc_cache will always contain SOFTRESET bit set
      so all further writes to sysconfig using this cache will initiate
      a repeated SOFTRESET e.g. enable_sysc(). This is true for OMAP3 like
      platforms that have RESET_DONE status in the SYSSTATUS register and
      so the the SOFTRESET bit in SYSCONFIG is not automatically cleared.
      It is not a problem for OMAP4 like platforms that indicate RESET
      completion by clearing the SOFTRESET bit in the SYSCONFIG register.
      
      This repeated SOFTRESET is undesired and was the root cause of
      USB host issues on OMAP3 platforms when hwmod was allowed to do the
      SOFTRESET for the USB Host module.
      
      To fix this we clear the SOFTRESET bit and update the sysconfig
      register + sysc_cache using write_sysconfig().
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Tested-by: Tomi Valkeinen <tomi.valkeinen@ti.com> # Panda, BeagleXM
      [paul@pwsan.com: renamed _clr_softreset() to _clear_softreset()]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      313a76ee
  18. 07 12月, 2013 1 次提交
    • T
      ARM: OMAP2+: Fix overwriting hwmod data with data from device tree · 5e863c56
      Tony Lindgren 提交于
      We have some device tree properties where the ti,hwmod have multiple
      values:
      
      am33xx.dtsi:	ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
      am4372.dtsi:	ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
      dra7.dtsi:	ti,hwmods = "l3_main_1", "l3_main_2";
      omap3.dtsi:	ti,hwmods = "mcbsp2", "mcbsp2_sidetone";
      omap3.dtsi:	ti,hwmods = "mcbsp3", "mcbsp3_sidetone";
      omap4.dtsi:	ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
      omap5.dtsi:	ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
      
      That's not correct way of doing things in this case because these are
      separate devices with their own address space, interrupts, SYSCONFIG
      registers and can set their PM states independently.
      
      So they should all be fixed up to be separate devices in the .dts files.
      
      We also have the related data removed for at least omap4 in commit
      3b9b1015 (ARM: OMAP4: hwmod data: Clean up the data file), so
      that data is wrongly initialized as null data.
      
      So we need to fix two bugs:
      
      1. We are only checking the first entry of the ti,hwmods property
      
         This means that we're only initializing the first hwmods entry
         instead of the ones listed in the ti,hwmods property.
      
      2. We are only checking the child nodes, not the nodes themselves
      
         This means that anything listed at OCP level is currently just
         ignored and unitialized and at least the omap4 case, with the
         legacy data missing from the hwmod.
      
      Fix both of the issues by using an index to the ti,hwmods property
      and changing the hwmod lookup function to also check the current node
      for ti,hwmods property instead of just the children.
      
      While at it, let's also add some warnings for the bad data so it's
      easier to fix.
      
      Cc: "Benoît Cousson" <bcousson@baylibre.com>
      Acked-by: NPaul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      5e863c56
  19. 14 10月, 2013 1 次提交
  20. 09 10月, 2013 2 次提交
    • R
      ARM: OMAP2+: hwmod: Extract no-idle and no-reset info from DT · f92d9597
      Rajendra Nayak 提交于
      Now that we have DT bindings to specify which devices should not
      be reset and idled during init, make hwmod extract the information
      (and store them in internal flags) from Device tree.
      Signed-off-by: NRajendra Nayak <rnayak@ti.com>
      [paul@pwsan.com: updated to apply]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      f92d9597
    • S
      ARM: OMAP2+: hwmod: check for module address space during init · 6423d6df
      Suman Anna 提交于
      The hwmod init sequence involves initializing and idling all the
      hwmods during bootup. If a module class has sysconfig, the init
      sequence utilizes the module register base for performing any
      sysc configuration.
      
      The module address space is being removed from hwmod database and
      retrieved from the <reg> property of the corresponding DT node.
      If a hwmod does not have its corresponding DT node defined and the
      memory address space is not defined in the corresponding
      omap_hwmod_ocp_if, then the module register target address space
      would be NULL and any sysc programming would result in a NULL
      pointer dereference and a kernel boot hang.
      
      Handle this scenario by checking for a valid module address space
      during the _init of each hwmod, and leaving it in the registered
      state if no module register address base is defined in either of
      the hwmod data or the DT data.
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Tested-by: NNishanth Menon <nm@ti.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      [paul@pwsan.com: use -ENXIO rather than -ENOMEM to indicate a missing address
       space error; fixed checkpatch.pl problem]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      6423d6df
  21. 23 8月, 2013 1 次提交
    • J
      ARM: OMAP2+: Only write the sysconfig on idle when necessary · 127500cc
      Jon Hunter 提交于
      Currently, whenever we idle a device _idle_sysc() is called and writes to the
      devices SYSCONFIG register to set the idle mode. A lot devices are using the
      smart-idle mode and so the write to the SYSCONFIG register is programming the
      same value that is already stored in the register.
      
      Writes to the devices SYSCONFIG register can be slow, for example, writing to
      the DMTIMER SYSCONFIG register takes 3 interface clock cycles and 3 functional
      clock cycles. If the DMTIMER is using the slow 32kHz functional clock this can
      take ~100us.
      
      Furthermore, during boot on an OMAP4430 panda board, I see that there are 100
      calls to _idle_sysc(), however, only 3 out of the 100 calls actually write
      the SYSCONFIG register with a new value.
      
      Therefore, to avoid unnecessary writes to device SYSCONFIG registers when
      idling the device, only write the value if the value has changed. It should be
      safe to do this on idle as the context of the register will never be lost while
      the device is active.
      
      Verified that suspend, CORE off and retention states are working with this
      change on OMAP3430 Beagle board.
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      [paul@pwsan.com: updated to apply]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      127500cc
  22. 13 8月, 2013 1 次提交
  23. 30 7月, 2013 1 次提交
    • A
      ARM: OMAP2+: hwmod: rt address space index for DT · 130142d9
      Afzal Mohammed 提交于
      Address space is being removed from hwmod database and DT information
      in <reg> property is being used. Currently the 0th index of device
      address space is used to map for register target address. This is not
      always true, eg. cpgmac has it's sysconfig in second address space.
      
      Handle it by specifying index of device address space to be used for
      register target. As default value of this field would be zero with
      static initialization, existing behaviour of using first address space
      for register target while using DT would be kept as such.
      Signed-off-by: NAfzal Mohammed <afzal@ti.com>
      Tested-by: NMugunthan V N <mugunthanvnm@ti.com>
      [paul@pwsan.com: use u8 rather than int to save memory]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      130142d9
  24. 20 5月, 2013 3 次提交