Commit graph android_kernel_sony_sdm845/arch/mips/kernel/cevt-r4k.c
Message SHA1
[MIPS] Handle R4000/R4400 mfc0 from count register.
The R4000 and R4400 have an errata where if the cp0 count register is read
in the exact moment when it matches the compare register no interrupt will
be generated.

This bug may be triggered if the cp0 count register is being used as
clocksource and the compare interrupt as clockevent.  So a simple
workaround is to avoid using the compare for both facilities on the
affected CPUs.

This is different from the workaround suggested in the old errata documents;
at some opportunity probably the official version should be implemented
and tested.  Another thing to find out is which processor versions
exactly are affected.  I only have errata documents upto R4400 V3.0
available so for the moment the code treats all R4000 and R4400 as broken.

This is potencially a problem for some machines that have no other decent
clocksource available; this workaround will cause them to fall back to
another clocksource, worst case the "jiffies" source.

Ralf Baechle   commited 2007-11-26 17:26:14 +00:00
5aa85c9fc4
[MIPS] time: Fix negated condition in cevt-r4k driver.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Ralf Baechle   commited 2007-11-26 17:26:13 +00:00
aea6863944
[MIPS] time: Replace plat_timer_setup with modern APIs.
plat_timer_setup is no longer getting called.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Ralf Baechle   commited 2007-10-29 19:35:36 +00:00
38760d40ca
[MIPS] time: Make c0_compare_int_usable faster
Try increasingly longer time periods starting of at 0x10 cycles.  This
should be fast on hardware and work nicely with emulators.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Atsushi Nemoto   authored and   Ralf Baechle   commited 2007-10-29 19:35:35 +00:00
3a6c43a787
[MIPS] time: Fix cevt-r4k.c for 64-bit kernel
The expression "(long)(read_c0_count() - cnt)" can never be a negative
value on 64-bit kernel.  Cast to "int" before comparison.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Atsushi Nemoto   authored and   Ralf Baechle   commited 2007-10-29 19:35:35 +00:00
c637fecb4f
[MIPS] Add mips_hpt_frequency check to mips_clockevent_init().
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Yoichi Yuasa   authored and   Ralf Baechle   commited 2007-10-29 19:35:35 +00:00
22df3f53e3
[MIPS] time: Make c0_compare_int_usable more bullet proof
Use write_c0_compare(read_c0_count()) to clear interrupt.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Atsushi Nemoto   authored and   Ralf Baechle   commited 2007-10-22 22:09:01 +01:00
dab969c00b
[MIPS] SMTC: Build fix.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Ralf Baechle   commited 2007-10-19 18:15:57 +01:00
f887b93e17
[MIPS] time: Move R4000 clockevent device code to separate configurable file
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Ralf Baechle   commited 2007-10-18 18:11:47 +01:00
42f77542f4