Skip to content

Commit b95f200

Browse files
committed
IDF master c8aab00fdb
1 parent 5641a10 commit b95f200

File tree

220 files changed

+1325
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+1325
-286
lines changed

platform.txt

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
"UNITY_INCLUDE_CONFIG_H",
299299
"WITH_POSIX",
300300
"_GNU_SOURCE",
301-
("IDF_VER", '\\"v4.4-dev-2897-g61299f879e\\"'),
301+
("IDF_VER", '\\"v4.4-dev-2915-gc8aab00fdb\\"'),
302302
"ESP_PLATFORM",
303303
"ARDUINO_ARCH_ESP32",
304304
"ESP32",

tools/platformio-build-esp32c3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
"UNITY_INCLUDE_CONFIG_H",
282282
"WITH_POSIX",
283283
"_GNU_SOURCE",
284-
("IDF_VER", '\\"v4.4-dev-2897-g61299f879e\\"'),
284+
("IDF_VER", '\\"v4.4-dev-2915-gc8aab00fdb\\"'),
285285
"ESP_PLATFORM",
286286
"ARDUINO_ARCH_ESP32",
287287
"ESP32",

tools/platformio-build-esp32s2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"UNITY_INCLUDE_CONFIG_H",
286286
"WITH_POSIX",
287287
"_GNU_SOURCE",
288-
("IDF_VER", '\\"v4.4-dev-2897-g61299f879e\\"'),
288+
("IDF_VER", '\\"v4.4-dev-2915-gc8aab00fdb\\"'),
289289
"ESP_PLATFORM",
290290
"ARDUINO_ARCH_ESP32",
291291
"ESP32",

tools/sdk/esp32/include/config/sdkconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,5 +695,5 @@
695695
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
696696
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
697697
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
698-
#define CONFIG_ARDUINO_IDF_COMMIT "61299f879e"
698+
#define CONFIG_ARDUINO_IDF_COMMIT "c8aab00fdb"
699699
#define CONFIG_ARDUINO_IDF_BRANCH "master"

tools/sdk/esp32/include/esp_rom/include/esp32s3/rom/cache.h

Lines changed: 98 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ typedef enum {
103103
CACHE_AUTOLOAD_NEGATIVE = 1, /*!< cache autoload step is negative */
104104
} cache_autoload_order_t;
105105

106+
typedef enum {
107+
CACHE_AUTOLOAD_REGION0 = 0, /*!< cache autoload region0 */
108+
CACHE_AUTOLOAD_REGION1 = 1, /*!< cache autoload region1 */
109+
} cache_autoload_region_t;
110+
106111
#define CACHE_AUTOLOAD_STEP(i) ((i) - 1)
107112

108113
typedef enum {
@@ -144,14 +149,17 @@ struct dcache_tag_item {
144149
};
145150

146151
struct autoload_config {
152+
uint8_t ena; /*!< autoload enable */
147153
uint8_t order; /*!< autoload step is positive or negative */
148154
uint8_t trigger; /*!< autoload trigger */
149-
uint8_t ena0; /*!< autoload region0 enable */
150-
uint8_t ena1; /*!< autoload region1 enable */
151-
uint32_t addr0; /*!< autoload region0 start address */
152-
uint32_t size0; /*!< autoload region0 size */
153-
uint32_t addr1; /*!< autoload region1 start address */
154-
uint32_t size1; /*!< autoload region1 size */
155+
uint8_t size; /*!< autoload size */
156+
};
157+
158+
struct autoload_region_config {
159+
uint8_t region; /*!< autoload region*/
160+
uint8_t ena; /*!< autoload region enable */
161+
uint32_t addr; /*!< autoload region start address */
162+
uint32_t size; /*!< autoload region size */
155163
};
156164

157165
struct tag_group_info {
@@ -160,6 +168,7 @@ struct tag_group_info {
160168
uint32_t vaddr_offset; /*!< virtual address offset of the cache ways */
161169
uint32_t tag_addr[MAX_CACHE_WAYS]; /*!< tag memory address, only [0~mode.ways-1] is valid to use */
162170
uint32_t cache_memory_offset[MAX_CACHE_WAYS]; /*!< cache memory address, only [0~mode.ways-1] is valid to use */
171+
uint8_t use_legacy; /*!< 1 for using legacy tag api, 0 for using 2rd tag api */
163172
};
164173

165174
struct lock_config {
@@ -168,6 +177,39 @@ struct lock_config {
168177
uint16_t group; /*!< manual lock group, 0 or 1*/
169178
};
170179

180+
struct cache_internal_stub_table {
181+
uint32_t (* icache_line_size)(void);
182+
uint32_t (* dcache_line_size)(void);
183+
uint32_t (* icache_addr)(uint32_t addr);
184+
uint32_t (* dcache_addr)(uint32_t addr);
185+
void (* invalidate_icache_items)(uint32_t addr, uint32_t items);
186+
void (* invalidate_dcache_items)(uint32_t addr, uint32_t items);
187+
void (* clean_items)(uint32_t addr, uint32_t items);
188+
void (* writeback_items)(uint32_t addr, uint32_t items);
189+
void (* lock_icache_items)(uint32_t addr, uint32_t items);
190+
void (* lock_dcache_items)(uint32_t addr, uint32_t items);
191+
void (* unlock_icache_items)(uint32_t addr, uint32_t items);
192+
void (* unlock_dcache_items)(uint32_t addr, uint32_t items);
193+
void (* occupy_items)(uint32_t addr, uint32_t items);
194+
uint32_t (* suspend_icache_autoload)(void);
195+
void (* resume_icache_autoload)(uint32_t autoload);
196+
uint32_t (* suspend_dcache_autoload)(void);
197+
void (* resume_dcache_autoload)(uint32_t autoload);
198+
void (* freeze_icache_enable)(cache_freeze_mode_t mode);
199+
void (* freeze_icache_disable)(void);
200+
void (* freeze_dcache_enable)(cache_freeze_mode_t mode);
201+
void (* freeze_dcache_disable)(void);
202+
int (* op_addr)(uint32_t op_icache, uint32_t start_addr, uint32_t size, uint32_t cache_line_size, uint32_t max_sync_num, void(* cache_Iop)(uint32_t, uint32_t), void(* cache_Dop)(uint32_t, uint32_t));
203+
};
204+
205+
typedef void (* cache_op_start)(void);
206+
typedef void (* cache_op_end)(void);
207+
208+
typedef struct {
209+
cache_op_start start;
210+
cache_op_end end;
211+
} cache_op_cb_t;
212+
171213
#define ESP_ROM_ERR_INVALID_ARG 1
172214
#define MMU_SET_ADDR_ALIGNED_ERROR 2
173215
#define MMU_SET_PASE_SIZE_ERROR 3
@@ -190,7 +232,7 @@ void Cache_MMU_Init(void);
190232
* @brief Set ICache mmu mapping.
191233
* Please do not call this function in your SDK application.
192234
*
193-
* @param uint32_t ext_ram : DPORT_MMU_ACCESS_FLASH for flash, DPORT_MMU_ACCESS_SPIRAM for spiram, DPORT_MMU_INVALID for invalid.
235+
* @param uint32_t ext_ram : MMU_ACCESS_FLASH for flash, MMU_ACCESS_SPIRAM for spiram, MMU_INVALID for invalid.
194236
*
195237
* @param uint32_t vaddr : virtual address in CPU address space.
196238
* Can be Iram0,Iram1,Irom0,Drom0 and AHB buses address.
@@ -217,7 +259,7 @@ int Cache_Ibus_MMU_Set(uint32_t ext_ram, uint32_t vaddr, uint32_t paddr, uint32
217259
* @brief Set DCache mmu mapping.
218260
* Please do not call this function in your SDK application.
219261
*
220-
* @param uint32_t ext_ram : DPORT_MMU_ACCESS_FLASH for flash, DPORT_MMU_ACCESS_SPIRAM for spiram, DPORT_MMU_INVALID for invalid.
262+
* @param uint32_t ext_ram : MMU_ACCESS_FLASH for flash, MMU_ACCESS_SPIRAM for spiram, MMU_INVALID for invalid.
221263
*
222264
* @param uint32_t vaddr : virtual address in CPU address space.
223265
* Can be DRam0, DRam1, DRom0, DPort and AHB buses address.
@@ -272,9 +314,9 @@ uint32_t Cache_Flash_To_SPIRAM_Copy(uint32_t bus, uint32_t bus_start_addr, uint3
272314
* @brief allocate memory to used by ICache.
273315
* Please do not call this function in your SDK application.
274316
*
275-
* @param cache_array_t icache_low : the data array bank used by icache low part, can be CACHE_MEMORY_INVALID, CACHE_MEMORY_IBANK0, CACHE_MEMORY_IBANK1
317+
* @param cache_array_t icache_low : the data array bank used by icache low part. Due to timing constraint, can only be CACHE_MEMORY_INVALID, CACHE_MEMORY_IBANK0
276318
*
277-
* @param cache_array_t icache_high : the data array bank used by icache high part, can be CACHE_MEMORY_INVALID, CACHE_MEMORY_IBANK0, CACHE_MEMORY_IBANK1 only if icache_low and icache_high is not CACHE_MEMORY_INVALID
319+
* @param cache_array_t icache_high : the data array bank used by icache high part. Due to timing constraint, can only be CACHE_MEMORY_INVALID, or CACHE_MEMORY_IBANK1 only if icache_low and icache_high is CACHE_MEMORY_IBANK0
278320
*
279321
* return none
280322
*/
@@ -284,9 +326,9 @@ void Cache_Occupy_ICache_MEMORY(cache_array_t icache_low, cache_array_t icache_h
284326
* @brief allocate memory to used by DCache.
285327
* Please do not call this function in your SDK application.
286328
*
287-
* @param cache_array_t dcache_low : the data array bank used by dcache low part, can be CACHE_MEMORY_INVALID, CACHE_MEMORY_DBANK0, CACHE_MEMORY_DBANK1
329+
* @param cache_array_t dcache_low : the data array bank used by dcache low part. Due to timing constraint, can only be CACHE_MEMORY_INVALID, CACHE_MEMORY_DBANK1
288330
*
289-
* @param cache_array_t dcache1_high : the data array bank used by dcache high part, can be CACHE_MEMORY_INVALID, CACHE_MEMORY_DBANK0, CACHE_MEMORY_DBANK1 only if dcache_low0 and dcache_low1 is not CACHE_MEMORY_INVALID
331+
* @param cache_array_t dcache1_high : the data array bank used by dcache high part. Due to timing constraint, can only be CACHE_MEMORY_INVALID, or CACHE_MEMORY_DBANK0 only if dcache_low0 and dcache_low1 is CACHE_MEMORY_DBANK1
290332
*
291333
* return none
292334
*/
@@ -310,7 +352,7 @@ void Cache_Get_Mode(struct cache_mode *mode);
310352
*
311353
* @param cache_ways_t ways : the associate ways of cache, can be CACHE_4WAYS_ASSOC and CACHE_8WAYS_ASSOC
312354
*
313-
* @param cache_line_size_t cache_line_size : the cache line size, can be CACHE_LINE_SIZE_16B, CACHE_LINE_SIZE_32B and CACHE_LINE_SIZE_64B
355+
* @param cache_line_size_t cache_line_size : the cache line size, can be CACHE_LINE_SIZE_16B and CACHE_LINE_SIZE_32B
314356
*
315357
* return none
316358
*/
@@ -320,9 +362,9 @@ void Cache_Set_ICache_Mode(cache_size_t cache_size, cache_ways_t ways, cache_lin
320362
* @brief set DCache modes: cache size, associate ways and cache line size.
321363
* Please do not call this function in your SDK application.
322364
*
323-
* @param cache_size_t cache_size : the cache size, can be CACHE_SIZE_8KB and CACHE_SIZE_16KB
365+
* @param cache_size_t cache_size : the cache size, can be CACHE_SIZE_HALF and CACHE_SIZE_FULL
324366
*
325-
* @param cache_ways_t ways : the associate ways of cache, can be CACHE_4WAYS_ASSOC and CACHE_8WAYS_ASSOC
367+
* @param cache_ways_t ways : the associate ways of cache, can be CACHE_4WAYS_ASSOC and CACHE_8WAYS_ASSOC, only CACHE_4WAYS_ASSOC works
326368
*
327369
* @param cache_line_size_t cache_line_size : the cache line size, can be CACHE_LINE_SIZE_16B, CACHE_LINE_SIZE_32B and CACHE_LINE_SIZE_64B
328370
*
@@ -351,7 +393,7 @@ uint32_t Cache_Address_Through_ICache(uint32_t addr);
351393
uint32_t Cache_Address_Through_DCache(uint32_t addr);
352394

353395
/**
354-
* @brief Init mmu owner register to make i/d cache use half mmu entries.
396+
* @brief Init Cache for ROM boot, including resetting the Dcache, initializing Owner, MMU, setting DCache mode, Enabling DCache, unmasking bus.
355397
*
356398
* @param None
357399
*
@@ -636,6 +678,16 @@ void Cache_End_DCache_Preload(uint32_t autoload);
636678
*/
637679
void Cache_Config_ICache_Autoload(const struct autoload_config *config);
638680

681+
/**
682+
* @brief Config region autoload parameters of ICache.
683+
* Please do not call this function in your SDK application.
684+
*
685+
* @param struct autoload_region_config * config : region autoload parameters.
686+
*
687+
* @return ESP_ROM_ERR_INVALID_ARG : invalid param, 0 : success
688+
*/
689+
int Cache_Config_ICache_Region_Autoload(const struct autoload_region_config *config);
690+
639691
/**
640692
* @brief Enable auto preload for ICache.
641693
* Please do not call this function in your SDK application.
@@ -666,6 +718,16 @@ void Cache_Disable_ICache_Autoload(void);
666718
*/
667719
void Cache_Config_DCache_Autoload(const struct autoload_config *config);
668720

721+
/**
722+
* @brief Config region autoload parameters of DCache.
723+
* Please do not call this function in your SDK application.
724+
*
725+
* @param struct autoload_region_config * config : region autoload parameters.
726+
*
727+
* @return ESP_ROM_ERR_INVALID_ARG : invalid param, 0 : success
728+
*/
729+
int Cache_Config_DCache_Region_Autoload(const struct autoload_region_config *config);
730+
669731
/**
670732
* @brief Enable auto preload for DCache.
671733
* Please do not call this function in your SDK application.
@@ -1008,7 +1070,24 @@ void Cache_Freeze_DCache_Disable(void);
10081070
*
10091071
* @return None
10101072
*/
1011-
void Cache_Travel_Tag_Memory(struct cache_mode *mode, uint32_t filter_addr, void (* process)(struct tag_group_info *));
1073+
void Cache_Travel_Tag_Memory(struct cache_mode * mode, uint32_t filter_addr, void (* process)(struct tag_group_info *));
1074+
1075+
/**
1076+
* @brief Travel tag memory to run a call back function, using 2nd tag registers.
1077+
* ICache and DCache are suspend when doing this.
1078+
* The callback will get the parameter tag_group_info, which will include a group of tag memory addresses and cache memory addresses.
1079+
* Please do not call this function in your SDK application.
1080+
*
1081+
* @param struct cache_mode * mode : the cache to check and the cache mode.
1082+
*
1083+
* @param uint32_t filter_addr : only the cache lines which may include the filter_address will be returned to the call back function.
1084+
* 0 for do not filter, all cache lines will be returned.
1085+
*
1086+
* @param void (* process)(struct tag_group_info *) : call back function, which may be called many times, a group(the addresses in the group are in the same position in the cache ways) a time.
1087+
*
1088+
* @return None
1089+
*/
1090+
void Cache_Travel_Tag_Memory2(struct cache_mode * mode, uint32_t filter_addr, void (* process)(struct tag_group_info *));
10121091

10131092
/**
10141093
* @brief Get the virtual address from cache mode, cache tag and the virtual address offset of cache ways.
@@ -1092,6 +1171,8 @@ int flash2spiram_rodata_offset(void);
10921171
uint32_t flash_instr_rodata_start_page(uint32_t bus);
10931172
uint32_t flash_instr_rodata_end_page(uint32_t bus);
10941173

1174+
extern struct cache_internal_stub_table* rom_cache_internal_table_ptr;
1175+
extern cache_op_cb_t rom_cache_op_cb;
10951176
#ifdef __cplusplus
10961177
}
10971178
#endif
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#pragma once
8+
9+
#include <stdint.h>
10+
11+
#include "esp_err.h"
12+
#include "esp_intr_alloc.h"
13+
14+
#ifdef __cplusplus
15+
extern "C" {
16+
#endif
17+
18+
/**
19+
* @brief esp_xt_wdt configuration struct
20+
*
21+
*/
22+
typedef struct {
23+
uint8_t timeout; /*!< Watchdog timeout */
24+
bool auto_backup_clk_enable; /*!< Enable automatic switch to backup clock at timeout */
25+
} esp_xt_wdt_config_t;
26+
27+
/* Callback function for WDT interrupt*/
28+
typedef void (*esp_xt_callback_t)(void *arg);
29+
30+
/**
31+
* @brief Initializes the xtal32k watchdog timer
32+
*
33+
* @param cfg Pointer to configuration struct
34+
* @return esp_err_t
35+
* - ESP_OK: XTWDT was successfully enabled
36+
* - ESP_ERR_NO_MEM: Failed to allocate ISR
37+
*/
38+
esp_err_t esp_xt_wdt_init(const esp_xt_wdt_config_t *cfg);
39+
40+
/**
41+
* @brief Register a callback function that will be called when the watchdog
42+
* times out.
43+
*
44+
* @note This function will be called from an interrupt context where the cache might be disabled.
45+
* Thus the function should be placed in IRAM and must not perform any blocking operations.
46+
*
47+
* Only one callback function can be registered, any call to esp_xt_wdt_register_callback
48+
* will override the previous callback function.
49+
*
50+
* @param func The callback function to register
51+
* @param arg Pointer to argument that will be passed to the callback function
52+
*/
53+
void esp_xt_wdt_register_callback(esp_xt_callback_t func, void *arg);
54+
55+
/**
56+
* @brief Restores the xtal32k clock and re-enables the WDT
57+
*
58+
*/
59+
void esp_xt_wdt_restore_clk(void);
60+
61+
#ifdef __cplusplus
62+
}
63+
#endif

0 commit comments

Comments
 (0)