aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/timer-imx-tpm.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-23clocksource/drivers/timer-imx-tpm: Switch to SPDX identifierFabio Estevam1-9/+4
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2018-04-19clocksource/imx-tpm: Correct -ETIME return condition checkAnson Huang1-1/+1
The additional brakects added to tpm_set_next_event's return value computation causes (int) forced type conversion NOT taking effect, and the incorrect value return will cause various system timer issue, like RCU stall etc.. Remove the additional brackets to make sure tpm_set_next_event always returns correct value. Fixes: 059ab7b82eec ("clocksource/drivers/imx-tpm: Add imx tpm timer support") Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Dong Aisheng <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
2018-03-30clocksource/drivers/imx-tpm: Add different counter width supportAnson Huang1-8/+25
Different TPM modules have different width counters which is 16-bit or 32-bit, the counter width can be read from TPM_PARAM register bit[23:16], this patch adds dynamic check for counter width to support both 16-bit and 32-bit TPM modules. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2018-03-30clocksource/drivers/imx-tpm: Correct some registers operation flowAnson Huang1-1/+7
According to i.MX7ULP reference manual, TPM_SC_CPWMS can ONLY be written when counter is disabled, TPM_SC_TOF is write-1-clear, TPM_C0SC_CHF is also write-1-clear, correct these registers initialization flow; Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2018-03-30clocksource/drivers/imx-tpm: Fix typo of clock nameAnson Huang1-1/+1
The clock name should be ipg instead of igp. Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2017-08-29clocksource/drivers/imx-tpm: Add imx tpm timer supportDong Aisheng1-0/+239
IMX Timer/PWM Module (TPM) supports both timer and pwm function while this patch only adds the timer support. PWM would be added later. The TPM counter, compare and capture registers are clocked by an asynchronous clock that can remain enabled in low power modes. NOTE: We observed in a very small probability, the bus fabric contention between GPU and A7 may results a few cycles delay of writing CNT registers which may cause the min_delta event got missed, so we need add a ETIME check here in case it happened. Cc: Daniel Lezcano <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Anson Huang <[email protected]> Cc: Bai Ping <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>