mirror of
https://github.com/linux-msm/bootrr.git
synced 2026-02-25 13:12:03 -08:00
db410c: Add initial bunch of tests
Some random smoke tests for db410c. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
30
Makefile
Normal file
30
Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
.PHONY: all
|
||||
|
||||
all:
|
||||
|
||||
all-install :=
|
||||
|
||||
HELPERS := assert_device_present \
|
||||
assert_driver_present \
|
||||
assert_mmc_present \
|
||||
assert_partition_found \
|
||||
ensure_lib_firmware \
|
||||
rproc-start \
|
||||
rproc-stop
|
||||
|
||||
BOARDS := qcom,apq8016-sbc
|
||||
|
||||
define add-scripts
|
||||
$(DESTDIR)$(prefix)/bin/$1: $1
|
||||
@echo "INSTALL $$<"
|
||||
@install -D -m 755 $$< $$@
|
||||
|
||||
all-install += $(DESTDIR)$(prefix)/bin/$1
|
||||
endef
|
||||
|
||||
$(foreach v,${BOARDS},$(eval $(call add-scripts,$v)))
|
||||
$(foreach v,${HELPERS},$(eval $(call add-scripts,$v)))
|
||||
|
||||
install: $(all-install)
|
||||
|
||||
clean:
|
||||
18
assert_device_present
Executable file
18
assert_device_present
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
DRIVER="$2"
|
||||
DEVICE="$3"
|
||||
|
||||
if [ -z "${TEST_CASE_ID}" -o -z "${DRIVER}" -o -z "${DEVICE}" ]; then
|
||||
echo "Usage: $0 <test-case-id> <driver> <device>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -L /sys/bus/*/drivers/${DRIVER}/${DEVICE} ]; then
|
||||
TEST_RESULT="pass"
|
||||
else
|
||||
TEST_RESULT="fail"
|
||||
fi
|
||||
|
||||
lava-test-case "${TEST_CASE_ID}" --result ${TEST_RESULT}
|
||||
17
assert_driver_present
Executable file
17
assert_driver_present
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
DRIVER="$2"
|
||||
|
||||
if [ -z "${DRIVER}" ]; then
|
||||
echo "Usage: $0 <driver>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d /sys/bus/*/drivers/${DRIVER} ]; then
|
||||
TEST_RESULT="pass"
|
||||
else
|
||||
TEST_RESULT="fail"
|
||||
fi
|
||||
|
||||
lava-test-case "${TEST_CASE_ID}" --result ${TEST_RESULT}
|
||||
17
assert_mmc_present
Executable file
17
assert_mmc_present
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
DEVICE="$2"
|
||||
|
||||
if [ -z "${TEST_CASE_ID}" -o -z "${DEVICE}" ]; then
|
||||
echo "Usage: $0 <test-case-id> <mmc-device>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -L /sys/bus/mmc/devices/${DEVICE} ]; then
|
||||
TEST_RESULT="pass"
|
||||
else
|
||||
TEST_RESULT="fail"
|
||||
fi
|
||||
|
||||
lava-test-case "${TEST_CASE_ID}" --result ${TEST_RESULT}
|
||||
17
assert_partition_found
Executable file
17
assert_partition_found
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
PARTITION="$2"
|
||||
|
||||
if [ -z "${TEST_CASE_ID}" -o -z "${PARTITION}" ]; then
|
||||
echo "Usage: $0 <test-case-id> <partition>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -L /dev/disk/by-partlabel/${PARTITION} ]; then
|
||||
TEST_RESULT="pass"
|
||||
else
|
||||
TEST_RESULT="fail"
|
||||
fi
|
||||
|
||||
lava-test-case "${TEST_CASE_ID}" --result ${TEST_RESULT}
|
||||
25
ensure_lib_firmware
Executable file
25
ensure_lib_firmware
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
PARTITION=/dev/disk/by-partlabel/userdata
|
||||
|
||||
test_report_exit() {
|
||||
TEST_RESULT=$1
|
||||
lava-test-case ${TEST_CASE_ID} --result ${TEST_RESULT}
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [ \! -L ${PARTITION} ]; then
|
||||
test_report_exit blocked
|
||||
fi
|
||||
|
||||
if [ -d /lib/firmware -o -L /lib/firmware ]; then
|
||||
test_report_exit skip
|
||||
fi
|
||||
|
||||
mkdir -p /mnt
|
||||
mount -t ext4 ${PARTITION} /mnt || test_report_exit failed
|
||||
|
||||
ln -s /mnt/lib/firmware /lib/firmware
|
||||
|
||||
test_report_exit pass
|
||||
156
qcom,apq8016-sbc
Executable file
156
qcom,apq8016-sbc
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Allow MMC to catch up
|
||||
sleep 2
|
||||
|
||||
# APCS IPC 0/0/0/0 (0)
|
||||
assert_driver_present apcs-ipc-driver-present qcom_apcs_ipc
|
||||
assert_device_present apcs-ipc-device-probed qcom_apcs_ipc b011000.*
|
||||
|
||||
# BAM 0/0/0/0 (0)
|
||||
assert_driver_present bam-driver-present bam-dma-engine
|
||||
assert_device_present bam-blsp-dma-device-probed bam-dma-engine 7884000.*
|
||||
|
||||
# CPU clock 0/0/0/0 (0)
|
||||
assert_driver_present cpu-clock-driver-present qcom-apcs-msm8916-clk
|
||||
assert_device_present cpu-clock-device-probed qcom-apcs-msm8916-clk qcom-apcs-msm8916-clk
|
||||
|
||||
# GCC 0/0/0/0 (0)
|
||||
assert_driver_present gcc-driver-present gcc-msm8916
|
||||
assert_device_present gcc-device-probed gcc-msm8916 1800000.*
|
||||
|
||||
# GDSC 0/0/0/0 (0)
|
||||
assert_driver_present gdsc-driver-present gcc-msm8916
|
||||
assert_device_present gdsc-device-probed gcc-msm8916 1800000.*
|
||||
|
||||
# GIC 0/0/0/0 (0)
|
||||
# CPR 0/0/0/0 (0)
|
||||
assert_driver_present cpr-driver-present qcom-cpr
|
||||
assert_device_present cpr-device-probed qcom-cpr b018000.*
|
||||
|
||||
# I2C QUP 0/0/0/0 (0)
|
||||
assert_driver_present qup-i2c-driver-present i2c_qup
|
||||
assert_device_present qup-i2c-blsp-i2c2-probed i2c_qup 78b6000.*
|
||||
assert_device_present qup-i2c-blsp-i2c4-probed i2c_qup 78b8000.*
|
||||
assert_device_present qup-i2c-blsp-i2c6-probed i2c_qup 78ba000.*
|
||||
|
||||
# MMCC 0/0/0/0 (0)
|
||||
# msm_bus 0/0/0/0 (0)
|
||||
# PSHOLD 0/0/0/0 (0)
|
||||
assert_driver_present pshold-driver-present msm-restart
|
||||
assert_device_present pshold-device-probed 4ab000.*
|
||||
|
||||
# QFPROM
|
||||
assert_driver_present qfprom-driver-present qcom,qfprom
|
||||
assert_device_present qfprom-device-probed qcom,qfprom 5c000.*
|
||||
|
||||
# RPM-clocks 0/0/0/0 (0)
|
||||
assert_driver_present rpm-clock-driver-present qcom-clk-smd-rpm
|
||||
assert_device_present rpm-clock-device-probed qcom-clk-smd-rpm *smd*
|
||||
|
||||
# RPM-regulators 0/0/0/0 (0)
|
||||
assert_driver_present rpm-regulator-driver-present qcom_rpm_smd_regulator
|
||||
assert_device_present rpm-regulator-device-probed qcom_rpm_smd_regulator *smd*
|
||||
|
||||
# SCM
|
||||
assert_driver_present scm-driver-present qcom_scm
|
||||
assert_device_present scm-device-probed qcom_scm firmware:scm
|
||||
|
||||
# Serial 0/0/0/0 (0)
|
||||
assert_driver_present msm_serial-driver-present msm_serial
|
||||
assert_device_present msm_serial-uart1-probed msm_serial 78af000.*
|
||||
assert_device_present msm_serial-uart2-probed msm_serial 78b0000.*
|
||||
|
||||
# SMD 0/0/0/0 (0)
|
||||
assert_driver_present smd-driver-present qcom-smd
|
||||
assert_device_present smd-device-present qcom-smd smd
|
||||
|
||||
# SMEM 0/0/0/0 (0)
|
||||
assert_driver_present smem-driver-present qcom-smem
|
||||
assert_device_present smem-device-probed qcom-smem smem
|
||||
|
||||
# SMMU 0/0/0/0 (0)
|
||||
# SPI QUP 0/0/0/0 (0)
|
||||
assert_driver_present qup-spi-driver-present spi_qup
|
||||
assert_device_present qup-spi-spi3-probed spi_qup 78b7000.*
|
||||
assert_device_present qup-spi-spi5-probed spi_qup 78b9000.*
|
||||
|
||||
# TCSR mutex 0/0/0/0 (0)
|
||||
assert_driver_present tcsr-mutex-driver-present qcom_hwspinlock
|
||||
assert_device_present tcsr-mutex-device-probed qcom_hwspinlock soc:hwlock
|
||||
|
||||
# Timer 0/0/0/0 (0)
|
||||
# TLMM 0/0/0/0 (0)
|
||||
assert_driver_present tlmm-driver-present msm8916-pinctrl
|
||||
assert_device_present tlmm-device-probed msm8916-pinctrl 1000000.*
|
||||
|
||||
# APR 0/0/0/0 (0)
|
||||
# GLINK/SMEM 0/0/0/0 (0)
|
||||
# GLINK/SPSS 0/0/0/0 (0)
|
||||
# IPCROUTER 0/0/0/0 (0)
|
||||
# SMP2P 0/0/0/0 (0)
|
||||
assert_driver_present smp2p-driver-present qcom_smp2p
|
||||
assert_device_present smp2p-hexagon-device-probed qcom_smp2p hexagon-smp2p
|
||||
assert_device_present smp2p-wcnss-device-probed qcom_smp2p wcnss-smp2p
|
||||
|
||||
# SMSM 0/0/0/0 (0)
|
||||
assert_driver_present smsm-driver-present qcom-smsm
|
||||
assert_device_present smsm-device-probed qcom-smsm smsm
|
||||
|
||||
# SPCOM 0/0/0/0 (0)
|
||||
# CCI 0/0/0/0 (0)
|
||||
# CPP 0/0/0/0 (0)
|
||||
# CSID 0/0/0/0 (0)
|
||||
# CSIPHY 0/0/0/0 (0)
|
||||
# FaceDetect 0/0/0/0 (0)
|
||||
# JPEG 0/0/0/0 (0)
|
||||
# VFE 0/0/0/0 (0)
|
||||
# FastRPC 0/0/0/0 (0)
|
||||
# QCrypto 0/0/0/0 (0)
|
||||
# PRNG 0/0/0/0 (0)
|
||||
# Coresight 0/0/0/0 (0)
|
||||
# CPU hand detect 0/0/0/0 (0)
|
||||
# DebugCC 0/0/0/0 (0)
|
||||
# Gladiator hang detect 0/0/0/0 (0)
|
||||
# Watchdog 0/0/0/0 (0)
|
||||
# ADSP PIL 0/0/0/0 (0)
|
||||
# Compute PIL 0/0/0/0 (0)
|
||||
# RMTFS memory 0/0/0/0 (0)
|
||||
assert_driver_present rmtfs-mem-driver-present qcom_rmtfs_mem
|
||||
|
||||
# Secure PIL 0/0/0/0 (0)
|
||||
# Sensor PIL 0/0/0/0 (0)
|
||||
# QMP (UFS) 0/0/0/0 (0)
|
||||
# SDHCI 0/0/0/0 (0)
|
||||
assert_driver_present sdhci-msm-driver-present sdhci_msm
|
||||
assert_device_present sdhci-msm-mmc0-probed sdhci_msm 7824900.*
|
||||
assert_device_present sdhci-msm-mmc1-probed sdhci_msm 7864900.*
|
||||
assert_mmc_present sdhci-msm-mmcblk0-probed mmc0:0001
|
||||
assert_partition_found sdhci-msm-has-userdata userdata
|
||||
|
||||
# UFS 0/0/0/0 (0)
|
||||
# UFS ICE 0/0/0/0 (0)
|
||||
# Bluetooth 0/1/0/0 (1)
|
||||
# WiFi 1/0/0/0 (1)
|
||||
|
||||
# Ensure /lib/firmware has firmware files
|
||||
ensure_lib_firmware sdhci-msm-mount-lib-firmware
|
||||
|
||||
# Modem PIL 1/1/0/0 (2)
|
||||
assert_driver_present mpss-rproc-driver-present qcom-q6v5-pil
|
||||
assert_device_present mpss-rproc-device-probed qcom-q6v5-pil 4080000.*
|
||||
|
||||
# WCNSS PIL 6/0/0/0 (6)
|
||||
assert_driver_present wcnss-rproc-driver-present qcom-wcnss-pil
|
||||
assert_device_present wcnss-rproc-device-probed qcom-wcnss-pil a204000.*
|
||||
|
||||
rproc-start wcnss-rproc-start a204000.*
|
||||
sleep 2 #TODO give the following command a timeout instead
|
||||
assert_device_present wcnss-wcnss_ctrl-probed qcom_wcnss_ctrl *WCNSS_CTRL*
|
||||
assert_device_present wcnss-btqcomsmd-probed btqcomsmd a204000*
|
||||
assert_device_present wcnss-wcn36xx-probed wcn36xx a204000*
|
||||
rproc-stop wcnss-rproc-stop a204000.*
|
||||
|
||||
rproc-start wcnss-rproc-start-again a204000.*
|
||||
sleep 2 #TODO give the following command a timeout instead
|
||||
rproc-stop wcnss-rproc-stop-again a204000.*
|
||||
42
rproc-start
Executable file
42
rproc-start
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
DEVICE="$2"
|
||||
|
||||
test_report_exit()
|
||||
{
|
||||
TEST_RESULT=$1
|
||||
lava-test-case ${TEST_CASE_ID} --result ${TEST_RESULT}
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [ -z "${TEST_CASE_ID}" -o -z "${DEVICE}" ]; then
|
||||
echo "Usage: $0 <test-case-id> <rproc-device>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ \! -d /sys/bus/*/devices/${DEVICE}/remoteproc ]; then
|
||||
test_report_exit blocked
|
||||
fi
|
||||
|
||||
RPROC_DIR=$(dirname /sys/bus/*/devices/${DEVICE}/remoteproc/remoteproc*/.)
|
||||
|
||||
cat ${RPROC_DIR}/state
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) = "running" ]; then
|
||||
test_report_exit skip
|
||||
fi
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) != "offline" ]; then
|
||||
test_report_exit blocked
|
||||
fi
|
||||
|
||||
echo start > ${RPROC_DIR}/state || test_report_exit fail
|
||||
|
||||
cat ${RPROC_DIR}/state
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) != "running" ]; then
|
||||
test_report_exit fail
|
||||
fi
|
||||
|
||||
test_report_exit pass
|
||||
38
rproc-stop
Executable file
38
rproc-stop
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
TEST_CASE_ID="$1"
|
||||
DEVICE="$2"
|
||||
|
||||
test_report_exit()
|
||||
{
|
||||
TEST_RESULT=$1
|
||||
lava-test-case "${TEST_CASE_ID}" --result ${TEST_RESULT}
|
||||
exit 0
|
||||
}
|
||||
|
||||
if [ -z "${TEST_CASE_ID}" -o -z "${DEVICE}" ]; then
|
||||
echo "Usage: $0 <test-case-id> <rproc-device>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ \! -d /sys/bus/*/devices/${DEVICE}/remoteproc ]; then
|
||||
test_report_exit blocked
|
||||
fi
|
||||
|
||||
RPROC_DIR=$(dirname /sys/bus/*/devices/${DEVICE}/remoteproc/remoteproc*/.)
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) = "offline" ]; then
|
||||
test_report_exit skip
|
||||
fi
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) != "running" ]; then
|
||||
test_report_exit blocked
|
||||
fi
|
||||
|
||||
echo stop > ${RPROC_DIR}/state || test_report_exit fail
|
||||
|
||||
if [ $(cat ${RPROC_DIR}/state) != "offline" ]; then
|
||||
test_report_exit fail
|
||||
fi
|
||||
|
||||
test_report_exit pass
|
||||
Reference in New Issue
Block a user