/* * Copyright (c) 2017-2020 Arm Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * \file cache_drv.h * \brief Driver for L1 instruction cache based on SSE-200 version r1p0 */ #ifndef ARM_CACHE_DRV_H #define ARM_CACHE_DRV_H #include #include #ifdef __cplusplus extern "C" { #endif /** * \brief L1 cache configuration structure */ struct arm_cache_dev_cfg_t { const uint32_t base; /*!< L1 cache base address */ }; /** * \brief L1 cache device structure */ struct arm_cache_dev_t { const struct arm_cache_dev_cfg_t* const cfg; /*!< L1 cache configuration */ }; #define ARM_CACHEICHWPARAMS_CSIZE_OFF 0x0U /*!< Instruction cache size bit field offset */ #define ARM_CACHEICHWPARAMS_STATS_OFF 0x4U /*!< Statistic functionality bit field offset */ #define ARM_CACHEICHWPARAMS_DMA_OFF 0x5U /*!< DMA engine bit field offset */ #define ARM_CACHEICHWPARAMS_INVMAT_OFF 0x6U /*!< Bit field offset to indicates whether * invalidate cache line on write match is * enabled */ #define ARM_CACHEICHWPARAMS_COFFSIZE_OFF 0xCU /*!< Cacheable Block Size bit field offset */ #define ARM_CACHEICHWPARAMS_COFFSET_OFF 0x10U /*!< Cacheable Offset Addr bit field offset */ #define ARM_CACHEICCTRL_CACHEEN_OFF 0x0U /*!< Cache enable bit field offset */ #define ARM_CACHEICCTRL_FINV_OFF 0x2U /*!< Full invalidate bit field offset */ #define ARM_CACHEICCTRL_STATEN_OFF 0x3U /*!< Enable Statistic bit field offset */ #define ARM_CACHEICCTRL_STATC_OFF 0x4U /*!< Clear Statistic bit field offset */ #define ARM_CACHEICCTRL_HALLOC_OFF 0x5U /*!< Enable handler alloc bit field offset */ #define ARM_CACHE_INTR_IC_OFF 0x0U /*!< Invalidate Complete IRQ offset */ #define ARM_CACHE_INTR_CDC_OFF 0x1U /*!< Cache Disable Complete IRQ offset */ #define ARM_CACHE_INTR_CEC_OFF 0x2U /*!< Cache Enable Complete IRQ offset */ #define ARM_CACHE_INTR_CFE_OFF 0x3U /*!< Cache Fill Error IRQ offset */ #define ARM_CACHE_INTR_SV_OFF 0x4U /*!< Security violation IRQ offset */ #define ARM_CACHE_INTR_SS_OFF 0x5U /*!< Statistics Saturated IRQ offset */ /** * \brief L1 Cache Interrupt data structure */ enum arm_cache_intr_t { arm_cache_ic_intr_mask = (0x1U<