Skip to content

[AS9716-32d] Modify check eeprom via pre_pddf sh #7827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,52 @@ ir3570_check()
fi
}

# Some initializations
#============================================================
# cpld_reset_stop
#i2cset -y 0 0x65 0x3 0x0

# Select the mux channels
i2cset -y 0 0x77 0x1
i2cset -y 0 0x76 0x4

# Diag LED: Boot successfully (SOLID GREEN) --- DO THIS STEP IN POST DEVICE CREATION
# i2cset -y 0 0x60 0x64 4

# 10G Merlin Ports
# SetModeXFI()
echo "Set Mux(retimer) to 2x10G XFI."
i2cset -y 0 0x76 0x20
i2cset -y 0 0x18 0x7 0x3
i2cset -y 0 0x19 0x7 0x3
i2cset -y 0 0x1a 0x7 0x3
i2cset -y 0 0x1b 0x7 0x3


# SetVOD()
#set channel B
i2cset -y 0 0x18 0xff 0x05
i2cset -y 0 0x19 0xff 0x05
#write output voltage to 800mV
i2cset -y 0 0x18 0x2d 0x82
i2cset -y 0 0x19 0x2d 0x82
#write de-emphasis to -3.5dB
i2cset -y 0 0x18 0x15 0x12
i2cset -y 0 0x19 0x15 0x12
#read output voltage
#i2cget -y 0 0x18 0x2d
#i2cget -y 0 0x19 0x2d
#read de-emphasis
#i2cget -y 0 0x18 0x15
#i2cget -y 0 0x19 0x15
#clr channel B
i2cset -y 0 0x18 0xff 0x00
i2cset -y 0 0x19 0xff 0x00

# De-select the mux channels which were selected for above configs
i2cset -y 0 0x76 0x0
i2cset -y 0 0x77 0x0

ir3570_check

echo "AS9716 post PDDF driver install completed"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Steps to check syseeprom i2c address
modprobe i2c-i801
modprobe i2c-dev
use_57_eeprom=false
(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1
if [ $? -eq 0 ]; then
use_57_eeprom=true
fi

if $use_57_eeprom ; then
echo "The board has system EEPROM at I2C address 0x57"
if [ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf_support ] && \
[ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json ]; then
# syseeprom is at the i2c address 0x57. Change the PDDF JSON file
sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\
"topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json
sync
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,8 @@
# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default)
# Enable pddf-platform-monitor

# Steps to check syseeprom i2c address
modprobe i2c-i801
modprobe i2c-dev
use_57_eeprom=false
(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1
if [ $? -eq 0 ]; then
use_57_eeprom=true
fi

if $use_57_eeprom ; then
echo "The board has system EEPROM at I2C address 0x57"
# syseeprom is at the i2c address 0x57. Change the PDDF JSON file
sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\
"topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json
sync
fi

depmod -a
#systemctl daemon-reload
systemctl enable pddf-platform-init.service
systemctl start pddf-platform-init.service
systemctl enable as9716-32d-pddf-platform-monitor.service
Expand Down