Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions scripts/build-tools.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash
cd tools
./autogen.sh
./configure

mkdir build_tools
cd build_tools
cmake ..
make -j$(nproc)
if [[ "$1" == "-t" ]]; then
make tests -j$(nproc)
fi
cd ../
cd ../../
9 changes: 4 additions & 5 deletions scripts/sof-target-install.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#!/bin/bash
# usage: ./scripts/sof-target-intsall.sh up2-hostname ip
# usage: ./scripts/sof-target-install.sh up2-hostname ip

for host in $@
do
scp build_*_*/sof-*.ri root@${host}:/lib/firmware/intel/sof/
# TODO: need modify when tools CMAKE build system updated
scp tools/topology/*.tplg root@${host}:/lib/firmware/intel/sof-tplg/
scp tools/logger/sof-logger \
scp tools/build_tools/topology/*.tplg root@${host}:/lib/firmware/intel/sof-tplg/
scp tools/build_tools/logger/sof-logger \
build_*_*/src/arch/xtensa/sof-*.ldc \
tools/coredumper/* \
tools/eqctl/sof-eqctl \
tools/build_tools/eqctl/sof-eqctl \
tools/kmod_scripts/* \
root@${host}:~/
done
18 changes: 18 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.10)

if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR
" In-source builds are not supported.\n"
" Please remove CMakeCache.txt and the CMakeFiles directory.\n"
" Then specify a build directory. Example: cmake -Bbuild ..."
)
endif()

project(SOF_TOOLS C)

set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..")

add_subdirectory(logger)
add_subdirectory(eqctl)
add_subdirectory(topology)
add_subdirectory(test)
5 changes: 0 additions & 5 deletions tools/Makefile.am

This file was deleted.

29 changes: 3 additions & 26 deletions tools/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,11 @@ DSP firmwares for ALSA.
Building and Installing
=======================

./autogen.sh (only needed first time)
./configure
cmake -Bbuild .
cd build
make
make install


rimage
======

rimage is used to convert ELF executable firmware files to the firmware file
formats used by the kernel drivers.

e.g.

rimage -i elf_file -o kernel_file -m machine

rimage can also convert kernel firmware formats to flat binaries formats to
assist in debugging :-

e.g. convert to flat binary, then ELF then dissasemble

rimage -i /lib/firmware/intel/reef-byt.ri -o image.bin -b -m byt

xtensa-byt-elf-objcopy -I binary -O elf32-xtensa-le -B xtensa image.bin image.bin.elf

xtensa-byt-elf-objdump -D image.bin.elf > image.dis.txt


sof-logger
======

Expand Down Expand Up @@ -130,4 +107,4 @@ tests

To generate all test configuration files:

make tests
make tests
6 changes: 0 additions & 6 deletions tools/autogen.sh

This file was deleted.

38 changes: 0 additions & 38 deletions tools/configure.ac

This file was deleted.

9 changes: 9 additions & 0 deletions tools/eqctl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_executable(sof-eqctl
eqctl.c
)

target_link_libraries(sof-eqctl PRIVATE
"-lasound"
)

install(TARGETS sof-eqctl DESTINATION bin)
6 changes: 0 additions & 6 deletions tools/eqctl/Makefile.am

This file was deleted.

15 changes: 15 additions & 0 deletions tools/logger/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
add_executable(sof-logger
logger.c
convert.c
)

target_compile_options(sof-logger PRIVATE
-Wall -Werror
)

target_include_directories(sof-logger PRIVATE
"${SOF_ROOT_SOURCE_DIRECTORY}/src/include"
"${SOF_ROOT_SOURCE_DIRECTORY}"
)

install(TARGETS sof-logger DESTINATION bin)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the prefix for destination ? I'm assuming it can be set somewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

11 changes: 0 additions & 11 deletions tools/logger/Makefile.am

This file was deleted.

1 change: 1 addition & 0 deletions tools/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(topology)
32 changes: 32 additions & 0 deletions tools/test/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
file(GLOB TPLG_DEPS
../../topology/platform/intel/*.m4
../../topology/common/*.m4
../../topology/m4/*.m4
../../topology/sof/*.m4
)

find_program(XARGS NAMES xargs PATHS ENV PATH NO_DEFAULT_PATH)

if(${XARGS} STREQUAL XARGS-NOTFOUND)
set(USE_XARGS "no")
else()
set(USE_XARGS "yes")
endif()

add_custom_target(tests
COMMAND ${CMAKE_COMMAND} -E env
SOF_TPLG_BUILD_OUTPUT=${CMAKE_CURRENT_BINARY_DIR}
USE_XARGS=${USE_XARGS}
./tplg-build.sh
DEPENDS ${TPLG_DEPS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
USES_TERMINAL
)

add_custom_target(tests-clean
COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/*.conf
COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/*.tplg
VERBATIM
USES_TERMINAL
)
32 changes: 0 additions & 32 deletions tools/test/topology/Makefile.am

This file was deleted.

23 changes: 15 additions & 8 deletions tools/test/topology/tplg-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ set -e
# M4 preprocessor flags
export M4PATH="../../topology/:../../topology/m4:../../topology/common:../../topology/platform/intel:../../topology/platform/common"

if [ -z "$SOF_TPLG_BUILD_OUTPUT" ]
then
BUILD_OUTPUT="."
else
BUILD_OUTPUT="$SOF_TPLG_BUILD_OUTPUT"
fi

# Simple component test cases
# can be used on components with 1 sink and 1 source.
SIMPLE_TESTS=(test-all test-capture test-playback)
Expand Down Expand Up @@ -63,9 +70,9 @@ function simple_test {
-DTEST_DMIC_DUTY_MAX=${12} \
-DTEST_DMIC_SAMPLE_RATE=${13} \
-DTEST_DMIC_PDM_CONFIG=${14} \
$i.m4 > ${TFILE}.conf
echo "Compiling test $i -> ${TFILE}.tplg"
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
$i.m4 > "$BUILD_OUTPUT/${TFILE}.conf"
echo "Compiling test $i -> $BUILD_OUTPUT/${TFILE}.tplg"
alsatplg -v 1 -c "$BUILD_OUTPUT/${TFILE}.conf" -o "$BUILD_OUTPUT/${TFILE}.tplg"
else
if [ "$USE_XARGS" == "yes" ]
then
Expand All @@ -85,9 +92,9 @@ function simple_test {
-DTEST_SSP_MCLK=${11},-DTEST_SSP_PHY_BITS=$8\
-DTEST_SSP_DATA_BITS=$9,-DTEST_SSP_MODE=${12}\
-DTEST_SSP_MCLK_ID=${13},-DTEST_DAI_TYPE=$5\
$i.m4,${TFILE},"
$i.m4,$BUILD_OUTPUT/${TFILE},"
#create input string for batch processing of conf files
TEST_STRINGS+=${TFILE}","
TEST_STRINGS+="$BUILD_OUTPUT/${TFILE},"
fi
else
#if DAI type is SSP, define the SSP specific params
Expand All @@ -113,9 +120,9 @@ function simple_test {
-DTEST_SSP_MODE=${12} \
-DTEST_SSP_MCLK_ID=${13} \
-DTEST_DAI_TYPE=$5 \
$i.m4 > ${TFILE}.conf
echo "Compiling test $i -> ${TFILE}.tplg"
alsatplg -v 1 -c ${TFILE}.conf -o ${TFILE}.tplg
$i.m4 > "$BUILD_OUTPUT/${TFILE}.conf"
echo "Compiling test $i -> $BUILD_OUTPUT/${TFILE}.tplg"
alsatplg -v 1 -c "$BUILD_OUTPUT/${TFILE}.conf" -o "$BUILD_OUTPUT/${TFILE}.tplg"
fi
fi
fi
Expand Down
70 changes: 70 additions & 0 deletions tools/topology/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
file(GLOB TPLG_DEPS
platform/intel/*.m4
platform/common/*.m4
common/*.m4
m4/*.m4
sof/*.m4
)

set(MACHINES
sof-cht-nocodec
sof-cht-max98090
sof-hda-intel-common
sof-apl-nocodec
sof-byt-nocodec
sof-bdw-rt286
sof-bdw-rt5640
sof-byt-rt5640
sof-byt-rt5645
sof-byt-rt5651
sof-byt-da7213
sof-cnl-rt274
sof-hsw-rt5640
sof-apl-tdf8532
sof-apl-pcm512x
sof-apl-pcm512x-nohdmi
sof-apl-rt298
sof-apl-wm8804
sof-apl-da7219
sof-glk-da7219
sof-glk-rt5682
sof-icl-nocodec
sof-apl-eq-pcm512x
sof-apl-eq-dmic
sof-apl-dmic-2ch
sof-apl-dmic-4ch
sof-icl-dmic-4ch
sof-apl-src-pcm512x
sof-cml-rt5682
sof-cml-src-rt5682
sof-cnl-nocodec
)

add_custom_target(topologies ALL)

foreach(machine ${MACHINES})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${machine}.conf
COMMAND m4
-I ${CMAKE_CURRENT_SOURCE_DIR}/m4
-I ${CMAKE_CURRENT_SOURCE_DIR}/common
-I ${CMAKE_CURRENT_SOURCE_DIR}/platform/common
-I ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${machine}.m4
> ${machine}.conf
DEPENDS ${TPLG_DEPS}
VERBATIM
USES_TERMINAL
)

add_custom_command(
OUTPUT ${machine}.tplg
COMMAND alsatplg -v 1 -c ${machine}.conf -o ${machine}.tplg
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${machine}.conf
VERBATIM
USES_TERMINAL
)

add_custom_target(topology_${machine} DEPENDS ${machine}.tplg)
add_dependencies(topologies topology_${machine})
endforeach()
Loading