Delphine CC Chiu | 5fd67bd | 2024-04-10 20:06:19 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # CXL need about 30 seconds to boot up. Wait 30 seconds then start polling CXLs status. |
Delphine CC Chiu | 34bcf27 | 2024-04-17 19:02:25 +0800 | [diff] [blame^] | 4 | sleep 40 |
Delphine CC Chiu | 5fd67bd | 2024-04-10 20:06:19 +0800 | [diff] [blame] | 5 | |
| 6 | wf_eid=$(($1 * 10 + 2)) |
| 7 | count=0 |
| 8 | while [ $count -lt 3 ]; do |
| 9 | |
| 10 | output=$(pldmtool raw -m "$wf_eid" -d 0x80 0x02 0x3A 0x04 0x01) |
| 11 | |
| 12 | rx_line=$(echo "$output" | grep "Rx:") |
| 13 | rx_data=$(echo "$rx_line" | awk '{print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13}') |
| 14 | |
| 15 | cxl1_ready=$(echo "$rx_data" | awk '{print substr($7,1,2)}') |
| 16 | cxl2_ready=$(echo "$rx_data" | awk '{print substr($10,1,2)}') |
| 17 | |
| 18 | if [ "$cxl1_ready" == "01" ]; then |
| 19 | busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL1 |
| 20 | fi |
| 21 | |
| 22 | if [ "$cxl2_ready" == "01" ]; then |
| 23 | busctl call xyz.openbmc_project.MCTP /xyz/openbmc_project/mctp au.com.CodeConstruct.MCTP SetupEndpointByConfigPath s /xyz/openbmc_project/inventory/system/board/Yosemite_4_Wailua_Falls_Slot_"$1"/CXL2 |
| 24 | fi |
| 25 | |
| 26 | if [ "$cxl1_ready" == "01" ] && [ "$cxl2_ready" == "01" ]; then |
| 27 | break |
| 28 | fi |
| 29 | |
| 30 | count=$((count + 1)) |
| 31 | sleep 2 |
| 32 | |
| 33 | done |