]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'pm-next' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman...
authorTony Lindgren <tony@atomide.com>
Fri, 24 Sep 2010 00:29:28 +0000 (17:29 -0700)
committerTony Lindgren <tony@atomide.com>
Fri, 24 Sep 2010 00:29:28 +0000 (17:29 -0700)
1  2 
arch/arm/mach-omap2/Makefile
arch/arm/plat-omap/include/plat/omap_hwmod.h
arch/arm/plat-omap/omap_device.c

index eb2504a300c21e03b39a797e03c41347502287c8,29d40b2a4f5d9c20363c150082beec16c1d63339..826cb0980054f154b5803b79d058a34b85b0a599
@@@ -5,7 -5,7 +5,7 @@@
  # Common support
  obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o
  
 -omap-2-3-common                               = irq.o sdrc.o
 +omap-2-3-common                               = irq.o sdrc.o prm2xxx_3xxx.o
  hwmod-common                          = omap_hwmod.o \
                                          omap_hwmod_common_data.o
  prcm-common                           = prcm.o powerdomain.o
@@@ -15,7 -15,7 +15,7 @@@ clock-common                          = clock.o clock_common_
  
  obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
  obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common)
 -obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common)
 +obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) prm44xx.o $(hwmod-common)
  
  obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
  
@@@ -87,6 -87,7 +87,7 @@@ obj-$(CONFIG_ARCH_OMAP2430)           += opp2430
  obj-$(CONFIG_ARCH_OMAP2420)           += omap_hwmod_2420_data.o
  obj-$(CONFIG_ARCH_OMAP2430)           += omap_hwmod_2430_data.o
  obj-$(CONFIG_ARCH_OMAP3)              += omap_hwmod_3xxx_data.o
+ obj-$(CONFIG_ARCH_OMAP4)              += omap_hwmod_44xx_data.o
  
  # EMU peripherals
  obj-$(CONFIG_OMAP3_EMU)                       += emu.o
index 72902814c3cae27eb1a90994e0b4cfdb2c5b8d3b,cab4a681a121ac8d8f9cf894991d5a06bb0504a4..c1835afc238d5235434f58ccf344e25840eb331a
   *
   * These headers and macros are used to define OMAP on-chip module
   * data and their integration with other OMAP modules and Linux.
 - *
 - * References:
 - * - OMAP2420 Multimedia Processor Silicon Revision 2.1.1, 2.2 (SWPU064)
 - * - OMAP2430 Multimedia Device POP Silicon Revision 2.1 (SWPU090)
 - * - OMAP34xx Multimedia Device Silicon Revision 3.1 (SWPU108)
 - * - OMAP4430 Multimedia Device Silicon Revision 1.0 (SWPU140)
 - * - Open Core Protocol Specification 2.2
 + * Copious documentation and references can also be found in the
 + * omap_hwmod code, in arch/arm/mach-omap2/omap_hwmod.c (as of this
 + * writing).
   *
   * To do:
   * - add interconnect error log structures
   * - add pinmuxing
   * - init_conn_id_bit (CONNID_BIT_VECTOR)
   * - implement default hwmod SMS/SDRC flags?
 + * - remove unused fields
   *
   */
  #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
@@@ -32,7 -35,6 +32,7 @@@
  #include <linux/kernel.h>
  #include <linux/list.h>
  #include <linux/ioport.h>
 +#include <linux/mutex.h>
  #include <plat/cpu.h>
  
  struct omap_device;
@@@ -94,7 -96,7 +94,7 @@@ struct omap_hwmod_irq_info 
  /**
   * struct omap_hwmod_dma_info - DMA channels used by the hwmod
   * @name: name of the DMA channel (module local name)
 - * @dma_ch: DMA channel ID
 + * @dma_req: DMA request ID
   *
   * @name should be something short, e.g., "tx" or "rx".  It is for use
   * by platform_get_resource_byname().  It is defined locally to the
   */
  struct omap_hwmod_dma_info {
        const char      *name;
 -      u16             dma_ch;
 +      u16             dma_req;
 +};
 +
 +/**
 + * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
 + * @name: name of the reset line (module local name)
 + * @rst_shift: Offset of the reset bit
 + *
 + * @name should be something short, e.g., "cpu0" or "rst". It is defined
 + * locally to the hwmod.
 + */
 +struct omap_hwmod_rst_info {
 +      const char      *name;
 +      u8              rst_shift;
  };
  
  /**
@@@ -248,9 -237,8 +248,9 @@@ struct omap_hwmod_ocp_if 
  #define SYSC_HAS_CLOCKACTIVITY        (1 << 4)
  #define SYSC_HAS_SIDLEMODE    (1 << 5)
  #define SYSC_HAS_MIDLEMODE    (1 << 6)
 -#define SYSS_MISSING          (1 << 7)
 +#define SYSS_HAS_RESET_STATUS (1 << 7)
  #define SYSC_NO_CACHE         (1 << 8)  /* XXX SW flag, belongs elsewhere */
 +#define SYSC_HAS_RESET_STATUS (1 << 9)
  
  /* omap_hwmod_sysconfig.clockact flags */
  #define CLOCKACT_TEST_BOTH    0x0
@@@ -339,12 -327,10 +339,12 @@@ struct omap_hwmod_omap2_prcm 
  /**
   * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
   * @clkctrl_reg: PRCM address of the clock control register
 + * @rstctrl_reg: adress of the XXX_RSTCTRL register located in the PRM
   * @submodule_wkdep_bit: bit shift of the WKDEP range
   */
  struct omap_hwmod_omap4_prcm {
        void __iomem    *clkctrl_reg;
 +      void __iomem    *rstctrl_reg;
        u8              submodule_wkdep_bit;
  };
  
   * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
   * HWMOD_NO_IDLEST : this module does not have idle status - this is the case
   *     only for few initiator modules on OMAP2 & 3.
 + * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
 + *     This is needed for devices like DSS that require optional clocks enabled
 + *     in order to complete the reset. Optional clocks will be disabled
 + *     again after the reset.
   */
  #define HWMOD_SWSUP_SIDLE                     (1 << 0)
  #define HWMOD_SWSUP_MSTANDBY                  (1 << 1)
  #define HWMOD_NO_OCP_AUTOIDLE                 (1 << 4)
  #define HWMOD_SET_DEFAULT_CLOCKACT            (1 << 5)
  #define HWMOD_NO_IDLEST                               (1 << 6)
 +#define HWMOD_CONTROL_OPT_CLKS_IN_RESET               (1 << 7)
  
  /*
   * omap_hwmod._int_flags definitions
@@@ -429,7 -410,7 +429,7 @@@ struct omap_hwmod_class 
   * @class: struct omap_hwmod_class * to the class of this hwmod
   * @od: struct omap_device currently associated with this hwmod (internal use)
   * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt)
 - * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt)
 + * @sdma_reqs: ptr to an array of System DMA request IDs (see sdma_reqs_cnt)
   * @prcm: PRCM data pertaining to this hwmod
   * @main_clk: main clock: OMAP clock name
   * @_clk: pointer to the main struct clk (filled in at runtime)
   * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
   * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
   * @mpu_irqs_cnt: number of @mpu_irqs
 - * @sdma_chs_cnt: number of @sdma_chs
 + * @sdma_reqs_cnt: number of @sdma_reqs
   * @opt_clks_cnt: number of @opt_clks
   * @master_cnt: number of @master entries
   * @slaves_cnt: number of @slave entries
   * @_state: internal-use hwmod state
   * @flags: hwmod flags (documented below)
   * @omap_chip: OMAP chips this hwmod is present on
 + * @_mutex: mutex serializing operations on this hwmod
   * @node: list node for hwmod list (internal use)
   *
   * @main_clk refers to this module's "main clock," which for our
@@@ -468,8 -448,7 +468,8 @@@ struct omap_hwmod 
        struct omap_hwmod_class         *class;
        struct omap_device              *od;
        struct omap_hwmod_irq_info      *mpu_irqs;
 -      struct omap_hwmod_dma_info      *sdma_chs;
 +      struct omap_hwmod_dma_info      *sdma_reqs;
 +      struct omap_hwmod_rst_info      *rst_lines;
        union {
                struct omap_hwmod_omap2_prcm omap2;
                struct omap_hwmod_omap4_prcm omap4;
        void                            *dev_attr;
        u32                             _sysc_cache;
        void __iomem                    *_mpu_rt_va;
 +      struct mutex                    _mutex;
        struct list_head                node;
        u16                             flags;
        u8                              _mpu_port_index;
        u8                              msuspendmux_shift;
        u8                              response_lat;
        u8                              mpu_irqs_cnt;
 -      u8                              sdma_chs_cnt;
 +      u8                              sdma_reqs_cnt;
 +      u8                              rst_lines_cnt;
        u8                              opt_clks_cnt;
        u8                              masters_cnt;
        u8                              slaves_cnt;
@@@ -515,10 -492,6 +515,10 @@@ int omap_hwmod_idle(struct omap_hwmod *
  int _omap_hwmod_idle(struct omap_hwmod *oh);
  int omap_hwmod_shutdown(struct omap_hwmod *oh);
  
 +int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name);
 +int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name);
 +int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name);
 +
  int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
  int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
  
@@@ -561,5 -534,6 +561,6 @@@ int omap_hwmod_for_each_by_class(const 
  extern int omap2420_hwmod_init(void);
  extern int omap2430_hwmod_init(void);
  extern int omap3xxx_hwmod_init(void);
+ extern int omap44xx_hwmod_init(void);
  
  #endif
index ceba58a475957768b0b44d483d26fd6070674951,8215b1bf40f81522a641b68d07e3b5ea7568375c..b5e5f6074b0b468ac78efb1ff735ef87e2c4a5d8
@@@ -82,7 -82,6 +82,7 @@@
  #include <linux/slab.h>
  #include <linux/err.h>
  #include <linux/io.h>
 +#include <linux/clk.h>
  
  #include <plat/omap_device.h>
  #include <plat/omap_hwmod.h>
  #define USE_WAKEUP_LAT                        0
  #define IGNORE_WAKEUP_LAT             1
  
- /*
-  * OMAP_DEVICE_MAGIC: used to determine whether a struct omap_device
-  * obtained via container_of() is in fact a struct omap_device
-  */
- #define OMAP_DEVICE_MAGIC              0xf00dcafe
  /* Private functions */
  
  /**
@@@ -244,44 -237,6 +238,44 @@@ static inline struct omap_device *_find
        return container_of(pdev, struct omap_device, pdev);
  }
  
 +/**
 + * _add_optional_clock_alias - Add clock alias for hwmod optional clocks
 + * @od: struct omap_device *od
 + *
 + * For every optional clock present per hwmod per omap_device, this function
 + * adds an entry in the clocks list of the form <dev-id=dev_name, con-id=role>
 + * if an entry is already present in it with the form <dev-id=NULL, con-id=role>
 + *
 + * The function is called from inside omap_device_build_ss(), after
 + * omap_device_register.
 + *
 + * This allows drivers to get a pointer to its optional clocks based on its role
 + * by calling clk_get(<dev*>, <role>).
 + *
 + * No return value.
 + */
 +static void _add_optional_clock_alias(struct omap_device *od,
 +                                    struct omap_hwmod *oh)
 +{
 +      int i;
 +
 +      for (i = 0; i < oh->opt_clks_cnt; i++) {
 +              struct omap_hwmod_opt_clk *oc;
 +              int r;
 +
 +              oc = &oh->opt_clks[i];
 +
 +              if (!oc->_clk)
 +                      continue;
 +
 +              r = clk_add_alias(oc->role, dev_name(&od->pdev.dev),
 +                                (char *)oc->clk, &od->pdev.dev);
 +              if (r)
 +                      pr_err("omap_device: %s: clk_add_alias for %s failed\n",
 +                             dev_name(&od->pdev.dev), oc->role);
 +      }
 +}
 +
  
  /* Public functions for use by core code */
  
@@@ -453,17 -408,13 +447,15 @@@ struct omap_device *omap_device_build_s
        od->pm_lats = pm_lats;
        od->pm_lats_cnt = pm_lats_cnt;
  
-       od->magic = OMAP_DEVICE_MAGIC;
        if (is_early_device)
                ret = omap_early_device_register(od);
        else
                ret = omap_device_register(od);
  
 -      for (i = 0; i < oh_cnt; i++)
 +      for (i = 0; i < oh_cnt; i++) {
                hwmods[i]->od = od;
 +              _add_optional_clock_alias(od, hwmods[i]);
 +      }
  
        if (ret)
                goto odbs_exit4;
@@@ -514,6 -465,7 +506,7 @@@ int omap_device_register(struct omap_de
  {
        pr_debug("omap_device: %s: registering\n", od->pdev.name);
  
+       od->pdev.dev.parent = &omap_device_parent;
        return platform_device_register(&od->pdev);
  }
  
@@@ -667,18 -619,6 +660,6 @@@ int omap_device_align_pm_lat(struct pla
        return ret;
  }
  
- /**
-  * omap_device_is_valid - Check if pointer is a valid omap_device
-  * @od: struct omap_device *
-  *
-  * Return whether struct omap_device pointer @od points to a valid
-  * omap_device.
-  */
- bool omap_device_is_valid(struct omap_device *od)
- {
-       return (od && od->magic == OMAP_DEVICE_MAGIC);
- }
  /**
   * omap_device_get_pwrdm - return the powerdomain * associated with @od
   * @od: struct omap_device *
@@@ -798,3 -738,14 +779,14 @@@ int omap_device_enable_clocks(struct om
        /* XXX pass along return value here? */
        return 0;
  }
+ struct device omap_device_parent = {
+       .init_name      = "omap",
+       .parent         = &platform_bus,
+ };
+ static int __init omap_device_init(void)
+ {
+       return device_register(&omap_device_parent);
+ }
+ core_initcall(omap_device_init);