summaryrefslogtreecommitdiff
path: root/meta-facebook
diff options
context:
space:
mode:
authorAllen.Wang <Allen_Wang@quantatw.com>2022-01-04 16:00:38 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-01-05 18:44:22 +0300
commit5ff992ef49cf0aedd1a3cab310657f7adcaee9a3 (patch)
treeb28ca296f6fcf875a6f7d686546b2aec04a0727f /meta-facebook
parent6af0dff7c638f4168c1e0f3c9c9cf0797fa9a8df (diff)
downloadopenbmc-5ff992ef49cf0aedd1a3cab310657f7adcaee9a3.tar.xz
meta-bletchley: motor-ctrl: Change sled numbering to 1-based
switch sled to 1-based numbering to align with multi host systems tools only accept input sled1 to sled6 Change-Id: Ic372e011716d8de7edf2eebdf8667e44b2179e64 Signed-off-by: Allen.Wang <Allen_Wang@quantatw.com>
Diffstat (limited to 'meta-facebook')
-rw-r--r--meta-facebook/meta-bletchley/conf/machine/bletchley.conf2
-rwxr-xr-xmeta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-ctrl4
-rwxr-xr-xmeta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-init6
-rwxr-xr-xmeta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl10
4 files changed, 11 insertions, 11 deletions
diff --git a/meta-facebook/meta-bletchley/conf/machine/bletchley.conf b/meta-facebook/meta-bletchley/conf/machine/bletchley.conf
index 6b7711a62f..c7407e80f2 100644
--- a/meta-facebook/meta-bletchley/conf/machine/bletchley.conf
+++ b/meta-facebook/meta-bletchley/conf/machine/bletchley.conf
@@ -14,5 +14,5 @@ FLASH_SIZE = "131072"
PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "bletchley-led-manager-config-native"
-OBMC_HOST_INSTANCES = "0 1 2 3 4 5 "
+OBMC_HOST_INSTANCES = "1 2 3 4 5 6"
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-ctrl b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-ctrl
index 9607453008..302c94bc01 100755
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-ctrl
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-ctrl
@@ -41,7 +41,7 @@ function set_motor() {
}
function show_usage(){
- echo "Usage: motor-ctrl [sled0 | sled1 | sled2 | sled3 | sled4 | sled5] [f r s]"
+ echo "Usage: motor-ctrl [sled1 | sled2 | sled3 | sled4 | sled5 | sled6] [f r s]"
echo " f : Step Motor go forward"
echo " r : Step Motor go reverse"
echo " s : Step Motor stop "
@@ -52,7 +52,7 @@ if [ $# -ne 2 ]; then
exit 1;
fi
-if [[ "$1" =~ ^(slot[0-5]{1})$ ]] || [[ "$1" =~ ^(sled[0-5]{1})$ ]]; then
+if [[ "$1" =~ ^(sled[1-6]{1})$ ]]; then
SLED=$1
SLED_NUM=${SLED:4}
ACTION=$2
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-init b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-init
index 60de76bb6c..89369acfcb 100755
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-init
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/motor-init
@@ -8,8 +8,8 @@
export PATH=$PATH:/usr/libexec
PWM_CLASS_PATH="/sys/class/pwm/pwmchip0"
-#Sleld 0~5 using bmc pwm8~13 as motor driver stick
-PWM_NUM_OFFSET=8
+#Sleld 1~6 using bmc pwm8~13 as motor driver stick
+PWM_NUM_OFFSET=7
PWM_PERIOD=2500000 #400HZ
PWM_DUTY=250000 #PWM_PERIOD X 10%
CALIBRATE_TIMEOUT=120
@@ -97,7 +97,7 @@ function init_gpios() {
done
}
-if [[ "$1" =~ ^(slot[0-5]{1})$ ]] || [[ "$1" =~ ^(sled[0-5]{1})$ ]]; then
+if [[ "$1" =~ ^(sled[1-6]{1})$ ]]; then
SLED=$1
SLED_NUM=${SLED:4}
else
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl
index eebe50cd31..83d65df843 100755
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl
@@ -62,9 +62,9 @@ function trigger_power_button() {
function get_bus_num() {
SLED_NUM=$1
local bus=0
-
- if [[ "$SLED_NUM" = [0-5] ]]; then
- bus="$SLED_NUM"
+ #Mapping Sled number 1~6 to i2c bus number 0~5
+ if [[ "$SLED_NUM" = [1-6] ]]; then
+ bus=$(( SLED_NUM - 1 ))
fi
echo "$bus"
}
@@ -120,7 +120,7 @@ function get_ac_status(){
}
function show_usage(){
- echo "Usage: power-ctrl [sled0 | sled1 | sled2 | sled3 | sled4 | sled5] [on off ac-on ac-off status]"
+ echo "Usage: power-ctrl [sled1 | sled2 | sled3 | sled4 | sled5 | sled6] [on off ac-on ac-off status]"
echo " power-ctrl chassis-cycle"
}
@@ -142,7 +142,7 @@ if [ $# -gt 2 ]; then
exit 1;
fi
-if [[ "$1" =~ ^(slot[0-5]{1})$ ]] || [[ "$1" =~ ^(sled[0-5]{1})$ ]]; then
+if [[ "$1" =~ ^(sled[1-6]{1})$ ]]; then
SLED=$1
ACTION=$2
SLED_NUM=${SLED:4}