Changeset 77a2226 in rtems


Ignore:
Timestamp:
Sep 10, 2014, 11:39:53 AM (6 years ago)
Author:
Daniel Cederman <cederman@…>
Branches:
4.11, 5, master
Children:
3e739ae
Parents:
cf4f962
git-author:
Daniel Cederman <cederman@…> (09/10/14 11:39:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/23/14 08:21:41)
Message:

bsp/sparc: Ensure that data cache snooping is enabled

Check that data cache snooping exists and is enabled on all cores.

Location:
c/src/lib/libbsp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/include/fatal.h

    rcf4f962 r77a2226  
    5353  LEON3_FATAL_CONSOLE_REGISTER_DEV,
    5454  LEON3_FATAL_CLOCK_INITIALIZATION,
     55  LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR,
     56  LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR,
    5557
    5658  /* LPC24XX fatal codes */
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    rcf4f962 r77a2226  
    9191 */
    9292#define LEON3_REG_CACHE_CTRL_FI      0x00200000 /* Flush instruction cache */
     93#define LEON3_REG_CACHE_CTRL_DS      0x00800000 /* Data cache snooping */
    9394
    9495/* LEON3 Interrupt Controller */
     
    360361}
    361362
     363static inline bool leon3_data_cache_snooping_enabled(void)
     364{
     365  return leon3_get_cache_control_register() & LEON3_REG_CACHE_CTRL_DS;
     366}
     367
    362368static inline uint32_t leon3_get_inst_cache_config_register(void)
    363369{
  • c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c

    rcf4f962 r77a2226  
    1616#include <bsp.h>
    1717#include <bsp/bootcard.h>
     18#include <bsp/fatal.h>
    1819#include <cache_.h>
    1920#include <leon.h>
     
    4546  uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();
    4647
    47   leon3_set_cache_control_register(0x80000F);
     48  /*
     49   * If data cache snooping is not enabled we terminate using BSP_fatal_exit()
     50   * instead of bsp_fatal().  This is done since the latter function tries to
     51   * acquire a ticket lock, an operation which requires data cache snooping to
     52   * be enabled.
     53   */
     54  if ( !leon3_data_cache_snooping_enabled() )
     55    BSP_fatal_exit( LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR );
     56
    4857  /* Unmask IPI interrupts at Interrupt controller for this CPU */
    4958  LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;
     
    5463uint32_t _CPU_SMP_Initialize( void )
    5564{
    56   leon3_set_cache_control_register(0x80000F);
     65  if ( !leon3_data_cache_snooping_enabled() )
     66    bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
    5767
    5868  if ( rtems_configuration_get_maximum_processors() > 1 ) {
Note: See TracChangeset for help on using the changeset viewer.