diff options
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/p2041rdb/i2c')
| -rwxr-xr-x | recipes-test/ddt-runner/files/scripts/p2041rdb/i2c | 44 |
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 | |||
| 4 | if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then | ||
| 5 | echo "PASS: found $I2C_ADAPTERS i2c adapters" | ||
| 6 | else | ||
| 7 | echo "FAIL: no i2c adapters found" | ||
| 8 | exit 1 | ||
| 9 | fi | ||
| 10 | |||
| 11 | if [ -z "$adapters" ]; then | ||
| 12 | adapters=0 | ||
| 13 | fi | ||
| 14 | |||
| 15 | while [ $adapters -lt $I2C_ADAPTERS ] | ||
| 16 | do | ||
| 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 | ||
| 25 | done | ||
| 26 | |||
| 27 | i2cdetect -y 0 | ||
| 28 | if [ $? -ne 0 ]; then | ||
| 29 | echo "FAIL: detect i2c bus 0 fail" | ||
| 30 | exit 1 | ||
| 31 | else | ||
| 32 | echo "PASS: detect i2c bus 0 success" | ||
| 33 | fi | ||
| 34 | |||
| 35 | #i2c bus 0, device address 0x52, DDR3 DIMM Socket 1, SPD EEPROM | ||
| 36 | i2cdump -f -y 0 0x52 |grep UG51U6400N8SU | ||
| 37 | if [ $? -ne 0 ]; then | ||
| 38 | echo "FAIL: read SPD EEPROM on i2c bus 0 fail" | ||
| 39 | exit 1 | ||
| 40 | else | ||
| 41 | echo "PASS: read SPD EEPROM on i2c bus 0 success" | ||
| 42 | fi | ||
| 43 | |||
| 44 | |||
