bsp/leon3: Add LEON3_IRQAMP_EXTENDED_INTERRUPT

This commit is contained in:
Sebastian Huber
2021-08-03 19:55:14 +02:00
parent 1d1c0e5d9a
commit f6b7279687
4 changed files with 33 additions and 0 deletions

View File

@@ -103,7 +103,11 @@ extern struct ambapp_dev *LEON3_IrqCtrl_Adev;
*
* This object should be read-only after initialization.
*/
#if defined(LEON3_IRQAMP_EXTENDED_INTERRUPT)
#define LEON3_IrqCtrl_EIrq LEON3_IRQAMP_EXTENDED_INTERRUPT
#else
extern uint32_t LEON3_IrqCtrl_EIrq;
#endif
/**
* @brief Initializes the interrupt controller for the boot processor.

View File

@@ -35,8 +35,10 @@
#include <bsp/irq-generic.h>
#include <bsp/irqimpl.h>
#if !defined(LEON3_IRQAMP_EXTENDED_INTERRUPT)
/* GRLIB extended IRQ controller IRQ number */
uint32_t LEON3_IrqCtrl_EIrq;
#endif
rtems_interrupt_lock LEON3_IrqCtrl_Lock =
RTEMS_INTERRUPT_LOCK_INITIALIZER("LEON3 IrqCtrl");
@@ -47,7 +49,9 @@ void leon3_ext_irq_init(irqamp *regs)
grlib_store_32(&regs->pimask[LEON3_Cpu_Index], 0);
grlib_store_32(&regs->piforce[LEON3_Cpu_Index], 0);
grlib_store_32(&regs->iclear, 0xffffffff);
#if !defined(LEON3_IRQAMP_EXTENDED_INTERRUPT)
LEON3_IrqCtrl_EIrq = IRQAMP_MPSTAT_EIRQ_GET(grlib_load_32(&regs->mpstat));
#endif
}
bool bsp_interrupt_is_valid_vector(rtems_vector_number vector)
@@ -56,11 +60,15 @@ bool bsp_interrupt_is_valid_vector(rtems_vector_number vector)
return false;
}
#if defined(LEON3_IRQAMP_EXTENDED_INTERRUPT)
return vector <= BSP_INTERRUPT_VECTOR_MAX_EXT;
#else
if (LEON3_IrqCtrl_EIrq > 0) {
return vector <= BSP_INTERRUPT_VECTOR_MAX_EXT;
}
return vector <= BSP_INTERRUPT_VECTOR_MAX_STD;
#endif
}
#if defined(RTEMS_SMP)

View File

@@ -42,6 +42,8 @@ links:
uid: optgptimerbase
- role: build-dependency
uid: optirqampbase
- role: build-dependency
uid: optirqampextirq
- role: build-dependency
uid: optirqampts
- role: build-dependency

View File

@@ -0,0 +1,19 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2021 embedded brains GmbH & Co. KG
actions:
- get-integer: null
- format-and-define: null
build-type: option
default:
- enabled-by: sparc/gr712rc
value: 12
- enabled-by: sparc/gr740
value: 10
enabled-by: true
format: '{}'
links: []
name: LEON3_IRQAMP_EXTENDED_INTERRUPT
description: |
This option specifies the interrupt line of the IRQ(A)MP extended interrupt.
type: build