1 /*
2  * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
3  * Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  */
8 
9 #ifndef __TFM_PERIPHERALS_DEF_H__
10 #define __TFM_PERIPHERALS_DEF_H__
11 
12 #include "platform_irq.h"
13 #include "target_cfg.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /*
20  * Quantized default IRQ priority, the value is:
21  * (Number of configurable priority) / 4: (1UL << __NVIC_PRIO_BITS) / 4
22  */
23 #define DEFAULT_IRQ_PRIORITY    (1UL << (__NVIC_PRIO_BITS - 2))
24 
25 #define TFM_TIMER0_IRQ           (TIMER0_IRQn)
26 #define TFM_TIMER1_IRQ           (TIMER1_IRQn)
27 
28 #define TFM_FPU_S_TEST_IRQ       (GPIO0_0_IRQn)
29 #define TFM_FPU_NS_TEST_IRQ      (GPIO0_1_IRQn)
30 
31 extern struct platform_data_t tfm_peripheral_gpio0;
32 extern struct platform_data_t tfm_peripheral_gpio1;
33 extern struct platform_data_t tfm_peripheral_gpio2;
34 extern struct platform_data_t tfm_peripheral_gpio3;
35 extern struct platform_data_t tfm_peripheral_fmc_cmsdk_gpio0;
36 extern struct platform_data_t tfm_peripheral_fmc_cmsdk_gpio1;
37 extern struct platform_data_t tfm_peripheral_fmc_cmsdk_gpio2;
38 extern struct platform_data_t tfm_peripheral_fmc_cmsdk_gpio3;
39 extern struct platform_data_t tfm_peripheral_ethernet;
40 extern struct platform_data_t tfm_peripheral_usb;
41 extern struct platform_data_t tfm_peripheral_timer0;
42 extern struct platform_data_t tfm_peripheral_timer1;
43 extern struct platform_data_t tfm_peripheral_timer2;
44 extern struct platform_data_t tfm_peripheral_timer3;
45 extern struct platform_data_t tfm_peripheral_slowclk;
46 extern struct platform_data_t tfm_peripheral_touch_i2c;
47 extern struct platform_data_t tfm_peripheral_audio_i2c;
48 extern struct platform_data_t tfm_peripheral_adc_spi;
49 extern struct platform_data_t tfm_peripheral_shield0_spi;
50 extern struct platform_data_t tfm_peripheral_shield1_spi;
51 extern struct platform_data_t tfm_peripheral_shield0_i2c;
52 extern struct platform_data_t tfm_peripheral_shield1_i2c;
53 extern struct platform_data_t tfm_peripheral_ddr4_eeprom_i2c;
54 extern struct platform_data_t tfm_peripheral_fpga_scc;
55 extern struct platform_data_t tfm_peripheral_fpga_i2s;
56 extern struct platform_data_t tfm_peripheral_fpga_io;
57 extern struct platform_data_t tfm_peripheral_std_uart;
58 extern struct platform_data_t tfm_peripheral_uart1;
59 extern struct platform_data_t tfm_peripheral_uart2;
60 extern struct platform_data_t tfm_peripheral_uart3;
61 extern struct platform_data_t tfm_peripheral_uart4;
62 extern struct platform_data_t tfm_peripheral_uart5;
63 extern struct platform_data_t tfm_peripheral_clcd;
64 extern struct platform_data_t tfm_peripheral_rtc;
65 
66 #define TFM_PERIPHERAL_GPIO0            (&tfm_peripheral_gpio0)
67 #define TFM_PERIPHERAL_GPIO1            (&tfm_peripheral_gpio1)
68 #define TFM_PERIPHERAL_GPIO2            (&tfm_peripheral_gpio2)
69 #define TFM_PERIPHERAL_GPIO3            (&tfm_peripheral_gpio3)
70 #define TFM_PERIPHERAL_FMC_CMSDK_GPIO0  (&tfm_peripheral_fmc_cmsdk_gpio0)
71 #define TFM_PERIPHERAL_FMC_CMSDK_GPIO1  (&tfm_peripheral_fmc_cmsdk_gpio1)
72 #define TFM_PERIPHERAL_FMC_CMSDK_GPIO2  (&tfm_peripheral_fmc_cmsdk_gpio2)
73 #define TFM_PERIPHERAL_FMC_CMSDK_GPIO3  (&tfm_peripheral_fmc_cmsdk_gpio3)
74 #define TFM_PERIPHERAL_ETHERNET         (&tfm_peripheral_ethernet)
75 #define TFM_PERIPHERAL_USB              (&tfm_peripheral_usb)
76 #define TFM_PERIPHERAL_TIMER0           (&tfm_peripheral_timer0)
77 #define TFM_PERIPHERAL_TIMER1           (&tfm_peripheral_timer1)
78 #define TFM_PERIPHERAL_TIMER2           (&tfm_peripheral_timer2)
79 #define TFM_PERIPHERAL_TIMER3           (&tfm_peripheral_timer3)
80 #define TFM_PERIPHERAL_SLOWCLK          (&tfm_peripheral_slowclk)
81 #define TFM_PERIPHERAL_TOUCH_I2C        (&tfm_peripheral_touch_i2c)
82 #define TFM_PERIPHERAL_AUDIO_I2C        (&tfm_peripheral_audio_i2c)
83 #define TFM_PERIPHERAL_ADC_SPI          (&tfm_peripheral_adc_spi)
84 #define TFM_PERIPHERAL_SHIELD0_SPI      (&tfm_peripheral_shield0_spi)
85 #define TFM_PERIPHERAL_SHIELD1_SPI      (&tfm_peripheral_shield1_spi)
86 #define TFM_PERIPHERAL_SHIELD0_I2C      (&tfm_peripheral_shield0_i2c)
87 #define TFM_PERIPHERAL_SHIELD1_I2C      (&tfm_peripheral_shield1_i2c)
88 #define TFM_PERIPHERAL_DDR4_EEPROM_I2C  (&tfm_peripheral_ddr4_eeprom_i2c)
89 #define TFM_PERIPHERAL_FPGA_SCC         (&tfm_peripheral_fpga_scc)
90 #define TFM_PERIPHERAL_FPGA_I2S         (&tfm_peripheral_fpga_i2s)
91 #define TFM_PERIPHERAL_FPGA_IO          (&tfm_peripheral_fpga_io)
92 #define TFM_PERIPHERAL_STD_UART         (&tfm_peripheral_std_uart)
93 #define TFM_PERIPHERAL_UART1            (&tfm_peripheral_uart1)
94 #define TFM_PERIPHERAL_UART2            (&tfm_peripheral_uart2)
95 #define TFM_PERIPHERAL_UART3            (&tfm_peripheral_uart3)
96 #define TFM_PERIPHERAL_UART4            (&tfm_peripheral_uart4)
97 #define TFM_PERIPHERAL_UART5            (&tfm_peripheral_uart5)
98 #define TFM_PERIPHERAL_CLCD             (&tfm_peripheral_clcd)
99 #define TFM_PERIPHERAL_RTC              (&tfm_peripheral_rtc)
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* __TFM_PERIPHERALS_DEF_H__ */
106