Merge tag 'omap-for-v4.5/soc-initcall' of git://git.kernel.org/pub/scm/linux/kernel...
authorOlof Johansson <olof@lixom.net>
Tue, 22 Dec 2015 22:49:17 +0000 (14:49 -0800)
committerOlof Johansson <olof@lixom.net>
Tue, 22 Dec 2015 22:49:17 +0000 (14:49 -0800)
SoC changes for omaps for v4.5 merge window. The main change here is to
change the omap initcall levels a bit to initialize things later to allow
early device drivers at core_initcall level. This makes things easier
for us as most clocks can be made into regular device drivers except for
a few early clocks needed to initialize system timers. I wanted to have
these changes sit in Linux next for a few weeks before sending out a pull
request, and so far now issues have showed up.

The other changes in this series are timer changes for making use of the
new PWM driver, and timer changes to support more high security SoCs.
Also few minor improvments for module autoidle settings for ti81xx spinbox
and dra7 debug on uart4 in hwmod code. The rest is pretty much just removal
of platform data for SoCs that are all device tree only nowadays.

* tag 'omap-for-v4.5/soc-initcall' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Remove device creation for omap-pcm-audio
  ARM: OMAP1: Remove device creation for omap-pcm-audio
  ARM: OMAP2+: Change core_initcall levels to postcore_initcall
  ARM: DRA7: hwmod: Enable DEBUG_LL for UART4
  ARM: OMAP: RX-51: fix a typo in log writing
  ARM: omap4: hwmod: Remove elm address space from hwmod data
  ARM: OMAP2+: timer: Remove secure timer for DRA7xx HS devices
  ARM: OMAP: dmtimer: check for fixed timers during config
  ARM: OMAP2+: Remove omap_mmu_dev_attr structure
  ARM: OMAP4: hwmod data: Remove legacy IOMMU attr and addrs
  ARM: OMAP3: hwmod data: Remove legacy IOMMU data
  ARM: OMAP2+: Remove legacy device instantiation of IOMMUs
  ARM: OMAP2+: Add hwmod spinbox support for dm816x
  ARM: OMAP: add DT support for ti,dm816-timer
  ARM: OMAP: dmtimer: Add clock source from DT

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
arch/arm/mach-omap2/pdata-quirks.c

@@@ -890,36 -890,6 +890,36 @@@ static int _init_opt_clks(struct omap_h
        return ret;
  }
  
 +static void _enable_optional_clocks(struct omap_hwmod *oh)
 +{
 +      struct omap_hwmod_opt_clk *oc;
 +      int i;
 +
 +      pr_debug("omap_hwmod: %s: enabling optional clocks\n", oh->name);
 +
 +      for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
 +              if (oc->_clk) {
 +                      pr_debug("omap_hwmod: enable %s:%s\n", oc->role,
 +                               __clk_get_name(oc->_clk));
 +                      clk_enable(oc->_clk);
 +              }
 +}
 +
 +static void _disable_optional_clocks(struct omap_hwmod *oh)
 +{
 +      struct omap_hwmod_opt_clk *oc;
 +      int i;
 +
 +      pr_debug("omap_hwmod: %s: disabling optional clocks\n", oh->name);
 +
 +      for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
 +              if (oc->_clk) {
 +                      pr_debug("omap_hwmod: disable %s:%s\n", oc->role,
 +                               __clk_get_name(oc->_clk));
 +                      clk_disable(oc->_clk);
 +              }
 +}
 +
  /**
   * _enable_clocks - enable hwmod main clock and interface clocks
   * @oh: struct omap_hwmod *
@@@ -947,9 -917,6 +947,9 @@@ static int _enable_clocks(struct omap_h
                        clk_enable(os->_clk);
        }
  
 +      if (oh->flags & HWMOD_OPT_CLKS_NEEDED)
 +              _enable_optional_clocks(oh);
 +
        /* The opt clocks are controlled by the device driver. */
  
        return 0;
@@@ -981,14 -948,41 +981,14 @@@ static int _disable_clocks(struct omap_
                        clk_disable(os->_clk);
        }
  
 +      if (oh->flags & HWMOD_OPT_CLKS_NEEDED)
 +              _disable_optional_clocks(oh);
 +
        /* The opt clocks are controlled by the device driver. */
  
        return 0;
  }
  
 -static void _enable_optional_clocks(struct omap_hwmod *oh)
 -{
 -      struct omap_hwmod_opt_clk *oc;
 -      int i;
 -
 -      pr_debug("omap_hwmod: %s: enabling optional clocks\n", oh->name);
 -
 -      for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
 -              if (oc->_clk) {
 -                      pr_debug("omap_hwmod: enable %s:%s\n", oc->role,
 -                               __clk_get_name(oc->_clk));
 -                      clk_enable(oc->_clk);
 -              }
 -}
 -
 -static void _disable_optional_clocks(struct omap_hwmod *oh)
 -{
 -      struct omap_hwmod_opt_clk *oc;
 -      int i;
 -
 -      pr_debug("omap_hwmod: %s: disabling optional clocks\n", oh->name);
 -
 -      for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++)
 -              if (oc->_clk) {
 -                      pr_debug("omap_hwmod: disable %s:%s\n", oc->role,
 -                               __clk_get_name(oc->_clk));
 -                      clk_disable(oc->_clk);
 -              }
 -}
 -
  /**
   * _omap4_enable_module - enable CLKCTRL modulemode on OMAP4
   * @oh: struct omap_hwmod *
@@@ -3313,7 -3307,7 +3313,7 @@@ static int __init omap_hwmod_setup_all(
  
        return 0;
  }
- omap_core_initcall(omap_hwmod_setup_all);
+ omap_postcore_initcall(omap_hwmod_setup_all);
  
  /**
   * omap_hwmod_enable - enable an omap_hwmod
@@@ -1297,44 -1297,6 +1297,44 @@@ static struct omap_hwmod dra7xx_mcspi4_
        .dev_attr       = &mcspi4_dev_attr,
  };
  
 +/*
 + * 'mcasp' class
 + *
 + */
 +static struct omap_hwmod_class_sysconfig dra7xx_mcasp_sysc = {
 +      .sysc_offs      = 0x0004,
 +      .sysc_flags     = SYSC_HAS_SIDLEMODE,
 +      .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
 +      .sysc_fields    = &omap_hwmod_sysc_type3,
 +};
 +
 +static struct omap_hwmod_class dra7xx_mcasp_hwmod_class = {
 +      .name   = "mcasp",
 +      .sysc   = &dra7xx_mcasp_sysc,
 +};
 +
 +/* mcasp3 */
 +static struct omap_hwmod_opt_clk mcasp3_opt_clks[] = {
 +      { .role = "ahclkx", .clk = "mcasp3_ahclkx_mux" },
 +};
 +
 +static struct omap_hwmod dra7xx_mcasp3_hwmod = {
 +      .name           = "mcasp3",
 +      .class          = &dra7xx_mcasp_hwmod_class,
 +      .clkdm_name     = "l4per2_clkdm",
 +      .main_clk       = "mcasp3_aux_gfclk_mux",
 +      .flags          = HWMOD_OPT_CLKS_NEEDED,
 +      .prcm = {
 +              .omap4 = {
 +                      .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP3_CLKCTRL_OFFSET,
 +                      .context_offs = DRA7XX_RM_L4PER2_MCASP3_CONTEXT_OFFSET,
 +                      .modulemode   = MODULEMODE_SWCTRL,
 +              },
 +      },
 +      .opt_clks       = mcasp3_opt_clks,
 +      .opt_clks_cnt   = ARRAY_SIZE(mcasp3_opt_clks),
 +};
 +
  /*
   * 'mmc' class
   *
@@@ -2103,7 -2065,7 +2103,7 @@@ static struct omap_hwmod dra7xx_uart4_h
        .class          = &dra7xx_uart_hwmod_class,
        .clkdm_name     = "l4per_clkdm",
        .main_clk       = "uart4_gfclk_mux",
-       .flags          = HWMOD_SWSUP_SIDLE_ACT,
+       .flags          = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART4_FLAGS,
        .prcm = {
                .omap4 = {
                        .clkctrl_offs = DRA7XX_CM_L4PER_UART4_CLKCTRL_OFFSET,
@@@ -2604,22 -2566,6 +2604,22 @@@ static struct omap_hwmod_ocp_if dra7xx_
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
  };
  
 +/* l4_per2 -> mcasp3 */
 +static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp3 = {
 +      .master         = &dra7xx_l4_per2_hwmod,
 +      .slave          = &dra7xx_mcasp3_hwmod,
 +      .clk            = "l4_root_clk_div",
 +      .user           = OCP_USER_MPU | OCP_USER_SDMA,
 +};
 +
 +/* l3_main_1 -> mcasp3 */
 +static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mcasp3 = {
 +      .master         = &dra7xx_l3_main_1_hwmod,
 +      .slave          = &dra7xx_mcasp3_hwmod,
 +      .clk            = "l3_iclk_div",
 +      .user           = OCP_USER_MPU | OCP_USER_SDMA,
 +};
 +
  /* l4_per1 -> elm */
  static struct omap_hwmod_ocp_if dra7xx_l4_per1__elm = {
        .master         = &dra7xx_l4_per1_hwmod,
@@@ -3362,8 -3308,6 +3362,8 @@@ static struct omap_hwmod_ocp_if *dra7xx
        &dra7xx_l4_wkup__dcan1,
        &dra7xx_l4_per2__dcan2,
        &dra7xx_l4_per2__cpgmac0,
 +      &dra7xx_l4_per2__mcasp3,
 +      &dra7xx_l3_main_1__mcasp3,
        &dra7xx_gmac__mdio,
        &dra7xx_l4_cfg__dma_system,
        &dra7xx_l3_main_1__dss,
@@@ -144,7 -144,6 +144,7 @@@ static struct omap_hwmod dm81xx_l4_ls_h
        .name           = "l4_ls",
        .clkdm_name     = "alwon_l3s_clkdm",
        .class          = &l4_hwmod_class,
 +      .flags          = HWMOD_NO_IDLEST,
  };
  
  /*
@@@ -156,7 -155,6 +156,7 @@@ static struct omap_hwmod dm81xx_l4_hs_h
        .name           = "l4_hs",
        .clkdm_name     = "alwon_l3_med_clkdm",
        .class          = &l4_hwmod_class,
 +      .flags          = HWMOD_NO_IDLEST,
  };
  
  /* L3 slow -> L4 ls peripheral interface running at 125MHz */
@@@ -852,7 -850,6 +852,7 @@@ static struct omap_hwmod dm816x_emac0_h
        .name           = "emac0",
        .clkdm_name     = "alwon_ethernet_clkdm",
        .class          = &dm816x_emac_hwmod_class,
 +      .flags          = HWMOD_NO_IDLEST,
  };
  
  static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
@@@ -1036,6 -1033,40 +1036,40 @@@ static struct omap_hwmod_ocp_if dm81xx_
        .user           = OCP_USER_MPU,
  };
  
+ static struct omap_hwmod_class_sysconfig dm81xx_spinbox_sysc = {
+       .rev_offs       = 0x000,
+       .sysc_offs      = 0x010,
+       .syss_offs      = 0x014,
+       .sysc_flags     = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
+                               SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
+       .idlemodes      = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
+       .sysc_fields    = &omap_hwmod_sysc_type1,
+ };
+ static struct omap_hwmod_class dm81xx_spinbox_hwmod_class = {
+       .name = "spinbox",
+       .sysc = &dm81xx_spinbox_sysc,
+ };
+ static struct omap_hwmod dm81xx_spinbox_hwmod = {
+       .name           = "spinbox",
+       .clkdm_name     = "alwon_l3s_clkdm",
+       .class          = &dm81xx_spinbox_hwmod_class,
+       .main_clk       = "sysclk6_ck",
+       .prcm           = {
+               .omap4 = {
+                       .clkctrl_offs = DM81XX_CM_ALWON_SPINBOX_CLKCTRL,
+                       .modulemode = MODULEMODE_SWCTRL,
+               },
+       },
+ };
+ static struct omap_hwmod_ocp_if dm81xx_l4_ls__spinbox = {
+       .master         = &dm81xx_l4_ls_hwmod,
+       .slave          = &dm81xx_spinbox_hwmod,
+       .user           = OCP_USER_MPU,
+ };
  static struct omap_hwmod_class dm81xx_tpcc_hwmod_class = {
        .name           = "tpcc",
  };
@@@ -1298,6 -1329,7 +1332,7 @@@ static struct omap_hwmod_ocp_if *dm816x
        &dm816x_l4_ls__timer7,
        &dm81xx_l4_ls__mcspi1,
        &dm81xx_l4_ls__mailbox,
+       &dm81xx_l4_ls__spinbox,
        &dm81xx_l4_hs__emac0,
        &dm81xx_emac0__mdio,
        &dm816x_l4_hs__emac1,
@@@ -24,6 -24,9 +24,6 @@@
  #include <linux/platform_data/iommu-omap.h>
  #include <linux/platform_data/wkup_m3.h>
  
 -#include <asm/siginfo.h>
 -#include <asm/signal.h>
 -
  #include "common.h"
  #include "common-board-devices.h"
  #include "dss-common.h"
@@@ -265,7 -268,7 +265,7 @@@ static void __init nokia_n900_legacy_in
                        pr_warn("Thumb binaries may crash randomly without this workaround\n");
                }
  
-               pr_info("RX-51: Registring OMAP3 HWRNG device\n");
+               pr_info("RX-51: Registering OMAP3 HWRNG device\n");
                platform_device_register(&omap3_rom_rng_device);
  
        }
@@@ -382,6 -385,29 +382,6 @@@ static void __init omap3_pandora_legacy
  }
  #endif /* CONFIG_ARCH_OMAP3 */
  
 -#ifdef CONFIG_SOC_TI81XX
 -static int fault_fixed_up;
 -
 -static int t410_abort_handler(unsigned long addr, unsigned int fsr,
 -                            struct pt_regs *regs)
 -{
 -      if ((fsr == 0x406 || fsr == 0xc06) && !fault_fixed_up) {
 -              pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
 -                      addr, fsr);
 -              fault_fixed_up = 1;
 -              return 0;
 -      }
 -
 -      return 1;
 -}
 -
 -static void __init t410_abort_init(void)
 -{
 -      hook_fault_code(16 + 6, t410_abort_handler, SIGBUS, BUS_OBJERR,
 -                      "imprecise external abort");
 -}
 -#endif
 -
  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
  static struct iommu_platform_data omap4_iommu_pdata = {
        .reset_name = "mmu_cache",
@@@ -510,6 -536,9 +510,6 @@@ static struct pdata_init pdata_quirks[
        { "openpandora,omap3-pandora-600mhz", omap3_pandora_legacy_init, },
        { "openpandora,omap3-pandora-1ghz", omap3_pandora_legacy_init, },
  #endif
 -#ifdef CONFIG_SOC_TI81XX
 -      { "hp,t410", t410_abort_init, },
 -#endif
  #ifdef CONFIG_SOC_OMAP5
        { "ti,omap5-uevm", omap5_uevm_legacy_init, },
  #endif