diff options
author | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2023-11-15 11:09:08 +0200 |
---|---|---|
committer | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2023-11-16 14:26:36 +0200 |
commit | 6da9d81e77b2f56a91a697ac474473e787a58ccf (patch) | |
tree | 170e6a5acc14673fc466a7405d7cc35673bed507 /recipes-test/ddt-runner/files/scripts/t1042rdb/i2c | |
parent | 2283105d0abe9efa216b018e0d34100e4544ce78 (diff) | |
download | meta-enea-daisy-enea-231026.tar.gz |
T1042RDB: Adding ddt testsdaisy-enea-231026
Signed-off-by: Bogdan Oprescu <bogdan.oprescu@enea.com>
Diffstat (limited to 'recipes-test/ddt-runner/files/scripts/t1042rdb/i2c')
-rwxr-xr-x | recipes-test/ddt-runner/files/scripts/t1042rdb/i2c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-test/ddt-runner/files/scripts/t1042rdb/i2c b/recipes-test/ddt-runner/files/scripts/t1042rdb/i2c new file mode 100755 index 0000000..7766e43 --- /dev/null +++ b/recipes-test/ddt-runner/files/scripts/t1042rdb/i2c | |||
@@ -0,0 +1,43 @@ | |||
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 0x51 | grep "EDPAR22QA01" | ||
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 | |||