blob: 7cfa8b24d7ea2f8d4552ab4956d11e7749c4c7cb [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*******************************************************************************
2 * Copyright (C) 2013, ZTE Corporation.
3 *
4 * File Name: drvs_l2cache.h
5 * File Mark:
6 * Description: This file contains the interface to operate L2 cache
7 * controller(L2C310) on zx297510 platform .
8 * Others:
9 * Version: V1.0
10 * Author: xuzhiguo
11 * Date: 2013-11-11
12 * History 1:
13 *
14 *********************************************************************************/
15#ifndef _DRVS_L2CACHE_H
16#define _DRVS_L2CACHE_H
17
18
19/*********************************************************************************
20* Include files
21**********************************************************************************/
22
23/*********************************************************************************
24* Macros
25**********************************************************************************/
26
27/*********************************************************************************
28* Type
29**********************************************************************************/
30
31/*********************************************************************************
32 * Global Variable *
33 *********************************************************************************/
34
35
36/*********************************************************************************
37* Global Function Prototypes
38**********************************************************************************/
39
40/*******************************************************************************
41* Function: zDrvL2x0_Sync
42* Description: Drain the STB. Operation complete when all buffers, LRB, LFB, STB,
43* and EB, are empty,
44* Parameters:
45* Input:
46* None
47* Outpu:
48* None
49* Returns:
50* None
51* Others: this fucntion can not be used when l2 cache is not initialized.
52* if you use it, nothing would be done.
53*******************************************************************************/
54void zDrvL2x0_Sync(void);
55
56/*******************************************************************************
57* Function: zDrvL2x0_Flush_All
58* Description: clean and invalidate entire L2 cache by way
59* Parameters:
60* Input:
61* None
62* Outpu:
63* None
64* Returns:
65* None
66* Others: this fucntion can not be used when l2 cache is not initialized.
67* if you use it, nothing would be done.
68*******************************************************************************/
69void zDrvL2x0_Flush_All(void);
70
71/*******************************************************************************
72* Function: zDrvL2x0_Clean_All
73* Description: clean entire L2 cache by way
74* Parameters:
75* Input:
76* None
77* Outpu:
78* None
79* Returns:
80* None
81* Others: this fucntion can not be used when l2 cache is not initialized.
82* if you use it, nothing would be done.
83*******************************************************************************/
84void zDrvL2x0_Clean_All(void);
85
86/*******************************************************************************
87* Function: zDrvL2x0_Inv_All
88* Description: invalidate entire L2 cache by way
89* Parameters:
90* Input:
91* None
92* Outpu:
93* None
94* Returns:
95* None
96* Others: this fucntion can not be used when l2 cache is not initialized.
97* if you use it, nothing would be done.
98*******************************************************************************/
99void zDrvL2x0_Inv_All(void);
100
101/*******************************************************************************
102* Function: zDrvL2x0_Flush_Range
103* Description: clean and invalidate L2 cache by line
104* Parameters:
105* Input:
106* base: base physical address of space needs to be flushed
107* size: size of space needs to be flushed
108* Outpu:
109* None
110* Returns:
111* None
112* Others: this fucntion can not be used when l2 cache is not initialized.
113* if you use it, nothing would be done.
114*******************************************************************************/
115void zDrvL2x0_Flush_Range(unsigned long base, unsigned long size);
116
117/*******************************************************************************
118* Function: zDrvL2x0_Clean_Range
119* Description: clean L2 cache by line
120* Parameters:
121* Input:
122* base: base physical address of space needs to be cleaned
123* size: size of space needs to be cleaned
124* Outpu:
125* None
126* Returns:
127* None
128* Others: this fucntion can not be used when l2 cache is not initialized.
129* if you use it, nothing would be done.
130*******************************************************************************/
131void zDrvL2x0_Clean_Range(unsigned long base, unsigned long size);
132
133/*******************************************************************************
134* Function: zDrvL2x0_Inv_Range
135* Description: invalidate L2 cache by line
136* Parameters:
137* Input:
138* base: base physical address of space needs to be invalidated
139* size: size of space needs to be invalidated
140* Outpu:
141* None
142* Returns:
143* None
144* Others: this fucntion can not be used when l2 cache is not initialized.
145* if you use it, nothing would be done.
146*******************************************************************************/
147void zDrvL2x0_Inv_Range(unsigned long base, unsigned long size);
148
149/*******************************************************************************
150* Function: zDrvL2x0_Enable
151* Description: enable l2 cache simply
152* Parameters:
153* Input:
154* None
155* Outpu:
156* None
157* Returns:
158* None
159* Others: this fucntion can not be used when l2 cache is not initialized.
160* if you use it, nothing would be done.
161*******************************************************************************/
162void zDrvL2x0_Enable(void);
163
164/*******************************************************************************
165* Function: zDrvL2x0_Disable
166* Description: disable l2 cache simply
167* Parameters:
168* Input:
169* None
170* Outpu:
171* None
172* Returns:
173* None
174* Others: this fucntion can not be used when l2 cache is not initialized.
175* if you use it, nothing would be done.
176* this function can not be used in complex case of operating L1 cache,
177* L2 cache and mmu.
178*******************************************************************************/
179void zDrvL2x0_Disable(void);
180
181/*******************************************************************************
182* Function: zDrvL2x0_Initiate
183* Description: Initiate l2 cache controller
184* Parameters:
185* Input:
186* None
187* Outpu:
188* None
189* Returns:
190* None
191* Others: None
192*******************************************************************************/
193void zDrvL2x0_Initiate(void);
194
195#endif