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

#### Why I did it
- After [sonic-linux-kernel#177](https://github.com/Azure/sonic-linux-kernel/pull/177)  changes, the I2C mux channels of Baseboard and Switchboard CPLDs are moved from i2c-4 and i2c-5 to i2c-36 and i2c-37 respectively.
- This caused QSFP driver initialization of i2c-36 to i2c-41 to fail causing the ports from Ethernet208 to Ethernet248 fail.

#### How I did it
- The fix to this problem is to change the order of QSFP driver initialization to I2C mux channels.
- Instead of the order i2c-10 to i2c-41, the order i2c-4 to i2c-35 is being utilized.
- Also, need to change the i2c-mux-channel number for Baseboard CPLD and switchboard CPLD in scripts to access them.
This commit is contained in:
Santhosh Kumar T 2021-06-05 06:04:19 +05:30 committed by Qi Luo
parent 44d9489b8d
commit 31a8b1c87a
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"
_port_to_i2c_mapping = {
1: 10,
2: 11,
3: 12,
4: 13,
5: 14,
6: 15,
7: 16,
8: 17,
9: 18,
10: 19,
11: 20,
12: 21,
13: 22,
14: 23,
15: 24,
16: 25,
17: 26,
18: 27,
19: 28,
20: 29,
21: 30,
22: 31,
23: 32,
24: 33,
25: 34,
26: 35,
27: 36,
28: 37,
29: 38,
30: 39,
31: 40,
32: 41,
1: 4,
2: 5,
3: 6,
4: 7,
5: 8,
6: 9,
7: 10,
8: 11,
9: 12,
10: 13,
11: 14,
12: 15,
13: 16,
14: 17,
15: 18,
16: 19,
17: 20,
18: 21,
19: 22,
20: 23,
21: 24,
22: 25,
23: 26,
24: 27,
25: 28,
26: 29,
27: 30,
28: 31,
29: 32,
30: 33,
31: 34,
32: 35,
33: 1,
34: 2,
}

View File

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

View File

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

View File

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

View File

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