Changeset 93b000e in rtems


Ignore:
Timestamp:
Oct 1, 2014, 11:53:03 AM (6 years ago)
Author:
Daniel Cederman <cederman@…>
Branches:
4.11, master
Children:
9a8b2984
Parents:
456eab7d
git-author:
Daniel Cederman <cederman@…> (10/01/14 11:53:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/02/14 05:29:05)
Message:

bsp/leon3: Replace the define LEON3_MP_IRQ with a weakly linked variable

The LEON3_MP_IRQ define is used to pick the IRQ to be used by the
shared memory driver and for inter-processor interrupts. On some LEON3
systems, for example the GR712RC, the default value of 14 is not suitable.
To make this value configurable from the application, it is replaced with
a weakly linked variable that can be overridden from the application.

Location:
c/src/lib/libbsp/sparc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/include/bsp.h

    r456eab7d r93b000e  
    216216extern void BSP_shared_interrupt_mask(int irq);
    217217
     218/* Irq used by the shared memory driver and for inter-processor interrupts.
     219 * The variable is weakly linked. Redefine the variable in your application
     220 * to override the BSP default.
     221 * See startup/bspsmp.c for the default value.
     222 */
     223extern unsigned char LEON3_mp_irq;
     224
    218225#ifdef __cplusplus
    219226}
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r456eab7d r93b000e  
    119119
    120120/* Macros used for manipulating bits in LEON3 GP Timer Control Register */
    121 
    122 #define LEON3_MP_IRQ    14        /* Irq used by shared memory driver */
    123121
    124122#define LEON3_IRQMPSTATUS_CPUNR     28
  • c/src/lib/libbsp/sparc/leon3/shmsupp/getcfg.c

    r456eab7d r93b000e  
    6161  {
    6262    NULL,
    63     1 << LEON3_MP_IRQ,      /* USER OVERRIDABLE */
     63    0,                      /* USER OVERRIDABLE - Uses default MP-IRQ if 0 */
    6464    4,
    6565  },
     
    9494     (vol_u32 *) &(LEON3_IrqCtrl_Regs->force[LEON3_Cpu_Index]);
    9595  if (BSP_shm_cfgtbl.Intr.value == 0)
    96     BSP_shm_cfgtbl.Intr.value = 1 << LEON3_MP_IRQ; /* Use default MP-IRQ */
     96    BSP_shm_cfgtbl.Intr.value = 1 << LEON3_mp_irq; /* Use default MP-IRQ */
    9797  BSP_shm_cfgtbl.Intr.length  = 4;
    9898
  • c/src/lib/libbsp/sparc/leon3/shmsupp/mpisr.c

    r456eab7d r93b000e  
    4646   * This is thought to be the interrupt to use.
    4747   */
    48   LEON_Unmask_interrupt(LEON3_MP_IRQ);
    49   set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
     48  LEON_Unmask_interrupt(LEON3_mp_irq);
     49  set_vector((rtems_isr_entry) Shm_isr, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
    5050}
  • c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c

    r456eab7d r93b000e  
    2222#include <stdlib.h>
    2323
     24/* Irq used by shared memory driver and for inter-processor interrupts.
     25 * Can be overridden by being defined in the application.
     26 */
     27unsigned char LEON3_mp_irq __attribute__((weak)) = 14;
     28
    2429#if !defined(__leon__) || defined(RTEMS_PARAVIRT)
    2530uint32_t _CPU_SMP_Get_current_processor( void )
     
    4247  leon3_set_cache_control_register(0x80000F);
    4348  /* Unmask IPI interrupts at Interrupt controller for this CPU */
    44   LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_MP_IRQ;
     49  LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;
    4550
    4651  _SMP_Start_multitasking_on_secondary_processor();
     
    5257
    5358  if ( rtems_configuration_get_maximum_processors() > 1 ) {
    54     LEON_Unmask_interrupt(LEON3_MP_IRQ);
    55     set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
     59    LEON_Unmask_interrupt(LEON3_mp_irq);
     60    set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
    5661  }
    5762
     
    8085{
    8186  /* send interrupt to destination CPU */
    82   LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_MP_IRQ;
     87  LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq;
    8388}
    8489
  • c/src/lib/libbsp/sparc/shared/irq/irq-shared.c

    r456eab7d r93b000e  
    3333
    3434       for (i=0; i <= BSP_INTERRUPT_VECTOR_MAX_STD; i++) {
    35 #if defined(LEON3_MP_IRQ) && \
     35#if defined(LEON3) && \
    3636    (defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
    3737               /* Don't install IRQ handler on IPI interrupt */
    38                if (i == LEON3_MP_IRQ)
     38               if (i == LEON3_mp_irq)
    3939                       continue;
    4040#endif
Note: See TracChangeset for help on using the changeset viewer.