The AMD Geode SC1100 CPU, as found on Soekris Engineering's net4801 single board computer, suffers from a timer problem. Apparently the time stamp counter (TSC) ceases to increment when the CPU enters the autohalt state . Since the Linux kernel uses the TSC to keep track of the time of day, the system clock will tend lose time, making it a poor choice for an NTP server. The Linux kernel can be configured to use the programmable interrupt timer (PIT) instead of the TSC, but my experiments show that it also loses time when the CPU is in the autohalt state.
Fortunately, this CPU has an alternate time source, an on-board 27MHz high-resolution timer, which continues to keep accurate time even when the CPU is in the autohalt state. The patch below permits the Linux kernel to use this timer instead of the TSC. I have found this to provide a reliable clock and have now been using my net4801 as a network time server for several months.
The patch relies on a patch from Henrik Brix Anderson to determine the location of the Configuration Block at runtime, which has been included in Andrew Morton's mm patch series since 2.6.11-rc-mm1 and the Linus's tree since 2.6.12-rc5.
I'm not especially happy with this patch for three reasons:
Once you've patched your Linux kernel, you should enable the timer in Processor type and features/NatSemi SCx200 27MHz High-Resolution Timer Support (CONFIG_SCx200HR_TIMER). If all is working correctly, you should see the following text at boot or in demsg:
... scx200hr: timer not yet accessible; will probe later. Detected 266.647 MHz processor. Using tsc for high-res timesource ... scx200: NatSemi SCx200 Driver scx200: GPIO base 0x6100 scx200: Configuration Block base 0x6000 switching to scx200 high-resolution timer (255961 cpt) ...See the second caveat above for an explanation of why the TSC appears here.
I referred to Poul-Henning Kamp's FreeBSD patch in order to determine how to access the high-resolution timer. More information is available in the SC1100 databook, available from the AMD web site.
George Anzinger corrected the calculation of the PIT frequency in my original patch.
|2006-04-16||Fixed the broken link for footnote 1.|
|2005-06-07||Included a patch for Linus's tree, fixed typos.|
|2005-05-22||Added the installation section|
|2005-05-22||Added pretty graphs|