From 1f1718ace695489b62cde20d2c31bb77714fa515 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Thu, 24 Jun 2021 12:00:35 -0700 Subject: [PATCH] Revert "[DellEMC] Z9332: Change in i2c mapping (#7797)" This reverts commit 31a8b1c87a344cbeba84bbda2784f3a9b7a3b396. --- .../plugins/sfputil.py | 64 +++++++++---------- .../z9332f/scripts/z9332f_platform.sh | 14 ++-- .../z9332f/sonic_platform/chassis.py | 64 +++++++++---------- .../z9332f/sonic_platform/component.py | 6 +- .../z9332f/sonic_platform/sfp.py | 64 +++++++++---------- 5 files changed, 106 insertions(+), 106 deletions(-) diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py index 9ac14d83d7..d037fd9273 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py @@ -31,38 +31,38 @@ class SfpUtil(SfpUtilBase): BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0" _port_to_i2c_mapping = { - 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, + 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, 33: 1, 34: 2, } diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh index a5f8a2e6d6..f80207df8e 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh @@ -56,14 +56,14 @@ switch_board_qsfp_mux() { switch_board_qsfp() { case $1 in "new_device") - for ((i=4;i<=35;i++)); + for ((i=10;i<=41;i++)); do echo optoe3 0x50 > /sys/bus/i2c/devices/i2c-$i/$1 done ;; "delete_device") - for ((i=4;i<=35;i++)); + for ((i=10;i<=41;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 37 0x0d 0x62 0xd0 + /usr/sbin/i2cset -y 5 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 37 0x0d 0x0` + ver=`/usr/sbin/i2cget -y 5 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 36 0x30 0x0` + ver=`/usr/sbin/i2cget -y 4 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 36 0x31 0x0` + ver=`/usr/sbin/i2cget -y 4 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 37 0x0d 0x06 > $REBOOT_REASON_FILE + /usr/sbin/i2cget -y 5 0x0d 0x06 > $REBOOT_REASON_FILE fi } diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py index a412122bae..41078bb1ee 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py @@ -74,38 +74,38 @@ class Chassis(ChassisBase): _global_port_pres_dict = {} _port_to_i2c_mapping = { - 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, + 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, 33: 1, 34: 2, } diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py index 8b7ae004e8..c60cc06b8f 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py @@ -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(37, 0x0d) + return get_cpld_version(5, 0x0d) def get_cpld1_version(): - return get_cpld_version(36, 0x30) + return get_cpld_version(4, 0x30) def get_cpld2_version(): - return get_cpld_version(36, 0x31) + return get_cpld_version(4, 0x31) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py index 1897177dbb..7089e8698d 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py @@ -227,38 +227,38 @@ class Sfp(SfpBase): """ BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0" _port_to_i2c_mapping = { - 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, + 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, 33: 1, 34: 2 }