1 /*
2  *  SPDX-License-Identifier: BSD-3-Clause
3  *  SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
4  *
5  */
6 
7 #ifndef __TFM_PERIPHERALS_DEF_H__
8 #define __TFM_PERIPHERALS_DEF_H__
9 
10 #include "hardware/irq.h"
11 #include "common_target_cfg.h"
12 #include "tfm_hal_device_header.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /*
19  * Quantized default IRQ priority, the value is:
20  * (Number of configurable priority) / 2: (1UL << __NVIC_PRIO_BITS) / 4
21  */
22 
23 #define DEFAULT_IRQ_PRIORITY     (1UL << (__NVIC_PRIO_BITS - 2))
24 
25 #define TFM_TIMER0_IRQ           (TIMER0_IRQ_0_IRQn)
26 #define MAILBOX_IRQ               SIO_IRQ_FIFO_NS_IRQn
27 
28 #define FF_TEST_UART_IRQ         (UART0_IRQ)
29 extern void FF_TEST_UART_IRQ_Handler(void);
30 
31 extern struct platform_data_t tfm_peripheral_std_uart;
32 extern struct platform_data_t tfm_peripheral_timer0;
33 
34 #define TFM_PERIPHERAL_STD_UART  (&tfm_peripheral_std_uart)
35 #define TFM_PERIPHERAL_TIMER0    (&tfm_peripheral_timer0)
36 
37 #ifdef PSA_API_TEST_IPC
38 extern struct platform_data_t tfm_peripheral_FF_TEST_UART_REGION;
39 extern struct platform_data_t tfm_peripheral_FF_TEST_WATCHDOG_REGION;
40 extern struct platform_data_t tfm_peripheral_FF_TEST_NVMEM_REGION;
41 extern struct platform_data_t tfm_peripheral_FF_TEST_SERVER_PARTITION_MMIO;
42 extern struct platform_data_t tfm_peripheral_FF_TEST_DRIVER_PARTITION_MMIO;
43 #define FF_TEST_UART_REGION           (&tfm_peripheral_FF_TEST_UART_REGION)
44 #define FF_TEST_WATCHDOG_REGION       (&tfm_peripheral_FF_TEST_WATCHDOG_REGION)
45 #define FF_TEST_NVMEM_REGION          (&tfm_peripheral_FF_TEST_NVMEM_REGION)
46 #define FF_TEST_SERVER_PARTITION_MMIO (&tfm_peripheral_FF_TEST_SERVER_PARTITION_MMIO)
47 #define FF_TEST_DRIVER_PARTITION_MMIO (&tfm_peripheral_FF_TEST_DRIVER_PARTITION_MMIO)
48 #endif /* PSA_API_TEST_IPC */
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif /* __TFM_PERIPHERALS_DEF_H__ */
55