xref: /OK3568_Linux_fs/kernel/arch/arm/include/asm/tcm.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2008-2009 ST-Ericsson AB
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Author: Rickard Andersson <rickard.andersson@stericsson.com>
7*4882a593Smuzhiyun  * Author: Linus Walleij <linus.walleij@stericsson.com>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun #ifndef __ASMARM_TCM_H
10*4882a593Smuzhiyun #define __ASMARM_TCM_H
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun #ifndef CONFIG_HAVE_TCM
13*4882a593Smuzhiyun #error "You should not be including tcm.h unless you have a TCM!"
14*4882a593Smuzhiyun #endif
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #include <linux/compiler.h>
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun /* Tag variables with this */
19*4882a593Smuzhiyun #define __tcmdata __section(".tcm.data")
20*4882a593Smuzhiyun /* Tag constants with this */
21*4882a593Smuzhiyun #define __tcmconst __section(".tcm.rodata")
22*4882a593Smuzhiyun /* Tag functions inside TCM called from outside TCM with this */
23*4882a593Smuzhiyun #define __tcmfunc __attribute__((long_call)) __section(".tcm.text") noinline
24*4882a593Smuzhiyun /* Tag function inside TCM called from inside TCM  with this */
25*4882a593Smuzhiyun #define __tcmlocalfunc __section(".tcm.text")
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun void *tcm_alloc(size_t len);
28*4882a593Smuzhiyun void tcm_free(void *addr, size_t len);
29*4882a593Smuzhiyun bool tcm_dtcm_present(void);
30*4882a593Smuzhiyun bool tcm_itcm_present(void);
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #endif
33