summaryrefslogtreecommitdiffstats
path: root/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/i2c')
-rwxr-xr-xrecipes-test/ddt-runner/files/scripts/p2041rdb/i2c44
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c b/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c
new file mode 100755
index 0000000..58800ce
--- /dev/null
+++ b/recipes-test/ddt-runner/files/scripts/p2041rdb/i2c
@@ -0,0 +1,44 @@
1#!/bin/sh
2# This script is used to test i2c bus functionality for p2041rdb board.
3
4if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then
5 echo "PASS: found $I2C_ADAPTERS i2c adapters"
6else
7 echo "FAIL: no i2c adapters found"
8 exit 1
9fi
10
11if [ -z "$adapters" ]; then
12 adapters=0
13fi
14
15while [ $adapters -lt $I2C_ADAPTERS ]
16do
17 i2cdetect -y $adapters
18 if [ $? -ne 0 ]; then
19 echo "FAIL: detect i2c adapter $adapters failed"
20 else
21 echo "PASS: detect i2c adapter $adapters success"
22 fi
23 adapters=`expr $adapters + 1`
24 sleep 1
25done
26
27i2cdetect -y 0
28if [ $? -ne 0 ]; then
29 echo "FAIL: detect i2c bus 0 fail"
30 exit 1
31else
32 echo "PASS: detect i2c bus 0 success"
33fi
34
35#i2c bus 0, device address 0x52, DDR3 DIMM Socket 1, SPD EEPROM
36i2cdump -f -y 0 0x52 |grep UG51U6400N8SU
37if [ $? -ne 0 ]; then
38 echo "FAIL: read SPD EEPROM on i2c bus 0 fail"
39 exit 1
40else
41 echo "PASS: read SPD EEPROM on i2c bus 0 success"
42fi
43
44