Skip to content

Commit

Permalink
minipack: Add "all" option in setup_mgmt.sh, and modify related scmcp…
Browse files Browse the repository at this point in the history
…ld driver node (facebook#96)

Summary:
1. Add "all" option in setup_mgmt.sh, and modify related scmcpld driver node

Note: scmcpld version need 1.31 above
Pull Request resolved: facebookexternal/openbmc.accton#96

Test Plan: Test on Minipack:pass

Reviewed By: mikechoifb

fbshipit-source-id: f9cebd1bb
  • Loading branch information
mikechoifb authored and facebook-github-bot committed Oct 15, 2018
1 parent 3961b50 commit 537c070
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static const i2c_dev_attr_st scmcpld_attr_table[] = {
},
{
"rj45_led1",
"Need 0x09[7] set to 0\n"
"0: LED GREEN is OFF\n"
"1: LED GREEN is ON",
I2C_DEV_ATTR_SHOW_DEFAULT,
Expand All @@ -107,6 +108,7 @@ static const i2c_dev_attr_st scmcpld_attr_table[] = {
},
{
"rj45_led2",
"Need 0x09[7] set to 0\n"
"0: LED ORANGE is OFF\n"
"1: LED ORANGE is ON",
I2C_DEV_ATTR_SHOW_DEFAULT,
Expand All @@ -115,6 +117,7 @@ static const i2c_dev_attr_st scmcpld_attr_table[] = {
},
{
"sfp_led3_n",
"Need 0x09[7] set to 0\n"
"1: LED ORANGE is ON\n"
"0: LED ORANGE is OFF",
I2C_DEV_ATTR_SHOW_DEFAULT,
Expand All @@ -123,16 +126,36 @@ static const i2c_dev_attr_st scmcpld_attr_table[] = {
},
{
"sfp_led3_p",
"Need 0x09[7] set to 0\n"
"1: LED GREEN is ON\n"
"0: LED GREEN is OFF",
I2C_DEV_ATTR_SHOW_DEFAULT,
I2C_DEV_ATTR_STORE_DEFAULT,
0x09, 3, 1,
},
{
"rj45_mode_sel",
"1: Control by OOB_LED\n"
"0: Control by SW register 0x09[1:0]",
"oob_mode_sel",
"Need 0x09[7] set to 0\n"
"1: OOB LED control by OOB\n"
"0: SW control, control by 0x09[3:0]",
I2C_DEV_ATTR_SHOW_DEFAULT,
I2C_DEV_ATTR_STORE_DEFAULT,
0x09, 5, 1,
},
{
"sfp_rj45_sel",
"Need 0x09[7] set to 0\n"
"1: SFP\n"
"0: RJ45",
I2C_DEV_ATTR_SHOW_DEFAULT,
I2C_DEV_ATTR_STORE_DEFAULT,
0x09, 6, 1,
},
{
"sfp_auto_detect",
"If SFP present then swith OOB LED to SFP, else switch OOB LED to RJ45\n"
"1: Auto detect SFP present\n"
"0: SW control, Control by SW register 0x09[6:5][3:0]",
I2C_DEV_ATTR_SHOW_DEFAULT,
I2C_DEV_ATTR_STORE_DEFAULT,
0x09, 7, 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ source /usr/local/bin/openbmc-utils.sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

RJ45_SEL="${SCMCPLD_SYSFS_DIR}/rj45_mode_sel"
SFP_AUTO_DETECT="${SCMCPLD_SYSFS_DIR}/sfp_auto_detect"
COM_E_PWRGD=`head -n 1 ${SCMCPLD_SYSFS_DIR}/pwrgd_pch_pwrok`

usage(){
program=`basename "$0"`
echo "Usage:"
echo " $program led/combo"
echo " $program led/combo/all"
}

if [ $# -ne 1 ]; then
Expand All @@ -55,10 +55,9 @@ if [ "$1" == "led" ]; then
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0xa03
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x019
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x2418
echo 1 > $RJ45_SEL
echo "Done!"
elif [ "$1" == "combo" ]; then
echo "Wait about 2.5 minutes to setup management combo port..."
echo "Wait a few minutes to setup management combo port..."
ast-mdio.py --mac 1 --phy 0x9 write 0x17 0x0f7e
ast-mdio.py --mac 1 --phy 0x9 write 0x15 0x00
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x083c
Expand All @@ -83,7 +82,41 @@ elif [ "$1" == "combo" ]; then
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x1140
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x23e
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x7ae2
echo 1 > $SFP_AUTO_DETECT
echo "Done!"
elif [ "$1" == "all" ]; then
echo "Wait a few minutes to setup management port..."
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x01d
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x3453
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x012
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0xa03
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x019
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x2418
ast-mdio.py --mac 1 --phy 0x9 write 0x17 0x0f7e
ast-mdio.py --mac 1 --phy 0x9 write 0x15 0x00
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x083c
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x00
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x2f
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x7167
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x21
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x7c05
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x00
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x1140
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x21
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x7c04
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x09
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x0200
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x04
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x01e1
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x00
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x1340
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x234
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0xd18f
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0xb00
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x1140
ast-mdio.py --mac 1 --phy 0x9 write 0x1e 0x23e
ast-mdio.py --mac 1 --phy 0x9 write 0x1f 0x7ae2
echo 1 > $SFP_AUTO_DETECT
else
usage
exit -1
Expand Down

0 comments on commit 537c070

Please sign in to comment.