[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel

Paul Boddie paul at boddie.org.uk
Sat Nov 28 19:03:21 CET 2020


On Friday, 27 November 2020 23:06:07 CET Paul Boddie wrote:
> 
> Yes, the kernel is reporting that the TCU only provides a 16-bit timer, but
> looking at my patches for Fiasco, I have the counter as a 32-bit register,
> and this corresponds to the header files from the legacy kernel. Recall
> that this TCU support for the JZ4730 actually uses the 3-channel OST
> (operating system timer), though.
> 
> Meanwhile, the JZ4740 has no OST but an 8-channel TCU, but the counters are
> all 16-bit registers. So, we might usefully need to change the TCU driver to
> permit 32-bit counters or just use the OST support in the TCU driver
> instead (although that appears to treat the OST as a singular timer like
> the WDT, not as something with multiple channels).

As far as I can tell, the 16-bit limit to TCU timers is imposed here:

drivers/clocksource/ingenic-timer.c

For example, in ingenic_tcu_setup_per_cpu_cevt:

clockevents_config_and_register(&tcu->cevt, rate, 10, 0xffff);

See the appropriate definition of that function in...

kernel/time/clockevents.c

Meanwhile, the OST employs a 32-bit counter as noted here:

drivers/clocksource/ingenic-ost.c

I suppose that we could just enable the OST for the JZ4730, using some 
adjustments, and just forget about the TCU, also forgetting about the other 
OST channels for the time being.

Paul




More information about the Letux-kernel mailing list