2020-12-17 12:04:46 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* arch/risc-v/include/bl602/irq.h
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you 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.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ARCH_RISCV_INCLUDE_BL602_IRQ_H
|
|
|
|
#define __ARCH_RISCV_INCLUDE_BL602_IRQ_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* CLINT Base Address */
|
|
|
|
|
|
|
|
#define CLIC_TIMER_ENABLE_ADDRESS (0x02800407)
|
|
|
|
|
|
|
|
/* Map RISC-V exception code to NuttX IRQ */
|
|
|
|
|
|
|
|
#define BL602_IRQ_NUM_BASE (16)
|
|
|
|
|
|
|
|
#define BL602_IRQ_BMX_ERR \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 0) /* BMX Error Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_BMX_TO \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 1) /* BMX Timeout Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_L1C_BMX_ERR \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 2) /* L1C BMX Error Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_L1C_BMX_TO \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 3) /* L1C BMX Timeout Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_BMX_ERR \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 4) /* SEC BMX Error Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RF_TOP_INT0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 5) /* RF_TOP_INT0 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RF_TOP_INT1 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 6) /* RF_TOP_INT1 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SDIO \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 7) /* SDIO Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_DMA_BMX_ERR \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 8) /* DMA BMX Error Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_GMAC \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 9) /* SEC_ENG_GMAC_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_CDET \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 10) /* SEC_ENG_CDET_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_PKA \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 11) /* SEC_ENG_PKA_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_TRNG \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 12) /* SEC_ENG_TRNG_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_AES \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 13) /* SEC_ENG_AES_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SEC_SHA \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 14) /* SEC_ENG_SHA_INT Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_DMA_ALL \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 15) /* DMA ALL Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 16) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED1 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 17) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED2 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 18) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_IRTX_IRQn \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 19) /* IR TX Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_IRRX_IRQn \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 20) /* IR RX Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED3 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 21) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED4 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 22) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SF_CTRL \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 23) /* SF_CTRL Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED5 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 24) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_GPADC_DMA \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 25) /* GPADC_DMA Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_EFUSE \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 26) /* Efuse Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_SPI \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 27) /* SPI Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED6 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 28) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_UART0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 29) /* UART Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_UART1 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 30) /* UART1 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED7 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 31) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_I2C \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 32) /* I2C Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED8 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 33) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_PWM \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 34) /* PWM Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED9 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 35) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_TIMER_CH0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 36) /* Timer Channel 0 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_TIMER_CH1 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 37) /* Timer Channel 1 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_TIMER_WDT \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 38) /* Timer Watch Dog Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED10 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 39) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED11 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 40) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED12 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 41) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED13 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 42) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED14 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 43) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_GPIO_INT0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 44) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED16 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 45) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED17 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 46) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED18 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 47) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED19 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 48) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_RESERVED20 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 49) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_PDS_WAKEUP \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 50) /* PDS Wakeup Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_HBN_OUT0 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 51) /* Hibernate out 0 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_HBN_OUT1 \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 52) /* Hibernate out 1 Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_BOR \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 53) /* BOR Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_WIFI \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 54) /* WIFI To CPU Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_BZ_PHY \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 55) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_BLE \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 56) /* RESERVED Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_MAC_TXRX_TIMER \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + \
|
2020-12-17 12:04:46 +01:00
|
|
|
57) /* mac_int_tx_rx_timer Interrupt */
|
|
|
|
#define BL602_IRQ_MAC_TXRX_MISC \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + \
|
2020-12-17 12:04:46 +01:00
|
|
|
58) /* mac_int_tx_rx_misc Interrupt */
|
|
|
|
#define BL602_IRQ_MAC_RX_TRG \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + \
|
2020-12-17 12:04:46 +01:00
|
|
|
59) /* mac_int_rx_trigger Interrupt */
|
|
|
|
#define BL602_IRQ_MAC_TX_TRG \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + \
|
2020-12-17 12:04:46 +01:00
|
|
|
60) /* mac_int_tx_trigger Interrupt */
|
|
|
|
#define BL602_IRQ_MAC_GEN \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 61) /* mac_int_gen Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
#define BL602_IRQ_MAC_PORT_TRG \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + \
|
2020-12-17 12:04:46 +01:00
|
|
|
62) /* mac_int_port_trigger Interrupt */
|
|
|
|
#define BL602_IRQ_WIFI_IPC_PUBLIC \
|
2022-01-20 15:30:12 +01:00
|
|
|
(RISCV_IRQ_ASYNC + BL602_IRQ_NUM_BASE + 63) /* wifi IPC public Interrupt */
|
2020-12-17 12:04:46 +01:00
|
|
|
|
|
|
|
/* Total number of IRQs */
|
|
|
|
|
2020-12-22 09:42:04 +01:00
|
|
|
#define NR_IRQS (64 + 16 + 16)
|
2020-12-17 12:04:46 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
EXTERN irqstate_t up_irq_enable(void);
|
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* __ARCH_RISCV_INCLUDE_BL602_IRQ_H */
|
2020-12-18 10:12:33 +01:00
|
|
|
|