1. 21 10月, 2012 2 次提交
    • P
      ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers · e24c3573
      Paul Walmsley 提交于
      There are several PRM operations which behave similarly across OMAP2+
      SoCs, but which have slight differences in their underlying
      implementations.  For example, to fetch the SoC's last reset sources,
      different registers are read across OMAP2xxx, 3xxx, and 44xx, and
      different bits are used on each SoC.  But the information returned is
      so similar that a single, common interface for drivers is useful.
      
      This patch creates the support code for this function pointer
      registration process.  No function pointers are included yet, but a
      subsequent patch will create one for the reset source API.
      
      To illustrate the end goal with the above reset source example, each
      per-SoC driver will use its own low-level implementation function --
      e.g., prm2xxx.c would contain omap2xxx_prm_read_reset_sources().  This
      function would read the appropriate register and remap the register
      bits to a standard set of reset source bits.  When the prm2xxx.c
      driver is loaded, it would register this function with the common PRM
      driver, prm.c.  prm.c would then export a common function,
      omap_prm_read_reset_sources().  Calling it would call through to the
      function pointer for the currently-registered SoC PRM driver.  This
      will allow other drivers to use PRM-provided data and operations
      without needing to know which SoC is currently in use.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      e24c3573
    • P
      ARM: OMAP2+: PRM: remove PRM weak functions · 7a0c1933
      Paul Walmsley 提交于
      Remove the now-unused PRM weak functions from prm_common.c.  These
      were formerly used to ensure that some OMAP2/3 PRM code would build on
      OMAP4, but none of those functions ever would have worked on OMAP4 due
      to an incompatible PRM register layout.  Now all that has been cleaned
      up and these can be removed.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Reviewed-by: NRuss Dill <Russ.Dill@ti.com>
      Acked-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      7a0c1933
  2. 13 9月, 2012 1 次提交
    • T
      ARM: OMAP2+: Prepare for irqs.h removal · 7d7e1eba
      Tony Lindgren 提交于
      As the interrupts should only be defined in the platform_data, and
      eventually coming from device tree, there's no need to define them
      in header files.
      
      Let's remove the hardcoded references to irqs.h and fix up the includes
      so we don't rely on headers included in irqs.h. Note that we're
      defining OMAP_INTC_START as 0 to the interrupts. This will be needed
      when we enable SPARSE_IRQ. For some drivers we need to add
      #include <plat/cpu.h> for now until these drivers are fixed to
      remove cpu_is_omapxxxx() usage.
      
      While at it, sort som of the includes the standard way, and add
      the trailing commas where they are missing in the related data
      structures.
      
      Note that for drivers/staging/tidspbridge we just define things
      locally.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      7d7e1eba
  3. 04 7月, 2012 1 次提交
  4. 28 6月, 2012 1 次提交
  5. 18 4月, 2012 1 次提交
    • P
      ARM: OMAP2+: clean up some cppcheck warnings · eeb3711b
      Paul Walmsley 提交于
      Resolve some warnings identified by cppcheck in arch/arm/mach-omap2:
      
          [arch/arm/mach-omap2/usb-tusb6010.c:129]: (style) Checking if unsigned variable 'tmp' is less than zero.
          [arch/arm/mach-omap2/prm_common.c:241]: (error) Possible null pointer dereference: irq_setup - otherwise it is redundant to check if irq_setup is null at line 247
          [arch/arm/mach-omap2/pm34xx.c:790]: (style) Variable 'per_clkdm' is assigned a value that is never used
          [arch/arm/mach-omap2/pm34xx.c:790]: (style) Variable 'core_clkdm' is assigned a value that is never used
          [arch/arm/mach-omap2/pm24xx.c:185]: (style) Variable 'only_idle' is assigned a value that is never used
          [arch/arm/mach-omap2/mux.c:254]: (error) Possible null pointer dereference: mux
          [arch/arm/mach-omap2/mux.c:258]: (error) Possible null pointer dereference: mux
          [arch/arm/mach-omap2/gpmc-onenand.c:178]: (style) Variable 'tick_ns' is assigned a value that is never used
          [arch/arm/mach-omap2/gpio.c:56]: (error) Possible null pointer dereference: pdata - otherwise it is redundant to check if pdata is null at line 57
          [arch/arm/mach-omap2/devices.c:45]: (style) Variable 'l' is assigned a value that is never used
          [arch/arm/mach-omap2/board-omap3evm.c:641] -> [arch/arm/mach-omap2/board-omap3evm.c:639]: (style) Found duplicate branches for if and else.
          [arch/arm/mach-omap2/am35xx-emac.c:95]: (style) Variable 'regval' is assigned a value that is never used
          [arch/arm/mach-omap2/devices.c:74]: (style) Variable 'l' is assigned a value that is never used
          [arch/arm/mach-omap2/pm34xx.c:277]: (style) Variable 'per_prev_state' is assigned a value that is never used
          [arch/arm/plat-omap/dmtimer.c:352]: (error) Possible null pointer dereference: timer - otherwise it is redundant to check if timer is null at line 354
          [arch/arm/plat-omap/omap_device.c:478]: (style) Variable 'c' is assigned a value that is never used
          [arch/arm/plat-omap/usb.c:42]: (style) Variable 'status' is assigned a value that is never used
          [arch/arm/mach-omap1/clock.c:197]: (style) Variable 'dpll1_rate' is assigned a value that is never used
          [arch/arm/mach-omap1/lcd_dma.c:60]: (style) struct or union member 'lcd_dma_info::size' is never used
          [arch/arm/mach-omap1/pm.c:572]: (style) Variable 'entry' is assigned a value that is never used
      
      Some of them are pretty good catches, such as gpio.c:56 and
      usb-tusb6010.c:129.
      
      Thanks to Jarkko Nikula for some comments on the sscanf() warnings.
      It seems that the kernel sscanf() ignores the field width anyway for the
      %d format, so those changes have been dropped from this second version.
      
      Thanks to Daniel Marjamäki <daniel.marjamaki@gmail.com> for pointing
      out that a variable was unnecessarily marked static in the
      board-omap3evm.c change.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
      Cc: Charulatha Varadarajan <charu@ti.com>
      Cc: Daniel Marjamäki <daniel.marjamaki@gmail.com>
      Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
      Reviewed-by: Charulatha Varadarajan <charu@ti.com> # for gpio.c
      eeb3711b
  6. 23 3月, 2012 1 次提交
    • M
      ARM: OMAP3+: fix oops triggered in omap_prcm_register_chain_handler(v1) · 4ba7c3c3
      Ming Lei 提交于
      This patch fixes the oops below[1].
      
      Obviously, the count of "struct irq_chip_generic" instances to be
      allocated and setup should be irq_setup->nr_regs instead of
      irq_setup->nr_regs plus one, so just fix the iterator to avoid
      the oops.
      
      [1], oops log.
      
      [    1.790242] Unable to handle kernel NULL pointer dereference at virtual address 00000004
      [    1.798632] pgd = c0004000
      [    1.801638] [00000004] *pgd=00000000
      [    1.805400] Internal error: Oops: 805 [#1] PREEMPT SMP THUMB2
      [    1.811381] Modules linked in:
      [    1.814601] CPU: 1    Not tainted  (3.3.0-next-20120320+ #733)
      [    1.820683] PC is at irq_setup_generic_chip+0x6a/0x84
      [    1.825951] LR is at irq_get_irq_data+0x7/0x8
      [    1.830508] pc : [<c006465e>]    lr : [<c0063a03>]    psr: 20000133
      [    1.830512] sp : ee04ff58  ip : 00000000  fp : 00000000
      [    1.842461] r10: 00000000  r9 : 00000000  r8 : 00000800
      [    1.847905] r7 : c064e260  r6 : 000001dc  r5 : 00000001  r4 : ee0accc0
      [    1.854687] r3 : 00000002  r2 : 00000800  r1 : 000001dc  r0 : 00000000
      [    1.861472] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment kernel
      [    1.869234] Control: 50c5387d  Table: 8000404a  DAC: 00000015
      [    1.875215] Process swapper/0 (pid: 1, stack limit = 0xee04e2f8)
      [    1.881463] Stack: (0xee04ff58 to 0xee050000)
      [    1.886017] ff40: c061b668 00000008
      [    1.894497] ff60: c0682090 ee0accc0 00000003 c001c637 00000000 00000000 00000201 00000000
      [    1.902976] ff80: 00000004 c0473820 c0473800 c0459e8d c0680ac0 c000866d 00000004 00000004
      [    1.911455] ffa0: ee04ffa8 00000004 c047381c 00000004 c0473820 c0473800 c0680ac0 00000082
      [    1.919934] ffc0: c0489694 c045265f 00000004 00000004 c0452135 c000d105 00000033 00000000
      [    1.928413] ffe0: c04525b5 c000d111 00000033 00000000 00000000 c000d111 aaaaaaaa aaaaaaaa
      [    1.936912] [<c006465e>] (irq_setup_generic_chip+0x6a/0x84) from [<c001c637>] (omap_prcm_register_chain_handler+0x147/0x1a0)
      [    1.948516] [<c001c637>] (omap_prcm_register_chain_handler+0x147/0x1a0) from [<c000866d>] (do_one_initcall+0x65/0xf4)
      [    1.959500] [<c000866d>] (do_one_initcall+0x65/0xf4) from [<c045265f>] (kernel_init+0xab/0x138)
      [    1.968529] [<c045265f>] (kernel_init+0xab/0x138) from [<c000d111>] (kernel_thread_exit+0x1/0x6)
      [    1.977632] Code: f7ff f9d1 6b23 1af3 (6043) 086d
      [    1.982684] ---[ end trace 1b75b31a2719ed1c ]---
      [    1.987526] Kernel panic - not syncing: Attempted to kill init!
      exitcode=0x0000000b
      Acked-by: NTero Kristo <t-kristo@ti.com>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      4ba7c3c3
  7. 21 1月, 2012 1 次提交
  8. 17 12月, 2011 2 次提交
    • T
      ARM: OMAP: PRCM: add suspend prepare / finish support · 91285b6f
      Tero Kristo 提交于
      PRCM chain handler needs to disable forwarding of interrupts during
      suspend, because runtime PM is disabled and most of the drivers
      are potentially not able to handle interrupts coming at this time.
      
      This patch masks all the PRCM interrupt events if a PRCM interrupt
      occurs during suspend, but does not ack them. Once suspend finish
      is called, all the masked events will be re-enabled, which causes
      immediate PRCM interrupt and handles the postponed event.
      
      The suspend prepare and complete  callbacks will be called from
      pm34xx.c / pm44xx.c files in the following patches.
      
      The functions defined in this patch should eventually be moved to
      suspend->prepare and suspend->finish driver hooks, once the PRCM
      chain handler will be made as its own driver.
      Signed-off-by: NTero Kristo <t-kristo@ti.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      [paul@pwsan.com: add kerneldoc, add omap_prcm_irq_setup.saved_mask, add fn
       ptrs for save_and_clear_irqen() and restore_irqen()]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      91285b6f
    • T
      ARM: OMAP: PRCM: add support for chain interrupt handler · 0a84a91c
      Tero Kristo 提交于
      Introduce a chained interrupt handler mechanism for the PRCM
      interrupt, so that individual PRCM event can cleanly be handled by
      handlers in separate drivers. We do this by introducing PRCM event
      names, which are then matched to the particular PRCM interrupt bit
      depending on the specific OMAP SoC being used.
      
      PRCM interrupts have two priority levels, high or normal. High priority
      is needed for IO event handling, so that we can be sure that IO events
      are processed before other events. This reduces latency for IO event
      customers and also prevents incorrect ack sequence on OMAP3.
      Signed-off-by: NTero Kristo <t-kristo@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: Avinash.H.M <avinashhm@ti.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Govindraj.R <govindraj.raja@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      [paul@pwsan.com: drop some dead code; use SoC-specific pending IRQ
       detection; move code to prm_common.c; add lots of documentation;
       remove saved_mask; add OCP barrier on ISR exit; improved error
       handling; split out per-SoC initialization to a separate patch]
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      0a84a91c