Part 1
요약·해설
CPU_HAS, DCACHE/ICACHE, CACHE_MANAGEMENT, ARCH/EXTERNAL_CACHE의 역할 차이를 정리합니다.
Capability
CPU_HAS_DCACHE · CPU_HAS_ICACHE
Implementation
ARCH_CACHE · EXTERNAL_CACHE
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
원문 SHA-256
1476795AA17E06F770866CC35A5E17189F2E7132328EEA1417DC921CE8999118
.. _cache-guide:
Cache Interface
###############
This is a high-level guide to cache interface and Kconfig options related to
cache controllers. See :ref:`cache_api` for API reference material.
Zephyr has different Kconfig options to control how the cache controller is
implemented and controlled.
* :kconfig:option:`CONFIG_CPU_HAS_DCACHE` /
:kconfig:option:`CONFIG_CPU_HAS_ICACHE`: these hidden options should be
selected at SoC / platform level when the CPU actually supports a data or
instruction cache. The cache controller can be in the core or can be an
external cache controller for which a driver is provided.
These options have the goal to document an available feature and should be
set whether we plan to support and use the caches in Zephyr or not.
* :kconfig:option:`CONFIG_DCACHE` / :kconfig:option:`CONFIG_ICACHE`: these
options must be selected when support for data or instruction cache is
present and working in zephyr.
All the code paths related to cache control must be conditionally enabled
depending on these symbols. When the symbol is set the cache is considered
enabled and used.
These symbols say nothing about the actual API interface exposed to the user.
For example a platform using the data cache can enable the
:kconfig:option:`CONFIG_DCACHE` symbol and use some HAL exported function in
some platform-specific code to enable and manage the d-cache.
* :kconfig:option:`CONFIG_CACHE_MANAGEMENT`: this option must be selected when
the cache operations are exposed to the user through a standard API (see
:ref:`cache_api`).
When this option is enabled we assume that all the cache functions are
implemented in the architectural code or in an external cache controller
driver.
* :kconfig:option:`CONFIG_ARCH_CACHE`/:kconfig:option:`CONFIG_EXTERNAL_CACHE`:
mutually exclusive options for :kconfig:option:`CACHE_TYPE` used to define
whether the cache operations are implemented at arch level or using an
external cache controller with a provided driver.
* :kconfig:option:`CONFIG_ARCH_CACHE`: the cache API is implemented by the
arch code
* :kconfig:option:`CONFIG_EXTERNAL_CACHE`: the cache API is implemented by a
driver that supports the external cache controller. In this case the driver
must be located as usual in the :file:`drivers/cache/` directory
.. _cache_api:
Cache API
*********
.. doxygengroup:: cache_interface
Part 3
한국어 전문 번역
Cache interface
이 문서는 cache controller와 관련 Kconfig option을 설명하는 상위 수준 가이드입니다. 세부 함수는 Cache API reference에 있습니다.
Zephyr는 cache controller의 구현과 제어 방식을 구분하기 위해 다음 Kconfig option을 사용합니다.
CONFIG_CPU_HAS_DCACHE/CONFIG_CPU_HAS_ICACHE: CPU가 data 또는 instruction cache를 실제 지원할 때 SoC/platform level에서 선택하는 hidden option입니다. Controller는 core 내부일 수도 있고 driver가 제공되는 external cache controller일 수도 있습니다. Zephyr가 cache를 실제 사용할 계획과 관계없이 사용 가능한 hardware 기능을 기록하기 위해 설정합니다.CONFIG_DCACHE/CONFIG_ICACHE: data/instruction cache 지원이 Zephyr에 존재하고 동작할 때 선택합니다. Cache control 관련 code path는 이 symbol을 조건으로 켜야 하며 symbol이 설정되면 cache가 활성화되어 사용 중인 것으로 봅니다. 다만 user에게 노출되는 API 종류를 뜻하지는 않습니다. Platform-specific HAL 함수로 d-cache를 관리하는 platform도CONFIG_DCACHE를 사용할 수 있습니다.CONFIG_CACHE_MANAGEMENT: 표준 API로 cache operation을 user에게 노출할 때 선택합니다. 활성화하면 architecture code 또는 external cache controller driver에 모든 cache 함수가 구현되어 있다고 가정합니다.CONFIG_ARCH_CACHE/CONFIG_EXTERNAL_CACHE:CACHE_TYPE의 상호 배타 option으로 cache operation을 architecture level에서 구현하는지, driver가 있는 external controller로 구현하는지 정합니다.
CONFIG_ARCH_CACHE: architecture code가 cache API를 구현합니다.CONFIG_EXTERNAL_CACHE: external cache controller driver가 cache API를 구현하며 driver는 일반적인 위치인drivers/cache/에 있어야 합니다.
Cache API
cache_interface API group은 cache enable·disable과 data/instruction cache 유지보수 operation을 위한 표준 interface를 제공합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.