irq: Add flags to IRQ_CONNECT_STATIC() macro and irq_connect() function
Flags allow passing IRQ triggering option for x86 architecture. Each platform defines flags for a particular device and then device driver uses them when registers the interrupt handler. The change in API means that device drivers and sample applications need to use the new API. IRQ triggering configuration is now handled by device drivers by using flags passed to interrupt registering API: IRQ_CONNECT_STATIC() or irq_connect() Change-Id: Ibc4312ea2b4032a2efc5b913c6389f780a2a11d1 Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This commit is contained in:
parent
4a61c2824b
commit
f1420515a7
35 changed files with 164 additions and 469 deletions
|
@ -159,9 +159,11 @@ int irq_connect(
|
||||||
unsigned int irq,
|
unsigned int irq,
|
||||||
unsigned int prio,
|
unsigned int prio,
|
||||||
void (*isr)(void *arg),
|
void (*isr)(void *arg),
|
||||||
void *arg
|
void *arg,
|
||||||
|
uint32_t flags
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
ARG_UNUSED(flags);
|
||||||
_irq_handler_set(irq, isr, arg);
|
_irq_handler_set(irq, isr, arg);
|
||||||
_irq_priority_set(irq, prio);
|
_irq_priority_set(irq, prio);
|
||||||
return irq;
|
return irq;
|
||||||
|
|
|
@ -139,8 +139,10 @@ void _irq_spurious(void *unused)
|
||||||
int irq_connect(unsigned int irq,
|
int irq_connect(unsigned int irq,
|
||||||
unsigned int prio,
|
unsigned int prio,
|
||||||
void (*isr)(void *arg),
|
void (*isr)(void *arg),
|
||||||
void *arg)
|
void *arg,
|
||||||
|
uint32_t flags)
|
||||||
{
|
{
|
||||||
|
ARG_UNUSED(flags);
|
||||||
_irq_handler_set(irq, isr, arg);
|
_irq_handler_set(irq, isr, arg);
|
||||||
_irq_priority_set(irq, prio);
|
_irq_priority_set(irq, prio);
|
||||||
return irq;
|
return irq;
|
||||||
|
|
|
@ -165,6 +165,8 @@
|
||||||
#define CONFIG_UART_PORT_4_REGS PERIPH_ADDR_BASE_UART4
|
#define CONFIG_UART_PORT_4_REGS PERIPH_ADDR_BASE_UART4
|
||||||
#define CONFIG_UART_PORT_4_IRQ IRQ_UART4_STATUS
|
#define CONFIG_UART_PORT_4_IRQ IRQ_UART4_STATUS
|
||||||
|
|
||||||
|
#define UART_IRQ_FLAGS 0
|
||||||
|
|
||||||
extern struct device * const uart_devs[];
|
extern struct device * const uart_devs[];
|
||||||
|
|
||||||
/* Uart console settings */
|
/* Uart console settings */
|
||||||
|
|
|
@ -99,6 +99,8 @@
|
||||||
#define CONFIG_UART_PORT_2_REGS PERIPH_ADDR_BASE_UART2
|
#define CONFIG_UART_PORT_2_REGS PERIPH_ADDR_BASE_UART2
|
||||||
#define CONFIG_UART_PORT_2_IRQ IRQ_UART2
|
#define CONFIG_UART_PORT_2_IRQ IRQ_UART2
|
||||||
|
|
||||||
|
#define UART_IRQ_FLAGS 0
|
||||||
|
|
||||||
extern struct device * const uart_devs[];
|
extern struct device * const uart_devs[];
|
||||||
|
|
||||||
/* Uart console configuration */
|
/* Uart console configuration */
|
||||||
|
|
|
@ -157,6 +157,7 @@ extern void *_DynIntStubsBegin;
|
||||||
* @param priority requested priority of interrupt
|
* @param priority requested priority of interrupt
|
||||||
* @param routine the C interrupt handler
|
* @param routine the C interrupt handler
|
||||||
* @param parameter parameter passed to C routine
|
* @param parameter parameter passed to C routine
|
||||||
|
* @param flags IRQ flags
|
||||||
*
|
*
|
||||||
* This routine connects an interrupt service routine (ISR) coded in C to
|
* This routine connects an interrupt service routine (ISR) coded in C to
|
||||||
* the specified hardware <irq>. An interrupt vector will be allocated to
|
* the specified hardware <irq>. An interrupt vector will be allocated to
|
||||||
|
@ -178,6 +179,9 @@ extern void *_DynIntStubsBegin;
|
||||||
* will then be invoked with the single <parameter>. When the ISR returns, a
|
* will then be invoked with the single <parameter>. When the ISR returns, a
|
||||||
* context switch may occur.
|
* context switch may occur.
|
||||||
*
|
*
|
||||||
|
* On some platforms <flags> parameter needs to be specified to indicate if
|
||||||
|
* the irq is triggered by low or high level or by rising or falling edge.
|
||||||
|
*
|
||||||
* The routine searches for the first available element in the dynamic_stubs
|
* The routine searches for the first available element in the dynamic_stubs
|
||||||
* array and uses it for the stub.
|
* array and uses it for the stub.
|
||||||
*
|
*
|
||||||
|
@ -199,7 +203,8 @@ extern void *_DynIntStubsBegin;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int irq_connect(unsigned int irq, unsigned int priority,
|
int irq_connect(unsigned int irq, unsigned int priority,
|
||||||
void (*routine)(void *parameter), void *parameter)
|
void (*routine)(void *parameter), void *parameter,
|
||||||
|
uint32_t flags)
|
||||||
{
|
{
|
||||||
int vector;
|
int vector;
|
||||||
int stub_idx;
|
int stub_idx;
|
||||||
|
@ -217,7 +222,7 @@ int irq_connect(unsigned int irq, unsigned int priority,
|
||||||
* _interrupt_vectors_allocated[] array for a suitable vector.
|
* _interrupt_vectors_allocated[] array for a suitable vector.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
vector = _SysIntVecAlloc(irq, priority);
|
vector = _SysIntVecAlloc(irq, priority, flags);
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
/*
|
/*
|
||||||
* The return value from _SysIntVecAlloc() will be -1 if an invalid
|
* The return value from _SysIntVecAlloc() will be -1 if an invalid
|
||||||
|
|
|
@ -36,17 +36,17 @@
|
||||||
#include <drivers/ioapic.h>
|
#include <drivers/ioapic.h>
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL)
|
||||||
#endif
|
#endif
|
||||||
#else /* edge triggered interrupt */
|
#else /* edge triggered interrupt */
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
/* generate interrupt on falling edge */
|
/* generate interrupt on falling edge */
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
/* generate interrupt on raising edge */
|
/* generate interrupt on raising edge */
|
||||||
#define UART_IOAPIC_FLAGS (0)
|
#define UART_IRQ_FLAGS (0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -94,13 +94,13 @@ extern struct device * const uart_devs[];
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_DW_0
|
#ifdef CONFIG_GPIO_DW_0
|
||||||
#if defined(CONFIG_GPIO_DW_0_FALLING_EDGE)
|
#if defined(CONFIG_GPIO_DW_0_FALLING_EDGE)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_RISING_EDGE)
|
#elif defined(CONFIG_GPIO_DW_0_RISING_EDGE)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_LEVEL_HIGH)
|
#elif defined(CONFIG_GPIO_DW_0_LEVEL_HIGH)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_LEVEL_LOW)
|
#elif defined(CONFIG_GPIO_DW_0_LEVEL_LOW)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
#endif /* GPIO_DW_0 */
|
#endif /* GPIO_DW_0 */
|
||||||
|
|
||||||
|
@ -121,29 +121,57 @@ extern struct device * const uart_devs[];
|
||||||
#include <drivers/ioapic.h>
|
#include <drivers/ioapic.h>
|
||||||
|
|
||||||
#if defined(CONFIG_I2C_DW_IRQ_FALLING_EDGE)
|
#if defined(CONFIG_I2C_DW_IRQ_FALLING_EDGE)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_RISING_EDGE)
|
#elif defined(CONFIG_I2C_DW_IRQ_RISING_EDGE)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_HIGH)
|
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_HIGH)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_LOW)
|
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_LOW)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_I2C_DW_0 */
|
#endif /* CONFIG_I2C_DW_0 */
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL
|
#ifdef CONFIG_SPI_INTEL
|
||||||
#if defined(CONFIG_SPI_INTEL_FALLING_EDGE)
|
#if defined(CONFIG_SPI_INTEL_FALLING_EDGE)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_SPI_INTEL_RISING_EDGE)
|
#elif defined(CONFIG_SPI_INTEL_RISING_EDGE)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_SPI_INTEL_LEVEL_HIGH)
|
#elif defined(CONFIG_SPI_INTEL_LEVEL_HIGH)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_SPI_INTEL_LEVEL_LOW)
|
#elif defined(CONFIG_SPI_INTEL_LEVEL_LOW)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_SPI_INTEL */
|
#endif /* CONFIG_SPI_INTEL */
|
||||||
|
|
||||||
|
#if defined (CONFIG_SHARED_IRQ) && defined (CONFIG_IOAPIC)
|
||||||
|
|
||||||
|
#if CONFIG_SHARED_IRQ_0
|
||||||
|
#if defined(CONFIG_SHARED_IRQ_0_FALLING_EDGE)
|
||||||
|
#define SHARED_IRQ_0_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_0_RISING_EDGE)
|
||||||
|
#define SHARED_IRQ_0_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_0_LEVEL_HIGH)
|
||||||
|
#define SHARED_IRQ_0_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_0_LEVEL_LOW)
|
||||||
|
#define SHARED_IRQ_0_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
|
#endif
|
||||||
|
#endif /* CONFIG_SHARED_IRQ_0 */
|
||||||
|
|
||||||
|
#if CONFIG_SHARED_IRQ_1
|
||||||
|
#if defined(CONFIG_SHARED_IRQ_1_FALLING_EDGE)
|
||||||
|
#define SHARED_IRQ_1_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_1_RISING_EDGE)
|
||||||
|
#define SHARED_IRQ_1_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_1_LEVEL_HIGH)
|
||||||
|
#define SHARED_IRQ_1_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
|
#elif defined(CONFIG_SHARED_IRQ_1_LEVEL_LOW)
|
||||||
|
#define SHARED_IRQ_1_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
|
#endif
|
||||||
|
#endif /* CONFIG_SHARED_IRQ_1 */
|
||||||
|
|
||||||
|
#endif /* CONFIG_SHARED_IRQ && CONFIG_IOAPIC */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The irq_connect() API connects to a (virtualized) IRQ and the
|
* The irq_connect() API connects to a (virtualized) IRQ and the
|
||||||
* associated interrupt controller is programmed with the allocated vector.
|
* associated interrupt controller is programmed with the allocated vector.
|
||||||
|
@ -213,6 +241,4 @@ static inline int pci_irq2pin(int irq)
|
||||||
return irq - NUM_STD_IRQS + 1;
|
return irq - NUM_STD_IRQS + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void _SysIntVecProgram(unsigned int vector, unsigned int);
|
|
||||||
|
|
||||||
#endif /* __INCboardh */
|
#endif /* __INCboardh */
|
||||||
|
|
|
@ -38,118 +38,8 @@
|
||||||
#include <drivers/pci/pci_mgr.h>
|
#include <drivers/pci/pci_mgr.h>
|
||||||
#include <drivers/loapic.h>
|
#include <drivers/loapic.h>
|
||||||
#include <drivers/ioapic.h>
|
#include <drivers/ioapic.h>
|
||||||
#include <drivers/hpet.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_I2C_DW_0
|
|
||||||
#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT
|
|
||||||
static int dw_i2c0_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_I2C_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_I2C_DW_0_IRQ),
|
|
||||||
I2C_DW_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(i2cirq_0, "", dw_i2c0_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(i2cirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_I2C_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_I2C_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_DW_0
|
|
||||||
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
|
|
||||||
static int gpio_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_GPIO_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_GPIO_DW_0_IRQ),
|
|
||||||
GPIO_DW_0_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(gpioirq_0, "", gpio_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(gpioirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_GPIO_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL_PORT_0
|
|
||||||
static int spi_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_SPI_INTEL_PORT_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SPI_INTEL_PORT_0_IRQ),
|
|
||||||
SPI_INTEL_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(spiirq_0, "", spi_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(spiirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SPI_INTEL_PORT_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL_PORT_1
|
|
||||||
static int spi_irq_set_1(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_SPI_INTEL_PORT_1_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SPI_INTEL_PORT_1_IRQ),
|
|
||||||
SPI_INTEL_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(spiirq_1, "", spi_irq_set_1, NULL);
|
|
||||||
pre_kernel_early_init(spiirq_1, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SPI_INTEL_PORT_1 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_ETH_DW_0
|
|
||||||
#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
|
|
||||||
static int eth_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_ETH_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_ETH_DW_0_IRQ),
|
|
||||||
ETH_DW_0_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(ethirq_0, "", eth_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(ethirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_ETH_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_ETH_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SHARED_IRQ
|
|
||||||
#ifdef CONFIG_IOAPIC
|
|
||||||
#include <drivers/ioapic.h>
|
|
||||||
|
|
||||||
#if defined(CONFIG_SHARED_IRQ_0_FALLING_EDGE)
|
|
||||||
#define SHARED_IRQ_0_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_0_RISING_EDGE)
|
|
||||||
#define SHARED_IRQ_0_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_0_LEVEL_HIGH)
|
|
||||||
#define SHARED_IRQ_0_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_0_LEVEL_LOW)
|
|
||||||
#define SHARED_IRQ_0_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_SHARED_IRQ_1_FALLING_EDGE)
|
|
||||||
#define SHARED_IRQ_1_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_1_RISING_EDGE)
|
|
||||||
#define SHARED_IRQ_1_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_1_LEVEL_HIGH)
|
|
||||||
#define SHARED_IRQ_1_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
|
||||||
#elif defined(CONFIG_SHARED_IRQ_1_LEVEL_LOW)
|
|
||||||
#define SHARED_IRQ_1_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* CONFIG_IOAPIC */
|
|
||||||
#endif /* CONFIG_SHARED_IRQ */
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI_LEGACY_BRIDGE
|
#ifdef CONFIG_PCI_LEGACY_BRIDGE
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -184,58 +74,6 @@ DECLARE_DEVICE_INIT_CONFIG(pci_legacy_bridge_0, "", pci_legacy_bridge_irq_config
|
||||||
pre_kernel_late_init(pci_legacy_bridge_0, NULL);
|
pre_kernel_late_init(pci_legacy_bridge_0, NULL);
|
||||||
#endif /* CONFIG_PCI_LEGACY_BRIDGE */
|
#endif /* CONFIG_PCI_LEGACY_BRIDGE */
|
||||||
|
|
||||||
#ifdef CONFIG_CONSOLE_HANDLER
|
|
||||||
|
|
||||||
static int console_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
_ioapic_irq_set(CONFIG_UART_CONSOLE_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_UART_CONSOLE_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(consoleirq, "", console_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(consoleirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_CONSOLE_HANDLER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_BLUETOOTH_UART
|
|
||||||
|
|
||||||
static int bluetooth_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
_ioapic_irq_set(CONFIG_BLUETOOTH_UART_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_BLUETOOTH_UART_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(btirq, "", bluetooth_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(btirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_BLUETOOTH_UART */
|
|
||||||
|
|
||||||
#ifdef CONFIG_HPET_TIMER
|
|
||||||
|
|
||||||
static int hpet_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_HPET_TIMER_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_HPET_TIMER_IRQ),
|
|
||||||
HPET_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(hpetirq, "", hpet_irq_set, NULL);
|
|
||||||
pre_kernel_early_init(hpetirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_HPET_TIMER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_IOAPIC
|
#ifdef CONFIG_IOAPIC
|
||||||
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
||||||
pre_kernel_core_init(ioapic_0, NULL);
|
pre_kernel_core_init(ioapic_0, NULL);
|
||||||
|
@ -254,29 +92,3 @@ DECLARE_DEVICE_INIT_CONFIG(pic_0, "", _i8259_init, NULL);
|
||||||
pre_kernel_core_init(pic_0, NULL);
|
pre_kernel_core_init(pic_0, NULL);
|
||||||
|
|
||||||
#endif /* CONFIG_PIC_DISABLE */
|
#endif /* CONFIG_PIC_DISABLE */
|
||||||
|
|
||||||
#ifdef CONFIG_SHARED_IRQ
|
|
||||||
|
|
||||||
static int shared_irq_config(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
#ifdef SHARED_IRQ_0_IOAPIC_FLAGS
|
|
||||||
_ioapic_irq_set(CONFIG_SHARED_IRQ_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SHARED_IRQ_0_IRQ),
|
|
||||||
SHARED_IRQ_0_IOAPIC_FLAGS);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SHARED_IRQ_1_IOAPIC_FLAGS
|
|
||||||
_ioapic_irq_set(CONFIG_SHARED_IRQ_1_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SHARED_IRQ_1_IRQ),
|
|
||||||
SHARED_IRQ_1_IOAPIC_FLAGS);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(sharedirqcfg, "", shared_irq_config, NULL);
|
|
||||||
pre_kernel_early_init(sharedirqcfg, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SHARED_IRQ */
|
|
||||||
|
|
|
@ -36,17 +36,17 @@
|
||||||
#include <drivers/ioapic.h>
|
#include <drivers/ioapic.h>
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL)
|
||||||
#endif
|
#endif
|
||||||
#else /* edge triggered interrupt */
|
#else /* edge triggered interrupt */
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
/* generate interrupt on falling edge */
|
/* generate interrupt on falling edge */
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
/* generate interrupt on raising edge */
|
/* generate interrupt on raising edge */
|
||||||
#define UART_IOAPIC_FLAGS (0)
|
#define UART_IRQ_FLAGS (0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,10 +119,4 @@ extern struct device * const uart_devs[];
|
||||||
|
|
||||||
#endif /* CONFIG_NS16550 */
|
#endif /* CONFIG_NS16550 */
|
||||||
|
|
||||||
#ifndef _ASMLANGUAGE
|
|
||||||
|
|
||||||
extern void _SysIntVecProgram(unsigned int vector, unsigned int);
|
|
||||||
|
|
||||||
#endif /* !_ASMLANGUAGE */
|
|
||||||
|
|
||||||
#endif /* __INCboardh */
|
#endif /* __INCboardh */
|
||||||
|
|
|
@ -50,58 +50,6 @@ static int ia32_init(struct device *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_CONSOLE_HANDLER
|
|
||||||
|
|
||||||
static int console_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
_ioapic_irq_set(CONFIG_UART_CONSOLE_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_UART_CONSOLE_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(consoleirq, "", console_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(consoleirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_CONSOLE_HANDLER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_BLUETOOTH_UART
|
|
||||||
|
|
||||||
static int bluetooth_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
_ioapic_irq_set(CONFIG_BLUETOOTH_UART_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_BLUETOOTH_UART_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(btirq, "", bluetooth_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(btirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_BLUETOOTH_UART */
|
|
||||||
|
|
||||||
#ifdef CONFIG_HPET_TIMER
|
|
||||||
|
|
||||||
static int hpet_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_HPET_TIMER_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_HPET_TIMER_IRQ),
|
|
||||||
HPET_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(hpetirq, "", hpet_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(hpetirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_HPET_TIMER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_IOAPIC
|
#ifdef CONFIG_IOAPIC
|
||||||
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
||||||
pre_kernel_core_init(ioapic_0, NULL);
|
pre_kernel_core_init(ioapic_0, NULL);
|
||||||
|
|
|
@ -36,17 +36,17 @@
|
||||||
#include <drivers/ioapic.h>
|
#include <drivers/ioapic.h>
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
#ifdef CONFIG_SERIAL_INTERRUPT_LEVEL
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LEVEL)
|
#define UART_IRQ_FLAGS (IOAPIC_LEVEL)
|
||||||
#endif
|
#endif
|
||||||
#else /* edge triggered interrupt */
|
#else /* edge triggered interrupt */
|
||||||
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
#ifdef CONFIG_SERIAL_INTERRUPT_LOW
|
||||||
/* generate interrupt on falling edge */
|
/* generate interrupt on falling edge */
|
||||||
#define UART_IOAPIC_FLAGS (IOAPIC_LOW)
|
#define UART_IRQ_FLAGS (IOAPIC_LOW)
|
||||||
#else
|
#else
|
||||||
/* generate interrupt on raising edge */
|
/* generate interrupt on raising edge */
|
||||||
#define UART_IOAPIC_FLAGS (0)
|
#define UART_IRQ_FLAGS (0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,13 +90,13 @@ extern struct device * const uart_devs[];
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_DW_0
|
#ifdef CONFIG_GPIO_DW_0
|
||||||
#if defined(CONFIG_GPIO_DW_0_FALLING_EDGE)
|
#if defined(CONFIG_GPIO_DW_0_FALLING_EDGE)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_RISING_EDGE)
|
#elif defined(CONFIG_GPIO_DW_0_RISING_EDGE)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_LEVEL_HIGH)
|
#elif defined(CONFIG_GPIO_DW_0_LEVEL_HIGH)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_GPIO_DW_0_LEVEL_LOW)
|
#elif defined(CONFIG_GPIO_DW_0_LEVEL_LOW)
|
||||||
#define GPIO_DW_0_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define GPIO_DW_0_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
#endif /* GPIO_DW_0 */
|
#endif /* GPIO_DW_0 */
|
||||||
|
|
||||||
|
@ -114,29 +114,27 @@ extern struct device * const uart_devs[];
|
||||||
|
|
||||||
#ifdef CONFIG_I2C_DW
|
#ifdef CONFIG_I2C_DW
|
||||||
|
|
||||||
#include <drivers/ioapic.h>
|
|
||||||
|
|
||||||
#if defined(CONFIG_I2C_DW_IRQ_FALLING_EDGE)
|
#if defined(CONFIG_I2C_DW_IRQ_FALLING_EDGE)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_RISING_EDGE)
|
#elif defined(CONFIG_I2C_DW_IRQ_RISING_EDGE)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_HIGH)
|
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_HIGH)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_LOW)
|
#elif defined(CONFIG_I2C_DW_IRQ_LEVEL_LOW)
|
||||||
#define I2C_DW_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define I2C_DW_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_I2C_DW_0 */
|
#endif /* CONFIG_I2C_DW_0 */
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL
|
#ifdef CONFIG_SPI_INTEL
|
||||||
#if defined(CONFIG_SPI_INTEL_FALLING_EDGE)
|
#if defined(CONFIG_SPI_INTEL_FALLING_EDGE)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||||
#elif defined(CONFIG_SPI_INTEL_RISING_EDGE)
|
#elif defined(CONFIG_SPI_INTEL_RISING_EDGE)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_EDGE | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_SPI_INTEL_LEVEL_HIGH)
|
#elif defined(CONFIG_SPI_INTEL_LEVEL_HIGH)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_HIGH)
|
||||||
#elif defined(CONFIG_SPI_INTEL_LEVEL_LOW)
|
#elif defined(CONFIG_SPI_INTEL_LEVEL_LOW)
|
||||||
#define SPI_INTEL_IRQ_IOAPIC_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
#define SPI_INTEL_IRQ_FLAGS (IOAPIC_LEVEL | IOAPIC_LOW)
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_SPI_INTEL */
|
#endif /* CONFIG_SPI_INTEL */
|
||||||
|
|
||||||
|
@ -209,6 +207,4 @@ static inline int pci_irq2pin(int irq)
|
||||||
return irq - NUM_STD_IRQS + 1;
|
return irq - NUM_STD_IRQS + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void _SysIntVecProgram(unsigned int vector, unsigned int);
|
|
||||||
|
|
||||||
#endif /* __INCboardh */
|
#endif /* __INCboardh */
|
||||||
|
|
|
@ -41,137 +41,6 @@
|
||||||
#include <drivers/hpet.h>
|
#include <drivers/hpet.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_I2C_DW_0
|
|
||||||
#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT
|
|
||||||
static int dw_i2c0_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_I2C_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_I2C_DW_0_IRQ),
|
|
||||||
I2C_DW_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(i2cirq_0, "", dw_i2c0_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(i2cirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_I2C_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_I2C_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_DW_0
|
|
||||||
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
|
|
||||||
static int gpio_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_GPIO_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_GPIO_DW_0_IRQ),
|
|
||||||
GPIO_DW_0_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(gpioirq_0, "", gpio_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(gpioirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_GPIO_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL_PORT_0
|
|
||||||
static int spi_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_SPI_INTEL_PORT_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SPI_INTEL_PORT_0_IRQ),
|
|
||||||
SPI_INTEL_IRQ_IOAPIC_FLAGS);
|
|
||||||
return DEV_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(spiirq_0, "", spi_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(spiirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SPI_INTEL_PORT_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SPI_INTEL_PORT_1
|
|
||||||
static int spi_irq_set_1(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_SPI_INTEL_PORT_1_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_SPI_INTEL_PORT_1_IRQ),
|
|
||||||
SPI_INTEL_IRQ_IOAPIC_FLAGS);
|
|
||||||
return DEV_OK;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(spiirq_1, "", spi_irq_set_1, NULL);
|
|
||||||
pre_kernel_early_init(spiirq_1, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_SPI_INTEL_PORT_1 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_ETH_DW_0
|
|
||||||
#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
|
|
||||||
static int eth_irq_set_0(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_ETH_DW_0_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_ETH_DW_0_IRQ),
|
|
||||||
ETH_DW_0_IRQ_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(ethirq_0, "", eth_irq_set_0, NULL);
|
|
||||||
pre_kernel_early_init(ethirq_0, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_ETH_DW_0_IRQ_DIRECT */
|
|
||||||
#endif /* CONFIG_ETH_DW_0 */
|
|
||||||
|
|
||||||
#ifdef CONFIG_CONSOLE_HANDLER
|
|
||||||
|
|
||||||
static int console_irq_set(struct device *unsued)
|
|
||||||
{
|
|
||||||
#if defined(CONFIG_UART_CONSOLE)
|
|
||||||
_ioapic_irq_set(CONFIG_UART_CONSOLE_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_UART_CONSOLE_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(consoleirq, "", console_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(consoleirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_CONSOLE_HANDLER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_BLUETOOTH_UART
|
|
||||||
static int bluetooth_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
|
|
||||||
_ioapic_irq_set(CONFIG_BLUETOOTH_UART_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_BLUETOOTH_UART_IRQ),
|
|
||||||
UART_IOAPIC_FLAGS);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(btirq, "", bluetooth_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(btirq, NULL);
|
|
||||||
#endif /* CONFIG_BLUETOOTH_UART */
|
|
||||||
|
|
||||||
#ifdef CONFIG_HPET_TIMER
|
|
||||||
|
|
||||||
static int hpet_irq_set(struct device *unused)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(unused);
|
|
||||||
_ioapic_irq_set(CONFIG_HPET_TIMER_IRQ,
|
|
||||||
_IRQ_TO_INTERRUPT_VECTOR(CONFIG_HPET_TIMER_IRQ),
|
|
||||||
HPET_IOAPIC_FLAGS);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DECLARE_DEVICE_INIT_CONFIG(hpetirq, "", hpet_irq_set, NULL);
|
|
||||||
pre_kernel_late_init(hpetirq, NULL);
|
|
||||||
|
|
||||||
#endif /* CONFIG_HPET_TIMER */
|
|
||||||
|
|
||||||
#ifdef CONFIG_IOAPIC
|
#ifdef CONFIG_IOAPIC
|
||||||
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
DECLARE_DEVICE_INIT_CONFIG(ioapic_0, "", _ioapic_init, NULL);
|
||||||
pre_kernel_core_init(ioapic_0, NULL);
|
pre_kernel_core_init(ioapic_0, NULL);
|
||||||
|
|
|
@ -234,7 +234,8 @@ static int bt_uart_send(enum bt_buf_type buf_type, struct net_buf *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(bluetooth, CONFIG_BLUETOOTH_UART_IRQ,
|
IRQ_CONNECT_STATIC(bluetooth, CONFIG_BLUETOOTH_UART_IRQ,
|
||||||
CONFIG_BLUETOOTH_UART_INT_PRI, bt_uart_isr, 0);
|
CONFIG_BLUETOOTH_UART_INT_PRI, bt_uart_isr, 0,
|
||||||
|
UART_IRQ_FLAGS);
|
||||||
|
|
||||||
static void bt_uart_setup(struct device *uart, struct uart_init_info *info)
|
static void bt_uart_setup(struct device *uart, struct uart_init_info *info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -175,7 +175,8 @@ void uart_console_isr(void *unused)
|
||||||
}
|
}
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(console, CONFIG_UART_CONSOLE_IRQ,
|
IRQ_CONNECT_STATIC(console, CONFIG_UART_CONSOLE_IRQ,
|
||||||
CONFIG_UART_CONSOLE_INT_PRI, uart_console_isr, 0);
|
CONFIG_UART_CONSOLE_INT_PRI, uart_console_isr, 0,
|
||||||
|
UART_IRQ_FLAGS);
|
||||||
|
|
||||||
static void console_input_init(void)
|
static void console_input_init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -385,7 +385,8 @@ pre_kernel_late_init(gpio_0, &gpio_0_runtime);
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
|
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
|
||||||
IRQ_CONNECT_STATIC(gpio_dw_0, CONFIG_GPIO_DW_0_IRQ,
|
IRQ_CONNECT_STATIC(gpio_dw_0, CONFIG_GPIO_DW_0_IRQ,
|
||||||
CONFIG_GPIO_DW_0_PRI, gpio_dw_isr_0, 0);
|
CONFIG_GPIO_DW_0_PRI, gpio_dw_isr_0, 0,
|
||||||
|
GPIO_DW_0_IRQ_FLAGS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void gpio_config_0_irq(struct device *port)
|
void gpio_config_0_irq(struct device *port)
|
||||||
|
|
|
@ -845,7 +845,8 @@ IRQ_CONNECT_STATIC(i2c_dw_0,
|
||||||
CONFIG_I2C_DW_0_IRQ,
|
CONFIG_I2C_DW_0_IRQ,
|
||||||
CONFIG_I2C_DW_0_INT_PRIORITY,
|
CONFIG_I2C_DW_0_INT_PRIORITY,
|
||||||
i2c_dw_isr,
|
i2c_dw_isr,
|
||||||
0);
|
0,
|
||||||
|
I2C_DW_IRQ_FLAGS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void i2c_config_0(struct device *port)
|
void i2c_config_0(struct device *port)
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
*
|
*
|
||||||
* @param irq virtualized IRQ
|
* @param irq virtualized IRQ
|
||||||
* @param priority get vector from <priority> group
|
* @param priority get vector from <priority> group
|
||||||
|
* @param flags Interrupt flags
|
||||||
*
|
*
|
||||||
* @return the allocated interrupt vector
|
* @return the allocated interrupt vector
|
||||||
*
|
*
|
||||||
|
@ -76,7 +77,8 @@
|
||||||
*/
|
*/
|
||||||
int _SysIntVecAlloc(
|
int _SysIntVecAlloc(
|
||||||
unsigned int irq, /* virtualized IRQ */
|
unsigned int irq, /* virtualized IRQ */
|
||||||
unsigned int priority /* get vector from <priority> group */
|
unsigned int priority, /* get vector from <priority> group */
|
||||||
|
uint32_t flags /* interrupt flags */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int vector;
|
int vector;
|
||||||
|
@ -113,7 +115,7 @@ int _SysIntVecAlloc(
|
||||||
if (irq != NANO_SOFT_IRQ)
|
if (irq != NANO_SOFT_IRQ)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
_SysIntVecProgram(vector, irq);
|
_SysIntVecProgram(vector, irq, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
|
@ -129,7 +131,7 @@ int _SysIntVecAlloc(
|
||||||
* Drivers call this routine instead of irq_connect() when interrupts are
|
* Drivers call this routine instead of irq_connect() when interrupts are
|
||||||
* configured statically.
|
* configured statically.
|
||||||
*
|
*
|
||||||
* The Clanton board virtualizes IRQs as follows:
|
* The Galileo board virtualizes IRQs as follows:
|
||||||
*
|
*
|
||||||
* - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the
|
* - The first CONFIG_IOAPIC_NUM_RTES IRQs are provided by the IOAPIC so the
|
||||||
* IOAPIC is programmed for these IRQs
|
* IOAPIC is programmed for these IRQs
|
||||||
|
@ -138,13 +140,14 @@ int _SysIntVecAlloc(
|
||||||
*
|
*
|
||||||
* @param vector the vector number
|
* @param vector the vector number
|
||||||
* @param irq the virtualized IRQ
|
* @param irq the virtualized IRQ
|
||||||
|
* @param flags interrupt flags
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void _SysIntVecProgram(unsigned int vector, unsigned int irq)
|
void _SysIntVecProgram(unsigned int vector, unsigned int irq, uint32_t flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (irq < CONFIG_IOAPIC_NUM_RTES) {
|
if (irq < CONFIG_IOAPIC_NUM_RTES) {
|
||||||
_ioapic_int_vec_set(irq, vector);
|
_ioapic_irq_set(irq, vector, flags);
|
||||||
} else {
|
} else {
|
||||||
_loapic_int_vec_set(irq - CONFIG_IOAPIC_NUM_RTES, vector);
|
_loapic_int_vec_set(irq - CONFIG_IOAPIC_NUM_RTES, vector);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,8 @@ DECLARE_DEVICE_INIT_CONFIG(shared_irq_0, CONFIG_SHARED_IRQ_0_NAME,
|
||||||
pre_kernel_early_init(shared_irq_0, &shared_irq_0_runtime);
|
pre_kernel_early_init(shared_irq_0, &shared_irq_0_runtime);
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(shared_irq_0, CONFIG_SHARED_IRQ_0_IRQ,
|
IRQ_CONNECT_STATIC(shared_irq_0, CONFIG_SHARED_IRQ_0_IRQ,
|
||||||
CONFIG_SHARED_IRQ_0_PRI, shared_irq_isr_0, 0);
|
CONFIG_SHARED_IRQ_0_PRI, shared_irq_isr_0, 0,
|
||||||
|
SHARED_IRQ_0_FLAGS);
|
||||||
|
|
||||||
void shared_irq_config_0_irq(struct device *port)
|
void shared_irq_config_0_irq(struct device *port)
|
||||||
{
|
{
|
||||||
|
@ -177,7 +178,8 @@ DECLARE_DEVICE_INIT_CONFIG(shared_irq_1, CONFIG_SHARED_IRQ_1_NAME,
|
||||||
pre_kernel_early_init(shared_irq_1, &shared_irq_1_runtime);
|
pre_kernel_early_init(shared_irq_1, &shared_irq_1_runtime);
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(shared_irq_1, CONFIG_SHARED_IRQ_1_IRQ,
|
IRQ_CONNECT_STATIC(shared_irq_1, CONFIG_SHARED_IRQ_1_IRQ,
|
||||||
CONFIG_SHARED_IRQ_1_PRI, shared_irq_isr_1, 0);
|
CONFIG_SHARED_IRQ_1_PRI, shared_irq_isr_1, 0,
|
||||||
|
SHARED_IRQ_1_FLAGS);
|
||||||
|
|
||||||
void shared_irq_config_1_irq(struct device *port)
|
void shared_irq_config_1_irq(struct device *port)
|
||||||
{
|
{
|
||||||
|
|
|
@ -70,7 +70,8 @@ int uart_simple_send(const uint8_t *data, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(uart_simple, CONFIG_UART_SIMPLE_IRQ,
|
IRQ_CONNECT_STATIC(uart_simple, CONFIG_UART_SIMPLE_IRQ,
|
||||||
CONFIG_UART_SIMPLE_INT_PRI, uart_simple_isr, 0);
|
CONFIG_UART_SIMPLE_INT_PRI, uart_simple_isr, 0,
|
||||||
|
UART_IRQ_FLAGS);
|
||||||
|
|
||||||
static void uart_simple_setup(struct device *uart, struct uart_init_info *info)
|
static void uart_simple_setup(struct device *uart, struct uart_init_info *info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -459,7 +459,8 @@ nano_late_init(spi_intel_port_0, &spi_intel_data_port_0);
|
||||||
struct device *spi_intel_isr_port_0 = SYS_GET_DEVICE(spi_intel_port_0);
|
struct device *spi_intel_isr_port_0 = SYS_GET_DEVICE(spi_intel_port_0);
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(spi_intel_irq_port_0, CONFIG_SPI_INTEL_PORT_0_IRQ,
|
IRQ_CONNECT_STATIC(spi_intel_irq_port_0, CONFIG_SPI_INTEL_PORT_0_IRQ,
|
||||||
CONFIG_SPI_INTEL_PORT_0_PRI, spi_intel_isr, 0);
|
CONFIG_SPI_INTEL_PORT_0_PRI, spi_intel_isr, 0,
|
||||||
|
SPI_INTEL_IRQ_FLAGS);
|
||||||
|
|
||||||
void spi_config_0_irq(struct device *dev)
|
void spi_config_0_irq(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -500,7 +501,8 @@ nano_late_init(spi_intel_port_1, &spi_intel_data_port_1);
|
||||||
struct device *spi_intel_isr_port_1 = SYS_GET_DEVICE(spi_intel_port_1);
|
struct device *spi_intel_isr_port_1 = SYS_GET_DEVICE(spi_intel_port_1);
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(spi_intel_irq_port_1, CONFIG_SPI_INTEL_PORT_1_IRQ,
|
IRQ_CONNECT_STATIC(spi_intel_irq_port_1, CONFIG_SPI_INTEL_PORT_1_IRQ,
|
||||||
CONFIG_SPI_INTEL_PORT_1_PRI, spi_intel_isr, 0);
|
CONFIG_SPI_INTEL_PORT_1_PRI, spi_intel_isr, 0,
|
||||||
|
SPI_INTEL_IRQ_FLAGS);
|
||||||
|
|
||||||
void spi_config_1_irq(struct device *dev)
|
void spi_config_1_irq(struct device *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -150,7 +150,7 @@ int _sys_clock_driver_init(struct device *device)
|
||||||
_arc_v2_aux_reg_write(_ARC_V2_TMR0_CONTROL, 0);
|
_arc_v2_aux_reg_write(_ARC_V2_TMR0_CONTROL, 0);
|
||||||
_arc_v2_aux_reg_write(_ARC_V2_TMR0_COUNT, 0); /* clear the count value */
|
_arc_v2_aux_reg_write(_ARC_V2_TMR0_COUNT, 0); /* clear the count value */
|
||||||
|
|
||||||
(void)irq_connect(irq, prio, _timer_int_handler, 0);
|
(void)irq_connect(irq, prio, _timer_int_handler, 0, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the reload value to achieve the configured tick rate, enable the
|
* Set the reload value to achieve the configured tick rate, enable the
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include <sections.h>
|
#include <sections.h>
|
||||||
#include <sys_clock.h>
|
#include <sys_clock.h>
|
||||||
#include <drivers/system_timer.h>
|
#include <drivers/system_timer.h>
|
||||||
|
#include <drivers/hpet.h>
|
||||||
|
|
||||||
#ifdef CONFIG_MICROKERNEL
|
#ifdef CONFIG_MICROKERNEL
|
||||||
|
|
||||||
|
@ -173,7 +174,7 @@ extern struct nano_stack _k_command_stack;
|
||||||
#define HPET_COMP_DELAY 192
|
#define HPET_COMP_DELAY 192
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(hpet, CONFIG_HPET_TIMER_IRQ, CONFIG_HPET_TIMER_IRQ_PRIORITY,
|
IRQ_CONNECT_STATIC(hpet, CONFIG_HPET_TIMER_IRQ, CONFIG_HPET_TIMER_IRQ_PRIORITY,
|
||||||
_timer_int_handler, 0);
|
_timer_int_handler, 0, HPET_IOAPIC_FLAGS);
|
||||||
|
|
||||||
#ifdef CONFIG_INT_LATENCY_BENCHMARK
|
#ifdef CONFIG_INT_LATENCY_BENCHMARK
|
||||||
static uint32_t main_count_first_irq_value;
|
static uint32_t main_count_first_irq_value;
|
||||||
|
|
|
@ -130,7 +130,7 @@ extern int32_t _sys_idle_elapsed_ticks;
|
||||||
|
|
||||||
IRQ_CONNECT_STATIC(loapic, CONFIG_LOAPIC_TIMER_IRQ,
|
IRQ_CONNECT_STATIC(loapic, CONFIG_LOAPIC_TIMER_IRQ,
|
||||||
CONFIG_LOAPIC_TIMER_IRQ_PRIORITY,
|
CONFIG_LOAPIC_TIMER_IRQ_PRIORITY,
|
||||||
_timer_int_handler, 0);
|
_timer_int_handler, 0, 0);
|
||||||
|
|
||||||
/* computed counter 0 initial count value */
|
/* computed counter 0 initial count value */
|
||||||
static uint32_t __noinit cycles_per_tick;
|
static uint32_t __noinit cycles_per_tick;
|
||||||
|
|
|
@ -69,11 +69,12 @@ extern "C" {
|
||||||
* @param priority IRQ Priority
|
* @param priority IRQ Priority
|
||||||
* @param isr Interrupt Service Routine
|
* @param isr Interrupt Service Routine
|
||||||
* @param parameter ISR parameter
|
* @param parameter ISR parameter
|
||||||
|
* @param flags IRQ flags
|
||||||
*
|
*
|
||||||
* @return N/A
|
* @return N/A
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter)
|
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -90,6 +91,6 @@ extern "C" {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define IRQ_CONFIG(isr, irq, priority) \
|
#define IRQ_CONFIG(isr, irq, priority) \
|
||||||
irq_connect(irq, priority, isr, NULL);
|
irq_connect(irq, priority, isr, NULL, 0);
|
||||||
|
|
||||||
#endif /* _ARC_ARCH__H_ */
|
#endif /* _ARC_ARCH__H_ */
|
||||||
|
|
|
@ -36,7 +36,8 @@ GTEXT(irq_disable)
|
||||||
extern int irq_connect(unsigned int irq,
|
extern int irq_connect(unsigned int irq,
|
||||||
unsigned int prio,
|
unsigned int prio,
|
||||||
void (*isr)(void *arg),
|
void (*isr)(void *arg),
|
||||||
void *arg);
|
void *arg,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
extern void irq_enable(unsigned int irq);
|
extern void irq_enable(unsigned int irq);
|
||||||
extern void irq_disable(unsigned int irq);
|
extern void irq_disable(unsigned int irq);
|
||||||
|
|
|
@ -36,7 +36,8 @@ GTEXT(irq_disable)
|
||||||
extern int irq_connect(unsigned int irq,
|
extern int irq_connect(unsigned int irq,
|
||||||
unsigned int prio,
|
unsigned int prio,
|
||||||
void (*isr)(void *arg),
|
void (*isr)(void *arg),
|
||||||
void *arg);
|
void *arg,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
extern void irq_enable(unsigned int irq);
|
extern void irq_enable(unsigned int irq);
|
||||||
extern void irq_disable(unsigned int irq);
|
extern void irq_disable(unsigned int irq);
|
||||||
|
@ -62,7 +63,7 @@ extern void _IntExit(void);
|
||||||
* @return N/A
|
* @return N/A
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter) \
|
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags) \
|
||||||
const unsigned int _##device##_int_priority = (priority); \
|
const unsigned int _##device##_int_priority = (priority); \
|
||||||
struct _IsrTableEntry CONCAT(_isr_irq, irq) \
|
struct _IsrTableEntry CONCAT(_isr_irq, irq) \
|
||||||
__attribute__ ((section(TOSTR(CONCAT(.gnu.linkonce.isr_irq, irq))))) = \
|
__attribute__ ((section(TOSTR(CONCAT(.gnu.linkonce.isr_irq, irq))))) = \
|
||||||
|
|
|
@ -161,8 +161,9 @@ typedef struct s_isrList {
|
||||||
* @return N/A
|
* @return N/A
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter) \
|
#define IRQ_CONNECT_STATIC(device, irq, priority, isr, parameter, flags) \
|
||||||
extern void *_##device##_##isr##_stub; \
|
extern void *_##device##_##isr##_stub; \
|
||||||
|
const const uint32_t _##device##_irq_flags = (flags); \
|
||||||
NANO_CPU_INT_REGISTER(_##device##_##isr##_stub, (irq), (priority), -1, 0)
|
NANO_CPU_INT_REGISTER(_##device##_##isr##_stub, (irq), (priority), -1, 0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -190,7 +191,8 @@ extern unsigned char _irq_to_interrupt_vector[];
|
||||||
*/
|
*/
|
||||||
#define IRQ_CONFIG(device, irq, priority) \
|
#define IRQ_CONFIG(device, irq, priority) \
|
||||||
do { \
|
do { \
|
||||||
_SysIntVecProgram(_IRQ_TO_INTERRUPT_VECTOR(irq), irq); \
|
_SysIntVecProgram(_IRQ_TO_INTERRUPT_VECTOR((irq)), (irq), \
|
||||||
|
_##device##_irq_flags); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,7 +365,8 @@ typedef void (*NANO_EOI_GET_FUNC) (void *);
|
||||||
extern int irq_connect(unsigned int irq,
|
extern int irq_connect(unsigned int irq,
|
||||||
unsigned int priority,
|
unsigned int priority,
|
||||||
void (*routine)(void *parameter),
|
void (*routine)(void *parameter),
|
||||||
void *parameter);
|
void *parameter,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable a specific IRQ
|
* @brief Enable a specific IRQ
|
||||||
|
@ -413,7 +416,21 @@ extern const NANO_ESF _default_esf;
|
||||||
* vector, and returns the vector number
|
* vector, and returns the vector number
|
||||||
*/
|
*/
|
||||||
extern int _SysIntVecAlloc(unsigned int irq,
|
extern int _SysIntVecAlloc(unsigned int irq,
|
||||||
unsigned int priority);
|
unsigned int priority,
|
||||||
|
uint32_t flags);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @brief Program interrupt controller
|
||||||
|
*
|
||||||
|
* This routine programs the interrupt controller with the given vector
|
||||||
|
* based on the given IRQ parameter.
|
||||||
|
*
|
||||||
|
* Drivers call this routine instead of irq_connect() when interrupts are
|
||||||
|
* configured statically.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
extern void _SysIntVecProgram(unsigned int vector, unsigned int irq, uint32_t flags);
|
||||||
|
|
||||||
/* functions provided by the kernel for usage by _SysIntVecAlloc() */
|
/* functions provided by the kernel for usage by _SysIntVecAlloc() */
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,12 @@
|
||||||
* @param irq_obj IRQ object identifier
|
* @param irq_obj IRQ object identifier
|
||||||
* @param irq Request IRQ
|
* @param irq Request IRQ
|
||||||
* @param priority Requested interrupt priority
|
* @param priority Requested interrupt priority
|
||||||
|
* @param flags IRQ flags
|
||||||
*
|
*
|
||||||
* @return assigned interrupt vector if successful, INVALID_VECTOR if not
|
* @return assigned interrupt vector if successful, INVALID_VECTOR if not
|
||||||
*/
|
*/
|
||||||
extern uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority);
|
extern uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority,
|
||||||
|
uint32_t flags);
|
||||||
/**
|
/**
|
||||||
* @cond internal
|
* @cond internal
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -206,7 +206,8 @@ static int _k_task_irq_alloc(void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority)
|
uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority,
|
||||||
|
uint32_t flags)
|
||||||
{
|
{
|
||||||
struct irq_obj_reg_arg arg; /* IRQ object registration request arguments */
|
struct irq_obj_reg_arg arg; /* IRQ object registration request arguments */
|
||||||
struct task_irq_info *irq_obj_ptr; /* ptr to task IRQ object */
|
struct task_irq_info *irq_obj_ptr; /* ptr to task IRQ object */
|
||||||
|
@ -228,7 +229,8 @@ uint32_t task_irq_alloc(kirq_t irq_obj, uint32_t irq, uint32_t priority)
|
||||||
* definition to abstract the different irq_connect signatures
|
* definition to abstract the different irq_connect signatures
|
||||||
*/
|
*/
|
||||||
irq_obj_ptr->vector = irq_connect(
|
irq_obj_ptr->vector = irq_connect(
|
||||||
irq, priority, task_irq_int_handler, (void *)irq_obj_ptr);
|
irq, priority, task_irq_int_handler, (void *)irq_obj_ptr,
|
||||||
|
flags);
|
||||||
irq_enable(irq);
|
irq_enable(irq);
|
||||||
|
|
||||||
return irq_obj_ptr->vector;
|
return irq_obj_ptr->vector;
|
||||||
|
|
|
@ -103,7 +103,7 @@ static int initIRQ(struct isrInitInfo *i)
|
||||||
|
|
||||||
if (i->isr[0]) {
|
if (i->isr[0]) {
|
||||||
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, i->isr[0],
|
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, i->isr[0],
|
||||||
i->arg[0]);
|
i->arg[0], 0);
|
||||||
if (-1 == vector) {
|
if (-1 == vector) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ static int initIRQ(struct isrInitInfo *i)
|
||||||
#if NUM_SW_IRQS >= 2
|
#if NUM_SW_IRQS >= 2
|
||||||
if (i->isr[1]) {
|
if (i->isr[1]) {
|
||||||
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, i->isr[1],
|
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, i->isr[1],
|
||||||
i->arg[1]);
|
i->arg[1], 0);
|
||||||
if (-1 == vector) {
|
if (-1 == vector) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -123,11 +123,11 @@ static int initIRQ(struct isrInitInfo *i)
|
||||||
#elif defined(CONFIG_ARM)
|
#elif defined(CONFIG_ARM)
|
||||||
#if defined(CONFIG_CPU_CORTEX_M)
|
#if defined(CONFIG_CPU_CORTEX_M)
|
||||||
if (i->isr[0]) {
|
if (i->isr[0]) {
|
||||||
(void) irq_connect(0, IRQ_PRIORITY, i->isr[0], i->arg[0]);
|
(void) irq_connect(0, IRQ_PRIORITY, i->isr[0], i->arg[0], 0);
|
||||||
irq_enable(0);
|
irq_enable(0);
|
||||||
}
|
}
|
||||||
if (i->isr[1]) {
|
if (i->isr[1]) {
|
||||||
(void) irq_connect(1, IRQ_PRIORITY, i->isr[1], i->arg[1]);
|
(void) irq_connect(1, IRQ_PRIORITY, i->isr[1], i->arg[1], 0);
|
||||||
irq_enable(1);
|
irq_enable(1);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CPU_CORTEX_M */
|
#endif /* CONFIG_CPU_CORTEX_M */
|
||||||
|
|
|
@ -69,7 +69,7 @@ static void uart1_init(void)
|
||||||
|
|
||||||
uart_init(UART1, &uart1);
|
uart_init(UART1, &uart1);
|
||||||
|
|
||||||
irq_connect(UART1_IRQ, uart1.irq_pri, uart1_isr, 0);
|
irq_connect(UART1_IRQ, uart1.irq_pri, uart1_isr, 0, UART_IRQ_FLAGS);
|
||||||
|
|
||||||
irq_enable(UART1_IRQ);
|
irq_enable(UART1_IRQ);
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ void fgTaskEntry(void)
|
||||||
{
|
{
|
||||||
#ifdef TEST_max
|
#ifdef TEST_max
|
||||||
/* dynamically link in dummy ISR */
|
/* dynamically link in dummy ISR */
|
||||||
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr, (void *) 0);
|
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr, (void *) 0, 0);
|
||||||
#endif /* TEST_max */
|
#endif /* TEST_max */
|
||||||
|
|
||||||
/* note: referencing "func_array" ensures it isn't optimized out */
|
/* note: referencing "func_array" ensures it isn't optimized out */
|
||||||
|
|
|
@ -46,7 +46,7 @@ char tmpString[TMP_STRING_SIZE];
|
||||||
int initSwInterrupt(ptestIsr pIsrHdlr)
|
int initSwInterrupt(ptestIsr pIsrHdlr)
|
||||||
{
|
{
|
||||||
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, pIsrHdlr,
|
vector = irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, pIsrHdlr,
|
||||||
(void *) 0);
|
(void *) 0, 0);
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,14 +67,14 @@ uint32_t irq_vectors[NUM_OBJECTS] = {[0 ... (NUM_OBJECTS - 1)] = INVALID_VECTOR}
|
||||||
|
|
||||||
int taskA(ksem_t semRdy)
|
int taskA(ksem_t semRdy)
|
||||||
{
|
{
|
||||||
irq_vectors[DEV1_ID] = task_irq_alloc(DEV1_ID, DEV1_IRQ, 1);
|
irq_vectors[DEV1_ID] = task_irq_alloc(DEV1_ID, DEV1_IRQ, 1, 0);
|
||||||
if (irq_vectors[DEV1_ID] == INVALID_VECTOR) {
|
if (irq_vectors[DEV1_ID] == INVALID_VECTOR) {
|
||||||
TC_ERROR("Not able to allocate IRQ object\n");
|
TC_ERROR("Not able to allocate IRQ object\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
}
|
}
|
||||||
TC_PRINT("IRQ object %d using IRQ%d allocated\n", DEV1_ID, DEV1_IRQ);
|
TC_PRINT("IRQ object %d using IRQ%d allocated\n", DEV1_ID, DEV1_IRQ);
|
||||||
|
|
||||||
irq_vectors[DEV2_ID] = task_irq_alloc(DEV2_ID, DEV2_IRQ, 2);
|
irq_vectors[DEV2_ID] = task_irq_alloc(DEV2_ID, DEV2_IRQ, 2, 0);
|
||||||
if (irq_vectors[DEV2_ID] == INVALID_VECTOR) {
|
if (irq_vectors[DEV2_ID] == INVALID_VECTOR) {
|
||||||
TC_ERROR("Not able to allocate IRQ object\n");
|
TC_ERROR("Not able to allocate IRQ object\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
|
@ -105,7 +105,7 @@ int taskA(ksem_t semRdy)
|
||||||
|
|
||||||
TC_PRINT("\nAttempt to allocate an IRQ object that\n");
|
TC_PRINT("\nAttempt to allocate an IRQ object that\n");
|
||||||
TC_PRINT("is already allocated by another task...\n");
|
TC_PRINT("is already allocated by another task...\n");
|
||||||
if (task_irq_alloc(DEV4_ID, DEV4_IRQ, 1) != INVALID_VECTOR) {
|
if (task_irq_alloc(DEV4_ID, DEV4_IRQ, 1, 0) != INVALID_VECTOR) {
|
||||||
TC_ERROR("Error: Was able to allocate\n\n");
|
TC_ERROR("Error: Was able to allocate\n\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ int taskA(ksem_t semRdy)
|
||||||
|
|
||||||
TC_PRINT("\nAttempt to allocate an IRQ that\n"
|
TC_PRINT("\nAttempt to allocate an IRQ that\n"
|
||||||
"is already allocated by another task...\n");
|
"is already allocated by another task...\n");
|
||||||
if (task_irq_alloc(DEV5_ID, DEV4_IRQ, 1) != INVALID_VECTOR) {
|
if (task_irq_alloc(DEV5_ID, DEV4_IRQ, 1, 0) != INVALID_VECTOR) {
|
||||||
TC_ERROR("Error: Was able to allocate\n\n");
|
TC_ERROR("Error: Was able to allocate\n\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
}
|
}
|
||||||
|
@ -139,14 +139,14 @@ int taskA(ksem_t semRdy)
|
||||||
|
|
||||||
int taskB(ksem_t semRdy)
|
int taskB(ksem_t semRdy)
|
||||||
{
|
{
|
||||||
irq_vectors[DEV3_ID] = task_irq_alloc(DEV3_ID, DEV3_IRQ, 1);
|
irq_vectors[DEV3_ID] = task_irq_alloc(DEV3_ID, DEV3_IRQ, 1, 0);
|
||||||
if (irq_vectors[DEV3_ID] == INVALID_VECTOR) {
|
if (irq_vectors[DEV3_ID] == INVALID_VECTOR) {
|
||||||
TC_ERROR("Not able to allocate IRQ object\n");
|
TC_ERROR("Not able to allocate IRQ object\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
}
|
}
|
||||||
TC_PRINT("IRQ object %d using IRQ%d allocated\n", DEV3_ID, DEV3_IRQ);
|
TC_PRINT("IRQ object %d using IRQ%d allocated\n", DEV3_ID, DEV3_IRQ);
|
||||||
|
|
||||||
irq_vectors[DEV4_ID] = task_irq_alloc(DEV4_ID, DEV4_IRQ, 1);
|
irq_vectors[DEV4_ID] = task_irq_alloc(DEV4_ID, DEV4_IRQ, 1, 0);
|
||||||
if (irq_vectors[DEV4_ID] == INVALID_VECTOR) {
|
if (irq_vectors[DEV4_ID] == INVALID_VECTOR) {
|
||||||
TC_ERROR("Not able to allocate IRQ object\n");
|
TC_ERROR("Not able to allocate IRQ object\n");
|
||||||
return TC_FAIL;
|
return TC_FAIL;
|
||||||
|
|
|
@ -160,7 +160,7 @@ void main(void)
|
||||||
#ifdef TEST_max
|
#ifdef TEST_max
|
||||||
/* dynamically link in dummy ISR */
|
/* dynamically link in dummy ISR */
|
||||||
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
|
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
|
||||||
(void *) 0);
|
(void *) 0, 0);
|
||||||
#endif /* TEST_max */
|
#endif /* TEST_max */
|
||||||
#ifndef TEST_min
|
#ifndef TEST_min
|
||||||
/* start a trivial fiber */
|
/* start a trivial fiber */
|
||||||
|
|
|
@ -147,7 +147,7 @@ void main(void)
|
||||||
#ifdef CONFIG_DYNAMIC_ISR
|
#ifdef CONFIG_DYNAMIC_ISR
|
||||||
/* dynamically link in dummy ISR */
|
/* dynamically link in dummy ISR */
|
||||||
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
|
irq_connect(NANO_SOFT_IRQ, IRQ_PRIORITY, dummyIsr,
|
||||||
(void *) 0);
|
(void *) 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_OBJECTS_FIBER
|
#ifdef CONFIG_OBJECTS_FIBER
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue