2018-10-12 13:07:17 +08:00
|
|
|
#!/bin/bash
|
2019-06-02 04:58:16 +08:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2018 Intel Corporation. All rights reserved.
|
2018-10-12 13:07:17 +08:00
|
|
|
|
2019-01-17 18:56:40 +08:00
|
|
|
SUPPORTED_PLATFORMS=(byt cht bdw hsw apl icl skl kbl cnl)
|
|
|
|
READY_MSG="6c 00 00 00 00 00 00 70"
|
2018-10-12 13:07:17 +08:00
|
|
|
|
|
|
|
rm -f dump-*.txt
|
|
|
|
|
|
|
|
if [ "$#" -eq 0 ]
|
|
|
|
then
|
|
|
|
PLATFORMS=${SUPPORTED_PLATFORMS[@]}
|
|
|
|
else
|
|
|
|
for args in $@
|
|
|
|
do
|
|
|
|
for i in ${SUPPORTED_PLATFORMS[@]}
|
|
|
|
do
|
|
|
|
if [ $i == $args ]
|
|
|
|
then
|
|
|
|
PLATFORMS+=$i" "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $PLATFORMS
|
|
|
|
|
|
|
|
for j in ${PLATFORMS[@]}
|
|
|
|
do
|
|
|
|
FWNAME="sof-$j.ri"
|
2019-01-11 13:57:54 +08:00
|
|
|
PLATFORM=$j
|
2018-10-12 13:07:17 +08:00
|
|
|
if [ $j == "byt" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 88 02 70 00 00 00 80"
|
|
|
|
SHM_IPC_REG=qemu-bridge-shim-io
|
|
|
|
SHM_MBOX=qemu-bridge-mbox-io
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "cht" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 88 02 70 00 00 00 80"
|
|
|
|
SHM_IPC_REG=qemu-bridge-shim-io
|
|
|
|
SHM_MBOX=qemu-bridge-mbox-io
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "bdw" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 3c 01 80"
|
|
|
|
SHM_IPC_REG=qemu-bridge-shim-io
|
|
|
|
SHM_MBOX=qemu-bridge-mbox-io
|
|
|
|
fi
|
2018-10-12 13:07:17 +08:00
|
|
|
if [ $j == "hsw" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 fc 00 80"
|
|
|
|
SHM_IPC_REG=qemu-bridge-shim-io
|
|
|
|
SHM_MBOX=qemu-bridge-mbox-io
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "apl" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 00 00 f0"
|
|
|
|
SHM_IPC_REG=qemu-bridge-ipc-io
|
|
|
|
OUTBOX_OFFSET="f000"
|
|
|
|
SHM_MBOX=qemu-bridge-hp-sram-mem
|
2019-01-23 17:28:47 +08:00
|
|
|
ROM="-r ../sof.git/build_${j}_gcc/src/arch/xtensa/rom-$j.bin"
|
2019-01-11 13:57:54 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "skl" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 00 00 f0"
|
|
|
|
SHM_IPC_REG=qemu-bridge-ipc-io
|
|
|
|
OUTBOX_OFFSET="f000"
|
|
|
|
SHM_MBOX=qemu-bridge-hp-sram-mem
|
2019-01-23 17:28:47 +08:00
|
|
|
ROM="-r ../sof.git/build_${j}_gcc/src/arch/xtensa/rom-$j.bin"
|
2019-01-11 13:57:54 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "kbl" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 00 00 f0"
|
|
|
|
SHM_IPC_REG=qemu-bridge-ipc-io
|
|
|
|
OUTBOX_OFFSET="f000"
|
|
|
|
SHM_MBOX=qemu-bridge-hp-sram-mem
|
2019-01-23 17:28:47 +08:00
|
|
|
ROM="-r ../sof.git/build_${j}_gcc/src/arch/xtensa/rom-$j.bin"
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "cnl" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 00 00 f0"
|
|
|
|
SHM_IPC_REG=qemu-bridge-ipc-io
|
|
|
|
OUTBOX_OFFSET="5000"
|
|
|
|
SHM_MBOX=qemu-bridge-hp-sram-mem
|
2019-01-23 17:28:47 +08:00
|
|
|
ROM="-r ../sof.git/build_${j}_gcc/src/arch/xtensa/rom-$j.bin"
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
if [ $j == "icl" ]
|
|
|
|
then
|
2019-01-17 18:56:40 +08:00
|
|
|
READY_IPC="00 00 00 f0"
|
|
|
|
SHM_IPC_REG=qemu-bridge-ipc-io
|
|
|
|
OUTBOX_OFFSET="5000"
|
|
|
|
SHM_MBOX=qemu-bridge-hp-sram-mem
|
2019-01-23 17:28:47 +08:00
|
|
|
ROM="-r ../sof.git/build_${j}_gcc/src/arch/xtensa/rom-$j.bin"
|
2018-10-12 13:07:17 +08:00
|
|
|
fi
|
|
|
|
|
2019-01-23 17:28:47 +08:00
|
|
|
./xtensa-host.sh $PLATFORM -k ../sof.git/build_${j}_gcc/src/arch/xtensa/$FWNAME $ROM -o 2.0 ../sof.git/dump-$j.txt
|
2018-10-12 13:07:17 +08:00
|
|
|
# dump log into sof.git incase running in docker
|
|
|
|
|
2019-01-17 18:56:40 +08:00
|
|
|
# check if ready ipc header is in the ipc regs
|
|
|
|
IPC_REG=$(hexdump -C /dev/shm/$SHM_IPC_REG | grep "$READY_IPC")
|
|
|
|
# check if ready ipc message is in the mbox
|
|
|
|
IPC_MSG=$(hexdump -C /dev/shm/$SHM_MBOX | grep -A 4 "$READY_MSG" | grep -A 4 "$OUTBOX_OFFSET")
|
|
|
|
|
|
|
|
if [ "$IPC_REG" ]; then
|
|
|
|
echo "ipc reg dump:"
|
|
|
|
# directly output the log to be nice to look
|
|
|
|
hexdump -C /dev/shm/$SHM_IPC_REG | grep "$READY_IPC"
|
|
|
|
if [ "$IPC_MSG" ]; then
|
|
|
|
echo "ipc message dump:"
|
|
|
|
# directly output the log to be nice to look
|
|
|
|
hexdump -C /dev/shm/$SHM_MBOX | grep -A 4 "$READY_MSG" | grep -A 4 "$OUTBOX_OFFSET"
|
|
|
|
else
|
|
|
|
echo "Error mailbox failed"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Error ipc reg failed"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$IPC_REG" && "$IPC_MSG" ]]; then
|
2018-10-12 13:07:17 +08:00
|
|
|
echo "Boot success";
|
|
|
|
else
|
|
|
|
echo "Error boot failed"
|
|
|
|
tail -n 50 ../sof.git/dump-$j.txt
|
|
|
|
exit 2;
|
|
|
|
fi
|
|
|
|
done
|