Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mtb-hal-t2gc2d6m/docs/html/md_asset_dcache.html
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
142 lines (140 sloc)
7.21 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML header for doxygen 1.8.13--> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> | |
<meta name="generator" content="Doxygen 1.9.2"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1"/> | |
<title>Hardware Abstraction Layer (HAL)</title> | |
<link href="tabs.css" rel="stylesheet" type="text/css"/> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="dynsections.js"></script> | |
<link href="navtree.css" rel="stylesheet" type="text/css"/> | |
<script type="text/javascript" src="resize.js"></script> | |
<script type="text/javascript" src="navtreedata.js"></script> | |
<script type="text/javascript" src="navtree.js"></script> | |
<link href="search/search.css" rel="stylesheet" type="text/css"/> | |
<script type="text/javascript" src="search/searchdata.js"></script> | |
<script type="text/javascript" src="search/search.js"></script> | |
<link href="doxygen_style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> | |
<div id="titlearea"> | |
<table cellspacing="0" cellpadding="0"> | |
<tbody> | |
<tr style="height: 56px;"> | |
<td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td> | |
<td id="projectalign" style="padding-left: 0.5em;"> | |
<div id="projectname">Hardware Abstraction Layer (HAL)</div> | |
</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> | |
<!-- end header part --> | |
<!-- Generated by Doxygen 1.9.2 --> | |
<script type="text/javascript"> | |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | |
var searchBox = new SearchBox("searchBox", "search",'Search','.html'); | |
/* @license-end */ | |
</script> | |
<script type="text/javascript" src="menudata.js"></script> | |
<script type="text/javascript" src="menu.js"></script> | |
<script type="text/javascript"> | |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | |
$(function() { | |
initMenu('',true,false,'search.php','Search'); | |
$(document).ready(function() { init_search(); }); | |
}); | |
/* @license-end */ | |
</script> | |
<div id="main-nav"></div> | |
</div><!-- top --> | |
<div id="side-nav" class="ui-resizable side-nav-resizable"> | |
<div id="nav-tree"> | |
<div id="nav-tree-contents"> | |
<div id="nav-sync" class="sync"></div> | |
</div> | |
</div> | |
<div id="splitbar" style="-moz-user-select:none;" | |
class="ui-resizable-handle"> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | |
$(document).ready(function(){initNavTree('md_asset_dcache.html',''); initResizable(); }); | |
/* @license-end */ | |
</script> | |
<div id="doc-content"> | |
<!-- window showing the filter options --> | |
<div id="MSearchSelectWindow" | |
onmouseover="return searchBox.OnSearchSelectShow()" | |
onmouseout="return searchBox.OnSearchSelectHide()" | |
onkeydown="return searchBox.OnSearchSelectKey(event)"> | |
</div> | |
<!-- iframe showing the search results (closed by default) --> | |
<div id="MSearchResultsWindow"> | |
<iframe src="javascript:void(0)" frameborder="0" | |
name="MSearchResults" id="MSearchResults"> | |
</iframe> | |
</div> | |
<div><div class="header"> | |
<div class="headertitle"><div class="title">DCACHE Management </div></div> | |
</div><!--header--> | |
<div class="contents"> | |
<div class="textblock"><h1><a class="anchor" id="autotoc_md14"></a> | |
Overview</h1> | |
<p ><a class="anchor" id="DCACHE_Management"></a>For devices that contain a data cache (DCACHE), the HAL supports cache management in select drivers that can potentially be affected by it. The impacted drivers are:</p> | |
<ul> | |
<li>DMA</li> | |
<li>SDIO</li> | |
<li>UART</li> | |
</ul> | |
<p >The implementation of the cache management is based on the following cache policy and configuration:</p> | |
<ul> | |
<li>Write-back with read and write allocate: WB-RWA</li> | |
<li>Cache line size of 32 bytes</li> | |
<li>All memory in application is assumed to be cacheable</li> | |
</ul> | |
<h1><a class="anchor" id="autotoc_md15"></a> | |
Operation</h1> | |
<p >When working with DCACHE, cache coherency issues can be encountered when multiple bus masters access the same region of memory. There are two main scenarios to consider in the case where one of these is the CPU with DCACHE enabled, and the other is a peripheral such as a DMA. Suppose that both access the same memory region located in SRAM. Cache coherency issues can occur depending on the ordering in which the bus masters access that memory and which operations are performed on it.</p> | |
<ol type="1"> | |
<li>CPU writes to SRAM, DMA reads the content: When the CPU writes to SRAM, only the cache is updated and not the actual memory. When the DMA reads, it reads the old value in the actual memory.</li> | |
<li>DMA writes to SRAM, CPU reads the content: When the DMA writes to SRAM, it is updated in the actual memory. When the CPU reads from that memory, it reads the old value in the cache.</li> | |
</ol> | |
<p >To avoid running into these issues, the HAL (and the application) must perform the following operations.</p> | |
<ol type="1"> | |
<li>CPU writes to SRAM, DMA reads the content: Clean the cache (SCB_CleanDCache_by_Addr) after CPU write.</li> | |
<li>DMA writes to SRAM, CPU reads the content: Invalidate the cache (SCB_InvalidateDCache_by_Addr) before CPU read.</li> | |
</ol> | |
<p >In a scenario where multiple bus masters have DCACHE enabled, such as in multi-core (CPU) devices, the application must ensure that memory access is co-ordinated between the cores, such as by using an IPC (Inter-processor commnication) channel.</p> | |
<h1><a class="anchor" id="autotoc_md16"></a> | |
Alignment and Padding</h1> | |
<p >Cache clean and invalidate operations are performed at a granularity of the cache line size (i.e. 32 bytes). Therefore, all affected memory regions must also be aligned to 32 bytes and suitably padded to be a multiple of 32 bytes. Without proper alignment and padding, adjacent data will become corrupted during these operations.</p> | |
<p >The HAL is responsible for managing the memory internally within the drivers. The affected memory regions are aligned to the cache line and padded. However, the drivers cannot manage all the memory, such as data buffers passed in by the application. It is the responsibility of the application to properly align and pad the data. Refer to the individual driver API documentation on where these operations should be applied.</p> | |
<h1><a class="anchor" id="autotoc_md17"></a> | |
References</h1> | |
<ul> | |
<li><a href="https://www.cypress.com/products/modustoolbox-software-environment">ModusToolbox™</a></li> | |
<li><a href="http://www.cypress.com/ModusToolboxUserGuide">ModusToolbox™ User Guide</a></li> | |
<li><a href="http://www.cypress.com">Cypress Semiconductor, an Infineon Technologies Company</a></li> | |
<li><a href="https://github.com/infineon">Infineon GitHub</a> </li> | |
</ul> | |
</div></div><!-- contents --> | |
</div><!-- PageDoc --> | |
</div><!-- doc-content --> | |
<!-- start footer part | |
<div id="nav-path" class="navpath"> | |
<ul> | |
<li class="footer"> | |
Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>. | |
All rights reserved. | |
</li> | |
</ul> | |
</div> | |
--> | |
</body> | |
</html> |