fsl_cache.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. /*
  2. * The Clear BSD License
  3. * Copyright (c) 2016, Freescale Semiconductor, Inc.
  4. * Copyright 2016-2017 NXP
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification,
  8. * are permitted (subject to the limitations in the disclaimer below) provided
  9. * that the following conditions are met:
  10. *
  11. * o Redistributions of source code must retain the above copyright notice, this list
  12. * of conditions and the following disclaimer.
  13. *
  14. * o Redistributions in binary form must reproduce the above copyright notice, this
  15. * list of conditions and the following disclaimer in the documentation and/or
  16. * other materials provided with the distribution.
  17. *
  18. * o Neither the name of the copyright holder nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  24. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  25. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  27. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  28. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  30. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  32. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #include "fsl_cache.h"
  35. /*******************************************************************************
  36. * Definitions
  37. ******************************************************************************/
  38. /* Component ID definition, used by tools. */
  39. #ifndef FSL_COMPONENT_ID
  40. #define FSL_COMPONENT_ID "platform.drivers.cache_armv7_m7"
  41. #endif
  42. #if defined(FSL_FEATURE_SOC_L2CACHEC_COUNT) && FSL_FEATURE_SOC_L2CACHEC_COUNT
  43. #define L2CACHE_OPERATION_TIMEOUT 0xFFFFFU
  44. #define L2CACHE_8WAYS_MASK 0xFFU
  45. #define L2CACHE_16WAYS_MASK 0xFFFFU
  46. #define L2CACHE_SMALLWAYS_NUM 8U
  47. #define L2CACHE_1KBCOVERTOB 1024U
  48. #define L2CACHE_SAMLLWAYS_SIZE 16U
  49. #define L2CACHE_LOCKDOWN_REGNUM 8 /*!< Lock down register numbers.*/
  50. /*******************************************************************************
  51. * Prototypes
  52. ******************************************************************************/
  53. /*!
  54. * @brief Set for all ways and waiting for the operation finished.
  55. * This is provided for all the background operations.
  56. *
  57. * @param auxCtlReg The auxiliary control register.
  58. * @param regAddr The register address to be operated.
  59. */
  60. static void L2CACHE_SetAndWaitBackGroundOperate(uint32_t auxCtlReg, uint32_t regAddr);
  61. /*!
  62. * @brief Invalidates the Level 2 cache line by physical address.
  63. * This function invalidates a cache line by physcial address.
  64. *
  65. * @param address The physical addderss of the cache.
  66. * The format of the address shall be :
  67. * bit 31 ~ bit n+1 | bitn ~ bit5 | bit4 ~ bit0
  68. * Tag | index | 0
  69. * Note: the physical address shall be aligned to the line size - 32B (256 bit).
  70. * so keep the last 5 bits (bit 4 ~ bit 0) of the physical address always be zero.
  71. * If the input address is not aligned, it will be changed to 32-byte aligned address.
  72. * The n is varies according to the index width.
  73. * @return The actual 32-byte aligned physical address be operated.
  74. */
  75. static uint32_t L2CACHE_InvalidateLineByAddr(uint32_t address);
  76. /*!
  77. * @brief Cleans the Level 2 cache line based on the physical address.
  78. * This function cleans a cache line based on a physcial address.
  79. *
  80. * @param address The physical addderss of the cache.
  81. * The format of the address shall be :
  82. * bit 31 ~ bit n+1 | bitn ~ bit5 | bit4 ~ bit0
  83. * Tag | index | 0
  84. * Note: the physical address shall be aligned to the line size - 32B (256 bit).
  85. * so keep the last 5 bits (bit 4 ~ bit 0) of the physical address always be zero.
  86. * If the input address is not aligned, it will be changed to 32-byte aligned address.
  87. * The n is varies according to the index width.
  88. * @return The actual 32-byte aligned physical address be operated.
  89. */
  90. static uint32_t L2CACHE_CleanLineByAddr(uint32_t address);
  91. /*!
  92. * @brief Cleans and invalidates the Level 2 cache line based on the physical address.
  93. * This function cleans and invalidates a cache line based on a physcial address.
  94. *
  95. * @param address The physical addderss of the cache.
  96. * The format of the address shall be :
  97. * bit 31 ~ bit n+1 | bitn ~ bit5 | bit4 ~ bit0
  98. * Tag | index | 0
  99. * Note: the physical address shall be aligned to the line size - 32B (256 bit).
  100. * so keep the last 5 bits (bit 4 ~ bit 0) of the physical address always be zero.
  101. * If the input address is not aligned, it will be changed to 32-byte aligned address.
  102. * The n is varies according to the index width.
  103. * @return The actual 32-byte aligned physical address be operated.
  104. */
  105. static uint32_t L2CACHE_CleanInvalidateLineByAddr(uint32_t address);
  106. /*!
  107. * @brief Gets the number of the Level 2 cache and the way size.
  108. * This function cleans and invalidates a cache line based on a physcial address.
  109. *
  110. * @param num_ways The number of the cache way.
  111. * @param size_way The way size.
  112. */
  113. static void L2CACHE_GetWayNumSize(uint32_t *num_ways, uint32_t *size_way);
  114. /*******************************************************************************
  115. * Code
  116. ******************************************************************************/
  117. static void L2CACHE_SetAndWaitBackGroundOperate(uint32_t auxCtlReg, uint32_t regAddr)
  118. {
  119. uint16_t mask = L2CACHE_8WAYS_MASK;
  120. uint32_t timeout = L2CACHE_OPERATION_TIMEOUT;
  121. /* Check the ways used at first. */
  122. if (auxCtlReg & L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_MASK)
  123. {
  124. mask = L2CACHE_16WAYS_MASK;
  125. }
  126. /* Set the opeartion for all ways/entries of the cache. */
  127. *(uint32_t *)regAddr = mask;
  128. /* Waiting for until the operation is complete. */
  129. while ((*(volatile uint32_t *)regAddr & mask) && timeout)
  130. {
  131. __ASM("nop");
  132. timeout--;
  133. }
  134. }
  135. static uint32_t L2CACHE_InvalidateLineByAddr(uint32_t address)
  136. {
  137. /* Align the address first. */
  138. address &= ~(uint32_t)(FSL_FEATURE_L2CACHE_LINESIZE_BYTE - 1);
  139. /* Invalidate the cache line by physical address. */
  140. L2CACHEC->REG7_INV_PA = address;
  141. return address;
  142. }
  143. static uint32_t L2CACHE_CleanLineByAddr(uint32_t address)
  144. {
  145. /* Align the address first. */
  146. address &= ~(uint32_t)(FSL_FEATURE_L2CACHE_LINESIZE_BYTE - 1);
  147. /* Invalidate the cache line by physical address. */
  148. L2CACHEC->REG7_CLEAN_PA = address;
  149. return address;
  150. }
  151. static uint32_t L2CACHE_CleanInvalidateLineByAddr(uint32_t address)
  152. {
  153. /* Align the address first. */
  154. address &= ~(uint32_t)(FSL_FEATURE_L2CACHE_LINESIZE_BYTE - 1);
  155. /* Clean and invalidate the cache line by physical address. */
  156. L2CACHEC->REG7_CLEAN_INV_PA = address;
  157. return address;
  158. }
  159. static void L2CACHE_GetWayNumSize(uint32_t *num_ways, uint32_t *size_way)
  160. {
  161. assert(num_ways);
  162. assert(size_way);
  163. uint32_t number = (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_MASK) >>
  164. L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_SHIFT;
  165. uint32_t size = (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_WAYSIZE_MASK) >>
  166. L2CACHEC_REG1_AUX_CONTROL_WAYSIZE_SHIFT;
  167. *num_ways = (number + 1) * L2CACHE_SMALLWAYS_NUM;
  168. if (!size)
  169. {
  170. /* 0 internally mapped to the same size as 1 - 16KB.*/
  171. size += 1;
  172. }
  173. *size_way = (1 << (size - 1)) * L2CACHE_SAMLLWAYS_SIZE * L2CACHE_1KBCOVERTOB;
  174. }
  175. void L2CACHE_Init(l2cache_config_t *config)
  176. {
  177. assert (config);
  178. uint16_t waysNum = 0xFFU; /* Default use the 8-way mask. */
  179. uint8_t count;
  180. uint32_t auxReg = 0;
  181. /*The aux register must be configured when the cachec is disabled
  182. * So disable first if the cache controller is enabled.
  183. */
  184. if (L2CACHEC->REG1_CONTROL & L2CACHEC_REG1_CONTROL_CE_MASK)
  185. {
  186. L2CACHE_Disable();
  187. }
  188. /* Unlock all entries. */
  189. if (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_MASK)
  190. {
  191. waysNum = 0xFFFFU;
  192. }
  193. for (count = 0; count < L2CACHE_LOCKDOWN_REGNUM; count ++)
  194. {
  195. L2CACHE_LockdownByWayEnable(count, waysNum, false);
  196. }
  197. /* Set the ways and way-size etc. */
  198. auxReg = L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY(config->wayNum) |
  199. L2CACHEC_REG1_AUX_CONTROL_WAYSIZE(config->waySize) |
  200. L2CACHEC_REG1_AUX_CONTROL_CRP(config->repacePolicy) |
  201. L2CACHEC_REG1_AUX_CONTROL_IPE(config->istrPrefetchEnable) |
  202. L2CACHEC_REG1_AUX_CONTROL_DPE(config->dataPrefetchEnable) |
  203. L2CACHEC_REG1_AUX_CONTROL_NLE(config->nsLockdownEnable) |
  204. L2CACHEC_REG1_AUX_CONTROL_FWA(config->writeAlloc) |
  205. L2CACHEC_REG1_AUX_CONTROL_HPSDRE(config->writeAlloc);
  206. L2CACHEC->REG1_AUX_CONTROL = auxReg;
  207. /* Set the tag/data ram latency. */
  208. if (config->lateConfig)
  209. {
  210. uint32_t data = 0;
  211. /* Tag latency. */
  212. data = L2CACHEC_REG1_TAG_RAM_CONTROL_SL(config->lateConfig->tagSetupLate)|
  213. L2CACHEC_REG1_TAG_RAM_CONTROL_SL(config->lateConfig->tagSetupLate)|
  214. L2CACHEC_REG1_TAG_RAM_CONTROL_RAL(config->lateConfig->tagReadLate)|
  215. L2CACHEC_REG1_TAG_RAM_CONTROL_WAL(config->lateConfig->dataWriteLate);
  216. L2CACHEC->REG1_TAG_RAM_CONTROL = data;
  217. /* Data latency. */
  218. data = L2CACHEC_REG1_DATA_RAM_CONTROL_SL(config->lateConfig->dataSetupLate)|
  219. L2CACHEC_REG1_DATA_RAM_CONTROL_SL(config->lateConfig->dataSetupLate)|
  220. L2CACHEC_REG1_DATA_RAM_CONTROL_RAL(config->lateConfig->dataReadLate)|
  221. L2CACHEC_REG1_DATA_RAM_CONTROL_WAL(config->lateConfig->dataWriteLate);
  222. L2CACHEC->REG1_DATA_RAM_CONTROL = data;
  223. }
  224. }
  225. void L2CACHE_GetDefaultConfig(l2cache_config_t *config)
  226. {
  227. assert(config);
  228. uint32_t number = (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_MASK) >>
  229. L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_SHIFT;
  230. uint32_t size = (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_WAYSIZE_MASK) >>
  231. L2CACHEC_REG1_AUX_CONTROL_WAYSIZE_SHIFT;
  232. /* Get the default value */
  233. config->wayNum = (l2cache_way_num_t)number;
  234. config->waySize = (l2cache_way_size)size;
  235. config->repacePolicy = kL2CACHE_Roundrobin;
  236. config->lateConfig = NULL;
  237. config->istrPrefetchEnable = false;
  238. config->dataPrefetchEnable = false;
  239. config->nsLockdownEnable = false;
  240. config->writeAlloc = kL2CACHE_UseAwcache;
  241. }
  242. void L2CACHE_Enable(void)
  243. {
  244. /* Invalidate first. */
  245. L2CACHE_Invalidate();
  246. /* Enable the level 2 cache controller. */
  247. L2CACHEC->REG1_CONTROL = L2CACHEC_REG1_CONTROL_CE_MASK;
  248. }
  249. void L2CACHE_Disable(void)
  250. {
  251. /* First CleanInvalidate all enties in the cache. */
  252. L2CACHE_CleanInvalidate();
  253. /* Disable the level 2 cache controller. */
  254. L2CACHEC->REG1_CONTROL &= ~L2CACHEC_REG1_CONTROL_CE_MASK;
  255. /* DSB - data sync barrier.*/
  256. __DSB();
  257. }
  258. void L2CACHE_Invalidate(void)
  259. {
  260. /* Invalidate all entries in cache. */
  261. L2CACHE_SetAndWaitBackGroundOperate(L2CACHEC->REG1_AUX_CONTROL, (uint32_t)&L2CACHEC->REG7_INV_WAY);
  262. /* Cache sync. */
  263. L2CACHEC->REG7_CACHE_SYNC = 0;
  264. }
  265. void L2CACHE_Clean(void)
  266. {
  267. /* Clean all entries of the cache. */
  268. L2CACHE_SetAndWaitBackGroundOperate(L2CACHEC->REG1_AUX_CONTROL, (uint32_t)&L2CACHEC->REG7_CLEAN_WAY);
  269. /* Cache sync. */
  270. L2CACHEC->REG7_CACHE_SYNC = 0;
  271. }
  272. void L2CACHE_CleanInvalidate(void)
  273. {
  274. /* Clean all entries of the cache. */
  275. L2CACHE_SetAndWaitBackGroundOperate(L2CACHEC->REG1_AUX_CONTROL, (uint32_t)&L2CACHEC->REG7_CLEAN_INV_WAY);
  276. /* Cache sync. */
  277. L2CACHEC->REG7_CACHE_SYNC = 0;
  278. }
  279. void L2CACHE_InvalidateByRange(uint32_t address, uint32_t size_byte)
  280. {
  281. uint32_t endAddr = address + size_byte;
  282. /* Invalidate addresses in the range. */
  283. while (address < endAddr)
  284. {
  285. address = L2CACHE_InvalidateLineByAddr(address);
  286. /* Update the size. */
  287. address += FSL_FEATURE_L2CACHE_LINESIZE_BYTE;
  288. }
  289. /* Cache sync. */
  290. L2CACHEC->REG7_CACHE_SYNC = 0;
  291. }
  292. void L2CACHE_CleanByRange(uint32_t address, uint32_t size_byte)
  293. {
  294. uint32_t num_ways = 0;
  295. uint32_t size_way = 0;
  296. uint32_t endAddr = address + size_byte;
  297. /* Get the number and size of the cache way. */
  298. L2CACHE_GetWayNumSize(&num_ways, &size_way);
  299. /* Check if the clean size is over the cache size. */
  300. if ((endAddr - address) > num_ways * size_way)
  301. {
  302. L2CACHE_Clean();
  303. return;
  304. }
  305. /* Clean addresses in the range. */
  306. while ((address & ~(uint32_t)(FSL_FEATURE_L2CACHE_LINESIZE_BYTE - 1)) < endAddr)
  307. {
  308. /* Clean the address in the range. */
  309. address = L2CACHE_CleanLineByAddr(address);
  310. address += FSL_FEATURE_L2CACHE_LINESIZE_BYTE;
  311. }
  312. L2CACHEC->REG7_CACHE_SYNC = 0;
  313. }
  314. void L2CACHE_CleanInvalidateByRange(uint32_t address, uint32_t size_byte)
  315. {
  316. uint32_t num_ways = 0;
  317. uint32_t size_way = 0;
  318. uint32_t endAddr = address + size_byte;
  319. /* Get the number and size of the cache way. */
  320. L2CACHE_GetWayNumSize(&num_ways, &size_way);
  321. /* Check if the clean size is over the cache size. */
  322. if ((endAddr - address) > num_ways * size_way)
  323. {
  324. L2CACHE_CleanInvalidate();
  325. return;
  326. }
  327. /* Clean addresses in the range. */
  328. while ((address & ~(uint32_t)(FSL_FEATURE_L2CACHE_LINESIZE_BYTE - 1)) < endAddr)
  329. {
  330. /* Clean the address in the range. */
  331. address = L2CACHE_CleanInvalidateLineByAddr(address);
  332. address += FSL_FEATURE_L2CACHE_LINESIZE_BYTE;
  333. }
  334. L2CACHEC->REG7_CACHE_SYNC = 0;
  335. }
  336. void L2CACHE_LockdownByWayEnable(uint32_t masterId, uint32_t mask, bool enable)
  337. {
  338. uint8_t num_ways = (L2CACHEC->REG1_AUX_CONTROL & L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_MASK) >>
  339. L2CACHEC_REG1_AUX_CONTROL_ASSOCIATIVITY_SHIFT;
  340. num_ways = (num_ways + 1) * L2CACHE_SMALLWAYS_NUM;
  341. assert(mask < (1U << num_ways));
  342. assert(masterId < L2CACHE_LOCKDOWN_REGNUM);
  343. uint32_t dataReg = L2CACHEC->LOCKDOWN[masterId].REG9_D_LOCKDOWN;
  344. uint32_t istrReg = L2CACHEC->LOCKDOWN[masterId].REG9_I_LOCKDOWN;
  345. if (enable)
  346. {
  347. /* Data lockdown. */
  348. L2CACHEC->LOCKDOWN[masterId].REG9_D_LOCKDOWN = dataReg | mask;
  349. /* Instruction lockdown. */
  350. L2CACHEC->LOCKDOWN[masterId].REG9_I_LOCKDOWN = istrReg | mask;
  351. }
  352. else
  353. {
  354. /* Data lockdown. */
  355. L2CACHEC->LOCKDOWN[masterId].REG9_D_LOCKDOWN = dataReg & ~mask;
  356. /* Instruction lockdown. */
  357. L2CACHEC->LOCKDOWN[masterId].REG9_I_LOCKDOWN = istrReg & ~mask;
  358. }
  359. }
  360. #endif /* FSL_FEATURE_SOC_L2CACHEC_COUNT */
  361. void L1CACHE_InvalidateICacheByRange(uint32_t address, uint32_t size_byte)
  362. {
  363. #if (__DCACHE_PRESENT == 1U)
  364. uint32_t addr = address & (uint32_t)~(FSL_FEATURE_L1ICACHE_LINESIZE_BYTE - 1);
  365. int32_t size = size_byte + address - addr;
  366. uint32_t linesize = 32U;
  367. __DSB();
  368. while (size > 0)
  369. {
  370. SCB->ICIMVAU = addr;
  371. addr += linesize;
  372. size -= linesize;
  373. }
  374. __DSB();
  375. __ISB();
  376. #endif
  377. }
  378. void ICACHE_InvalidateByRange(uint32_t address, uint32_t size_byte)
  379. {
  380. #if defined(FSL_FEATURE_SOC_L2CACHEC_COUNT) && FSL_FEATURE_SOC_L2CACHEC_COUNT
  381. #if defined(FSL_SDK_DISBLE_L2CACHE_PRESENT) && !FSL_SDK_DISBLE_L2CACHE_PRESENT
  382. L2CACHE_InvalidateByRange(address, size_byte);
  383. #endif /* !FSL_SDK_DISBLE_L2CACHE_PRESENT */
  384. #endif /* FSL_FEATURE_SOC_L2CACHEC_COUNT */
  385. L1CACHE_InvalidateICacheByRange(address, size_byte);
  386. }
  387. void DCACHE_InvalidateByRange(uint32_t address, uint32_t size_byte)
  388. {
  389. #if defined(FSL_FEATURE_SOC_L2CACHEC_COUNT) && FSL_FEATURE_SOC_L2CACHEC_COUNT
  390. #if defined(FSL_SDK_DISBLE_L2CACHE_PRESENT) && !FSL_SDK_DISBLE_L2CACHE_PRESENT
  391. L2CACHE_InvalidateByRange(address, size_byte);
  392. #endif /* !FSL_SDK_DISBLE_L2CACHE_PRESENT */
  393. #endif /* FSL_FEATURE_SOC_L2CACHEC_COUNT */
  394. L1CACHE_InvalidateDCacheByRange(address, size_byte);
  395. }
  396. void DCACHE_CleanByRange(uint32_t address, uint32_t size_byte)
  397. {
  398. L1CACHE_CleanDCacheByRange(address, size_byte);
  399. #if defined(FSL_FEATURE_SOC_L2CACHEC_COUNT) && FSL_FEATURE_SOC_L2CACHEC_COUNT
  400. #if defined(FSL_SDK_DISBLE_L2CACHE_PRESENT) && !FSL_SDK_DISBLE_L2CACHE_PRESENT
  401. L2CACHE_CleanByRange(address, size_byte);
  402. #endif /* !FSL_SDK_DISBLE_L2CACHE_PRESENT */
  403. #endif /* FSL_FEATURE_SOC_L2CACHEC_COUNT */
  404. }
  405. void DCACHE_CleanInvalidateByRange(uint32_t address, uint32_t size_byte)
  406. {
  407. L1CACHE_CleanInvalidateDCacheByRange(address, size_byte);
  408. #if defined(FSL_FEATURE_SOC_L2CACHEC_COUNT) && FSL_FEATURE_SOC_L2CACHEC_COUNT
  409. #if defined(FSL_SDK_DISBLE_L2CACHE_PRESENT) && !FSL_SDK_DISBLE_L2CACHE_PRESENT
  410. L2CACHE_CleanInvalidateByRange(address, size_byte);
  411. #endif /* !FSL_SDK_DISBLE_L2CACHE_PRESENT */
  412. #endif /* FSL_FEATURE_SOC_L2CACHEC_COUNT */
  413. }