summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines/meta-openpower/meta-rcs/meta-talos/recipes-phosphor/chassis/vrm-control/vrm.sh
blob: 86d5f1dd6ad30a993953a798d4724c547d4faf22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# Get CPU count
CPU_COUNT=1
STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
if [ $? != 0 ]; then
	STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
if [ $? != 0 ]; then
	STATUS_FLAGS=$(i2cget -y 12 0x31 0x7)
fi
CPU_PRESENT_FLAG_N=$(( ${STATUS_FLAGS} & 0x20 ))
if [ $CPU_PRESENT_FLAG_N != 0 ]; then
	CPU_COUNT=$(( ${CPU_COUNT} + 1 ))
fi
echo "Found $CPU_COUNT CPU(s)"

if [ $CPU_COUNT -gt 1 ]; then
	vrm-control.sh vdna=1.0 vdnb=1.0
else
	vrm-control.sh vdna=1.0
fi
OpenPOWER on IntegriCloud