aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/mmio.c
AgeCommit message (Collapse)AuthorFilesLines
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-12-25clocksource: Use a plain u64 instead of cycle_tThomas Gleixner1-9/+9
There is no point in having an extra type for extra confusion. u64 is unambiguous. Conversion was done with the following coccinelle script: @rem@ @@ -typedef u64 cycle_t; @fix@ typedef cycle_t; @@ -cycle_t +u64 Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: John Stultz <[email protected]>
2015-12-10clocksource: Mmio: remove artificial 32bit limitationLinus Walleij1-1/+1
The EP93xx is registering a clocksource of 40 bits with clocksource_mmio_init() but this is not working because of this artificial limitation. It works fine to lift the uppe limit to 64 bits, and since cycle_t is u64, it should intuitively have been like that from the beginning. Fixes: 000bc17817bf "ARM: ep93xx: switch to GENERIC_CLOCKEVENTS" Reported-by: Alexander Sverdlin <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Cc: Daniel Lezcano <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2014-05-23clocksource: Fix clocksource_mmio_readX_downXiubo Li1-2/+2
For some clocksource devices, for example, the registers are 32-bit, while the lower 16-bit is used for timer counting(And reading the upper 16-bit will return 0). For example, when the counter value is 0x00001111, and then the ~readl_relaxed(to_mmio_clksrc(c)->reg) will return the value of 0xFFFFEEEE, but it should be 0x0000EEEE. So just using the c->mask to mask the unused bits. Signed-off-by: Xiubo Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2014-05-23clocksource: Fix type confusion for clocksource_mmio_readX_YXiubo Li1-4/+4
The types' definations are: o cycle_t -> u64 o readl_relaxed -> u32 o readw_relaxed -> u16 So let clocksource_mmio_readX_Ys return a cast to cycle_t, though this maybe look reduntant sometimes, it make sense and they will be more readable and less confusion... This patch clarifies the functions type and fix it. Signed-off-by: Xiubo Li <[email protected]> Cc: Daniel Lezcano <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2011-05-23clocksource: add common mmio clocksourceRussell King1-0/+73
Add a generic mmio clocksource, covering both 32-bit and 16-bit register access sizes, for up or down counters. This can be used to easily create clocksources for simple counter-based implementations. Cc: Alessandro Rubini <[email protected]> Cc: Colin Cross <[email protected]> Cc: Eric Miao <[email protected]> Cc: Erik Gilling <[email protected]> Acked-by: "Hans J. Koch" <[email protected]> Cc: Imre Kaloz <[email protected]> Cc: Krzysztof Halasa <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Lennert Buytenhek <[email protected]> Cc: Linus Walleij <[email protected]> Cc: [email protected] Acked-by: Nicolas Pitre <[email protected]> Cc: Olof Johansson <[email protected]> Tested-by: Sascha Hauer <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Tested-by: Tony Lindgren <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Cc: Wan ZongShun <[email protected]> Signed-off-by: Russell King <[email protected]>