cache.h 20 KB

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