Revert "[DellEMC] Z9332: Change in i2c mapping (#7797)"

This reverts commit 31a8b1c87a.
This commit is contained in:
Guohan Lu 2021-06-24 12:00:35 -07:00
parent 48e0461c7e
commit 1f1718ace6
5 changed files with 106 additions and 106 deletions

View File

@ -31,38 +31,38 @@ class SfpUtil(SfpUtilBase):
BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0" BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0"
_port_to_i2c_mapping = { _port_to_i2c_mapping = {
1: 4, 1: 10,
2: 5, 2: 11,
3: 6, 3: 12,
4: 7, 4: 13,
5: 8, 5: 14,
6: 9, 6: 15,
7: 10, 7: 16,
8: 11, 8: 17,
9: 12, 9: 18,
10: 13, 10: 19,
11: 14, 11: 20,
12: 15, 12: 21,
13: 16, 13: 22,
14: 17, 14: 23,
15: 18, 15: 24,
16: 19, 16: 25,
17: 20, 17: 26,
18: 21, 18: 27,
19: 22, 19: 28,
20: 23, 20: 29,
21: 24, 21: 30,
22: 25, 22: 31,
23: 26, 23: 32,
24: 27, 24: 33,
25: 28, 25: 34,
26: 29, 26: 35,
27: 30, 27: 36,
28: 31, 28: 37,
29: 32, 29: 38,
30: 33, 30: 39,
31: 34, 31: 40,
32: 35, 32: 41,
33: 1, 33: 1,
34: 2, 34: 2,
} }

View File

@ -56,14 +56,14 @@ switch_board_qsfp_mux() {
switch_board_qsfp() { switch_board_qsfp() {
case $1 in case $1 in
"new_device") "new_device")
for ((i=4;i<=35;i++)); for ((i=10;i<=41;i++));
do do
echo optoe3 0x50 > /sys/bus/i2c/devices/i2c-$i/$1 echo optoe3 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
done done
;; ;;
"delete_device") "delete_device")
for ((i=4;i<=35;i++)); for ((i=10;i<=41;i++));
do do
echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1 echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
done done
@ -112,7 +112,7 @@ switch_board_modsel() {
#This enables the led control for CPU and default states #This enables the led control for CPU and default states
switch_board_led_default() { switch_board_led_default() {
/usr/sbin/i2cset -y 37 0x0d 0x62 0xd0 /usr/sbin/i2cset -y 5 0x0d 0x62 0xd0
} }
# Readout firmware version of the system and # Readout firmware version of the system and
@ -135,15 +135,15 @@ platform_firmware_versions() {
echo "BMC: $r" >> $FIRMWARE_VERSION_FILE echo "BMC: $r" >> $FIRMWARE_VERSION_FILE
#BaseBoard CPLD 0x0d on i2c bus 5 ( physical FPGA I2C-5) #BaseBoard CPLD 0x0d on i2c bus 5 ( physical FPGA I2C-5)
ver=`/usr/sbin/i2cget -y 37 0x0d 0x0` ver=`/usr/sbin/i2cget -y 5 0x0d 0x0`
echo "Baseboard CPLD: $((ver))" >> $FIRMWARE_VERSION_FILE echo "Baseboard CPLD: $((ver))" >> $FIRMWARE_VERSION_FILE
#Switch CPLD 1 0x30 on i2c bus 4 ( physical FPGA I2C-4) #Switch CPLD 1 0x30 on i2c bus 4 ( physical FPGA I2C-4)
ver=`/usr/sbin/i2cget -y 36 0x30 0x0` ver=`/usr/sbin/i2cget -y 4 0x30 0x0`
echo "Switch CPLD 1: $((ver))" >> $FIRMWARE_VERSION_FILE echo "Switch CPLD 1: $((ver))" >> $FIRMWARE_VERSION_FILE
#Switch CPLD 1 0x30 on i2c bus 4 ( physical FPGA I2C-4) #Switch CPLD 1 0x30 on i2c bus 4 ( physical FPGA I2C-4)
ver=`/usr/sbin/i2cget -y 36 0x31 0x0` ver=`/usr/sbin/i2cget -y 4 0x31 0x0`
echo "Switch CPLD 2: $((ver))" >> $FIRMWARE_VERSION_FILE echo "Switch CPLD 2: $((ver))" >> $FIRMWARE_VERSION_FILE
} }
@ -176,7 +176,7 @@ get_reboot_cause() {
if [[ ! -e $REBOOT_REASON_FILE ]]; then if [[ ! -e $REBOOT_REASON_FILE ]]; then
echo "0" > $REBOOT_REASON_FILE echo "0" > $REBOOT_REASON_FILE
else else
/usr/sbin/i2cget -y 37 0x0d 0x06 > $REBOOT_REASON_FILE /usr/sbin/i2cget -y 5 0x0d 0x06 > $REBOOT_REASON_FILE
fi fi
} }

View File

@ -74,38 +74,38 @@ class Chassis(ChassisBase):
_global_port_pres_dict = {} _global_port_pres_dict = {}
_port_to_i2c_mapping = { _port_to_i2c_mapping = {
1: 4, 1: 10,
2: 5, 2: 11,
3: 6, 3: 12,
4: 7, 4: 13,
5: 8, 5: 14,
6: 9, 6: 15,
7: 10, 7: 16,
8: 11, 8: 17,
9: 12, 9: 18,
10: 13, 10: 19,
11: 14, 11: 20,
12: 15, 12: 21,
13: 16, 13: 22,
14: 17, 14: 23,
15: 18, 15: 24,
16: 19, 16: 25,
17: 20, 17: 26,
18: 21, 18: 27,
19: 22, 19: 28,
20: 23, 20: 29,
21: 24, 21: 30,
22: 25, 22: 31,
23: 26, 23: 32,
24: 27, 24: 33,
25: 28, 25: 34,
26: 29, 26: 35,
27: 30, 27: 36,
28: 31, 28: 37,
29: 32, 29: 38,
30: 33, 30: 39,
31: 34, 31: 40,
32: 35, 32: 41,
33: 1, 33: 1,
34: 2, 34: 2,
} }

View File

@ -35,13 +35,13 @@ def get_cpld_version(bus, i2caddr):
return '{}'.format(hwaccess.i2c_get(bus, i2caddr, 0)) return '{}'.format(hwaccess.i2c_get(bus, i2caddr, 0))
def get_cpld0_version(): def get_cpld0_version():
return get_cpld_version(37, 0x0d) return get_cpld_version(5, 0x0d)
def get_cpld1_version(): def get_cpld1_version():
return get_cpld_version(36, 0x30) return get_cpld_version(4, 0x30)
def get_cpld2_version(): def get_cpld2_version():
return get_cpld_version(36, 0x31) return get_cpld_version(4, 0x31)

View File

@ -227,38 +227,38 @@ class Sfp(SfpBase):
""" """
BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0" BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0"
_port_to_i2c_mapping = { _port_to_i2c_mapping = {
1: 4, 1: 10,
2: 5, 2: 11,
3: 6, 3: 12,
4: 7, 4: 13,
5: 8, 5: 14,
6: 9, 6: 15,
7: 10, 7: 16,
8: 11, 8: 17,
9: 12, 9: 18,
10: 13, 10: 19,
11: 14, 11: 20,
12: 15, 12: 21,
13: 16, 13: 22,
14: 17, 14: 23,
15: 18, 15: 24,
16: 19, 16: 25,
17: 20, 17: 26,
18: 21, 18: 27,
19: 22, 19: 28,
20: 23, 20: 29,
21: 24, 21: 30,
22: 25, 22: 31,
23: 26, 23: 32,
24: 27, 24: 33,
25: 28, 25: 34,
26: 29, 26: 35,
27: 30, 27: 36,
28: 31, 28: 37,
29: 32, 29: 38,
30: 33, 30: 39,
31: 34, 31: 40,
32: 35, 32: 41,
33: 1, 33: 1,
34: 2 34: 2
} }