summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPotin Lai <potin.lai@quantatw.com>2022-09-19 09:20:58 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-11-01 07:54:14 +0300
commitb8f52ae4caef899fdd97cea9d2175c260a0c912c (patch)
tree6214bf4dd46d30965961970ab052f36d81511735
parent6817b7daf853e8aaec51ca34259d953e635d0ef6 (diff)
downloadopenbmc-b8f52ae4caef899fdd97cea9d2175c260a0c912c.tar.xz
meta-bletchley: use mdio-tools instead mdio-util
Introduce mdio-tools package to replace mdio-util script. This commit relies on the linux kernel patch below. LINK: https://lore.kernel.org/all/20221025055046.1704920-1-potin.lai.pt@gmail.com/ Tested Result: Check host status by power-ctrl which will call mdio internally. root@bletchley:~# power-ctrl sled6 status On Signed-off-by: Potin Lai <potin.lai@quantatw.com> Change-Id: I482dde297acb7797896d9b7ae07580104fb21540
-rwxr-xr-xmeta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/power-ctrl13
-rw-r--r--meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb2
2 files changed, 12 insertions, 3 deletions
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 7a6a96c8dd..9bae16b845 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
@@ -234,10 +234,19 @@ function get_host_status_dbus()
return 0
}
+function get_addr_from_dts_aliases()
+{
+ local node_address
+ node_address=$(awk -F '@' '{printf $2}' /sys/firmware/devicetree/base/aliases/"$1")
+ echo "$node_address"
+}
+
function get_host_status_mdio()
{
local SLED_NUM=$1
- local MDIO_BUS=0
+ local MDIO_BUS
+
+ MDIO_BUS="$(get_addr_from_dts_aliases mdio0).mdio-1"
declare -a PORT_MAP=(0 3 2 1 7 6 5)
@@ -257,7 +266,7 @@ function get_host_status_mdio()
while true
do
- if POST_ST_VAL=$(mdio-util c22 r $MDIO_BUS "${PORT_MAP[SLED_NUM]}" 0); then
+ if POST_ST_VAL=$(mdio "$MDIO_BUS" phy "${PORT_MAP[SLED_NUM]}" 0); then
if [ $((POST_ST_VAL&16#0800)) -eq $((16#0000)) ]; then
case $SLED_LAST_ACTION in
"$ACTION_DFU")
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
index 1b9f75e893..73932a183e 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
@@ -8,7 +8,7 @@ inherit obmc-phosphor-systemd
RDEPENDS:${PN} += "bash"
RDEPENDS:${PN} += "i2c-tools"
RDEPENDS:${PN} += "libgpiod-tools"
-RDEPENDS:${PN} += "mdio-util"
+RDEPENDS:${PN} += "mdio-tools"
RDEPENDS:${PN} += "bletchley-common-functions"
S = "${WORKDIR}"