FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_l2_cache.c
/*==============================================================================
 * Configure the L2 scratchpad based on linker symbols:
 *  __l2_scratchpad_vma_start
 *  __l2_scratchpad_vma_end
 *
 *  These linker symbols specify the start address and length of the scratchpad.
 *  The scratchpad must be located within the Zero Device memory range.
 */
Configure the L2 scratchpad based on linker symbols:
l2_scratchpad_vma_start
l2_scratchpad_vma_end

These linker symbols specify the start address and length of the scratchpad.
The scratchpad must be located within the Zero Device memory range.
Configure the L2 scratchpad based on linker symbols : l2_scratchpad_vma_start l2_scratchpad_vma_end These linker symbols specify the start address and length of the scratchpad . The scratchpad must be located within the Zero Device memory range .
static void check_config_l2_scratchpad(void)
{
    extern char __l2_scratchpad_vma_start;
    extern char __l2_scratchpad_vma_end;
    uint8_t n_scratchpad_ways;
    const uint64_t end = (const uint64_t)&__l2_scratchpad_vma_end;
    const uint64_t start = (const uint64_t)&__l2_scratchpad_vma_start;
    uint64_t modulo;
    ASSERT(start >= (uint64_t)ZERO_DEVICE_BOTTOM);
    ASSERT(end < (uint64_t)ZERO_DEVICE_TOP);
    ASSERT(end >= start);
    n_scratchpad_ways = (uint8_t)((end - start) / WAY_BYTE_LENGTH);
    modulo = (end - start) % WAY_BYTE_LENGTH;
    if(modulo > 0)
    {
        ++n_scratchpad_ways;
    }
    ASSERT(LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS >= n_scratchpad_ways);
}
static void check_config_l2_scratchpad ( void ) { extern char __l2_scratchpad_vma_start ; extern char __l2_scratchpad_vma_end ; uint8_t n_scratchpad_ways ; const uint64_t end = ( const uint64_t ) & __l2_scratchpad_vma_end ; const uint64_t start = ( const uint64_t ) & __l2_scratchpad_vma_start ; uint64_t modulo ; ASSERT ( start >= ( uint64_t ) ZERO_DEVICE_BOTTOM ) ; ASSERT ( end < ( uint64_t ) ZERO_DEVICE_TOP ) ; ASSERT ( end >= start ) ; n_scratchpad_ways = ( uint8_t ) ( ( end - start ) / WAY_BYTE_LENGTH ) ; modulo = ( end - start ) % WAY_BYTE_LENGTH ; if ( modulo > 0 ) { ++ n_scratchpad_ways ; } ASSERT ( LIBERO_SETTING_NUM_SCRATCH_PAD_WAYS >= n_scratchpad_ways ) ; }
Configure the L2 scratchpad based on linker symbols:
  __l2_scratchpad_vma_start
  __l2_scratchpad_vma_end
Configure the L2 scratchpad based on linker symbols : __l2_scratchpad_vma_start __l2_scratchpad_vma_end
/*
     * Figure out how many cache ways will be required from linker script
     * symbols.
     */