1. 14 6月, 2017 1 次提交
  2. 07 4月, 2017 1 次提交
    • A
      clocksource/drivers/rockchip_timer: Implement clocksource timer · 5e0a39d0
      Alexander Kochetkov 提交于
      The clock supplying the arm-global-timer on the rk3188 is coming from the
      the cpu clock itself and thus changes its rate everytime cpufreq adjusts
      the cpu frequency making this timer unsuitable as a stable clocksource
      and sched clock.
      
      The rk3188, rk3288 and following socs share a separate timer block already
      handled by the rockchip-timer driver. Therefore adapt this driver to also
      be able to act as clocksource and sched clock on rk3188.
      
      In order to test clocksource you can run following commands and check
      how much time it take in real. On rk3188 it take about ~45 seconds.
      
          cpufreq-set -f 1.6GHZ
          date; sleep 60; date
      
      In order to use the patch you need to declare two timers in the dts
      file. The first timer will be initialized as clockevent provider
      and the second one as clocksource. The clockevent must be from
      alive subsystem as it used as backup for the local timers at sleep
      time.
      
      The patch does not break compatibility with older device tree files.
      The older device tree files contain only one timer. The timer
      will be initialized as clockevent, as expected.
      
      rk3288 (and probably anything newer) is irrelevant to this patch,
      as it has the arch timer interface. This patch may be useful
      for Cortex-A9/A5 based parts.
      Signed-off-by: NAlexander Kochetkov <al.kochet@gmail.com>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      5e0a39d0
  3. 28 6月, 2016 4 次提交
  4. 25 2月, 2016 1 次提交
  5. 15 12月, 2015 2 次提交
  6. 29 9月, 2015 1 次提交
    • D
      clocksource/drivers/rockchip: Fix bad NO_IRQ usage · ccc42592
      Daniel Lezcano 提交于
      The current code assumes the 'irq_of_parse_and_map' will return NO_IRQ in case
      of failure. Unfortunately, the NO_IRQ is not consistent across the different
      architectures and we must not rely on it.
      
      NO_IRQ is equal to '-1' on ARM and 'irq_of_parse_and_map' returns '0' in case
      of an error. Hence, the latter won't be detected and will lead to a crash.
      
      Fix this by just checking 'irq' is different from zero.
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      ccc42592
  7. 10 8月, 2015 1 次提交
  8. 29 1月, 2015 1 次提交
    • D
      clockevents: rockchip: Add rockchip timer for rk3288 · 468b8c4c
      Daniel Lezcano 提交于
      The rk3288 board uses the architected timers and these ones are shutdown when
      the cpu is powered down. There is a need of a broadcast timer in this case to
      ensure proper wakeup when the cpus are in sleep mode and a timer expires.
      
      This driver provides the basic timer functionnality as a backup for the local
      timers at sleep time.
      
      The timer belongs to the alive subsystem. It includes two programmables 64 bits
      timer channels but the driver only uses 32bits. It works with two operations
      mode: free running and user defined count.
      
      Programing sequence:
      
      1. Timer initialization:
       * Disable the timer by writing '0' to the CONTROLREG register
       * Program the timer mode by writing the mode to the CONTROLREG register
       * Set the interrupt mask
      
      2. Setting the count value:
       * Load the count value to the registers COUNT0 and COUNT1 (not used).
      
      3. Enable the timer
       * Write '1' to the CONTROLREG register with the mode (free running or user)
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      468b8c4c