From cd3411088f6bb4393d79c50b5f7eef3f11a83435 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 10 Oct 2014 00:31:33 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../ddt-runner/files/scripts/imx6qsabrelite/spi | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi (limited to 'recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi') diff --git a/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi new file mode 100755 index 0000000..a601517 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/imx6qsabrelite/spi @@ -0,0 +1,48 @@ +#!/bin/sh + +#An spi flash M25P80 connect to b4860qds-64b cpu by spi bus, so the method +#is to read/write spi flash to verify whether the spi bus driver worked +#or not. + +MTD_CHAR_DEVICE="/dev/mtd2" +MTD_BLOCK_DEVICE="/dev/mtdblock2" + +if [ ! -e $MTD_CHAR_DEVICE ]; then + echo "FAIL: spi flash device $MTD_CHAR_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_CHAR_DEVICE exists" +fi + +if [ ! -e $MTD_BLOCK_DEVICE ]; then + echo "FAIL: spi flash device $MTD_BLOCK_DEVICE does not exist" + exit 1 +else + echo "PASS: spi flash device $MTD_BLOCK_DEVICE exists" +fi + +/usr/sbin/flash_erase -j $MTD_CHAR_DEVICE 0 0 +if [ $? -ne 0 ]; then + echo "FAIL: format spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 +else + mkdir -p /mnt/spi + mount -t jffs2 $MTD_BLOCK_DEVICE /mnt/spi + if [ $? -ne 0 ]; then + echo "FAIL: mount spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + cp /bin/busybox /mnt/spi + ls /mnt/spi |grep busybox + if [ $? -ne 0 ]; then + echo "FAIL: read or write spi flash device $MTD_BLOCK_DEVICE fail" + exit 1 + else + umount $MTD_BLOCK_DEVICE + echo "PASS: read or write spi flash device $MTD_BLOCK_DEVICE success" + fi + fi +fi + +echo "PASS: spi bus test passed" +exit 0 -- cgit v1.2.3-54-g00ecf