-
Notifications
You must be signed in to change notification settings - Fork 367
Expand file tree
/
Copy pathmemory.h
More file actions
73 lines (54 loc) · 1.95 KB
/
Copy pathmemory.h
File metadata and controls
73 lines (54 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*
* Author: Marcin Rajwa <marcin.rajwa@linux.intel.com>
*/
#ifdef __SOF_LIB_MEMORY_H__
#ifndef __PLATFORM_LIB_MEMORY_H__
#define __PLATFORM_LIB_MEMORY_H__
/* prioritize definitions in Zephyr SoC layer */
#ifdef __ZEPHYR__
#include <adsp_memory.h>
#endif
#include <ace/lib/memory.h>
#include <mem_window.h>
#include <sof/lib/cpu.h>
/* HP SRAM windows */
#define WIN_BASE(n) DT_REG_ADDR(DT_PHANDLE(MEM_WINDOW_NODE(n), memory))
/* window 0 */
#define SRAM_SW_REG_BASE ((uint32_t)(WIN_BASE(0) + WIN0_OFFSET))
#define SRAM_SW_REG_SIZE 0x1000
#define SRAM_OUTBOX_BASE (SRAM_SW_REG_BASE + SRAM_SW_REG_SIZE)
#define SRAM_OUTBOX_SIZE 0x1000
/* window 1 */
#define SRAM_INBOX_BASE ((uint32_t)(WIN_BASE(1) + WIN1_OFFSET))
#define SRAM_INBOX_SIZE ((uint32_t)WIN_SIZE(1))
/* window 2 */
#define SRAM_DEBUG_BASE ((uint32_t)(WIN_BASE(2) + WIN2_OFFSET))
#define SRAM_DEBUG_SIZE 0x800
#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE)
#define SRAM_EXCEPT_SIZE 0x800
#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE)
#define SRAM_STREAM_SIZE 0x1000
/* Stack configuration */
#define SOF_STACK_SIZE CONFIG_SOF_STACK_SIZE
#define PLATFORM_HEAP_SYSTEM CONFIG_CORE_COUNT /* one per core */
#define PLATFORM_HEAP_SYSTEM_RUNTIME CONFIG_CORE_COUNT /* one per core */
#define PLATFORM_HEAP_RUNTIME 1
#define PLATFORM_HEAP_RUNTIME_SHARED 1
#define PLATFORM_HEAP_SYSTEM_SHARED 1
#define PLATFORM_HEAP_BUFFER 2
/**
* size of HPSRAM system heap
*/
#define HEAPMEM_SIZE CONFIG_SOF_ZEPHYR_HEAP_SIZE
#if CONFIG_COLD_STORE_EXECUTE_DRAM && \
(CONFIG_LLEXT_TYPE_ELF_RELOCATABLE || !defined(LL_EXTENSION_BUILD))
#define __cold __section(".cold")
#define __cold_rodata __section(".coldrodata")
#endif
#endif /* __PLATFORM_LIB_MEMORY_H__ */
#else
#error "This file shouldn't be included from outside of sof/lib/memory.h"
#endif /* __SOF_LIB_MEMORY_H__ */