interrupts: new static IRQ API

The interrupt API has been redesigned:

- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
  It will be used in situations where the new static irq_connect()
  won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
  exactly the same way as its dynamic counterpart. The old static irq
  macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
  generated inline with irq_connect()

ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-01-08 00:46:14 -08:00 committed by Anas Nashif
commit d9cfbd5a61
70 changed files with 347 additions and 923 deletions

View file

@ -1,2 +1,2 @@
obj-$(CONFIG_I2C_DW) += i2c_dw.o i2c_static_irq_stubs.o
obj-$(CONFIG_I2C_DW) += i2c_dw.o
obj-$(CONFIG_I2C_QUARK_SE_SS) += i2c_quark_se_ss.o

View file

@ -779,16 +779,6 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_0,
&i2c_config_dw_0);
SYS_DEFINE_DEVICE(i2c_0, &i2c_0_runtime, SECONDARY, CONFIG_I2C_INIT_PRIORITY);
struct device *i2c_dw_isr_0_device = SYS_GET_DEVICE(i2c_0);
#ifdef CONFIG_I2C_DW_0_IRQ_DIRECT
IRQ_CONNECT_STATIC(i2c_dw_0,
CONFIG_I2C_DW_0_IRQ,
CONFIG_I2C_DW_0_INT_PRIORITY,
i2c_dw_isr,
SYS_GET_DEVICE(i2c_0),
I2C_DW_IRQ_FLAGS);
#endif
void i2c_config_0(struct device *port)
{
@ -797,7 +787,8 @@ void i2c_config_0(struct device *port)
#if defined(CONFIG_I2C_DW_0_IRQ_DIRECT)
ARG_UNUSED(shared_irq_dev);
IRQ_CONFIG(i2c_dw_0, config->irq_num);
irq_connect(CONFIG_I2C_DW_0_IRQ, CONFIG_I2C_DW_0_INT_PRIORITY,
i2c_dw_isr, SYS_GET_DEVICE(i2c_0), I2C_DW_IRQ_FLAGS);
irq_enable(config->irq_num);
#elif defined(CONFIG_I2C_DW_0_IRQ_SHARED)
ARG_UNUSED(config);
@ -842,14 +833,6 @@ DECLARE_DEVICE_INIT_CONFIG(i2c_1,
SYS_DEFINE_DEVICE(i2c_1, &i2c_1_runtime, SECONDARY,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
struct device *i2c_dw_isr_1_device = SYS_GET_DEVICE(i2c_1);
IRQ_CONNECT_STATIC(i2c_dw_1,
CONFIG_I2C_DW_1_IRQ,
CONFIG_I2C_DW_1_INT_PRIORITY,
i2c_dw_isr,
SYS_GET_DEVICE(i2c_1),
I2C_DW_IRQ_FLAGS);
void i2c_config_1(struct device *port)
{
@ -857,7 +840,8 @@ void i2c_config_1(struct device *port)
struct device *shared_irq_dev;
ARG_UNUSED(shared_irq_dev);
IRQ_CONFIG(i2c_dw_1, config->irq_num);
irq_connect(CONFIG_I2C_DW_1_IRQ, CONFIG_I2C_DW_1_INT_PRIORITY,
i2c_dw_isr, SYS_GET_DEVICE(i2c_1), I2C_DW_IRQ_FLAGS);
irq_enable(config->irq_num);
}

View file

@ -668,10 +668,10 @@ void _i2c_qse_ss_config_irq(struct device *port)
_i2c_qse_ss_memory_write(SCSS_REGISTER_BASE, rom->isr_stop_mask, mask);
/* Connect the IRQs to ISR */
irq_connect(rom->isr_err_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect(rom->isr_rx_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect(rom->isr_tx_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect(rom->isr_stop_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect_dynamic(rom->isr_err_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect_dynamic(rom->isr_rx_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect_dynamic(rom->isr_tx_vector, 1, i2c_qse_ss_isr, port, 0);
irq_connect_dynamic(rom->isr_stop_vector, 1, i2c_qse_ss_isr, port, 0);
irq_enable(rom->isr_err_vector);
irq_enable(rom->isr_rx_vector);

View file

@ -1,42 +0,0 @@
/*
* Copyright (c) 2015, Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @brief I2C interrupt stubs
* This module contains the static interrupt stubs for the i2c drivers
*/
#define _ASMLANGUAGE
#ifdef CONFIG_X86
#include <arch/x86/asm.h>
#include <drivers/ioapic.h>
#endif
#if defined(CONFIG_I2C_DW_0)
#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
ioapic_mkstub i2c_dw_0 i2c_dw_isr i2c_dw_isr_0_device
#endif
#endif /* CONFIG_I2C_DW_0 */
#if defined(CONFIG_I2C_DW_1)
#if defined(CONFIG_IOAPIC) || defined(CONFIG_MVIC)
ioapic_mkstub i2c_dw_1 i2c_dw_isr i2c_dw_isr_1_device
#endif
#endif /* CONFIG_I2C_DW_1 */