1 /*
2  * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __SOC_H__
8 #define __SOC_H__
9 
10 #ifndef _ASMLANGUAGE
11 #include <soc/soc.h>
12 #include <rom/ets_sys.h>
13 #include <rom/spi_flash.h>
14 #include <zephyr/types.h>
15 #include <stdbool.h>
16 #include <esp_private/esp_clk.h>
17 #endif
18 
19 #ifndef _ASMLANGUAGE
20 
21 void __esp_platform_start(void);
22 
esp_core_id(void)23 static inline uint32_t esp_core_id(void)
24 {
25 	return 0;
26 }
27 
28 extern void esp_rom_intr_matrix_set(int cpu_no, uint32_t model_num, uint32_t intr_num);
29 extern void esp_rom_uart_attach(void);
30 extern void esp_rom_uart_tx_wait_idle(uint8_t uart_no);
31 extern int esp_rom_uart_tx_one_char(uint8_t chr);
32 extern int esp_rom_uart_rx_one_char(uint8_t *chr);
33 extern int esp_rom_gpio_matrix_in(uint32_t gpio, uint32_t signal_index, bool inverted);
34 extern int esp_rom_gpio_matrix_out(uint32_t gpio, uint32_t signal_index,
35 				bool out_invrted, bool out_enabled_inverted);
36 extern void esp_rom_ets_set_user_start(uint32_t start);
37 extern void esprv_intc_int_set_threshold(int priority_threshold);
38 uint32_t soc_intr_get_next_source(void);
39 extern void esp_rom_Cache_Resume_ICache(uint32_t autoload);
40 extern int esp_rom_Cache_Invalidate_Addr(uint32_t addr, uint32_t size);
41 extern uint32_t esp_rom_Cache_Suspend_ICache(void);
42 extern void esp_rom_Cache_Invalidate_ICache_All(void);
43 extern int esp_rom_Cache_Dbus_MMU_Set(uint32_t ext_ram, uint32_t vaddr, uint32_t paddr,
44 				uint32_t psize, uint32_t num, uint32_t fixed);
45 extern int esp_rom_Cache_Ibus_MMU_Set(uint32_t ext_ram, uint32_t vaddr, uint32_t paddr,
46 				uint32_t psize, uint32_t num, uint32_t fixed);
47 extern void esp_rom_Cache_Resume_ICache(uint32_t autoload);
48 extern int esp_rom_gpio_matrix_in(uint32_t gpio, uint32_t signal_index,
49 				    bool inverted);
50 extern int esp_rom_gpio_matrix_out(uint32_t gpio, uint32_t signal_index,
51 				     bool out_inverted,
52 				     bool out_enabled_inverted);
53 
54 #endif /* _ASMLANGUAGE */
55 
56 #endif /* __SOC_H__ */
57