Files
zephyr/soc/ite/ec/common/soc_common_irq.c
Fabio Baltieri 4a6e286a3b soc: convert ite_ec to hwmv2
Convert the ite_ec soc to the hardware model v2.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-03-01 15:49:58 +01:00

43 lines
839 B
C

/*
* Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief interrupt management code for riscv SOCs supporting the riscv
privileged architecture specification
*/
#include <zephyr/irq.h>
#include <soc_common.h>
void arch_irq_enable(unsigned int irq)
{
if (IS_ENABLED(CONFIG_HAS_ITE_INTC)) {
ite_intc_irq_enable(irq);
}
}
void arch_irq_disable(unsigned int irq)
{
if (IS_ENABLED(CONFIG_HAS_ITE_INTC)) {
ite_intc_irq_disable(irq);
}
};
int arch_irq_is_enabled(unsigned int irq)
{
/*
* Return true from arch_irq_is_enabled() when external interrupt-enable
* bit, and SOC's IER are both true.
*/
if (IS_ENABLED(CONFIG_HAS_ITE_INTC)) {
return ((csr_read(mie) & BIT(IRQ_M_EXT)) &&
ite_intc_irq_is_enable(irq));
} else {
return 0;
}
}