> Date: Fri, 9 Dec 2022 16:27:59 -0600
> From: Scott Cheloha <[email protected]>
>
> The UltraSPARC IIe's %TICK register has a variable frequency. See
> section 2.3 in this document here:
>
> https://web.archive.org/web/20221028065731/https://www.oracle.com/technetwork/server-storage/sun-sparc-enterprise/documentation/ultrasparc-iie-2516664.pdf
>
> Timecounters need to have a constant frequency, so we should not
> install tick_timecounter if the implementation is an UltraSPARC IIe
> ("Hummingbird").
>
> As far as I know this issue is unique to the IIe. I can't find any
> reference to a varying %TICK frequency in the documentation for the
> IIi or the UltraSPARC III.
>
> miod@ confirmed that the problem is real.
>
> ok?
I don't think so.
IIRC, UltraSPARC IIi and UltraSPARC IIIi also have a potentially
varying %tick frequency. Those chips implement %sys_tick though and
since we give the associated timecounter a higher quality, it wins.
With your diff UltraSPARC IIe will end up without a timecounter. That
would bad isn't it?
So I think there are two options:
1. Implement a timecounter for Hummingbird's STICK logic. Shouldn't
be too difficult as we have a stick() function that returns the
counter.
2. Disable the hummingbird_setperf() implementation.
Cheers,
Mark
> Index: clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/sparc64/sparc64/clock.c,v
> retrieving revision 1.72
> diff -u -p -r1.72 clock.c
> --- clock.c 10 Nov 2022 07:08:01 -0000 1.72
> +++ clock.c 9 Dec 2022 22:19:33 -0000
> @@ -567,17 +567,23 @@ cpu_initclocks(void)
> /* Default to 200MHz clock XXXXX */
> cpu_clockrate = 200000000;
>
> - tick_timecounter.tc_frequency = cpu_clockrate;
> - tc_init(&tick_timecounter);
> + if (CPU_ISSUN4U || CPU_ISSUN4US)
> + impl = (getver() & VER_IMPL) >> VER_IMPL_SHIFT;
> +
> + /*
> + * The TICK frequency varies on the UltraSPARc IIe, so it isn't
> + * a suitable timecounter.
> + */
> + if (impl != IMPL_HUMMINGBIRD) {
> + tick_timecounter.tc_frequency = cpu_clockrate;
> + tc_init(&tick_timecounter);
> + }
>
> /*
> * UltraSPARC IIe processors do have a STICK register, but it
> * lives on the PCI host bridge and isn't accessible through
> * ASR24.
> */
> - if (CPU_ISSUN4U || CPU_ISSUN4US)
> - impl = (getver() & VER_IMPL) >> VER_IMPL_SHIFT;
> -
> sys_tick_rate = getpropint(findroot(), "stick-frequency", 0);
> if (sys_tick_rate > 0 && impl != IMPL_HUMMINGBIRD) {
> sys_tick_timecounter.tc_frequency = sys_tick_rate;
>
>