Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions scripts/xtensa-build-zephyr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ set -e

SOF_TOP=$(cd "$(dirname "$0")" && cd .. && pwd)

SUPPORTED_PLATFORMS=(apl cnl icl tgl-h)
# Default value, can be overridden on the command line
SUPPORTED_PLATFORMS=(apl cnl icl tgl-h imx)
# Default value, can (and sometimes must) be overridden with -p
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we add imx8 instead of imx here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, should be imx8:

-SUPPORTED_PLATFORMS=(apl cnl icl tgl-h)
+SUPPORTED_PLATFORMS=(apl cnl icl tgl-h imx8)

WEST_TOP="${SOF_TOP}"/zephyrproject
BUILD_JOBS=$(nproc --all)
RIMAGE_KEY=modules/audio/sof/keys/otc_private_key.pem
Expand Down Expand Up @@ -38,9 +38,13 @@ usage: $0 [options] platform(s)
-k Path to a non-default rimage signing key.
-c recursively clones Zephyr inside sof before building.
Incompatible with -p.
-p Existing Zephyr project directory. Incompatible with -c.
If modules/audio/sof is missing there then a symbolic
link pointing to ${SOF_TOP} will be added.
-p Existing Zephyr project directory. Incompatible with -c. If
zephyr-project/modules/audio/sof is missing then a
symbolic link pointing to ${SOF_TOP} will automatically be
created and west will recognize it as a new sof module.
This -p option is always _required_ if the real (not symbolic)
sof/ and zephyr-project/ directories are not nested in one
another.

Supported platforms ${SUPPORTED_PLATFORMS[*]}

Expand Down Expand Up @@ -77,6 +81,12 @@ install_opts()
build()
{
cd "$WEST_TOP"
west topdir || {
printf 'SOF_TOP=%s\nWEST_TOP=%s\n' "$SOF_TOP" "$WEST_TOP"
die 'try the -p option?'
# Also note west can get confused by symbolic links, see
# https://github.com/zephyrproject-rtos/west/issues/419
}

# Build rimage
RIMAGE_DIR=build-rimage
Expand All @@ -89,11 +99,16 @@ build()
local STAGING=build-sof-staging
mkdir -p ${STAGING}/sof/ # smex does not use 'install -D'

# Default RIMAGE_KEY defined at the top of this file
for platform in "${PLATFORMS[@]}"; do
case "$platform" in
apl)
PLAT_CONFIG='intel_adsp_cavs15'
;;
imx)
PLAT_CONFIG='intel_adsp_cavs15'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hasty copy/paste... @iuliana-prodan which --board parameter have you been using?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's nxp_adsp_imx8.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, is PLAT_CONFIG='nxp_adsp_imx8'

RIMAGE_KEY='None'
;;
cnl)
PLAT_CONFIG='intel_adsp_cavs18'
;;
Expand Down Expand Up @@ -130,10 +145,12 @@ build()
-l "$STAGING"/sof/sof-"$platform".ldc \
"$bdir"/zephyr/zephyr.elf

test "$RIMAGE_KEY" = 'None' ||
west sign --build-dir "$bdir" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation looks odd here. Same with line below.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tabs vs spaces, the new line seems to be indented with spaces.

--tool rimage --tool-path "$RIMAGE_DIR"/rimage \
--tool-data modules/audio/sof/rimage/config -- -k "$RIMAGE_KEY"
)
test "$RIMAGE_KEY" = 'None' ||
install_opts -m 0644 "$bdir"/zephyr/zephyr.ri \
"$STAGING"/sof/community/sof-"$platform".ri
done
Expand Down Expand Up @@ -206,7 +223,7 @@ main()
if [ "x$DO_CLONE" == "xyes" ]; then
clone
else
# Link to ourselves if no sof module yet
# Symlink zephyr-project to our SOF selves if no sof west module yet
test -e "${WEST_TOP}"/modules/audio/sof || {
mkdir -p "${WEST_TOP}"/modules/audio
ln -s "$SOF_TOP" "${WEST_TOP}"/modules/audio/sof
Expand Down