[PATCH 2/3] bsps/riscv: Add Microchip PolarFire SoC BSP variant

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Sep 12 12:57:14 UTC 2022


On 08/09/2022 17:43, Padmarao Begari wrote:
> +++ b/bsps/riscv/riscv/clock/clockdrv.c
> @@ -93,7 +93,7 @@ static void riscv_clock_at_tick(riscv_timecounter *tc)
>   {
>     volatile RISCV_CLINT_regs *clint;
>     uint64_t value;
> -  uint32_t cpu = rtems_scheduler_get_processor();
> +  uint32_t cpu = rtems_scheduler_get_processor() + RTEMS_BOOT_HARTID;

Defines and functions starting with RTEMS_ or rtems_ should belong to 
the architecture-independent RTEMS API. This is specific to RISC-V, so 
it should be RISCV_BOOT_HARDID. I am not sure if your approach is correct.

The numbers returned by rtems_scheduler_get_processor() (also known as 
_CPU_SMP_Get_current_processor()) should range from 0 to the configured 
(and available) processor count minus one. If your SoC has four 
processors then the valid numbers are 0, 1, 2, and 3. If the HARDIDs of 
your SoC range from 1 to n, then you have to map these HARDID numbers so 
that they start with 0 in _CPU_SMP_Get_current_processor().

Another issue is if you boot from a processor other than 0 (as returned 
by _CPU_SMP_Get_current_processor()).

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list