18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright (C) 2008-2009 ST-Ericsson AB 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Author: Rickard Andersson <rickard.andersson@stericsson.com> 78c2ecf20Sopenharmony_ci * Author: Linus Walleij <linus.walleij@stericsson.com> 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci#ifndef __ASMARM_TCM_H 108c2ecf20Sopenharmony_ci#define __ASMARM_TCM_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#ifndef CONFIG_HAVE_TCM 138c2ecf20Sopenharmony_ci#error "You should not be including tcm.h unless you have a TCM!" 148c2ecf20Sopenharmony_ci#endif 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#include <linux/compiler.h> 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* Tag variables with this */ 198c2ecf20Sopenharmony_ci#define __tcmdata __section(".tcm.data") 208c2ecf20Sopenharmony_ci/* Tag constants with this */ 218c2ecf20Sopenharmony_ci#define __tcmconst __section(".tcm.rodata") 228c2ecf20Sopenharmony_ci/* Tag functions inside TCM called from outside TCM with this */ 238c2ecf20Sopenharmony_ci#define __tcmfunc __attribute__((long_call)) __section(".tcm.text") noinline 248c2ecf20Sopenharmony_ci/* Tag function inside TCM called from inside TCM with this */ 258c2ecf20Sopenharmony_ci#define __tcmlocalfunc __section(".tcm.text") 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_civoid *tcm_alloc(size_t len); 288c2ecf20Sopenharmony_civoid tcm_free(void *addr, size_t len); 298c2ecf20Sopenharmony_cibool tcm_dtcm_present(void); 308c2ecf20Sopenharmony_cibool tcm_itcm_present(void); 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#endif 33