1. 09 Apr, 2019 2 commits
    • Tony Lindgren's avatar
      ARM: dts: Add common mcpdm dts file for omap4 · ed01ffd9
      Tony Lindgren authored
      The mcpdm module found on omap4 and 5 needs pdmclk clock from
      the pmic that may or may not be wired. Without this clock we
      cannot read the registers for mcpdm at all. For the external
      mcpdm clock to work, it needs to be muxed at the module level
      for ti-sysc driver probe to mux it early enough for probe.
      
      Let's set up a common file for it to make things a bit easier
      to make l4 abe interconnect to probe with ti-sysc driver. Note
      that this is not needed for omap5 as we can just update mcpdm
      muxing in omap5-board-common.dtsi in later patches.
      
      Cc: devicetree@vger.kernel.org
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      ed01ffd9
    • Roger Quadros's avatar
      bus: ti-sysc: Add generic enable/disable functions · d59b6056
      Roger Quadros authored
      For non legacy cases, add generic sysc_enable_module()
      and sysc_disable_module() functions.
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      d59b6056
  2. 08 Apr, 2019 17 commits
  3. 05 Apr, 2019 4 commits
  4. 03 Apr, 2019 6 commits
    • Tony Lindgren's avatar
      bus: ti-sysc: Add quirk handling for external optional functional clock · a54275f4
      Tony Lindgren authored
      We cannot access mcpdm registers at all unless there is an optional pdmclk
      configured. As this is currently only needed for mcpdm, let's check for
      mcpdm in sysc_get_clocks(). If it turns out to be needed for other modules
      too, we can add more flags to the quirks table for this.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      a54275f4
    • Tony Lindgren's avatar
      bus: ti-sysc: Add support for early quirks based on register address · 42b9c5c9
      Tony Lindgren authored
      At least mcpdm needs an optional external clock enabled to function and
      this clock typically comes from the PMIC. We can detect mcpdm based on
      the interconnect target module address and set a quirk flag early.
      
      To do this, let's initialize the clocks a bit later and add a new
      function for sysc_init_early_quirks(). Note that we cannot yet enable
      the early quirks for mcpdm until the optional external clocks are
      handled in the in the following patch.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      42b9c5c9
    • Tony Lindgren's avatar
      bus: ti-sysc: Move rstctrl reset to happen later · b11c1ea1
      Tony Lindgren authored
      We can do the rsstctrl a bit later, but need to deassert rstctrl reset
      before the clocks are enabled if asserted. Let's only init restctrl
      in sysc_init_resets() and do the reset later on just before we enable
      the device clocks.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      b11c1ea1
    • Tony Lindgren's avatar
      bus: ti-sysc: Manage clocks for the interconnect target module in all cases · 93de83a2
      Tony Lindgren authored
      We are currently not managing interconnect target module clocks in the
      for legacy platform data based case. This causes a problem for using the
      platform data based functions when dropping the platform data for the
      interconnect target module configuration.
      
      To avoid a situation where we need to populate the main and optional
      clocks also for the platform data based functions, let's just manage the
      clocks directly in ti-sysc driver. This means that until the interconnect
      target module confugration platform data is dropped our use count for
      clk_enable() will be 2 instead of 1.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      93de83a2
    • Tony Lindgren's avatar
      bus: ti-sysc: Allocate mdata as needed and do platform data based init later · a3e92e7b
      Tony Lindgren authored
      The platform data based init functions typically reset the interconnect
      target module configure the registers. As we may need the interconnect
      target module specific quirks configured based on the revision register,
      we want to move the platform data based init to happen later.
      
      Let's allocate mdata as needed so it's available for sysc_legacy_init()
      that we call with module clocks enabled from sysc_init_module().
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      a3e92e7b
    • Tony Lindgren's avatar
      bus: ti-sysc: Enable all clocks directly during init to read revision · 1a5cd7c2
      Tony Lindgren authored
      The first thing we want to do is just read the module revision register to
      be able to configure the module specific quirks and configure the module
      registers.
      
      As the interconnect target module may not yet be properly configured and
      may need a reset first, we don't want to use pm_runtime_get() at this
      point.
      
      To read the revision register, let's just enable the all the clocks for
      the interconnect target module during init even if the optional clocks
      are not needed. That way we can read the revision register to configure
      the quirks needed for PM runtime.
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      1a5cd7c2
  5. 01 Apr, 2019 5 commits
  6. 26 Mar, 2019 6 commits
    • Tony Lindgren's avatar
      ARM: OMAP2+: Handle reset quirks for dynamically allocated modules · 8b30919a
      Tony Lindgren authored
      For dynamically allocated struct omap_hwmod data, we need to populate
      the device IP specific reset quirks.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      8b30919a
    • Tony Lindgren's avatar
      ARM: OMAP2+: Remove hwmod .rev data and use local SoC checks instead · 70451127
      Tony Lindgren authored
      We can just check for omap2 and 3 for i2c and smartreflex locally.
      The rest of the .rev data is already unused.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      70451127
    • Tony Lindgren's avatar
      ARM: OMAP2+: Allocate struct omap_hwmod based on dts data · b57250fa
      Tony Lindgren authored
      With ti-sysc interconnect target module, we can allocate struct omap_hwmod
      data based on the devicetree data. This allows dropping the static SoC
      specific data eventually so we will only boot with data we actually need.
      
      To allocate struct omap_hwmod dynamically, we need to add a mutex for
      modifying the list, and remove __init for few functions.
      
      Note that we are not initialized oh->_clk or the optional clocks and their
      related quirks. That can be directly handled by the interconnect target
      module driver.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      b57250fa
    • Tony Lindgren's avatar
      ARM: OMAP2+: Define _HWMOD_STATE_DEFAULT and use it · 6d63b12d
      Tony Lindgren authored
      For dynamically allocated struct hwmod entries probing with ti-sysc
      interconnect target module driver, we need to specify the initial default
      state the same way as we do for the platform data cases.
      
      Let's prepare for that by adding _HWMOD_STATE_DEFAULT that we can then
      use to set the initial default state without a need to add similar
      CONFIG_PM handling in multiple places.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      6d63b12d
    • Tony Lindgren's avatar
      ARM: OMAP2+: Prepare class allocation for dynamically allocated modules · 513a4abb
      Tony Lindgren authored
      For dynamically allocated sysconfig data we only need to allocate a new
      class for the cases where the class is shared. For dynamically allocated
      struct omap_hwmod we will always allocate a new class.
      
      Let's add detection for when we need to allocate a new class by comparing
      the class name against the module name. If they match, there's no need
      to allocate a new calls as we don't have case of mixed platform data and
      dts data initialized modules for the same class.
      
      Let's also move the init of class data inside the spinlock.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      513a4abb
    • Tony Lindgren's avatar
      ARM: OMAP2+: Make interconnect target module allocation functions static · 798bd175
      Tony Lindgren authored
      Only omap_hwmod_init_module() gets called, the rest of the interconnect
      target module allocation functions can be static.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Tero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      798bd175