- 14 6月, 2017 1 次提交
-
-
由 Daniel Lezcano 提交于
The CLOCKSOURCE_OF_DECLARE macro is used widely for the timers to declare the clocksource at early stage. However, this macro is also used to initialize the clockevent if any, or the clockevent only. It was originally suggested to declare another macro to initialize a clockevent, so in order to separate the two entities even they belong to the same IP. This was not accepted because of the impact on the DT where splitting a clocksource/clockevent definition does not make sense as it is a Linux concept not a hardware description. On the other side, the clocksource has not interrupt declared while the clockevent has, so it is easy from the driver to know if the description is for a clockevent or a clocksource, IOW it could be implemented at the driver level. So instead of dealing with a named clocksource macro, let's use a more generic one: TIMER_OF_DECLARE. The patch has not functional changes. Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Acked-by: NHeiko Stuebner <heiko@sntech.de> Acked-by: NNeil Armstrong <narmstrong@baylibre.com> Acked-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NMatthias Brugger <matthias.bgg@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 07 4月, 2017 1 次提交
-
-
由 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>
-
- 28 6月, 2016 4 次提交
-
-
由 Daniel Lezcano 提交于
All the clocksource drivers's init function are now converted to return an error code. CLOCKSOURCE_OF_DECLARE is no longer used as well as the clksrc-of table. Let's convert back the names: - CLOCKSOURCE_OF_DECLARE_RET => CLOCKSOURCE_OF_DECLARE - clksrc-of-ret => clksrc-of Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> For exynos_mct and samsung_pwm_timer: Acked-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> For arch/arc: Acked-by: NVineet Gupta <vgupta@synopsys.com> For mediatek driver: Acked-by: NMatthias Brugger <matthias.bgg@gmail.com> For the Rockchip-part Acked-by: NHeiko Stuebner <heiko@sntech.de> For STi : Acked-by: NPatrice Chotard <patrice.chotard@st.com> For the mps2-timer.c and versatile.c changes: Acked-by: NLiviu Dudau <Liviu.Dudau@arm.com> For the OXNAS part : Acked-by: NNeil Armstrong <narmstrong@baylibre.com> For LPC32xx driver: Acked-by: NSylvain Lemieux <slemieux.tyco@gmail.com> For Broadcom Kona timer change: Acked-by: NRay Jui <ray.jui@broadcom.com> For Sun4i and Sun5i: Acked-by: NChen-Yu Tsai <wens@csie.org> For Meson6: Acked-by: NCarlo Caione <carlo@caione.org> For Keystone: Acked-by: NSantosh Shilimkar <ssantosh@kernel.org> For NPS: Acked-by: NNoam Camus <noamca@mellanox.com> For bcm2835: Acked-by: NEric Anholt <eric@anholt.net>
-
由 Daniel Lezcano 提交于
The init functions do not return any error. They behave as the following: - panic, thus leading to a kernel crash while another timer may work and make the system boot up correctly or - print an error and let the caller unaware if the state of the system Change that by converting the init functions to return an error conforming to the CLOCKSOURCE_OF_RET prototype. Proper error handling (rollback, errno value) will be changed later case by case, thus this change just return back an error or success in the init function. Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: NHeiko Stuebner <heiko@sntech.de> on a rk3399-evb Tested-by: NHeiko Stuebner <heiko@sntech.de>
-
由 Huang, Tao 提交于
The only difference between the rk3399 SoC and the other ones is the control register offset which is different. Add a new field to store the control register address depending on the SoC and use it instead of the <base> + <control offset>. Signed-off-by: NHuang Tao <huangtao@rock-chips.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Heiko Stuebner <heiko@sntech.de> Tested-by: NJianqun Xu <jay.xu@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
-
由 Huang, Tao 提交于
The rockchip timer is a broadcast timer. Add the CLOCK_EVT_FEAT_DYNIRQ flag and set the cpumask to all possible cpus to save power by avoiding unnecessary wakeups and IPIs. Signed-off-by: NHuang Tao <huangtao@rock-chips.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Heiko Stuebner <heiko@sntech.de> Tested-by: NJianqun Xu <jay.xu@rock-chips.com> Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
-
- 25 2月, 2016 1 次提交
-
-
由 Shawn Lin 提交于
Currently rockchip_timer doesn't do some basic cleanup work when failing to init the timer. Let's add err handle routine to deal with all the err cases. Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
-
- 15 12月, 2015 2 次提交
-
-
由 Caesar Wang 提交于
The dsb() instruction is pointless in this code. Remove it. That also fixes the ARM64 compilation issue. Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org> Tested-by: NCaesar Wang <wxt@rock-chips.com>
-
由 Caesar Wang 提交于
Let's checkstyle to clean up the macros with such trivial details. Signed-off-by: NCaesar Wang <wxt@rock-chips.com> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
-
- 29 9月, 2015 1 次提交
-
-
由 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>
-
- 10 8月, 2015 1 次提交
-
-
由 Viresh Kumar 提交于
Migrate rockchip driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. We weren't doing anything for oneshot or resume modes, and so the callbacks aren't provided. Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
-
- 29 1月, 2015 1 次提交
-
-
由 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>
-