2019-05-28 09:57:21 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2009-09-15 17:30:37 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008-2009 ST-Ericsson AB
|
|
|
|
*
|
|
|
|
* Author: Rickard Andersson <rickard.andersson@stericsson.com>
|
|
|
|
* Author: Linus Walleij <linus.walleij@stericsson.com>
|
|
|
|
*/
|
|
|
|
#ifndef __ASMARM_TCM_H
|
|
|
|
#define __ASMARM_TCM_H
|
|
|
|
|
2023-06-02 19:28:43 +01:00
|
|
|
#ifdef CONFIG_HAVE_TCM
|
2009-09-15 17:30:37 +01:00
|
|
|
|
|
|
|
#include <linux/compiler.h>
|
|
|
|
|
|
|
|
/* Tag variables with this */
|
2020-10-21 19:36:07 -07:00
|
|
|
#define __tcmdata __section(".tcm.data")
|
2009-09-15 17:30:37 +01:00
|
|
|
/* Tag constants with this */
|
2020-10-21 19:36:07 -07:00
|
|
|
#define __tcmconst __section(".tcm.rodata")
|
2009-09-15 17:30:37 +01:00
|
|
|
/* Tag functions inside TCM called from outside TCM with this */
|
2020-10-21 19:36:07 -07:00
|
|
|
#define __tcmfunc __attribute__((long_call)) __section(".tcm.text") noinline
|
2009-09-15 17:30:37 +01:00
|
|
|
/* Tag function inside TCM called from inside TCM with this */
|
2020-10-21 19:36:07 -07:00
|
|
|
#define __tcmlocalfunc __section(".tcm.text")
|
2009-09-15 17:30:37 +01:00
|
|
|
|
|
|
|
void *tcm_alloc(size_t len);
|
|
|
|
void tcm_free(void *addr, size_t len);
|
2011-07-01 08:23:36 +01:00
|
|
|
bool tcm_dtcm_present(void);
|
|
|
|
bool tcm_itcm_present(void);
|
2009-09-15 17:30:37 +01:00
|
|
|
|
2023-06-02 19:28:43 +01:00
|
|
|
void __init tcm_init(void);
|
|
|
|
#else
|
|
|
|
/* No TCM support, just blank inlines to be optimized out */
|
|
|
|
static inline void tcm_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
2009-09-15 17:30:37 +01:00
|
|
|
#endif
|