kernel-ark/arch/mips
Maciej W. Rozycki 8533966a6d MIPS: DECstation HRT calibration bug fixes
This change corrects DECstation HRT calibration, by removing the following
bugs:

1. Calibration period selection -- HZ / 10 has been chosen, however on
   DECstation computers, HZ never divides by 10, as the choice for HZ is
   among 128, 256 and 1024.  The choice therefore results in a systematic
   calibration error, e.g. 6.25% for the usual choice of 128 for HZ:

   128 / 10 * 10 = 120

   (128 - 120) / 128 -> 6.25%

   The change therefore makes calibration use HZ / 8 that is always
   accurate for the HZ values available, getting rid of the systematic
   error.

2. Calibration starting point synchronisation -- the duration of a number
   of intervals between DS1287A periodic interrupt assertions is measured,
   however code does not ensure at the beginning that the interrupt has
   not been previously asserted.  This results in a variable error of e.g.
   up to another 6.25% for the period of HZ / 8 (8.(3)% with the original
   HZ / 10 period) and the usual choice of 128 for HZ:

   1 / 16 -> 6.25%

   1 / 12 -> 8.(3)%

   The change therefore adds an initial call to ds1287_timer_state that
   clears any previous periodic interrupt pending.

The same issue applies to both I/O ASIC counter and R4k CP0 timer
calibration on DECstation systems as similar code is used in both cases
and both pieces of code are covered by this fix.

On an R3400 test system used this fix results in a change of the I/O ASIC
clock frequency reported from values like:

I/O ASIC clock frequency 23185830Hz

to:

I/O ASIC clock frequency 24999288Hz

removing the miscalculation by 6.25% from the systematic error and (for
the individual sample provided) a further 1.00% from the variable error,
accordingly.  The nominal I/O ASIC clock frequency is 25MHz on this
system.

Here's another result, with the fix applied, from a system that has both
HRTs available (using an R4400 at 60MHz nominal):

MIPS counter frequency 59999328Hz
I/O ASIC clock frequency 24999432Hz

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5807/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-09-05 20:38:28 +02:00
..
alchemy MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
ar7 MIPS: FW: Remove obsolete header file for MTI platforms. 2013-05-08 12:30:10 +02:00
ath79 MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
bcm47xx MIPS: Set default CPU type for BCM47XX platforms 2013-07-30 18:48:50 +02:00
bcm63xx Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-07-13 14:52:21 -07:00
boot MIPS: Boot: Compressed: Remove -fstack-protector from CFLAGS 2013-07-01 15:10:41 +02:00
cavium-octeon Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-07-19 15:10:01 -07:00
cobalt MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
configs MIPS: Update cavium_octeon_defconfig 2013-07-01 15:10:55 +02:00
dec MIPS: DECstation HRT calibration bug fixes 2013-09-05 20:38:28 +02:00
emma
fw MIPS: sibyte: Declare the cfe_write() buffer as constant 2013-06-21 18:07:02 +02:00
include MIPS: oprofile: Fix BUG due to smp_processor_id() in preemptible code. 2013-08-05 13:34:22 +02:00
jazz Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-03-02 07:44:16 -08:00
jz4740 MIPS: jz4740: Correct clock gate bit for DMA controller 2013-07-05 11:40:53 +05:30
kernel MIPS: DECstation HRT calibration bug fixes 2013-09-05 20:38:28 +02:00
kvm MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION 2013-07-19 12:45:57 +02:00
lantiq MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
lasat mips: lasat: sysctl: Convert use of typedef ctl_table to struct ctl_table 2013-06-18 00:31:32 +02:00
lib MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
loongson MIPS: Loongson: Hide the pci code behind CONFIG_PCI 2013-09-03 15:27:39 +02:00
loongson1 MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
math-emu MIPS: Handle OCTEON BBIT instructions in FPU emulator. 2013-08-20 19:17:40 +02:00
mm MIPS: Export copy_from_user_page() (needed by lustre) 2013-09-05 19:59:34 +02:00
mti-malta MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
mti-sead3 MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
netlogic Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-07-19 15:10:01 -07:00
oprofile MIPS: oprofile: Fix BUG due to smp_processor_id() in preemptible code. 2013-08-05 13:34:22 +02:00
pci MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
pmcs-msp71xx MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
pnx833x MIPS: PNX833x: PNX8335_PCI_ETHERNET_INT depends on CONFIG_SOC_PNX8335 2013-08-05 13:34:22 +02:00
power
powertv MIPS: powertv: Drop BOOTLOADER_DRIVER Kconfig symbol 2013-09-03 16:48:37 +02:00
ralink MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
rb532
sgi-ip22 MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sgi-ip27 MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
sgi-ip32
sibyte MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
sni MIPS: SNI: pcit: Fix build error with CONFIG_PCI=n disabled. 2013-06-25 17:10:28 +02:00
txx9 MIPS: TXx9: Fix build error if CONFIG_TOSHIBA_JMR3927 is not selected 2013-09-03 15:30:50 +02:00
vr41xx MIPS: Idle: Consolidate all declarations in <asm/idle.h>. 2013-05-22 01:34:27 +02:00
Kbuild KVM/MIPS32: Infrastructure/build files. 2013-05-08 03:55:34 +02:00
Kbuild.platforms MIPS: Delete Wind River ppmc eval board support. 2013-07-01 15:10:53 +02:00
Kconfig MIPS: Kconfig: Drop obsolete NR_CPUS_DEFAULT_{1,2} options 2013-09-03 16:31:26 +02:00
Kconfig.debug consolidate per-arch stack overflow debugging options 2013-07-04 11:25:39 -07:00
Makefile MIPS: initial stack protector support 2013-07-01 15:10:48 +02:00