soft: kmod_scripts: initial import

set of basic bash scripts to remove/insert SOF Linux kernel modules in
the right order.  This is typically used to avoid rebooting every time
the SOF image or topology are updated - and detect leaks on remove.

sof_remove.sh: remove all SOF modules
sof_insert.sh: probe SOF modules
sof_bootone.sh: combination of remove/insert in one shot
sof_bootloop.sh: boot loop to see if firmware boot is reliable over
time

This can probably be enhanced to remove spurious "module is not
currently loaded" logs.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This commit is contained in:
Pierre-Louis Bossart 2018-02-14 19:30:57 -06:00 committed by Liam Girdwood
parent 72d797d9dd
commit a02abb7994
4 changed files with 69 additions and 0 deletions

11
kmod_scripts/sof_bootloop.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
MAXLOOPS=100
COUNTER=0
while [ $COUNTER -lt $MAXLOOPS ]; do
echo "test $COUNTER"
./sof_bootone.sh
dmesg > boot_$COUNTER.bootlog
let COUNTER+=1
done

19
kmod_scripts/sof_bootone.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
dmesg -C
./sof_remove.sh
./sof_insert.sh
sleep 1
unset FW_BOOT
unset ERROR
FW_BOOT=$(dmesg | grep sof-audio | grep "boot complete")
ERROR=$(dmesg | grep sof-audio | grep "error")
if [ ! -z "$ERROR" ] || [ -z "$FW_BOOT" ]
then
echo "boot failed"
else
echo "boot success"
fi

12
kmod_scripts/sof_insert.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
modprobe snd_soc_rt5670
modprobe snd_soc_rt5645
modprobe snd_soc_rt5651
modprobe snd_soc_rt5640
modprobe snd_soc_da7213
modprobe sof_acpi_dev
modprobe sof_pci_dev

27
kmod_scripts/sof_remove.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
rmmod sof_pci_dev
rmmod sof_acpi_dev
rmmod snd_soc_acpi_intel_match
rmmod snd_sof_intel_byt
rmmod snd_sof_intel_hsw
rmmod snd_sof_intel_bdw
rmmod snd_sof_intel_apl
rmmod snd_sof_intel_cnl
rmmod snd_sof_intel_hda_common
rmmod snd_sof
rmmod snd_soc_sst_bytcr_rt5640
rmmod snd_soc_sst_bytcr_rt5651
rmmod snd_soc_sst_cht_bsw_rt5645
rmmod snd_soc_sst_cht_bsw_rt5670
rmmod snd_soc_sst_byt_cht_da7213
rmmod snd_soc_rt5670
rmmod snd_soc_rt5645
rmmod snd_soc_rt5651
rmmod snd_soc_rt5640
rmmod snd_soc_rl6231
rmmod snd_soc_da7213
rmmod snd_soc_acpi