[PATCH 4/4] bsp: Add new riscv_generic bsp v3

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 27 07:09:22 UTC 2017


On 27/10/17 01:45, Hesham Almatary wrote:
> +static void riscv_generic_clock_at_tick(void)
> +{
> +  REG(MTIME_MM) = 0;
> +  REG(MTIMECMP_MM) = TTMR_NUM_OF_CLOCK_TICKS_INTERRUPT;
> +
> +  cpu_counter_ticks += TTMR_NUM_OF_CLOCK_TICKS_INTERRUPT * 10000;
> +}
> +

Instead of setting the MM to 0, can't you increment the CMP_MM at each 
clock tick? This would make MM to a free running counter for easier 
timecounter and CPU counter support.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list