Hello Sebastian,

Thank you for the clarifications.

We have discussed this internally, and there were two main discussion points: 1. Users of custom GRLIB+LEON3 systems (FPGA/ASIC) may be affected by the RTEMS hardware requirement change of needing one more subtimer. 2. The application will have access to one less subtimer. This affects for example the UT700 LEON3 component.

The conclusion is that we are positive to the change proposed in this patch. It is also in line with LEON3 hardware requirements for other operating systems.

After the AMP scenario (see below) has been clarified, this commit is OK.


On 2023-10-13 13:00, Sebastian Huber wrote:
Hello Martin,

On 13.10.23 12:09, Martin Åberg wrote:

What are the implications when using RTEMS_MULTIPROCESSING together with "use_gptimer"?

In bsps/sparc/leon3/include/bsp/leon3.h, we have:
 >  #if defined(RTEMS_MULTIPROCESSING)
 >  #define LEON3_CLOCK_INDEX \
 >    ( rtems_configuration_get_user_multiprocessing_table() ? LEON3_Cpu_Index : 0 )
 >  #else
 >  #define LEON3_CLOCK_INDEX 0
 >  #endif

Can LEON3_COUNTER_GPTIMER_INDEX of CPU0 be equal to LEON3_CLOCK_INDEX of CPU1 here?

The individual RTEMS instances could share the GPTIMER configured in free-running mode.

LEON3_Timer_Regs is probed in amba.c. There is a link time option to set GPTIMER core index (leon3_timer_core_index). Instances could have unique GPTIMER cores associated.

The preprocessor symbols LEON3_CLOCK_INDEX (clock driver) and LEON3_COUNTER_GPTIMER_INDEX (timecounter) are used as subtimer index of the GPTIMER core LEON3_Timer_Regs.

For CPU0 these are:
  - LEON3_CLOCK_INDEX is 0 (equal to hardware processor index)
  - LEON3_COUNTER_GPTIMER_INDEX is 1 (LEON3_CLOCK_INDEX+1)
For CPU1 these are:
  - LEON3_CLOCK_INDEX is 1 (equal to hardware processor index)
  - LEON3_COUNTER_GPTIMER_INDEX is 2 (LEON3_CLOCK_INDEX+1)
etc...

In the case when LEON3_Timer_Regs is different on CPU0 and CPU1, there is no conflict but will leave low-numbered subtimers unused. (Behavior not introduced by this patch.)

In the case when LEON3_Timer_Regs is equal on the CPU0 and CPU1 instances, it appears there is now a conflict between CPU0:LEON3_COUNTER_GPTIMER_INDEX and CPU1:LEON3_CLOCK_INDEX.


The GR712RC and GR740 do not need the additional GPTIMER subtimer. Which products would be affected by this change? I hope that all future Gaisler products provide a free-running counter device with a capture feature for PPS.

Thank you for the input. I have created an internal ticket on the free-running counter.

--
Best regards,

Martin Åberg
Software Engineer
Frontgrade Gaisler
martin.ab...@gaisler.com

Frontgrade Gaisler AB, Kungsgatan 12, SE-411 19 GÖTEBORG, Sweden.
+46 (0) 31 775 8650, www.gaisler.com

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to