Skip to content

Commit

Permalink
Merge pull request #624 from cujomalainey/soft-merge
Browse files Browse the repository at this point in the history
Soft merge
  • Loading branch information
lgirdwood authored Nov 26, 2018
2 parents 6e14892 + c0c8172 commit d963e51
Show file tree
Hide file tree
Showing 245 changed files with 23,751 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/README.docker
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ To build for baytrail:
or (may need password test0000 for rimage install)
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh byt

To rebuild the topology in soft.git:
./scripts/docker-run.sh ./scripts/build-soft.sh
To rebuild the topology and logger:
./scripts/docker-run.sh ./scripts/build-tools.sh

An incremental sof.git build:
./scripts/docker-run.sh make
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-soft.sh → scripts/build-tools.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
cd ../soft.git
cd tools
./autogen.sh
./configure
make -j$(nproc)
cd ../sof.git
cd ../
23 changes: 23 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.o
*.in
*~
autom4te*
*.Po
*.swp
Makefile
config.*
configure
depcomp
install-sh
missing
stamp-h1
aclocal.m4
compile
ltmain.sh
rimage/rimage
rwav/rwav
*.tplg
topology/*.conf
topology/test/*.conf
eqctl/sof-eqctl
logger/sof-logger
14 changes: 14 additions & 0 deletions tools/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sudo: required

language: c

services:
- docker

before_install:
- docker pull xiulipan/sof
- echo -e '#!/bin/bash \n./autogen.sh && ./configure && make && make tests 1>/dev/null' > quickbuild.sh
- chmod 755 quickbuild.sh

script:
- docker run -it -v `pwd`:/home/sof/work/sof.git --user `id -u` xiulipan/sof ./quickbuild.sh
5 changes: 5 additions & 0 deletions tools/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SUBDIRS = logger topology eqctl
TESTDIR = test/topology

tests:
$(MAKE) -C $(TESTDIR)
133 changes: 133 additions & 0 deletions tools/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Sound Open Firmware Tools
=========================

This is a collection of open source tools used to develop open source audio
DSP firmwares for ALSA.

Building and Installing
=======================

./autogen.sh (only needed first time)
./configure
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
======

sof-logger is used to print logs delivered from FW dma_trace mechanism, by searching log
entries in *.ldc file generated by rimage.

Every entry declared in FW is placed in elf output file (e.g. sof-apl) in
.static_log_entries section in a form of struct defined in sof/src/include/sof/trace.h
in sof fw repo.

*.ldc file contains snd_sof_logs_header (defined in rmbox/logger_convert.c)
following by .static_log_entries section incorporated from FW elf file (e.g. sof-apl).
snd_sof_logs_header contains basic information about .static_log_entries section
like base_address and data_length.

sof-logger works by reading entry parameters value and entries addresses from FW
dma_trace mechanism and searching suitable entry in *.ldc file by its address.

Usage sof-logger <option(s)> <file(s)>
Display mailbox contents
-h help
-l *.ldc_file Specify the *.ldc file
-i in_file Get traces from in_file, instead of the default
"/sys/kernel/debug/sof/etrace"
-o out_file Specify the output file, instead of default stdout
-t Get traces from "/sys/kernel/debug/sof/trace", instead
of the default "/sys/kernel/debug/sof/etrace"
-p Get traces from stdin, instead of the default
"/sys/kernel/debug/sof/etrace"
-c Set timestamp clock in MHz
-e Enable checking firmware version with default verification file
"/sys/kernel/debug/sof/fw_version"
-v ver_file Enable checking firmware version with ver_file file,
instead of default: "/sys/kernel/debug/sof/fw_version"
-s Take a snapshot of state


Examples:

- Get traces from "/sys/kernel/debug/sof/etrace" file, verifies fw_version with
"/sys/kernel/debug/sof/fw_version" and prints logs to stdout

$ sof-logger -l ldc_file -e

- Get traces from "/sys/kernel/debug/sof/etrace" file, verifies fw_version with
ver_file file and prints logs to stdout

$ sof-logger -l ldc_file -v ver_file

- Get traces from "/sys/kernel/debug/sof/etrace" file and prints logs to stdout

$ sof-logger -l ldc_file

- Get traces from "/sys/kernel/debug/sof/etrace" file and prints logs to
out_file file

$ sof-logger -l ldc_file -o out_file

- Get traces from "/sys/kernel/debug/sof/trace" file and prints logs to stdout

$ sof-logger -l ldc_file -t

- Get traces from "/sys/kernel/debug/sof/trace" file and prints logs to
out_file file

$ sof-logger -l ldc_file -t -o out_file

- Get traces from stdin and prints logs to stdout

$ sof-logger -l ldc_file -p

- Get traces from stdin and prints logs to out_file file

$ sof-logger -l ldc_file -p -o out_file

- Get traces from trace_dump file and prints logs to stdout

$ sof-logger -l ldc_file -i trace_dump

- Get traces from trace_dump file and prints logs to out_file file

$ sof-logger -l ldc_file -i trace_dump -o out_file

- c flag is intented for defining clock value (in MHz) used to format log
timestamps. By default clock value is set to 19.2 (MHz). Below example
set clock value to 19.9 (MHz).

$ sof-logger -l ldc_file -i trace_dump -o out_file -c 19.9


tests
=====

To generate all test configuration files:

make tests
6 changes: 6 additions & 0 deletions tools/autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
libtoolize -c --force
aclocal -I m4 --install
autoconf -Wall
autoheader
automake -a --copy --foreign --add-missing
38 changes: 38 additions & 0 deletions tools/configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

AC_PREREQ([2.69])
AC_INIT([sof-tools], [1.0.1])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([logger/logger.c])
AC_CONFIG_SRCDIR([eqctl/eqctl.c])
AC_CONFIG_HEADERS([config.h])
AC_CHECK_HEADER([sof/uapi/abi.h])
AC_CHECK_PROG([XARGS], xargs, "yes", "no", [$PATH])
AM_CONDITIONAL(XARGS, test "$XARGS" = "yes")

AC_CANONICAL_HOST

dnl Initialize maintainer mode
AM_MAINTAINER_MODE([enable])

AC_PROG_CC

AC_OUTPUT([
Makefile
logger/Makefile
eqctl/Makefile
topology/Makefile
topology/common/Makefile
topology/platform/Makefile
topology/platform/intel/Makefile
topology/platform/common/Makefile
topology/m4/Makefile
topology/sof/Makefile
test/topology/Makefile
])

echo "

prefix: ${prefix}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
"
Loading

0 comments on commit d963e51

Please sign in to comment.