cache.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #ifndef _ROM_CACHE_H_
  8. #define _ROM_CACHE_H_
  9. #include <stdint.h>
  10. #include "esp_bit_defs.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /** \defgroup cache_apis, cache operation related apis
  15. * @brief cache apis
  16. */
  17. /** @addtogroup cache_apis
  18. * @{
  19. */
  20. #define MIN_ICACHE_SIZE 16384
  21. #define MAX_ICACHE_SIZE 16384
  22. #define MIN_ICACHE_WAYS 8
  23. #define MAX_ICACHE_WAYS 8
  24. #define MAX_CACHE_WAYS 8
  25. #define MIN_CACHE_LINE_SIZE 32
  26. #define TAG_SIZE 4
  27. #define MIN_ICACHE_BANK_NUM 1
  28. #define MAX_ICACHE_BANK_NUM 1
  29. #define CACHE_MEMORY_BANK_NUM 1
  30. #define CACHE_MEMORY_IBANK_SIZE 0x4000
  31. #define MAX_ITAG_BANK_ITEMS (MAX_ICACHE_SIZE / MAX_ICACHE_BANK_NUM / MIN_CACHE_LINE_SIZE)
  32. #define MAX_ITAG_BLOCK_ITEMS (MAX_ICACHE_SIZE / MAX_ICACHE_BANK_NUM / MAX_ICACHE_WAYS / MIN_CACHE_LINE_SIZE)
  33. #define MAX_ITAG_BANK_SIZE (MAX_ITAG_BANK_ITEMS * TAG_SIZE)
  34. #define MAX_ITAG_BLOCK_SIZE (MAX_ITAG_BLOCK_ITEMS * TAG_SIZE)
  35. typedef enum {
  36. CACHE_SIZE_HALF = 0, /*!< 8KB for icache and dcache */
  37. CACHE_SIZE_FULL = 1, /*!< 16KB for icache and dcache */
  38. } cache_size_t;
  39. typedef enum {
  40. CACHE_4WAYS_ASSOC = 0, /*!< 4 way associated cache */
  41. CACHE_8WAYS_ASSOC = 1, /*!< 8 way associated cache */
  42. } cache_ways_t;
  43. typedef enum {
  44. CACHE_LINE_SIZE_16B = 0, /*!< 16 Byte cache line size */
  45. CACHE_LINE_SIZE_32B = 1, /*!< 32 Byte cache line size */
  46. CACHE_LINE_SIZE_64B = 2, /*!< 64 Byte cache line size */
  47. } cache_line_size_t;
  48. typedef enum {
  49. CACHE_AUTOLOAD_POSITIVE = 0, /*!< cache autoload step is positive */
  50. CACHE_AUTOLOAD_NEGATIVE = 1, /*!< cache autoload step is negative */
  51. } cache_autoload_order_t;
  52. #define CACHE_AUTOLOAD_STEP(i) ((i) - 1)
  53. typedef enum {
  54. CACHE_AUTOLOAD_MISS_TRIGGER = 0, /*!< autoload only triggered by cache miss */
  55. CACHE_AUTOLOAD_HIT_TRIGGER = 1, /*!< autoload only triggered by cache hit */
  56. CACHE_AUTOLOAD_BOTH_TRIGGER = 2, /*!< autoload triggered both by cache miss and hit */
  57. } cache_autoload_trigger_t;
  58. typedef enum {
  59. CACHE_FREEZE_ACK_BUSY = 0, /*!< in this mode, cache ack busy to CPU if a cache miss happens*/
  60. CACHE_FREEZE_ACK_ERROR = 1, /*!< in this mode, cache ack wrong data to CPU and trigger an error if a cache miss happens */
  61. } cache_freeze_mode_t;
  62. typedef enum {
  63. MMU_PAGE_MODE_64KB = 0,
  64. MMU_PAGE_MODE_32KB = 1,
  65. MMU_PAGE_MODE_16KB = 2,
  66. MMU_PAGE_MODE_8KB = 3,
  67. MMU_PAGE_MODE_INVALID,
  68. } mmu_page_mode_t;
  69. struct cache_mode {
  70. uint32_t cache_size; /*!< cache size in byte */
  71. uint16_t cache_line_size; /*!< cache line size in byte */
  72. uint8_t cache_ways; /*!< cache ways, always 4 */
  73. uint8_t ibus; /*!< the cache index, 0 for dcache, 1 for icache */
  74. };
  75. struct icache_tag_item {
  76. uint32_t valid:1; /*!< the tag item is valid or not */
  77. uint32_t lock:1; /*!< the cache line is locked or not */
  78. uint32_t fifo_cnt:3; /*!< fifo cnt, 0 ~ 3 for 4 ways cache */
  79. uint32_t tag:13; /*!< the tag is the high part of the cache address, however is only 16MB (8MB Ibus + 8MB Dbus) range, and without low part */
  80. uint32_t reserved:14;
  81. };
  82. struct autoload_config {
  83. uint8_t order; /*!< autoload step is positive or negative */
  84. uint8_t trigger; /*!< autoload trigger */
  85. uint8_t ena0; /*!< autoload region0 enable */
  86. uint8_t ena1; /*!< autoload region1 enable */
  87. uint32_t addr0; /*!< autoload region0 start address */
  88. uint32_t size0; /*!< autoload region0 size */
  89. uint32_t addr1; /*!< autoload region1 start address */
  90. uint32_t size1; /*!< autoload region1 size */
  91. };
  92. struct tag_group_info {
  93. struct cache_mode mode; /*!< cache and cache mode */
  94. uint32_t filter_addr; /*!< the address that used to generate the struct */
  95. uint32_t vaddr_offset; /*!< virtual address offset of the cache ways */
  96. uint32_t tag_addr[MAX_CACHE_WAYS]; /*!< tag memory address, only [0~mode.ways-1] is valid to use */
  97. uint32_t cache_memory_offset[MAX_CACHE_WAYS]; /*!< cache memory address, only [0~mode.ways-1] is valid to use */
  98. };
  99. struct lock_config {
  100. uint32_t addr; /*!< manual lock address*/
  101. uint16_t size; /*!< manual lock size*/
  102. uint16_t group; /*!< manual lock group, 0 or 1*/
  103. };
  104. struct cache_internal_stub_table {
  105. uint32_t (* icache_line_size)(void);
  106. uint32_t (* icache_addr)(uint32_t addr);
  107. uint32_t (* dcache_addr)(uint32_t addr);
  108. void (* invalidate_icache_items)(uint32_t addr, uint32_t items);
  109. void (* lock_icache_items)(uint32_t addr, uint32_t items);
  110. void (* unlock_icache_items)(uint32_t addr, uint32_t items);
  111. uint32_t (* suspend_icache_autoload)(void);
  112. void (* resume_icache_autoload)(uint32_t autoload);
  113. void (* freeze_icache_enable)(cache_freeze_mode_t mode);
  114. void (* freeze_icache_disable)(void);
  115. int (* op_addr)(uint32_t start_addr, uint32_t size, uint32_t cache_line_size, uint32_t max_sync_num, void(* cache_Iop)(uint32_t, uint32_t));
  116. };
  117. /* Defined in the interface file, default value is rom_default_cache_internal_table */
  118. extern const struct cache_internal_stub_table* rom_cache_internal_table_ptr;
  119. typedef void (* cache_op_start)(void);
  120. typedef void (* cache_op_end)(void);
  121. typedef struct {
  122. cache_op_start start;
  123. cache_op_end end;
  124. } cache_op_cb_t;
  125. /* Defined in the interface file, default value is NULL */
  126. extern const cache_op_cb_t* rom_cache_op_cb;
  127. #define ESP_ROM_ERR_INVALID_ARG 1
  128. #define MMU_SET_ADDR_ALIGNED_ERROR 2
  129. #define MMU_SET_PASE_SIZE_ERROR 3
  130. #define MMU_SET_VADDR_OUT_RANGE 4
  131. #define CACHE_OP_ICACHE_Y 1
  132. #define CACHE_OP_ICACHE_N 0
  133. /**
  134. * @brief Initialise cache mmu, mark all entries as invalid.
  135. * Please do not call this function in your SDK application.
  136. *
  137. * @param None
  138. *
  139. * @return None
  140. */
  141. void Cache_MMU_Init(void);
  142. /**
  143. * @brief Init Cache for ROM boot, including resetting the Icache, initializing MMU, Enabling ICache, unmasking bus.
  144. *
  145. * @param None
  146. *
  147. * @return None
  148. */
  149. void ROM_Boot_Cache_Init(void);
  150. /**
  151. * @brief Set ICache mmu mapping.
  152. * Please do not call this function in your SDK application.
  153. *
  154. * @param uint32_t senitive : Config this page should apply flash encryption or not
  155. *
  156. * @param uint32_t ext_ram : DPORT_MMU_ACCESS_FLASH for flash, DPORT_MMU_INVALID for invalid. In
  157. * esp32h2, external memory is always flash
  158. *
  159. * @param uint32_t vaddr : virtual address in CPU address space.
  160. * Can be Iram0,Iram1,Irom0,Drom0 and AHB buses address.
  161. * Should be aligned by psize.
  162. *
  163. * @param uint32_t paddr : physical address in external memory.
  164. * Should be aligned by psize.
  165. *
  166. * @param uint32_t psize : page size of ICache, in kilobytes. Should be 64 here.
  167. *
  168. * @param uint32_t num : pages to be set.
  169. *
  170. * @param uint32_t fixed : 0 for physical pages grow with virtual pages, other for virtual pages map to same physical page.
  171. *
  172. * @return uint32_t: error status
  173. * 0 : mmu set success
  174. * 2 : vaddr or paddr is not aligned
  175. * 3 : psize error
  176. * 4 : vaddr is out of range
  177. */
  178. int Cache_MSPI_MMU_Set(uint32_t sensitive, uint32_t ext_ram, uint32_t vaddr, uint32_t paddr, uint32_t psize, uint32_t num, uint32_t fixed);
  179. /**
  180. * @brief Set DCache mmu mapping.
  181. * Please do not call this function in your SDK application.
  182. *
  183. * @param uint32_t ext_ram : DPORT_MMU_ACCESS_FLASH for flash, DPORT_MMU_INVALID for invalid. In
  184. * esp32c3, external memory is always flash
  185. *
  186. * @param uint32_t vaddr : virtual address in CPU address space.
  187. * Can be DRam0, DRam1, DRom0, DPort and AHB buses address.
  188. * Should be aligned by psize.
  189. *
  190. * @param uint32_t paddr : physical address in external memory.
  191. * Should be aligned by psize.
  192. *
  193. * @param uint32_t psize : page size of DCache, in kilobytes. Should be 64 here.
  194. *
  195. * @param uint32_t num : pages to be set.
  196. * @param uint32_t fixed : 0 for physical pages grow with virtual pages, other for virtual pages map to same physical page.
  197. *
  198. * @return uint32_t: error status
  199. * 0 : mmu set success
  200. * 2 : vaddr or paddr is not aligned
  201. * 3 : psize error
  202. * 4 : vaddr is out of range
  203. */
  204. int Cache_Dbus_MMU_Set(uint32_t ext_ram, uint32_t vaddr, uint32_t paddr, uint32_t psize, uint32_t num, uint32_t fixed);
  205. /**
  206. * @brief Get cache mode of ICache or DCache.
  207. * Please do not call this function in your SDK application.
  208. *
  209. * @param struct cache_mode * mode : the pointer of cache mode struct, caller should set the icache field
  210. *
  211. * return none
  212. */
  213. void Cache_Get_Mode(struct cache_mode * mode);
  214. /**
  215. * @brief Set cache page mode.
  216. *
  217. * @param mmu_page_mode_t
  218. *
  219. * @return None
  220. */
  221. void MMU_Set_Page_Mode(mmu_page_mode_t pg_mode);
  222. /**
  223. * @brief Get cache page mode.
  224. *
  225. * @param None
  226. *
  227. * @return page mode
  228. */
  229. mmu_page_mode_t MMU_Get_Page_Mode(void);
  230. /**
  231. * @brief Invalidate the cache items for ICache.
  232. * Operation will be done CACHE_LINE_SIZE aligned.
  233. * If the region is not in ICache addr room, nothing will be done.
  234. * Please do not call this function in your SDK application.
  235. *
  236. * @param uint32_t addr: start address to invalidate
  237. *
  238. * @param uint32_t items: cache lines to invalidate, items * cache_line_size should not exceed the bus address size(16MB/32MB/64MB)
  239. *
  240. * @return None
  241. */
  242. void Cache_Invalidate_ICache_Items(uint32_t addr, uint32_t items);
  243. /**
  244. * @brief Invalidate the Cache items in the region from ICache or DCache.
  245. * If the region is not in Cache addr room, nothing will be done.
  246. * Please do not call this function in your SDK application.
  247. *
  248. * @param uint32_t addr : invalidated region start address.
  249. *
  250. * @param uint32_t size : invalidated region size.
  251. *
  252. * @return 0 for success
  253. * 1 for invalid argument
  254. */
  255. int Cache_Invalidate_Addr(uint32_t addr, uint32_t size);
  256. /**
  257. * @brief Invalidate all cache items in ICache.
  258. * Please do not call this function in your SDK application.
  259. *
  260. * @param None
  261. *
  262. * @return None
  263. */
  264. void Cache_Invalidate_ICache_All(void);
  265. /**
  266. * @brief Mask all buses through ICache and DCache.
  267. * Please do not call this function in your SDK application.
  268. *
  269. * @param None
  270. *
  271. * @return None
  272. */
  273. void Cache_Mask_All(void);
  274. /**
  275. * @brief Suspend ICache auto preload operation, then you can resume it after some ICache operations.
  276. * Please do not call this function in your SDK application.
  277. *
  278. * @param None
  279. *
  280. * @return uint32_t : 0 for ICache not auto preload before suspend.
  281. */
  282. uint32_t Cache_Suspend_ICache_Autoload(void);
  283. /**
  284. * @brief Resume ICache auto preload operation after some ICache operations.
  285. * Please do not call this function in your SDK application.
  286. *
  287. * @param uint32_t autoload : 0 for ICache not auto preload before suspend.
  288. *
  289. * @return None.
  290. */
  291. void Cache_Resume_ICache_Autoload(uint32_t autoload);
  292. /**
  293. * @brief Start an ICache manual preload, will suspend auto preload of ICache.
  294. * Please do not call this function in your SDK application.
  295. *
  296. * @param uint32_t addr : start address of the preload region.
  297. *
  298. * @param uint32_t size : size of the preload region, should not exceed the size of ICache.
  299. *
  300. * @param uint32_t order : the preload order, 0 for positive, other for negative
  301. *
  302. * @return uint32_t : 0 for ICache not auto preload before manual preload.
  303. */
  304. uint32_t Cache_Start_ICache_Preload(uint32_t addr, uint32_t size, uint32_t order);
  305. /**
  306. * @brief Return if the ICache manual preload done.
  307. * Please do not call this function in your SDK application.
  308. *
  309. * @param None
  310. *
  311. * @return uint32_t : 0 for ICache manual preload not done.
  312. */
  313. uint32_t Cache_ICache_Preload_Done(void);
  314. /**
  315. * @brief End the ICache manual preload to resume auto preload of ICache.
  316. * Please do not call this function in your SDK application.
  317. *
  318. * @param uint32_t autoload : 0 for ICache not auto preload before manual preload.
  319. *
  320. * @return None
  321. */
  322. void Cache_End_ICache_Preload(uint32_t autoload);
  323. /**
  324. * @brief Config autoload parameters of ICache.
  325. * Please do not call this function in your SDK application.
  326. *
  327. * @param struct autoload_config * config : autoload parameters.
  328. *
  329. * @return None
  330. */
  331. void Cache_Config_ICache_Autoload(const struct autoload_config * config);
  332. /**
  333. * @brief Enable auto preload for ICache.
  334. * Please do not call this function in your SDK application.
  335. *
  336. * @param None
  337. *
  338. * @return None
  339. */
  340. void Cache_Enable_ICache_Autoload(void);
  341. /**
  342. * @brief Disable auto preload for ICache.
  343. * Please do not call this function in your SDK application.
  344. *
  345. * @param None
  346. *
  347. * @return None
  348. */
  349. void Cache_Disable_ICache_Autoload(void);
  350. /**
  351. * @brief Config a group of prelock parameters of ICache.
  352. * Please do not call this function in your SDK application.
  353. *
  354. * @param struct lock_config * config : a group of lock parameters.
  355. *
  356. * @return None
  357. */
  358. void Cache_Enable_ICache_PreLock(const struct lock_config *config);
  359. /**
  360. * @brief Disable a group of prelock parameters for ICache.
  361. * However, the locked data will not be released.
  362. * Please do not call this function in your SDK application.
  363. *
  364. * @param uint16_t group : 0 for group0, 1 for group1.
  365. *
  366. * @return None
  367. */
  368. void Cache_Disable_ICache_PreLock(uint16_t group);
  369. /**
  370. * @brief Lock the cache items for ICache.
  371. * Operation will be done CACHE_LINE_SIZE aligned.
  372. * If the region is not in ICache addr room, nothing will be done.
  373. * Please do not call this function in your SDK application.
  374. *
  375. * @param uint32_t addr: start address to lock
  376. *
  377. * @param uint32_t items: cache lines to lock, items * cache_line_size should not exceed the bus address size(16MB/32MB/64MB)
  378. *
  379. * @return None
  380. */
  381. void Cache_Lock_ICache_Items(uint32_t addr, uint32_t items);
  382. /**
  383. * @brief Unlock the cache items for ICache.
  384. * Operation will be done CACHE_LINE_SIZE aligned.
  385. * If the region is not in ICache addr room, nothing will be done.
  386. * Please do not call this function in your SDK application.
  387. *
  388. * @param uint32_t addr: start address to unlock
  389. *
  390. * @param uint32_t items: cache lines to unlock, items * cache_line_size should not exceed the bus address size(16MB/32MB/64MB)
  391. *
  392. * @return None
  393. */
  394. void Cache_Unlock_ICache_Items(uint32_t addr, uint32_t items);
  395. /**
  396. * @brief Lock the cache items in tag memory for ICache or DCache.
  397. * Please do not call this function in your SDK application.
  398. *
  399. * @param uint32_t addr : start address of lock region.
  400. *
  401. * @param uint32_t size : size of lock region.
  402. *
  403. * @return 0 for success
  404. * 1 for invalid argument
  405. */
  406. int Cache_Lock_Addr(uint32_t addr, uint32_t size);
  407. /**
  408. * @brief Unlock the cache items in tag memory for ICache or DCache.
  409. * Please do not call this function in your SDK application.
  410. *
  411. * @param uint32_t addr : start address of unlock region.
  412. *
  413. * @param uint32_t size : size of unlock region.
  414. *
  415. * @return 0 for success
  416. * 1 for invalid argument
  417. */
  418. int Cache_Unlock_Addr(uint32_t addr, uint32_t size);
  419. /**
  420. * @brief Disable ICache access for the cpu.
  421. * This operation will make all ICache tag memory invalid, CPU can't access ICache, ICache will keep idle.
  422. * Please do not call this function in your SDK application.
  423. *
  424. * @return uint32_t : auto preload enabled before
  425. */
  426. uint32_t Cache_Disable_ICache(void);
  427. /**
  428. * @brief Enable ICache access for the cpu.
  429. * Please do not call this function in your SDK application.
  430. *
  431. * @param uint32_t autoload : ICache will preload then.
  432. *
  433. * @return None
  434. */
  435. void Cache_Enable_ICache(uint32_t autoload);
  436. /**
  437. * @brief Suspend ICache access for the cpu.
  438. * The ICache tag memory is still there, CPU can't access ICache, ICache will keep idle.
  439. * Please do not change MMU, cache mode or tag memory(tag memory can be changed in some special case).
  440. * Please do not call this function in your SDK application.
  441. *
  442. * @param None
  443. *
  444. * @return uint32_t : auto preload enabled before
  445. */
  446. uint32_t Cache_Suspend_ICache(void);
  447. /**
  448. * @brief Resume ICache access for the cpu.
  449. * Please do not call this function in your SDK application.
  450. *
  451. * @param uint32_t autoload : ICache will preload then.
  452. *
  453. * @return None
  454. */
  455. void Cache_Resume_ICache(uint32_t autoload);
  456. /**
  457. * @brief Get ICache cache line size
  458. *
  459. * @param None
  460. *
  461. * @return uint32_t: 16, 32, 64 Byte
  462. */
  463. uint32_t Cache_Get_ICache_Line_Size(void);
  464. /**
  465. * @brief Enable freeze for ICache.
  466. * Any miss request will be rejected, including cpu miss and preload/autoload miss.
  467. * Please do not call this function in your SDK application.
  468. *
  469. * @param cache_freeze_mode_t mode : 0 for assert busy 1 for assert hit
  470. *
  471. * @return None
  472. */
  473. void Cache_Freeze_ICache_Enable(cache_freeze_mode_t mode);
  474. /**
  475. * @brief Disable freeze for ICache.
  476. * Please do not call this function in your SDK application.
  477. *
  478. * @return None
  479. */
  480. void Cache_Freeze_ICache_Disable(void);
  481. /**
  482. * @brief Travel tag memory to run a call back function.
  483. * ICache and DCache are suspend when doing this.
  484. * The callback will get the parameter tag_group_info, which will include a group of tag memory addresses and cache memory addresses.
  485. * Please do not call this function in your SDK application.
  486. *
  487. * @param struct cache_mode * mode : the cache to check and the cache mode.
  488. *
  489. * @param uint32_t filter_addr : only the cache lines which may include the filter_address will be returned to the call back function.
  490. * 0 for do not filter, all cache lines will be returned.
  491. *
  492. * @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.
  493. *
  494. * @return None
  495. */
  496. void Cache_Travel_Tag_Memory(struct cache_mode * mode, uint32_t filter_addr, void (* process)(struct tag_group_info *));
  497. /**
  498. * @brief Get the virtual address from cache mode, cache tag and the virtual address offset of cache ways.
  499. * Please do not call this function in your SDK application.
  500. *
  501. * @param struct cache_mode * mode : the cache to calculate the virtual address and the cache mode.
  502. *
  503. * @param uint32_t tag : the tag part fo a tag item, 12-14 bits.
  504. *
  505. * @param uint32_t addr_offset : the virtual address offset of the cache ways.
  506. *
  507. * @return uint32_t : the virtual address.
  508. */
  509. uint32_t Cache_Get_Virtual_Addr(struct cache_mode *mode, uint32_t tag, uint32_t vaddr_offset);
  510. /**
  511. * @}
  512. */
  513. /**
  514. * @brief Get the cache MMU IROM end address.
  515. * Please do not call this function in your SDK application.
  516. *
  517. * @param void
  518. *
  519. * @return uint32_t : the word value of the address.
  520. */
  521. uint32_t Cache_Get_IROM_MMU_End(void);
  522. /**
  523. * @brief Get the cache MMU DROM end address.
  524. * Please do not call this function in your SDK application.
  525. *
  526. * @param void
  527. *
  528. * @return uint32_t : the word value of the address.
  529. */
  530. uint32_t Cache_Get_DROM_MMU_End(void);
  531. /**
  532. * @brief Configure cache MMU page size according to instruction and rodata size
  533. *
  534. * @param irom_size The instruction cache MMU page size
  535. * @param drom_size The rodata data cache MMU page size
  536. */
  537. void Cache_Set_IDROM_MMU_Size(uint32_t irom_size, uint32_t drom_size);
  538. #define Cache_Dbus_MMU_Set(ext_ram, vaddr, paddr, psize, num, fixed) \
  539. Cache_MSPI_MMU_Set(ets_efuse_cache_encryption_enabled() ? MMU_SENSITIVE : 0, ext_ram, vaddr, paddr, psize, num, fixed)
  540. #ifdef __cplusplus
  541. }
  542. #endif
  543. #endif /* _ROM_CACHE_H_ */