forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset_xtensa_params.sh
More file actions
175 lines (162 loc) · 4.17 KB
/
set_xtensa_params.sh
File metadata and controls
175 lines (162 loc) · 4.17 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2023 Intel Corporation. All rights reserved.
# Because this is meant to be sourced
# shellcheck disable=SC2148
# shellcheck disable=SC2034
### XTENSA_ toolchain configuration shared across projects ###
# These variables are currently used in/by:
#
# - script/rebuild-testbench.sh
# - before Zephyr's `twister` or `west build`
#
# Not all variables are used in all use cases. Some are.
#
# Find some information about XTENSA_SYSTEM and XTENSA_CORE in
# ./scripts/xtensa-build-zephyr.py --help
#
# The variables used by Zephyr are duplicated in
# xtensa-build-zephyr.py, please keep in sync!
# To maximize reuse, keep this script very basic and minimal and don't
# `export`: leave which the decision for each variable to the caller.
# Sourced script argument $1 is a non-standard bash extension
[ -n "$1" ] || {
>&2 printf 'Missing platform argument\n'
return 1 # Not exit!
}
platform=$1
# If adding a new variable is required, avoid adding it to the mass
# duplication in this first, very verbose `case` statement. Prefer
# adding a new, smarter, per-variable `case` statement like the one for
# ZEPHYR_TOOLCHAIN_VARIANT below
PLATFORM="$platform"
case "$platform" in
# Intel
tgl)
PLATFORM="tgplp"
XTENSA_CORE="cavs2x_LX6HiFi3_2017_8"
HOST="xtensa-cnl-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
HAVE_ROM='yes'
IPC4_CONFIG_OVERLAY="tigerlake_ipc4"
# default key for TGL
PLATFORM_PRIVATE_KEY="-D${SIGNING_TOOL}_PRIVATE_KEY=$SOF_TOP/keys/otc_private_key_3k.pem"
;;
tgl-h)
PLATFORM="tgph"
XTENSA_CORE="cavs2x_LX6HiFi3_2017_8"
HOST="xtensa-cnl-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
HAVE_ROM='yes'
# default key for TGL
PLATFORM_PRIVATE_KEY="-D${SIGNING_TOOL}_PRIVATE_KEY=$SOF_TOP/keys/otc_private_key_3k.pem"
;;
mtl|lnl)
XTENSA_CORE="ace10_LX7HiFi4_2022_10"
TOOLCHAIN_VER="RI-2022.10-linux"
;;
ptl)
XTENSA_CORE="ace30_LX7HiFi4_PIF"
TOOLCHAIN_VER="RI-2022.10-linux"
;;
nvl)
PLATFORM="$platform"
XTENSA_CORE="ace4px_HiFi5MMU_PIF_nlib"
TOOLCHAIN_VER="RI-2022.10-linux"
;;
# NXP
imx8)
XTENSA_CORE="hifi4_nxp_v3_3_1_2_2017"
HOST="xtensa-imx-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
;;
imx8x)
XTENSA_CORE="hifi4_nxp_v3_3_1_2_2017"
HOST="xtensa-imx-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
;;
imx8m)
XTENSA_CORE="hifi4_mscale_v0_0_2_2017"
HOST="xtensa-imx8m-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
;;
imx8ulp)
XTENSA_CORE="hifi4_nxp2_ulp_prod"
HOST="xtensa-imx8ulp-elf"
TOOLCHAIN_VER="RG-2017.8-linux"
;;
# AMD
rn)
PLATFORM="renoir"
XTENSA_CORE="ACP_3_1_001_PROD_2019_1"
HOST="xtensa-rn-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
rmb)
PLATFORM="rembrandt"
XTENSA_CORE="LX7_HiFi5_PROD"
HOST="xtensa-rmb-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
vangogh)
XTENSA_CORE="ACP_5_0_001_PROD"
HOST="xtensa-vangogh-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
acp_6_3)
XTENSA_CORE="ACP_6_3_HiFi5_PROD_Linux"
HOST="xtensa-acp_6_3-elf"
TOOLCHAIN_VER="RI-2021.6-linux"
;;
acp_7_0)
XTENSA_CORE="ACP_7_0_HiFi5_NNE_PROD"
HOST="xtensa-acp_7_0-elf"
TOOLCHAIN_VER="RI-2023.11-linux"
;;
# Mediatek
mt8186)
XTENSA_CORE="hifi5_7stg_I64D128"
HOST="xtensa-mt8186-elf"
TOOLCHAIN_VER="RI-2020.5-linux"
;;
mt8188)
XTENSA_CORE="hifi5_7stg_I64D128"
HOST="xtensa-mt8188-elf"
TOOLCHAIN_VER="RI-2020.5-linux"
;;
mt8195)
XTENSA_CORE="hifi4_8195_PROD"
HOST="xtensa-mt8195-elf"
TOOLCHAIN_VER="RI-2019.1-linux"
;;
mt8196)
XTENSA_CORE="HiFi5_MPU_lock_2023_11"
HOST="xtensa-mt8196-elf"
TOOLCHAIN_VER="RI-2023.11-linux"
;;
mt8365)
PLATFORM="mt8365"
XTENSA_CORE="hifi4_Aquila_E2_PROD"
HOST="xtensa-mt8365-elf"
TOOLCHAIN_VER="RG-2018.9-linux"
;;
*)
>&2 printf 'Unknown xtensa platform=%s\n' "$platform"
return 1
;;
esac
# Pre-zephyr "XTOS" build, testbench,...
case "$platform" in
mtl|lnl|ptl|acp_7_0|mt8196|nvl)
SOF_CC_BASE='clang';;
*)
SOF_CC_BASE='xcc';;
esac
# For Zephyr unit tests
case "$platform" in
imx8*|mtl|lnl)
ZEPHYR_TOOLCHAIN_VARIANT='xt-clang';;
*) # The previous, main case/esac already caught invalid input.
# This won't hurt platforms that don't use Zephyr (it's not even
# exported).
ZEPHYR_TOOLCHAIN_VARIANT='xcc';;
esac