From 527a6b67583e2d1581369bce4edaf60836ff1687 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Tue, 7 Feb 2023 15:08:49 +0800 Subject: [PATCH 01/21] [Edgecore][PDDF/as5835-54x] Support PDDF Signed-off-by: jostar-yang --- .../pddf/pd-plugin.json | 66 + .../pddf/pddf-device.json | 2819 +++++++++++++++++ .../x86_64-accton_as5835_54x-r0/pddf_support | 0 .../pmon_daemon_control.json | 4 +- .../x86_64-accton_as5835_54x-r0/sensors.conf | 8 +- .../system_health_monitoring_config.json | 32 +- .../as5835-54x/modules/Makefile | 5 +- .../as5835-54x/modules/pddf_custom_psu.c | 117 + .../as5835-54x-pddf-platform-monitor.service | 16 + .../service/pddf-platform-init.service | 1 + .../as5835-54x/sonic_platform/__init__.py | 3 + .../as5835-54x/sonic_platform/chassis.py | 119 + .../as5835-54x/sonic_platform/component.py | 172 + .../as5835-54x/sonic_platform/eeprom.py | 88 + .../as5835-54x/sonic_platform/event.py | 60 + .../as5835-54x/sonic_platform/fan.py | 32 + .../as5835-54x/sonic_platform/fan_drawer.py | 24 + .../as5835-54x/sonic_platform/helper.py | 121 + .../as5835-54x/sonic_platform/pcie.py | 19 + .../as5835-54x/sonic_platform/platform.py | 25 + .../as5835-54x/sonic_platform/psu.py | 65 + .../as5835-54x/sonic_platform/sfp.py | 57 + .../as5835-54x/sonic_platform/thermal.py | 42 + .../as5835-54x/sonic_platform/watchdog.py | 23 + .../as5835-54x/sonic_platform_setup.py | 11 +- .../utils/accton_as5835_54x_pddf_monitor.py | 241 ++ .../utils/pddf_post_device_create.sh | 27 + .../as5835-54x/utils/pddf_switch_svc.py | 86 + .../sonic-platform-accton-as5835-54x.install | 3 +- .../sonic-platform-accton-as5835-54x.postinst | 9 + 30 files changed, 4261 insertions(+), 34 deletions(-) create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/pddf_support create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-pddf-platform-monitor.service create mode 120000 platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/event.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/pcie.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/platform.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/watchdog.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_pddf_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh create mode 100755 platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_switch_svc.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.postinst diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pd-plugin.json new file mode 100644 index 000000000000..93cfc7589994 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pd-plugin.json @@ -0,0 +1,66 @@ +{ + + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-SFP28": {"1":true, "0":false }, + "valmap-QSFP28": {"1":true, "0":false} + } + } + }, + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"exhaust", "B2F":"intake" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"intake", "0":"exhaust"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: (dc/5)", + + "pwm_to_duty_cycle": "lambda pwm: (pwm*5)" + } + +} diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json new file mode 100644 index 000000000000..edf570a8bbea --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -0,0 +1,2819 @@ +{ + "PLATFORM": + { + "num_psus":2, + "num_fantrays":5, + "num_fans_pertray":2, + "num_ports":54, + "num_temps": 4, + "pddf_dev_types": + { + "description":"AS5835-54X - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", + "CPLD": + [ + "i2c_cpld" + ], + "PSU": + [ + "psu_eeprom", + "psu_pmbus" + ], + "FAN": + [ + "fan_ctrl", + "fan_eeprom" + ], + "PORT_MODULE": + [ + "pddf_xcvr" + ] + }, + "std_kos": + [ + "i2c-i801", + "i2c-ismt", + "i2c_dev", + "i2c_mux_pca954x", + "optoe" + ], + "pddf_kos": + [ + "pddf_client_module", + "pddf_cpld_module", + "pddf_cpld_driver", + "pddf_mux_module", + "pddf_xcvr_module", + "pddf_xcvr_driver_module", + "pddf_psu_driver_module", + "pddf_psu_module", + "pddf_fan_driver_module", + "pddf_fan_module", + "pddf_led_module", + "pddf_sysstatus_module" + ], + "custom_kos": + [ + "pddf_custom_psu" + ] + + }, + + "SYSTEM": + { + "dev_info": {"device_type":"CPU", "device_name":"ROOT_COMPLEX", "device_parent":null}, + "i2c": + { + "CONTROLLERS": + [ + { "dev_name":"i2c-1", "dev":"SMBUS1" } + ] + } + }, + + "SMBUS1": + { + "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM"}, + "i2c": + { + "topo_info": {"dev_addr": "0x1"}, + "DEVICES": + [ + {"dev": "EEPROM1"}, + {"dev": "CPU_CPLD"}, + {"dev": "MUX1"} + ] + } + }, + + "EEPROM1": + { + "dev_info": {"device_type": "EEPROM", "device_name": "EEPROM1", "device_parent": "SMBUS1"}, + "i2c": + { + "topo_info": {"parent_bus": "0x1", "dev_addr": "0x57", "dev_type": "24c02"}, + "dev_attr": {"access_mode": "BLOCK"}, + "attr_list": [ + {"attr_name": "eeprom"} + ] + } + }, + + "CPU_CPLD": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPU_CPLD", "device_parent":"SMBUS1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x65", "dev_type":"i2c_cpld"}, + "dev_attr": { } + } + }, + + "MUX1": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX1", "device_parent":"SMBUS1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x77", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x2", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"MUX2" }, + { "chn":"0", "dev":"MUX3" }, + { "chn":"0", "dev":"MUX4" }, + { "chn":"1", "dev":"CPLD1" }, + { "chn":"1", "dev":"CPLD2" }, + { "chn":"1", "dev":"CPLD3" }, + { "chn":"1", "dev":"FAN-CTRL" }, + { "chn":"1", "dev":"MUX5" } + ] + } + }, + "MUX2": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX2", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x70", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0xa", "idle_state":"-2"}, + "channel": + [ + { "chn":"1", "dev":"PSU1" }, + { "chn":"2", "dev":"PSU2" } + ] + } + }, + + "PSU1": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU1", "device_parent":"MUX2"}, + "dev_attr": { "dev_idx":"1", "num_psu_fans": "1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU1-PMBUS" }, + { "itf":"eeprom", "dev":"PSU1-EEPROM" } + ] + } + }, + + "PSU1-PMBUS": + { + "dev_info": { "device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU1-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU1-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + ] + } + }, + + "PSU2": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU2", "device_parent":"MUX2" }, + "dev_attr": { "dev_idx":"2", "num_psu_fans":"1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU2-PMBUS"}, + { "itf":"eeprom", "dev":"PSU2-EEPROM" } + ] + } + }, + + "PSU2-PMBUS": + { + "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU2-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xc", "dev_addr":"0x5b", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU2-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU2-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xc", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + ] + } + }, + "MUX3": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX3", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x72", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x12", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT51" }, + { "chn":"1", "dev":"PORT54" }, + { "chn":"2", "dev":"PORT49" }, + { "chn":"3", "dev":"PORT50" }, + { "chn":"4", "dev":"PORT52" }, + { "chn":"5", "dev":"PORT53" } + ] + } + }, + + "PORT51": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT51", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"51"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT51-EEPROM" }, + { "itf":"control", "dev":"PORT51-CTRL" } + ] + } + }, + "PORT51-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT51-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT51-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT51-CTRL", "device_parent":"MUX3", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x14", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x15", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x13", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x16", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT54": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT54", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"54"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT54-EEPROM" }, + { "itf":"control", "dev":"PORT54-CTRL" } + ] + } + }, + "PORT54-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT54-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT54-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT54-CTRL", "device_parent":"MUX3", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x14", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x15", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x13", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x16", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT49": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT49", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"49"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT49-EEPROM" }, + { "itf":"control", "dev":"PORT49-CTRL" } + ] + } + }, + "PORT49-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT49-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT49-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT49-CTRL", "device_parent":"MUX3", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x14", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x13", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x16", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT50": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT50", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"50"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT50-EEPROM" }, + { "itf":"control", "dev":"PORT50-CTRL" } + ] + } + }, + "PORT50-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT50-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + + "PORT50-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT50-CTRL", "device_parent":"MUX3", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x14", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x15", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x13", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x16", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT52": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT52", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"52"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT52-EEPROM" }, + { "itf":"control", "dev":"PORT52-CTRL" } + ] + } + }, + "PORT52-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT52-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT52-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT52-CTRL", "device_parent":"MUX3", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x14", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x15", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD3", "attr_offset":"0x13", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x16", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT53": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT53", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"53"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT53-EEPROM" }, + { "itf":"control", "dev":"PORT53-CTRL" } + ] + } + }, + "PORT53-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT53-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT53-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT53-CTRL", "device_parent":"MUX3", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x14", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x15", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x62", "attr_devtype":"cpld","attr_devname":"CPLD3", "attr_offset":"0x13", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_lpmode", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x16", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + + "CPLD1": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD1", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x60", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + "CPLD2": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD2", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x61", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + "CPLD3": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD3", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x62", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + + "FAN-CTRL": + { + "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x63", "dev_type":"fan_ctrl"}, + "dev_attr": { "num_fantrays":"5"}, + "attr_list": + [ + { "attr_name":"fan1_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan2_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan3_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan4_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan5_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan6_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan7_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan8_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan9_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan10_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x02","attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan1_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan2_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan3_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan4_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan5_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan6_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan7_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan8_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan9_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan10_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x03", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan1_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x07", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan2_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0C", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan3_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x08", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan4_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0D", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan5_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x09", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan6_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0E", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150", "attr_is_divisor":0}, + { "attr_name":"fan7_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0A", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150" , "attr_is_divisor":0}, + { "attr_name":"fan8_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150" , "attr_is_divisor":0}, + { "attr_name":"fan9_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0B", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150" , "attr_is_divisor":0}, + { "attr_name":"fan10_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"150" , "attr_is_divisor":0}, + { "attr_name":"fan1_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan2_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan3_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan4_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan5_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan6_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan7_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan8_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan9_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" }, + { "attr_name":"fan10_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x06", "attr_mask":"0x1F", "attr_len":"1" } + ] + } + }, + + "MUX4": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX4", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x1a", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"TEMP1" }, + { "chn":"1", "dev":"TEMP2" }, + { "chn":"2", "dev":"TEMP3" }, + { "chn":"3", "dev":"TEMP4" } + ] + } + }, + + "TEMP1" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX4"}, + "dev_attr": { "display_name":"CpuBoard_temp(0x4B)"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x4B", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP2" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP2", "device_parent":"MUX4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x4C", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP3" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP3", "device_parent":"MUX4"}, + "dev_attr": { "display_name":"MB_RearLeft_temp(0x49)"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x49", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + "TEMP4" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP4", "device_parent":"MUX4"}, + "dev_attr": { "display_name":"MB_RearLeft_temp(0x4A)"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x4A", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + "SYSSTATUS": + { + "dev_info":{ "device_type":"SYSSTAT", "device_name":"SYSSTATUS"}, + "dev_attr":{ }, + "attr_list": + [ + + { "attr_name":"board_info","attr_devaddr":"0x60", "attr_offset":"0x0","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"cpld1_version","attr_devaddr":"0x60","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"cpld2_version","attr_devaddr":"0x61","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"cpld3version","attr_devaddr":"0x62","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"fan_cpld_version","attr_devaddr":"0x63","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"} + + ] + }, + + "MUX5": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX5", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x70", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x22", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"MUX6" }, + { "chn":"1", "dev":"MUX7" }, + { "chn":"2", "dev":"MUX8" }, + { "chn":"3", "dev":"MUX9" }, + { "chn":"4", "dev":"MUX10" }, + { "chn":"5", "dev":"MUX11" } + ] + } + }, + "MUX6": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX6", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x22", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x2a", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT1" }, + { "chn":"1", "dev":"PORT2" }, + { "chn":"2", "dev":"PORT3" }, + { "chn":"3", "dev":"PORT4" }, + { "chn":"4", "dev":"PORT5" }, + { "chn":"5", "dev":"PORT6" }, + { "chn":"6", "dev":"PORT7" }, + { "chn":"7", "dev":"PORT8" } + ] + } + }, + "MUX7": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX7", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x23", "dev_addr":"0x72", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x32", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT9" }, + { "chn":"1", "dev":"PORT10" }, + { "chn":"2", "dev":"PORT11" }, + { "chn":"3", "dev":"PORT12" }, + { "chn":"4", "dev":"PORT13" }, + { "chn":"5", "dev":"PORT14" }, + { "chn":"6", "dev":"PORT15" }, + { "chn":"7", "dev":"PORT16" } + ] + } + }, + "MUX8": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX8", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x24", "dev_addr":"0x73", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x3a", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT17" }, + { "chn":"1", "dev":"PORT18" }, + { "chn":"2", "dev":"PORT19" }, + { "chn":"3", "dev":"PORT20" }, + { "chn":"4", "dev":"PORT21" }, + { "chn":"5", "dev":"PORT22" }, + { "chn":"6", "dev":"PORT23" }, + { "chn":"7", "dev":"PORT24" } + ] + } + }, + "MUX9": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX9", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x25", "dev_addr":"0x74", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x42", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT25" }, + { "chn":"1", "dev":"PORT26" }, + { "chn":"2", "dev":"PORT27" }, + { "chn":"3", "dev":"PORT28" }, + { "chn":"4", "dev":"PORT29" }, + { "chn":"5", "dev":"PORT30" }, + { "chn":"6", "dev":"PORT31" }, + { "chn":"7", "dev":"PORT32" } + ] + } + }, + "MUX10": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX10", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x26", "dev_addr":"0x75", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x4a", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT33" }, + { "chn":"1", "dev":"PORT34" }, + { "chn":"2", "dev":"PORT35" }, + { "chn":"3", "dev":"PORT36" }, + { "chn":"4", "dev":"PORT37" }, + { "chn":"5", "dev":"PORT38" }, + { "chn":"6", "dev":"PORT39" }, + { "chn":"7", "dev":"PORT40" } + ] + } + }, + "MUX11": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX11", "device_parent":"MUX5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x27", "dev_addr":"0x76", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x52", "idle_state":"-2"}, + "channel": + [ + { "chn":"0", "dev":"PORT41" }, + { "chn":"1", "dev":"PORT42" }, + { "chn":"2", "dev":"PORT43" }, + { "chn":"3", "dev":"PORT44" }, + { "chn":"4", "dev":"PORT45" }, + { "chn":"5", "dev":"PORT46" }, + { "chn":"6", "dev":"PORT47" }, + { "chn":"7", "dev":"PORT48" } + ] + } + }, + + "PORT1": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT1", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"1"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT1-EEPROM" }, + { "itf":"control", "dev":"PORT1-CTRL" } + ] + } + }, + "PORT1-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT1-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT1-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT1-CTRL", "device_parent":"MUX6", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT2": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT2", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"2"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT2-EEPROM" }, + { "itf":"control", "dev":"PORT2-CTRL" } + ] + } + }, + "PORT2-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT2-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT2-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT2-CTRL", "device_parent":"MUX6", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT3": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT3", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"3"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT3-EEPROM" }, + { "itf":"control", "dev":"PORT3-CTRL" } + ] + } + }, + "PORT3-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT3-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT3-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT3-CTRL", "device_parent":"MUX6", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT4": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT4", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"4"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT4-EEPROM" }, + { "itf":"control", "dev":"PORT4-CTRL" } + ] + } + }, + "PORT4-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT4-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT4-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT4-CTRL", "device_parent":"MUX6", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT5": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT5", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"5"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT5-EEPROM" }, + { "itf":"control", "dev":"PORT5-CTRL" } + ] + } + }, + "PORT5-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT5-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT5-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT5-CTRL", "device_parent":"MUX6", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT6": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT6", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"6"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT6-EEPROM" }, + { "itf":"control", "dev":"PORT6-CTRL" } + ] + } + }, + "PORT6-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT6-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT6-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT6-CTRL", "device_parent":"MUX6", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT7": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT7", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"7"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT7-EEPROM" }, + { "itf":"control", "dev":"PORT7-CTRL" } + ] + } + }, + "PORT7-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT7-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT7-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT7-CTRL", "device_parent":"MUX6", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT8": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT8", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"8"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT8-EEPROM" }, + { "itf":"control", "dev":"PORT8-CTRL" } + ] + } + }, + "PORT8-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT8-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT8-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT8-CTRL", "device_parent":"MUX6", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x8", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0D", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x12", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x17", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT9": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT9", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"9"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT9-EEPROM" }, + { "itf":"control", "dev":"PORT9-CTRL" } + ] + } + }, + "PORT9-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT9-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x32", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT9-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT9-CTRL", "device_parent":"MUX7", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x32", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT10": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT10", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"10"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT10-EEPROM" }, + { "itf":"control", "dev":"PORT10-CTRL" } + ] + } + }, + "PORT10-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT10-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x33", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT10-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT10-CTRL", "device_parent":"MUX7", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x33", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT11": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT11", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"11"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT11-EEPROM" }, + { "itf":"control", "dev":"PORT11-CTRL" } + ] + } + }, + "PORT11-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT11-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x34", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT11-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT11-CTRL", "device_parent":"MUX7", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x34", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT12": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT12", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"12"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT12-EEPROM" }, + { "itf":"control", "dev":"PORT12-CTRL" } + ] + } + }, + "PORT12-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT12-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x35", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT12-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT12-CTRL", "device_parent":"MUX7", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x35", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT13": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT13", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"13"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT13-EEPROM" }, + { "itf":"control", "dev":"PORT13-CTRL" } + ] + } + }, + "PORT13-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT13-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x36", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT13-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT13-CTRL", "device_parent":"MUX7", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x36", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT14": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT14", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"14"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT14-EEPROM" }, + { "itf":"control", "dev":"PORT14-CTRL" } + ] + } + }, + "PORT14-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT14-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x37", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT14-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT14-CTRL", "device_parent":"MUX7", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x37", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT15": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT15", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"15"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT15-EEPROM" }, + { "itf":"control", "dev":"PORT15-CTRL" } + ] + } + }, + "PORT15-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT15-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x38", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT15-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT15-CTRL", "device_parent":"MUX7", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x38", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT16": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT16", "device_parent":"MUX7"}, + "dev_attr": { "dev_idx":"16"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT16-EEPROM" }, + { "itf":"control", "dev":"PORT16-CTRL" } + ] + } + }, + "PORT16-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT16-EEPROM", "device_parent":"MUX7", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x39", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT16-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT16-CTRL", "device_parent":"MUX7", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x39", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x09", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0E", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x13", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x18", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT17": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT17", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"17"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT17-EEPROM" }, + { "itf":"control", "dev":"PORT17-CTRL" } + ] + } + }, + "PORT17-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT17-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT17-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT17-CTRL", "device_parent":"MUX8", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT18": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT18", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"18"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT18-EEPROM" }, + { "itf":"control", "dev":"PORT18-CTRL" } + ] + } + }, + "PORT18-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT18-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT18-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT18-CTRL", "device_parent":"MUX8", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT19": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT19", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"19"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT19-EEPROM" }, + { "itf":"control", "dev":"PORT19-CTRL" } + ] + } + }, + "PORT19-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT19-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT19-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT19-CTRL", "device_parent":"MUX8", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT20": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT20", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"20"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT20-EEPROM" }, + { "itf":"control", "dev":"PORT20-CTRL" } + ] + } + }, + "PORT20-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT20-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT20-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT20-CTRL", "device_parent":"MUX8", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT21": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT21", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"21"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT21-EEPROM" }, + { "itf":"control", "dev":"PORT21-CTRL" } + ] + } + }, + "PORT21-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT21-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT21-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT21-CTRL", "device_parent":"MUX8", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT22": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT22", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"22"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT22-EEPROM" }, + { "itf":"control", "dev":"PORT22-CTRL" } + ] + } + }, + "PORT22-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT22-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT22-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT22-CTRL", "device_parent":"MUX8", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT23": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT23", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"23"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT23-EEPROM" }, + { "itf":"control", "dev":"PORT23-CTRL" } + ] + } + }, + "PORT23-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT23-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x40", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT23-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT23-CTRL", "device_parent":"MUX8", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x40", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT24": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT24", "device_parent":"MUX8"}, + "dev_attr": { "dev_idx":"24"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT24-EEPROM" }, + { "itf":"control", "dev":"PORT24-CTRL" } + ] + } + }, + "PORT24-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT24-EEPROM", "device_parent":"MUX8", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x41", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT24-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT24-CTRL", "device_parent":"MUX8", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x41", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0A", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0F", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x14", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x19", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT25": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT25", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"25"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT25-EEPROM" }, + { "itf":"control", "dev":"PORT25-CTRL" } + ] + } + }, + "PORT25-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT25-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x42", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT25-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT25-CTRL", "device_parent":"MUX9", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x42", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT26": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT26", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"26"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT26-EEPROM" }, + { "itf":"control", "dev":"PORT26-CTRL" } + ] + } + }, + "PORT26-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT26-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x43", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT26-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT26-CTRL", "device_parent":"MUX9", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x43", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x15", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT27": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT27", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"27"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT27-EEPROM" }, + { "itf":"control", "dev":"PORT27-CTRL" } + ] + } + }, + "PORT27-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT27-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x44", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT27-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT27-CTRL", "device_parent":"MUX9", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x44", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x15", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT28": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT28", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"28"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT28-EEPROM" }, + { "itf":"control", "dev":"PORT28-CTRL" } + ] + } + }, + "PORT28-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT28-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x45", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT28-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT28-CTRL", "device_parent":"MUX9", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x45", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x15", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT29": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT29", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"29"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT29-EEPROM" }, + { "itf":"control", "dev":"PORT29-CTRL" } + ] + } + }, + "PORT29-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT29-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x46", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT29-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT29-CTRL", "device_parent":"MUX9", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x46", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x15", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT30": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT30", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"30"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT30-EEPROM" }, + { "itf":"control", "dev":"PORT30-CTRL" } + ] + } + }, + "PORT30-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT30-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x47", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT30-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT30-CTRL", "device_parent":"MUX9", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x47", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0B", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x15", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1A", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT31": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT31", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"31"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT31-EEPROM" }, + { "itf":"control", "dev":"PORT31-CTRL" } + ] + } + }, + "PORT31-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT31-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x48", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT31-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT31-CTRL", "device_parent":"MUX9", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x48", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x0B", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x15", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2","attr_offset":"0x1A", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT32": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT32", "device_parent":"MUX9"}, + "dev_attr": { "dev_idx":"32"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT32-EEPROM" }, + { "itf":"control", "dev":"PORT32-CTRL" } + ] + } + }, + "PORT32-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT32-EEPROM", "device_parent":"MUX9", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x49", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT32-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT32-CTRL", "device_parent":"MUX9", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x49", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0B", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld","attr_devname":"CPLD2", "attr_offset":"0x15", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1A", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT33": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT33", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"33"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT33-EEPROM" }, + { "itf":"control", "dev":"PORT33-CTRL" } + ] + } + }, + "PORT33-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT33-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT33"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT33-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT33-CTRL", "device_parent":"MUX10", "virt_parent":"PORT33"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT34": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT34", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"34"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT34-EEPROM" }, + { "itf":"control", "dev":"PORT34-CTRL" } + ] + } + }, + "PORT34-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT34-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT34"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT34-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT34-CTRL", "device_parent":"MUX10", "virt_parent":"PORT34"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT35": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT35", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"35"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT35-EEPROM" }, + { "itf":"control", "dev":"PORT35-CTRL" } + ] + } + }, + "PORT35-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT35-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT35"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT35-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT35-CTRL", "device_parent":"MUX10", "virt_parent":"PORT35"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT36": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT36", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"36"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT36-EEPROM" }, + { "itf":"control", "dev":"PORT36-CTRL" } + ] + } + }, + "PORT36-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT36-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT36"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT36-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT36-CTRL", "device_parent":"MUX10", "virt_parent":"PORT36"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT37": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT37", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"37"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT37-EEPROM" }, + { "itf":"control", "dev":"PORT37-CTRL" } + ] + } + }, + "PORT37-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT37-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT37"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT37-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT37-CTRL", "device_parent":"MUX10", "virt_parent":"PORT37"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT38": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT38", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"38"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT38-EEPROM" }, + { "itf":"control", "dev":"PORT38-CTRL" } + ] + } + }, + "PORT38-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT38-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT38"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT38-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT38-CTRL", "device_parent":"MUX10", "virt_parent":"PORT38"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x0C", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x16", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x61", "attr_devtype":"cpld", "attr_devname":"CPLD2", "attr_offset":"0x1B", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT39": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT39", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"39"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT39-EEPROM" }, + { "itf":"control", "dev":"PORT39-CTRL" } + ] + } + }, + "PORT39-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT39-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT39"}, + "i2c": + { + "topo_info": { "parent_bus":"0x50", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT39-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT39-CTRL", "device_parent":"MUX10", "virt_parent":"PORT39"}, + "i2c": + { + "topo_info": { "parent_bus":"0x50", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT40": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT40", "device_parent":"MUX10"}, + "dev_attr": { "dev_idx":"40"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT40-EEPROM" }, + { "itf":"control", "dev":"PORT40-CTRL" } + ] + } + }, + "PORT40-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT40-EEPROM", "device_parent":"MUX10", "virt_parent":"PORT40"}, + "i2c": + { + "topo_info": { "parent_bus":"0x51", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT40-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT40-CTRL", "device_parent":"MUX10", "virt_parent":"PORT40"}, + "i2c": + { + "topo_info": { "parent_bus":"0x51", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "PORT41": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT41", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"41"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT41-EEPROM" }, + { "itf":"control", "dev":"PORT41-CTRL" } + ] + } + }, + "PORT41-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT41-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT41"}, + "i2c": + { + "topo_info": { "parent_bus":"0x52", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT41-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT41-CTRL", "device_parent":"MUX11", "virt_parent":"PORT41"}, + "i2c": + { + "topo_info": { "parent_bus":"0x52", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x2", "attr_cmpval":"0x4", "attr_len":"1"} + ] + } + }, + + "PORT42": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT42", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"42"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT42-EEPROM" }, + { "itf":"control", "dev":"PORT42-CTRL" } + ] + } + }, + "PORT42-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT42-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT42"}, + "i2c": + { + "topo_info": { "parent_bus":"0x53", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT42-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT42-CTRL", "device_parent":"MUX11", "virt_parent":"PORT42"}, + "i2c": + { + "topo_info": { "parent_bus":"0x53", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x3", "attr_cmpval":"0x8", "attr_len":"1"} + ] + } + }, + + "PORT43": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT43", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"43"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT43-EEPROM" }, + { "itf":"control", "dev":"PORT43-CTRL" } + ] + } + }, + "PORT43-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT43-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT43"}, + "i2c": + { + "topo_info": { "parent_bus":"0x54", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT43-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT43-CTRL", "device_parent":"MUX11", "virt_parent":"PORT43"}, + "i2c": + { + "topo_info": { "parent_bus":"0x54", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x06", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x09", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x0C", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3","attr_offset":"0x0F", "attr_mask":"0x4", "attr_cmpval":"0x10", "attr_len":"1"} + ] + } + }, + + "PORT44": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT44", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"44"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT44-EEPROM" }, + { "itf":"control", "dev":"PORT44-CTRL" } + ] + } + }, + "PORT44-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT44-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT44"}, + "i2c": + { + "topo_info": { "parent_bus":"0x55", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT44-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT44-CTRL", "device_parent":"MUX11", "virt_parent":"PORT44"}, + "i2c": + { + "topo_info": { "parent_bus":"0x55", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x5", "attr_cmpval":"0x20", "attr_len":"1"} + ] + } + }, + + "PORT45": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT45", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"45"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT45-EEPROM" }, + { "itf":"control", "dev":"PORT45-CTRL" } + ] + } + }, + "PORT45-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT45-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT45"}, + "i2c": + { + "topo_info": { "parent_bus":"0x56", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT45-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT45-CTRL", "device_parent":"MUX11", "virt_parent":"PORT45"}, + "i2c": + { + "topo_info": { "parent_bus":"0x56", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x6", "attr_cmpval":"0x40", "attr_len":"1"} + ] + } + }, + + "PORT46": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT46", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"46"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT46-EEPROM" }, + { "itf":"control", "dev":"PORT46-CTRL" } + ] + } + }, + "PORT46-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT46-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT46"}, + "i2c": + { + "topo_info": { "parent_bus":"0x57", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT46-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT46-CTRL", "device_parent":"MUX11", "virt_parent":"PORT46"}, + "i2c": + { + "topo_info": { "parent_bus":"0x57", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x06", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x09", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0C", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0F", "attr_mask":"0x7", "attr_cmpval":"0x80", "attr_len":"1"} + ] + } + }, + + "PORT47": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT47", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"47"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT47-EEPROM" }, + { "itf":"control", "dev":"PORT47-CTRL" } + ] + } + }, + "PORT47-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT47-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT47"}, + "i2c": + { + "topo_info": { "parent_bus":"0x58", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT47-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT47-CTRL", "device_parent":"MUX11", "virt_parent":"PORT47"}, + "i2c": + { + "topo_info": { "parent_bus":"0x58", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x07", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0A", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0D", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x1", "attr_len":"1"} + ] + } + }, + + "PORT48": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT48", "device_parent":"MUX11"}, + "dev_attr": { "dev_idx":"48"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT48-EEPROM" }, + { "itf":"control", "dev":"PORT48-CTRL" } + ] + } + }, + "PORT48-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT48-EEPROM", "device_parent":"MUX11", "virt_parent":"PORT48"}, + "i2c": + { + "topo_info": { "parent_bus":"0x59", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT48-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT48-CTRL", "device_parent":"MUX11", "virt_parent":"PORT48"}, + "i2c": + { + "topo_info": { "parent_bus":"0x59", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x07", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_txfault", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0A", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_txdisable", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x0D", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"xcvr_rxlos", "attr_devaddr":"0x62", "attr_devtype":"cpld", "attr_devname":"CPLD3", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x2", "attr_len":"1"} + ] + } + }, + + "LOC_LED": + { + "dev_info": { "device_type":"LED", "device_name":"LOC_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : + { + "attr_list": + [ + {"attr_name":"amber", "descr": "" , "bits" : "5:4", "value" : "0x0", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x0A"}, + {"attr_name":"off", "descr": "" , "bits" : "5:4", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x0A"} + + ] + } + }, + "DIAG_LED": + { + "dev_info": { "device_type":"LED", "device_name":"DIAG_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : + { + "attr_list": + [ + {"attr_name":"green", "descr": "" , "bits" : "3:2", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x0A"}, + {"attr_name":"amber", "descr": "" , "bits" : "3:2", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x0A"}, + {"attr_name":"off", "descr": "" , "bits" : "3:2", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x0A"} + ] + } + } +} diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf_support b/device/accton/x86_64-accton_as5835_54x-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json index a3b204e20d8d..fb49c2978fcd 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { - "skip_ledd": true, - "skip_pcied": true + "skip_ledd": true + } diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf index 38cf89fc68c4..c220d28f59e6 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf +++ b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf @@ -39,13 +39,13 @@ chip "as5835_54x_fan-*" chip "lm75-i2c-*-49" - label temp1 "Main Board Temperature" + label temp1 "MB_RearLeft_temp" chip "lm75-i2c-*-4a" - label temp1 "Main Board Temperature" + label temp1 "MB_RearRight_temp" chip "lm75-i2c-*-4c" - label temp1 "Main Board Temperature" + label temp1 "MB_FrontMiddle_temp" chip "lm75-i2c-*-4b" - label temp1 "CPU Board Temperature" + label temp1 "CpuBoard_temp" diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json index 5f3b3b07e73f..596dff2d55bf 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -1,15 +1,17 @@ -{ - "services_to_ignore": [], - "devices_to_ignore": [ - "asic", - "psu.temperature" - - ], - "user_defined_checkers": [], - "polling_interval": 60, - "led_color": { - "fault": "STATUS_LED_COLOR_AMBER", - "normal": "STATUS_LED_COLOR_GREEN", - "booting": "STATUS_LED_COLOR_GREEN" - } -} +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.voltage", + "psu.temperature", + "PSU1_FAN1.speed", + "PSU2_FAN1.speed" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "STATUS_LED_COLOR_AMBER", + "normal": "STATUS_LED_COLOR_GREEN", + "booting": "STATUS_LED_COLOR_GREEN" + } +} diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile index ec29de5fe791..eafc97032e26 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile @@ -1,8 +1,11 @@ ifneq ($(KERNELRELEASE),) obj-m:= accton_as5835_54x_cpld.o accton_as5835_54x_psu.o \ accton_as5835_54x_fan.o accton_as5835_54x_leds.o \ - ym2651y.o + ym2651y.o pddf_custom_psu.o +CFLAGS_pddf_custom_psu.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF + else ifeq (,$(KERNEL_SRC)) $(error KERNEL_SRC is not defined) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c new file mode 100644 index 000000000000..1591267b0127 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c @@ -0,0 +1,117 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pddf_psu_defs.h" + +ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf); +extern PSU_SYSFS_ATTR_DATA access_psu_v_out; + +static int two_complement_to_int(u16 data, u8 valid_bit, int mask) +{ + u16 valid_data = data & mask; + bool is_negative = valid_data >> (valid_bit - 1); + + return is_negative ? (-(((~valid_data) & mask) + 1)) : valid_data; +} + +static u8 psu_get_vout_mode(struct i2c_client *client) +{ + u8 status = 0, retry = 10; + uint8_t offset = 0x20; // VOUT_MODE + + while (retry) { + status = i2c_smbus_read_byte_data((struct i2c_client *)client, offset); + if (unlikely(status < 0)) { + msleep(60); + retry--; + continue; + } + break; + } + + if (status < 0) + { + printk(KERN_ERR "%s: Get PSU Vout mode failed\n", __func__); + return 0; + } + else + { + /*printk(KERN_ERR "%s: vout_mode reg value 0x%x\n", __func__, status);*/ + return status; + } +} + +static u16 psu_get_v_out(struct i2c_client *client) +{ + u16 status = 0, retry = 10; + uint8_t offset = 0x8b; // READ_VOUT + + while (retry) { + status = i2c_smbus_read_word_data((struct i2c_client *)client, offset); + if (unlikely(status < 0)) { + msleep(60); + retry--; + continue; + } + break; + } + + if (status < 0) + { + printk(KERN_ERR "%s: Get PSU Vout failed\n", __func__); + return 0; + } + else + { + /*printk(KERN_ERR "%s: vout reg value 0x%x\n", __func__, status);*/ + return status; + } +} + +ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int exponent, mantissa; + int multiplier = 1000; + + u16 value = psu_get_v_out(client); + u8 vout_mode = psu_get_vout_mode(client); + + exponent = two_complement_to_int(vout_mode, 5, 0x1f); + mantissa = value; + if (exponent >= 0) + return sprintf(buf, "%d\n", (mantissa << exponent) * multiplier); + else + return sprintf(buf, "%d\n", (mantissa * multiplier) / (1 << -exponent)); +} + + + +static int __init pddf_custom_psu_init(void) +{ + access_psu_v_out.show = pddf_show_custom_psu_v_out; + access_psu_v_out.do_get = NULL; + return 0; +} + +static void __exit pddf_custom_psu_exit(void) +{ + return; +} + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("pddf custom psu api"); +MODULE_LICENSE("GPL"); + +module_init(pddf_custom_psu_init); +module_exit(pddf_custom_psu_exit); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-pddf-platform-monitor.service new file mode 100644 index 000000000000..ddd8d6abbbbe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-pddf-platform-monitor.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS5835-54X Platform Monitoring service +Before=pmon.service +After=pddf-platform-init.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as5835_54x_pddf_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/__init__.py new file mode 100644 index 000000000000..cdc3b813f64c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal", "fan"] +from . import platform diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py new file mode 100644 index 000000000000..dc564a980e95 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import sys + from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from .event import SfpEvent + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 6 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + SYSLED_DEV_NAME = "DIAG_LED" + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self.__initialize_components() + self._api_helper = APIHelper() + self._sfpevent = SfpEvent(self.get_all_sfps()) + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_change_event(self, timeout=0): + return self._sfpevent.get_sfp_event(timeout) + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + + Returns: + An object derived from SfpBase representing the specified sfp + """ + sfp = None + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp + + def initizalize_system_led(self): + return + + def get_status_led(self): + return self.get_system_led(self.SYSLED_DEV_NAME) + + def set_status_led(self, color): + return self.set_system_led(self.SYSLED_DEV_NAME, color) + + def get_port_or_cage_type(self, port): + from sonic_platform_base.sfp_base import SfpBase + if port in range(1, 48): + return SfpBase.SFP_PORT_TYPE_BIT_SFP | SfpBase.SFP_PORT_TYPE_BIT_SFP_PLUS + else: + return SfpBase.SFP_PORT_TYPE_BIT_QSFP | SfpBase.SFP_PORT_TYPE_BIT_QSFP_PLUS | SfpBase.SFP_PORT_TYPE_BIT_QSFP28 + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py new file mode 100644 index 000000000000..9656d717bfb4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py @@ -0,0 +1,172 @@ +############################################################################# +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "MB CPLD1": ['3', '0x60'], + "MB CPLD2": ['3', '0x61'], + "MB CPLD3": ['3', '0x62'], + "FAN CPLD": ['3', '0x63'], + "CPU CPLD": ['1', '0x65'] +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("MB CPLD1", "Mainboard CPLD 1"), + ("MB CPLD2", "Mainboard CPLD 2"), + ("MB CPLD3", "Mainboard CPLD 3"), + ("FAN CPLD", "Fan board CPLD"), + ("CPU CPLD", "CPU CPLD"), + ("BIOS", "Basic Input/Output System") + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + cmd = "i2cget -f -y {0} {1} 0x1".format(CPLD_ADDR_MAPPING[cpld_name][0], CPLD_ADDR_MAPPING[cpld_name][1]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + cpld_version_raw = value.rstrip() + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..ca9b5ce062d1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom + import os +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' + +class Eeprom(PddfEeprom): + _TLV_INFO_MAX_LEN = 256 + pddf_obj = {} + plugin_data = {} + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + #PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + if not pddf_data or not pddf_plugin_data: + raise ValueError('PDDF JSON data error') + + self.pddf_obj = pddf_data + self.plugin_data = pddf_plugin_data + + # system EEPROM always has device name EEPROM1 + self.eeprom_path = self.pddf_obj.get_path("EEPROM1", "eeprom") + if self.eeprom_path is None: + return + + super(PddfEeprom, self).__init__(self.eeprom_path, 0, '', True) + self.eeprom_tlv_dict = dict() + + # Create the cache directory if not created + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception as e: + print("Error in creating Eeprom cache directory - {}".format(str(e))) + + # Assign cache_name in eeprom_base.py + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except: + pass + + try: + self.eeprom_data = self.read_eeprom() + except Exception as e: + self.eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed - Error: {}".format(str(e))) + else: + eeprom = self.eeprom_data + + try: + self.update_cache(eeprom) + except: + pass + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = ((eeprom[9]) << 8) | (eeprom[10]) + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + (eeprom[tlv_index + 1])] + code = "0x%02X" % ((tlv[0])) + + if (tlv[0]) == self._TLV_CODE_VENDOR_EXT: + value = str(((tlv[2]) << 24) | ((tlv[3]) << 16) | + ((tlv[4]) << 8) | (tlv[5])) + value += str(tlv[6:6 + (tlv[1])]) + else: + name, value = self.decoder(None, tlv) + + self.eeprom_tlv_dict[code] = value + if (eeprom[tlv_index]) == self._TLV_CODE_CRC_32: + break + + tlv_index += (eeprom[tlv_index+1]) + 2 + + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/event.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/event.py new file mode 100644 index 000000000000..d5dac6d7f7e0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/event.py @@ -0,0 +1,60 @@ +try: + import time + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + +POLL_INTERVAL_IN_SEC = 1 + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._sfp_list = sfp_list + self._logger = Logger() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.get_position_in_parent() - 1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + for sfp in self._sfp_list: + i=sfp.get_position_in_parent() - 1 + if (changed_ports & (1 << i)): + if (bitmap & (1 << i)) == 0: + port_dict[i+1] = '0' + else: + port_dict[i+1] = '1' + + + # Update the cache dict + self._sfp_change_event_data['present'] = bitmap + return True, change_dict + else: + return True, change_dict diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py new file mode 100644 index 000000000000..448f483c9372 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", + "FAN-3F", "FAN-3R", "FAN-4F", "FAN-4R", + "FAN-5F", "FAN-5R"] + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + fan_name = FAN_NAME_LIST[(self.fantray_index-1)*2 + self.fan_index-1] \ + if not self.is_psu_fan \ + else "PSU-{} FAN-{}".format(self.fans_psu_index, self.fan_index) + + return fan_name diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..624ece4f3f99 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_name(self): + """ + Retrieves the fan drawer name + Returns: + string: The name of the device + """ + return "FanTray{}".format(self.fantray_index) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py new file mode 100644 index 000000000000..3284bb1a828b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py @@ -0,0 +1,121 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = ["docker"] +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + try: + status, output = getstatusoutput_noshell(HOST_CHK_CMD) + return status == 0 + except Exception: + return False + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r', errors='replace') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/pcie.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/pcie.py new file mode 100644 index 000000000000..e4da32adf9f8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/pcie.py @@ -0,0 +1,19 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# Base PCIe class +############################################################################# + +try: + from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Pcie(PcieUtil): + """Edgecore Platform-specific PCIe class""" + + def __init__(self, platform_path): + PcieUtil.__init__(self, platform_path) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/platform.py new file mode 100644 index 000000000000..406b1179ae1b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/platform.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + + +try: + from sonic_platform_pddf_base.pddf_platform import PddfPlatform +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PddfPlatform): + """ + PDDF Platform-Specific Platform Class + """ + + def __init__(self): + PddfPlatform.__init__(self) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py new file mode 100644 index 000000000000..48cdbab12132 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 1200 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + return 14.72 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + return 7.68 + + def get_name(self): + return "PSU-{}".format(self.psu_index) + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return float(self.PLATFORM_PSU_CAPACITY) + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + return (self.PLATFORM_PSU_CAPACITY) + + def get_type(self): + """ + Gets the type of the PSU + Returns: + A string, the type of PSU (AC/DC) + """ + return "AC" diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py new file mode 100644 index 000000000000..d8d6cc5de1a3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +try: + import natsort + from sonic_platform_pddf_base.pddf_sfp import PddfSfp + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from sonic_py_common import device_info +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + self.index = index + 1 + + # Provide the functions/variables below for which implementation is to be overwritten + def __get_path_to_port_config_file(self): + platform, hwsku = device_info.get_platform_and_hwsku() + hwsku_path = "/".join(["/usr/share/sonic/platform",hwsku]) + return "/".join([hwsku_path, "port_config.ini"]) + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + + logical_port_list = sfputil_helper.logical + logical_port_list = natsort.natsorted(logical_port_list) + name = logical_port_list[self.port_index-1] or "Unknown" + + return name + + def get_position_in_parent(self): + """Retrieves 1-based relative physical position in parent device.""" + return self.port_index + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + raise NotImplementedError + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py new file mode 100644 index 000000000000..8b7769cece25 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) + + self.pddf_obj = pddf_data + self.thermal_obj_name = "TEMP{}".format(self.thermal_index) + self.thermal_obj = self.pddf_obj.data[self.thermal_obj_name] + + # Provide the functions/variables below for which implementation is to be overwritten + def get_name(self): + if self.is_psu_thermal: + return "PSU-{0} temp sensor 1".format(self.thermals_psu_index) + else: + if 'dev_attr' in self.thermal_obj.keys(): + if 'display_name' in self.thermal_obj['dev_attr']: + return str(self.thermal_obj['dev_attr']['display_name']) + # In case of errors + #return (self.thermal_obj_name) + return "Temp sensor {0}".format(self.thermal_index) + + #def get_name(self): + # if self.is_psu_thermal: + # return "PSU-{0} temp sensor 1".format(self.thermals_psu_index) + # else: + # return "Temp sensor {0}".format(self.thermal_index) + + def get_status(self): + get_temp=self.get_temperature() + + if get_temp is not None: + return True if get_temp else False diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/watchdog.py new file mode 100644 index 000000000000..88660b1a1faa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/watchdog.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of platform specific watchdog API's +# +############################################################################# + +try: + from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Watchdog(PddfWatchdog): + """ + PDDF Platform-specific Chassis class + """ + + def __init__(self): + PddfWatchdog.__init__(self) + self.timeout= 180 + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py index a775511c643d..22bd354ea686 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py @@ -1,8 +1,5 @@ from setuptools import setup -DEVICE_NAME = 'accton' -HW_SKU = 'x86_64-accton_as5835_54x-r0' - setup( name='sonic-platform', version='1.0', @@ -11,13 +8,7 @@ author='SONiC Team', author_email='linuxnetdev@microsoft.com', url='https://github.com/Azure/sonic-buildimage', - maintainer='Jostar Yang', - maintainer_email='jostar_yang@accton.com', - packages=[ - 'sonic_platform', - ], - package_dir={ - 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + packages=['sonic_platform'], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_pddf_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_pddf_monitor.py new file mode 100755 index 000000000000..02be5a097202 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_pddf_monitor.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2019 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 05/29/2019: Brandon Chuang, changed for as5835-54x. +# 08/03/2020: Jostar Yang, change to call PDDF API . +# ------------------------------------------------------------------ + +try: + import sys, getopt + import logging + import logging.config + import time + import signal + from sonic_platform import platform +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = 'accton_as5835_54x_monitor' +DUTY_MAX = 100 + +platform_chassis = None + +test_temp = 0 +test_temp_list = [0, 0, 0, 0] +test_temp_revert=0 +temp_test_data=0 + +# Make a class we can use to capture stdout and sterr in the log +class accton_as5835_54x_monitor(object): + # static temp var + _ori_temp = 0 + _new_perc = 0 + + def __init__(self, log_file, log_level): + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_fans(self): + global platform_chassis + global test_temp_list + global temp_test_data + global test_temp + + THERMAL_NUM_MAX=4 + FAN_LEV1_UP_TEMP = 57700 # temperature + FAN_LEV1_SPEED_PERC = DUTY_MAX # percentage*/ + + FAN_LEV2_UP_TEMP = 53000 + FAN_LEV2_DOWN_TEMP = 52700 + FAN_LEV2_SPEED_PERC = 80 + + FAN_LEV3_UP_TEMP = 49500 + FAN_LEV3_DOWN_TEMP = 47700 + FAN_LEV3_SPEED_PERC = 65 + + FAN_LEV4_DOWN_TEMP = 42700 + FAN_LEV4_SPEED_PERC = 40 + + FAN_NUM=2 + FAN_TRAY_NUM=5 + + if test_temp_revert==0: + temp_test_data=temp_test_data+2000 + else: + temp_test_data=temp_test_data-2000 + + if test_temp==0: + temp2=platform_chassis.get_thermal(1).get_temperature()*1000 + if temp2 is None: + return False + + temp3=platform_chassis.get_thermal(2).get_temperature()*1000 + if temp3 is None: + return False + + new_temp = (temp2 + temp3) / 2 + else: + thermal_val=[0,0,0,0] + for i in range (THERMAL_NUM_MAX): + thermal_val[i]=test_temp_list[i] + thermal_val[i]= thermal_val[i] + temp_test_data + + + new_temp = (thermal_val[1] + thermal_val[2])/2 + logging.debug("Test case:thermal_val[1]=%d, thermal_val[2]=%d, get new_temp=%d", thermal_val[1], thermal_val[2],new_temp) + + for x in range(FAN_TRAY_NUM * FAN_NUM): + #fan_stat = platform_chassis.get_fan(x).get_status() or not platform_chassis.get_fan(x).get_speed_rpm() + + #if fan_stat is None: + # return False + #if fan_stat is False: + fan_stat=True + if not platform_chassis.get_fan(x).get_status() or not platform_chassis.get_fan(x).get_speed_rpm(): + self._new_perc = FAN_LEV1_SPEED_PERC + logging.debug('INFO. SET new_perc to %d (FAN fault. fan_num:%d)', self._new_perc, x+1) + fan_stat=False + break + logging.debug('INFO. fan_stat is True (fan_num:%d)', x+1) + + if fan_stat==True: + diff = new_temp - self._ori_temp + if diff == 0: + logging.debug('INFO. RETURN. THERMAL temp not changed. %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + return True + else: + if diff >= 0: + is_up = True + logging.debug('INFO. THERMAL temp UP %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + else: + is_up = False + logging.debug('INFO. THERMAL temp DOWN %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + + if is_up is True: + if new_temp >= FAN_LEV1_UP_TEMP: + self._new_perc = FAN_LEV1_SPEED_PERC + elif new_temp >= FAN_LEV2_UP_TEMP: + self._new_perc = FAN_LEV2_SPEED_PERC + elif new_temp >= FAN_LEV3_UP_TEMP: + self._new_perc = FAN_LEV3_SPEED_PERC + else: + self._new_perc = FAN_LEV4_SPEED_PERC + logging.debug('INFO. SET. FAN_SPEED as %d (new THERMAL temp:%d)', self._new_perc, new_temp) + else: + if new_temp <= FAN_LEV4_DOWN_TEMP: + self._new_perc = FAN_LEV4_SPEED_PERC + elif new_temp <= FAN_LEV3_DOWN_TEMP: + self._new_perc = FAN_LEV3_SPEED_PERC + elif new_temp <= FAN_LEV2_DOWN_TEMP: + self._new_perc = FAN_LEV2_SPEED_PERC + else: + self._new_perc = FAN_LEV1_SPEED_PERC + logging.debug('INFO. SET. FAN_SPEED as %d (new THERMAL temp:%d)', self._new_perc, new_temp) + + cur_perc= platform_chassis.get_fan(0).get_speed() + #cur_perc = fan.get_fan_duty_cycle() + if cur_perc == self._new_perc: + logging.debug('INFO. RETURN. FAN speed not changed. %d / %d (new_perc / ori_perc)', self._new_perc, cur_perc) + return True + + #set_stat = fan.set_fan_duty_cycle(self._new_perc) + set_stat = platform_chassis.get_fan(0).set_speed(self._new_perc) + if set_stat is True: + logging.debug('INFO: PASS. set_fan_duty_cycle (%d)', self._new_perc) + else: + logging.debug('INFO: FAIL. set_fan_duty_cycle (%d)', self._new_perc) + + logging.debug('INFO: GET. ori_perc is %d. ori_temp is %d', cur_perc, self._ori_temp) + self._ori_temp = new_temp + logging.debug('INFO: UPDATE. ori_perc to %d. ori_temp to %d', cur_perc, self._ori_temp) + + return True + +def handler(signum, frame): + logging.debug('INFO:Cause signal %d, set fan speed max.', signum) + platform_chassis.get_fan(0).set_speed(DUTY_MAX) + sys.exit(0) + +def main(argv): + global test_temp + + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdlt:',['lfile=']) + except getopt.GetoptError: + print('Usage: %s [-d] [-l ]' % sys.argv[0]) + return 0 + for opt, arg in opts: + if opt == '-h': + print('Usage: %s [-d] [-l ]' % sys.argv[0]) + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + + if sys.argv[1]== '-t': + if len(sys.argv)!=6: + print("temp test, need input 4 temp") + return 0 + i=0 + for x in range(2, 6): + test_temp_list[i]= int(sys.argv[x])*1000 + i=i+1 + test_temp = 1 + log_level = logging.DEBUG + print(test_temp_list) + + global platform_chassis + platform_chassis = platform.Platform().get_chassis() + + + signal.signal(signal.SIGINT, handler) + signal.signal(signal.SIGTERM, handler) + monitor = accton_as5835_54x_monitor(log_file, log_level) + + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(10) + +if __name__ == '__main__': + main(sys.argv[1:]) \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh new file mode 100755 index 000000000000..c1a6660f9e46 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set_qsfp_reset_to_normal_state() +{ + i2cset -y -f 3 0x62 0x15 0x3f &>/dev/null +} + + +set_sfp_tx_disable_to_disable() +{ + i2cset -y -f 3 0x61 0x12 0x0 &>/dev/null + i2cset -y -f 3 0x61 0x13 0x0 &>/dev/null + i2cset -y -f 3 0x61 0x14 0x0 &>/dev/null + i2cset -y -f 3 0x61 0x15 0x0 &>/dev/null + i2cset -y -f 3 0x61 0x16 0x0 &>/dev/null + i2cset -y -f 3 0x62 0xc 0x0 &>/dev/null + i2cset -y -f 3 0x62 0xd 0x0 &>/dev/null +} + +set_system_led_diag_loc_to_off() +{ + i2cset -y -f 3 0x60 0xa 0x1c &>/dev/null +} + +set_qsfp_reset_to_normal_state +set_sfp_tx_disable_to_disable +set_system_led_diag_loc_to_off diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_switch_svc.py new file mode 100755 index 000000000000..c7dad91bae8f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_switch_svc.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa +from sonic_py_common.general import getstatusoutput_noshell + +def check_pddf_support(): + return True + +def stop_platform_svc(): + + status, output = getstatusoutput_noshell(["systemctl", "stop", "as5835-54x-platform-monitor-fan.service"]) + if status: + print("Stop as5835-54x-platform-fan.service failed %d"%status) + return False + + status, output = getstatusoutput_noshell(["systemctl", "stop", "as5835-54x-platform-monitor-psu.service"]) + if status: + print("Stop as5835-54x-platform-psu.service failed %d"%status) + return False + + status, output = getstatusoutput_noshell(["systemctl", "stop", "as5835-54x-platform-monitor.service"]) + if status: + print("Stop as5835-54x-platform-init.service failed %d"%status) + return False + status, output = getstatusoutput_noshell(["systemctl", "disable", "as5835-54x-platform-monitor.service"]) + if status: + print("Disable as5835-54x-platform-monitor.service failed %d"%status) + return False + + status, output = getstatusoutput_noshell(["/usr/local/bin/accton_as5835_54x_util.py", "clean"]) + if status: + print("accton_as5835_54x_util.py clean command failed %d"%status) + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = getstatusoutput_noshell(["systemctl", "stop", "pddf-platform-init.service"]) + if status: + print("Stop pddf-platform-init.service along with other platform serives failed %d"%status) + return False + + return True + +def start_platform_svc(): + status, output = getstatusoutput_noshell(["/usr/local/bin/accton_as5835_54x_util.py", "install"]) + if status: + print("accton_as5835_54x_util.py install command failed %d"%status) + return False + + status, output = getstatusoutput_noshell(["systemctl", "enable", "as5835-54x-platform-monitor.service"]) + if status: + print("Enable as5835-54x-platform-monitor.service failed %d"%status) + return False + status, output = getstatusoutput_noshell(["systemctl", "start" ,"as5835-54x-platform-monitor-fan.service"]) + if status: + print("Start as5835-54x-platform-monitor-fan.service failed %d"%status) + return False + + status, output = getstatusoutput_noshell(["systemctl", "start", "as5835-54x-platform-monitor-psu.service"]) + if status: + print("Start as5835-54x-platform-monitor-psu.service failed %d"%status) + return False + + return True + +def start_platform_pddf(): + status, output = getstatusoutput_noshell(["systemctl", "start", "pddf-platform-init.service"]) + if status: + print("Start pddf-platform-init.service failed %d"%status) + return False + + return True + +def stop_platform_pddf(): + status, output = getstatusoutput_noshell(["systemctl", "stop", "pddf-platform-init.service"]) + if status: + print("Stop pddf-platform-init.service failed %d"%status) + return False + + return True + +def main(): + pass + +if __name__ == "__main__": + main() + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install index d108eb582c38..a234273ab74b 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install @@ -1,2 +1 @@ -as5835-54x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as5835_54x-r0 - +as5835-54x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as5835_54x-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.postinst new file mode 100644 index 000000000000..c478bcac28a6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.postinst @@ -0,0 +1,9 @@ +# Special arrangement to make PDDF mode default +# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) +# Enable pddf-platform-monitor +depmod -a +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service +systemctl enable as5835-54x-pddf-platform-monitor.service +systemctl start as5835-54x-pddf-platform-monitor.service From 5a5f46675a93ff98b0b1a129767baf2936a5bb3a Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Tue, 7 Feb 2023 16:39:44 +0800 Subject: [PATCH 02/21] Fix Semgrep check --- .../pddf/pddf-device.json | 1 + .../as5835-54x/sonic_platform/helper.py | 70 ------------------- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index edf570a8bbea..f73222593af0 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -623,6 +623,7 @@ "TEMP2" : { "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP2", "device_parent":"MUX4"}, + "dev_attr": { "display_name":"MB_FrontMiddle_temp(0x4C)"}, "i2c": { "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x4C", "dev_type":"lm75"}, diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py index 3284bb1a828b..5162803fb51f 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py @@ -33,26 +33,6 @@ def pci_get_value(self, resource, offset): status = False return status, result - def run_command(self, cmd): - status = True - result = "" - try: - p = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - raw_data, err = p.communicate() - if err == '': - result = raw_data.strip() - except Exception: - status = False - return status, result - - def run_interactive_command(self, cmd): - try: - os.system(cmd) - except Exception: - return False - return True - def read_txt_file(self, file_path): try: with open(file_path, 'r', errors='replace') as fd: @@ -69,53 +49,3 @@ def write_txt_file(self, file_path, value): except IOError: return False return True - - def ipmi_raw(self, netfn, cmd): - status = True - result = "" - try: - cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) - p = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - raw_data, err = p.communicate() - if err == '': - result = raw_data.strip() - else: - status = False - except Exception: - status = False - return status, result - - def ipmi_fru_id(self, id, key=None): - status = True - result = "" - try: - cmd = "ipmitool fru print {}".format(str( - id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) - - p = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - raw_data, err = p.communicate() - if err == '': - result = raw_data.strip() - else: - status = False - except Exception: - status = False - return status, result - - def ipmi_set_ss_thres(self, id, threshold_key, value): - status = True - result = "" - try: - cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) - p = subprocess.Popen( - cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - raw_data, err = p.communicate() - if err == '': - result = raw_data.strip() - else: - status = False - except Exception: - status = False - return status, result From 0ec63c4339872ada9d210484e13a82cbfc3aaa95 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 8 Feb 2023 16:20:43 +0800 Subject: [PATCH 03/21] Add pcie.yaml file --- .../x86_64-accton_as5835_54x-r0/pcie.yaml | 135 ++++++++++++++++++ .../pddf/pddf-device.json | 4 +- 2 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml b/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml new file mode 100644 index 000000000000..ecfe957bcabe --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml @@ -0,0 +1,135 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 1980 + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent' +- bus: '00' + dev: '04' + fn: '0' + id: 19a1 + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers' +- bus: '00' + dev: '05' + fn: '0' + id: 19a2 + name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 Series Root Complex Event Collector' +- bus: '00' + dev: '06' + fn: '0' + id: 19a3 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT Root Port' +- bus: '00' + dev: 09 + fn: '0' + id: 0x19a4 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #0 ' +- bus: '00' + dev: 'b' + fn: '0' + id: 19a6 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #2' +- bus: '00' + dev: 'e' + fn: '0' + id: 19a8 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #4 ' +- bus: '00' + dev: '10' + fn: '0' + id: 19aa + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #6' +- bus: '00' + dev: '12' + fn: '0' + id: 19ac + name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller' +- bus: '00' + dev: '013' + fn: '0' + id: 19b2 + name: 'SATA controller: Intel Corporation Atom Processor C3000 Series SATA Controller 0' +- bus: '00' + dev: '15' + fn: '0' + id: 19d0 + name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI Controller' +- bus: '00' + dev: '16' + fn: '0' + id: 19d1 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN Root Port #0' +- bus: '00' + dev: '17' + fn: '0' + id: 19d2 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN Root Port #1' +- bus: '00' + dev: '18' + fn: '0' + id: 19d3 + name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME HECI 1' +- bus: '00' + dev: '1a' + fn: '0' + id: 19d8 + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' +- bus: '00' + dev: '1a' + fn: '1' + id: 19d8 + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' +- bus: '00' + dev: '1a' + fn: '2' + id: 19d8 + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' +- bus: '00' + dev: '1f' + fn: '0' + id: 19dc + name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI' +- bus: '00' + dev: '1f' + fn: '1' + id: 19dd + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Primary to Side Band (P2SB) Bridge' +- bus: '00' + dev: '1f' + fn: '2' + id: 19de + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management Controller' +- bus: '00' + dev: '1f' + fn: '4' + id: 19df + name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller' +- bus: '00' + dev: '1f' + fn: '5' + id: 0x19e0 + name: 'Serial bus controller [0c80]: Intel Corporation Atom Processor C3000 Series SPI Controller' +- bus: '01' + dev: '00' + fn: '0' + id: 19e2 + name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology' +- bus: '02' + dev: '00' + fn: '0' + id: b771 + name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b771' +- bus: '05' + dev: '00' + fn: '0' + id: 1533 + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection' +- bus: '06' + dev: '00' + fn: '0' + id: 15c2 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 Backplane' +- bus: '08' + dev: '00' + fn: '0' + id: 15e5 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 1GbE' diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index f73222593af0..de5c1799a8ec 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -223,7 +223,7 @@ { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] } }, @@ -623,7 +623,7 @@ "TEMP2" : { "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP2", "device_parent":"MUX4"}, - "dev_attr": { "display_name":"MB_FrontMiddle_temp(0x4C)"}, + "dev_attr": { "display_name":"MB_FrontMiddle_temp(0x4C)"}, "i2c": { "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x4C", "dev_type":"lm75"}, From aba92dc4677b49d8bd21d2a40fa37a1767c87cbb Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Thu, 9 Feb 2023 15:56:34 +0800 Subject: [PATCH 04/21] Add platform.json file --- .../x86_64-accton_as5835_54x-r0/platform.json | 806 ++++++++++++++++++ 1 file changed, 806 insertions(+) create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/platform.json diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json new file mode 100644 index 000000000000..20fc68502053 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -0,0 +1,806 @@ +{ + "chassis": { + "name": "5835-54X", + "components": [ + { + "name": "MB CPLD1" + }, + { + "name": "MB CPLD2" + }, + { + "name": "MB CPLD3" + }, + { + "name": "FAN CPLD" + }, + { + "name": "CPU CPLD" + }, + { + "name": "BIOS" + } + ], + "fans": [ + { + "name": "FAN-1F" + }, + { + "name": "FAN-1R" + }, + { + "name": "FAN-2F" + }, + { + "name": "FAN-2R" + }, + { + "name": "FAN-3F" + }, + { + "name": "FAN-3R" + }, + { + "name": "FAN-4F" + }, + { + "name": "FAN-4R" + }, + { + "name": "FAN-5F" + }, + { + "name": "FAN-5R" + } + ], + "fan_drawers":[ + { + "name": "FanTray1", + "num_fans" : 2, + "fans": [ + { + "name": "FAN-1F" + }, + { + "name": "FAN-1R" + } + ] + }, + { + "name": "FanTray2", + "num_fans" : 2, + "fans": [ + { + "name": "FAN-2F" + }, + { + "name": "FAN-2R" + } + ] + }, + { + "name": "FanTray3", + "num_fans" : 2, + "fans": [ + { + "name": "FAN-3F" + }, + { + "name": "FAN-3R" + } + ] + }, + { + "name": "FanTray4", + "num_fans" : 2, + "fans": [ + { + "name": "FAN-4F" + }, + { + "name": "FAN-4R" + } + ] + }, + { + "name": "FanTray5", + "num_fans" : 2, + "fans": [ + { + "name": "FAN-5F" + }, + { + "name": "FAN-5R" + } + ] + } + ], + "psus": [ + { + "name": "PSU-1", + "fans": [ + { + "name": "PSU-1 FAN-1" + } + ], + "thermals": [ + { + "name": "PSU-1 temp sensor 1", + "controllable": false, + "low-threshold": false, + "high-threshold": false, + "low-crit-threshold": false, + "high-crit-threshold": false + } + ], + "temperature": true, + "temperature_high_threshold": true + }, + { + "name": "PSU-2", + "fans": [ + { + "name": "PSU-2 FAN-1" + } + ], + "thermals": [ + { + "name": "PSU-2 temp sensor 1", + "controllable": false, + "low-threshold": false, + "high-threshold": false, + "low-crit-threshold": false, + "high-crit-threshold": false + } + ], + "temperature": true, + "temperature_high_threshold": true + } + ], + "thermals": [ + { + "name": "CpuBoard_temp(0x4B)", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB_FrontMiddle_temp(0x4C)", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB_RearLeft_temp(0x4A)", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB_RearLeft_temp(0x49)", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "CPU Temp", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet1" + }, + { + "name": "Ethernet2" + }, + { + "name": "Ethernet3" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet5" + }, + { + "name": "Ethernet6" + }, + { + "name": "Ethernet7" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet9" + }, + { + "name": "Ethernet10" + }, + { + "name": "Ethernet11" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet13" + }, + { + "name": "Ethernet14" + }, + { + "name": "Ethernet15" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet17" + }, + { + "name": "Ethernet18" + }, + { + "name": "Ethernet19" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet21" + }, + { + "name": "Ethernet22" + }, + { + "name": "Ethernet23" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet25" + }, + { + "name": "Ethernet26" + }, + { + "name": "Ethernet27" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet29" + }, + { + "name": "Ethernet30" + }, + { + "name": "Ethernet31" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet33" + }, + { + "name": "Ethernet34" + }, + { + "name": "Ethernet35" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet37" + }, + { + "name": "Ethernet38" + }, + { + "name": "Ethernet39" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet41" + }, + { + "name": "Ethernet42" + }, + { + "name": "Ethernet43" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet45" + }, + { + "name": "Ethernet46" + }, + { + "name": "Ethernet47" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet52" + }, + { + "name": "Ethernet56" + }, + { + "name": "Ethernet60" + }, + { + "name": "Ethernet64" + }, + { + "name": "Ethernet68" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1", + "lanes": "1", + "breakout_modes": { + "1x10G[1G]": ["Eth1(Port1)"] + } + }, + + "Ethernet1": { + "index": "2", + "lanes": "2", + "breakout_modes": { + "1x10G[1G]": ["Eth2(Port2)"] + } + }, + + "Ethernet2": { + "index": "3", + "lanes": "3", + "breakout_modes": { + "1x10G[1G]": ["Eth3(Port3)"] + } + }, + + "Ethernet3": { + "index": "4", + "lanes": "4", + "breakout_modes": { + "1x10G[1G]": ["Eth4(Port4)"] + } + }, + + "Ethernet4": { + "index": "5", + "lanes": "5", + "breakout_modes": { + "1x10G[1G]": ["Eth5(Port5)"] + } + }, + + "Ethernet5": { + "index": "6", + "lanes": "6", + "breakout_modes": { + "1x10G[1G]": ["Eth6(Port6)"] + } + }, + + "Ethernet6": { + "index": "7", + "lanes": "7", + "breakout_modes": { + "1x10G[1G]": ["Eth7(Port7)"] + } + }, + + "Ethernet7": { + "index": "8", + "lanes": "8", + "breakout_modes": { + "1x10G[1G]": ["Eth8(Port8)"] + } + }, + + "Ethernet8": { + "index": "9", + "lanes": "9", + "breakout_modes": { + "1x10G[1G]": ["Eth9(Port9)"] + } + }, + + "Ethernet9": { + "index": "10", + "lanes": "10", + "breakout_modes": { + "1x10G[1G]": ["Eth10(Port10)"] + } + }, + + "Ethernet10": { + "index": "11", + "lanes": "11", + "breakout_modes": { + "1x10G[1G]": ["Eth11(Port11)"] + } + }, + + "Ethernet11": { + "index": "12", + "lanes": "12", + "breakout_modes": { + "1x10G[1G]": ["Eth12(Port12)"] + } + }, + + "Ethernet12": { + "index": "13", + "lanes": "13", + "breakout_modes": { + "1x10G[1G]": ["Eth13(Port13)"] + } + }, + + "Ethernet13": { + "index": "14", + "lanes": "14", + "breakout_modes": { + "1x10G[1G]": ["Eth14(Port14)"] + } + }, + + "Ethernet14": { + "index": "15", + "lanes": "15", + "breakout_modes": { + "1x10G[1G]": ["Eth15(Port15)"] + } + }, + + "Ethernet15": { + "index": "16", + "lanes": "16", + "breakout_modes": { + "1x10G[1G]": ["Eth16(Port16)"] + } + }, + + "Ethernet16": { + "index": "17", + "lanes": "17", + "breakout_modes": { + "1x10G[1G]": ["Eth17(Port17)"] + } + }, + + "Ethernet17": { + "index": "18", + "lanes": "18", + "breakout_modes": { + "1x10G[1G]": ["Eth18(Port18)"] + } + }, + + "Ethernet18": { + "index": "19", + "lanes": "19", + "breakout_modes": { + "1x10G[1G]": ["Eth19(Port19)"] + } + }, + + "Ethernet19": { + "index": "20", + "lanes": "20", + "breakout_modes": { + "1x10G[1G]": ["Eth20(Port20)"] + } + }, + + "Ethernet20": { + "index": "21", + "lanes": "21", + "breakout_modes": { + "1x10G[1G]": ["Eth21(Port21)"] + } + }, + + "Ethernet21": { + "index": "22", + "lanes": "22", + "breakout_modes": { + "1x10G[1G]": ["Eth22(Port22)"] + } + }, + + "Ethernet22": { + "index": "23", + "lanes": "23", + "breakout_modes": { + "1x10G[1G]": ["Eth23(Port23)"] + } + }, + + "Ethernet23": { + "index": "24", + "lanes": "24", + "breakout_modes": { + "1x10G[1G]": ["Eth24(Port24)"] + } + }, + + "Ethernet24": { + "index": "25", + "lanes": "53", + "breakout_modes": { + "1x10G[1G]": ["Eth25(Port25)"] + } + }, + + "Ethernet25": { + "index": "26", + "lanes": "54", + "breakout_modes": { + "1x10G[1G]": ["Eth26(Port26)"] + } + }, + + "Ethernet26": { + "index": "27", + "lanes": "55", + "breakout_modes": { + "1x10G[1G]": ["Eth27(Port27)"] + } + }, + + "Ethernet27": { + "index": "28", + "lanes": "56", + "breakout_modes": { + "1x10G[1G]": ["Eth28(Port28)"] + } + }, + + "Ethernet28": { + "index": "29", + "lanes": "57", + "breakout_modes": { + "1x10G[1G]": ["Eth29(Port29)"] + } + }, + + "Ethernet29": { + "index": "30", + "lanes": "58", + "breakout_modes": { + "1x10G[1G]": ["Eth30(Port30)"] + } + }, + + "Ethernet30": { + "index": "31", + "lanes": "59", + "breakout_modes": { + "1x10G[1G]": ["Eth31(Port31)"] + } + }, + + "Ethernet31": { + "index": "32", + "lanes": "60", + "breakout_modes": { + "1x10G[1G]": ["Eth32(Port32)"] + } + }, + + "Ethernet32": { + "index": "33", + "lanes": "61", + "breakout_modes": { + "1x10G[1G]": ["Eth33(Port33)"] + } + }, + + "Ethernet33": { + "index": "34", + "lanes": "62", + "breakout_modes": { + "1x10G[1G]": ["Eth34(Port34)"] + } + }, + + "Ethernet34": { + "index": "35", + "lanes": "63", + "breakout_modes": { + "1x10G[1G]": ["Eth35(Port35)"] + } + }, + + "Ethernet35": { + "index": "36", + "lanes": "64", + "breakout_modes": { + "1x10G[1G]": ["Eth36(Port36)"] + } + }, + + "Ethernet36": { + "index": "37", + "lanes": "65", + "breakout_modes": { + "1x10G[1G]": ["Eth37(Port37)"] + } + }, + + "Ethernet37": { + "index": "38", + "lanes": "66", + "breakout_modes": { + "1x10G[1G]": ["Eth38(Port38)"] + } + }, + + "Ethernet38": { + "index": "39", + "lanes": "67", + "breakout_modes": { + "1x10G[1G]": ["Eth39(Port39)"] + } + }, + + "Ethernet39": { + "index": "40", + "lanes": "68", + "breakout_modes": { + "1x10G[1G]": ["Eth40(Port40)"] + } + }, + + "Ethernet40": { + "index": "41", + "lanes": "69", + "breakout_modes": { + "1x10G[1G]": ["Eth41(Port41)"] + } + }, + + "Ethernet41": { + "index": "42", + "lanes": "70", + "breakout_modes": { + "1x10G[1G]": ["Eth42(Port42)"] + } + }, + + "Ethernet42": { + "index": "43", + "lanes": "71", + "breakout_modes": { + "1x10G[1G]": ["Eth43(Port43)"] + } + }, + + "Ethernet43": { + "index": "44", + "lanes": "72", + "breakout_modes": { + "1x10G[1G]": ["Eth44(Port44)"] + } + }, + + "Ethernet44": { + "index": "45", + "lanes": "73", + "breakout_modes": { + "1x10G[1G]": ["Eth45(Port45)"] + } + }, + + "Ethernet45": { + "index": "46", + "lanes": "74", + "breakout_modes": { + "1x10G[1G]": ["Eth46(Port46)"] + } + }, + + "Ethernet46": { + "index": "47", + "lanes": "75", + "breakout_modes": { + "1x10G[1G]": ["Eth47(Port47)"] + } + }, + + "Ethernet47": { + "index": "48", + "lanes": "76", + "breakout_modes": { + "1x10G[1G]": ["Eth48(Port48)"] + } + }, + + "Ethernet48": { + "index": "49,49,49,49", + "lanes": "37,38,39,40", + "breakout_modes": { + "1x100G[40G]": ["Eth49(Port49)"], + "2x50G": ["Eth49/1(Port49)", "Eth49/2(Port49)"], + "4x25G": ["Eth49/1(Port49)", "Eth49/2(Port49)", "Eth49/3(Port49)", "Eth49/4(Port49)"], + "4x10G": ["Eth49/1(Port49)", "Eth49/2(Port49)", "Eth49/3(Port49)", "Eth49/4(Port49)"] + } + }, + + "Ethernet52": { + "index": "50,50,50,50", + "lanes": "29,30,31,32", + "breakout_modes": { + "1x100G[40G]": ["Eth50(Port50)"] + } + }, + + "Ethernet56": { + "index": "51,51,51,51", + "lanes": "33,34,35,36", + "breakout_modes": { + "1x100G[40G]": ["Eth51(Port51)"] + } + }, + + "Ethernet60": { + "index": "52,52,52,52", + "lanes": "49,50,51,52", + "breakout_modes": { + "1x100G[40G]": ["Eth52(Port52)"], + "2x50G": ["Eth52/1(Port52)", "Eth52/2(Port52)"], + "4x25G": ["Eth52/1(Port52)", "Eth52/2(Port52)", "Eth52/3(Port52)", "Eth52/4(Port52)"], + "4x10G": ["Eth52/1(Port52)", "Eth52/2(Port52)", "Eth52/3(Port52)", "Eth52/4(Port52)"] + } + }, + + "Ethernet64": { + "index": "53,53,53,53", + "lanes": "45,46,47,48", + "breakout_modes": { + "1x100G[40G]": ["Eth53(Port53)"] + } + }, + + "Ethernet68": { + "index": "54,54,54,54", + "lanes": "41,42,43,44", + "breakout_modes": { + "1x100G[40G]": ["Eth54(Port54)"] + } + } + } +} From f2f368f78243e05fe599740a7e9ba11c133e3498 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 10 Feb 2023 15:13:24 +0800 Subject: [PATCH 05/21] Modify CPLD name to more detail --- .../x86_64-accton_as5835_54x-r0/platform.json | 10 +++--- .../as5835-54x/sonic_platform/component.py | 36 ++++++------------- .../as5835-54x/sonic_platform/helper.py | 4 ++- 3 files changed, 18 insertions(+), 32 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json index 20fc68502053..9159f73dc296 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/platform.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -3,19 +3,19 @@ "name": "5835-54X", "components": [ { - "name": "MB CPLD1" + "name": "MB_CPLD1" }, { - "name": "MB CPLD2" + "name": "MB_CPLD2" }, { - "name": "MB CPLD3" + "name": "MB_CPLD3" }, { - "name": "FAN CPLD" + "name": "FAN_CPLD" }, { - "name": "CPU CPLD" + "name": "CPU_CPLD" }, { "name": "BIOS" diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py index 9656d717bfb4..8f0d8a6feb28 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py @@ -12,20 +12,20 @@ raise ImportError(str(e) + "- required module not found") CPLD_ADDR_MAPPING = { - "MB CPLD1": ['3', '0x60'], - "MB CPLD2": ['3', '0x61'], - "MB CPLD3": ['3', '0x62'], - "FAN CPLD": ['3', '0x63'], - "CPU CPLD": ['1', '0x65'] + "MB_CPLD1": ['3', '0x60'], + "MB_CPLD2": ['3', '0x61'], + "MB_CPLD3": ['3', '0x62'], + "FAN_CPLD": ['3', '0x63'], + "CPU_CPLD": ['1', '0x65'] } SYSFS_PATH = "/sys/bus/i2c/devices/" BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" COMPONENT_LIST= [ - ("MB CPLD1", "Mainboard CPLD 1"), - ("MB CPLD2", "Mainboard CPLD 2"), - ("MB CPLD3", "Mainboard CPLD 3"), - ("FAN CPLD", "Fan board CPLD"), - ("CPU CPLD", "CPU CPLD"), + ("MB_CPLD1", "Mainboard CPLD(0x60)"), + ("MB_CPLD2", "Mainboard CPLD(0x61)"), + ("MB_CPLD3", "Mainboard CPLD(0x62"), + ("FAN_CPLD", "Fan board CPLD(0x63)"), + ("CPU_CPLD", "CPU CPLD(0x65)"), ("BIOS", "Basic Input/Output System") ] @@ -39,22 +39,6 @@ def __init__(self, component_index=0): self.index = component_index self.name = self.get_name() - def __run_command(self, command): - # Run bash command and print output to stdout - try: - process = subprocess.Popen( - shlex.split(command), stdout=subprocess.PIPE) - while True: - output = process.stdout.readline() - if output == '' and process.poll() is not None: - break - rc = process.poll() - if rc != 0: - return False - except Exception: - return False - return True - def __get_bios_version(self): # Retrieves the BIOS firmware version try: diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py index 5162803fb51f..09c2af7a8756 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py @@ -37,7 +37,9 @@ def read_txt_file(self, file_path): try: with open(file_path, 'r', errors='replace') as fd: data = fd.read() - return data.strip() + ret = data.strip() + if len(ret) > 0: + return ret except IOError: pass return None From baf599b8ddc7d9af2a24c7f295ed104b60e0f280 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 10 Feb 2023 15:22:42 +0800 Subject: [PATCH 06/21] Fix error cpld name --- .../as5835-54x/sonic_platform/component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py index 8f0d8a6feb28..d0932600c1ba 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/component.py @@ -23,7 +23,7 @@ COMPONENT_LIST= [ ("MB_CPLD1", "Mainboard CPLD(0x60)"), ("MB_CPLD2", "Mainboard CPLD(0x61)"), - ("MB_CPLD3", "Mainboard CPLD(0x62"), + ("MB_CPLD3", "Mainboard CPLD(0x62)"), ("FAN_CPLD", "Fan board CPLD(0x63)"), ("CPU_CPLD", "CPU CPLD(0x65)"), ("BIOS", "Basic Input/Output System") From 53796a4fd9ff069640fb81a1d067151e8c95c00c Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Tue, 14 Feb 2023 17:50:25 +0800 Subject: [PATCH 07/21] Modify sys_led define in pddf-device.json --- .../pddf/pddf-device.json | 14 +++++++++---- .../as5835-54x/sonic_platform/fan.py | 20 +++++++++++++++++++ .../as5835-54x/sonic_platform/fan_drawer.py | 17 ++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index de5c1799a8ec..9bbdeffd9b2b 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -171,8 +171,11 @@ { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, { "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_v_out_min", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xa4", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_v_out_max", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xa5", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out_max", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xa7", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] @@ -184,7 +187,7 @@ "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU1-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU1"}, "i2c": { - "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, + "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, "attr_list": [ { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } @@ -220,8 +223,11 @@ { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_v_out_min", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xa4", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_v_out_max", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xa5", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out_max", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xa7", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] @@ -233,7 +239,7 @@ "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU2-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU2"}, "i2c": { - "topo_info":{ "parent_bus":"0xc", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, + "topo_info":{ "parent_bus":"0xc", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, "attr_list": [ { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } @@ -2792,7 +2798,7 @@ "LOC_LED": { "dev_info": { "device_type":"LED", "device_name":"LOC_LED"}, - "dev_attr": { "index":"0"}, + "dev_attr": { "index":"0", "flag": "rw"}, "i2c" : { "attr_list": @@ -2806,7 +2812,7 @@ "DIAG_LED": { "dev_info": { "device_type":"LED", "device_name":"DIAG_LED"}, - "dev_attr": { "index":"0"}, + "dev_attr": { "index":"0", "flag": "rw"}, "i2c" : { "attr_list": diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py index 448f483c9372..585652d87dbd 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py @@ -30,3 +30,23 @@ def get_name(self): else "PSU-{} FAN-{}".format(self.fans_psu_index, self.fan_index) return fan_name + + + + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return "N/A" diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py index 624ece4f3f99..e4e37f962067 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan_drawer.py @@ -22,3 +22,20 @@ def get_name(self): string: The name of the device """ return "FanTray{}".format(self.fantray_index) + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._fan_list[0].get_model() + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return self._fan_list[0].get_serial() + From a533c35bfc5f4bdf41852170865f34cd30076cdc Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 17 Feb 2023 14:40:43 +0800 Subject: [PATCH 08/21] Modify devices_to_ignore for psu_fan speed --- .../system_health_monitoring_config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json index 596dff2d55bf..68363f35e3cb 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -4,8 +4,8 @@ "asic", "psu.voltage", "psu.temperature", - "PSU1_FAN1.speed", - "PSU2_FAN1.speed" + "PSU-1 FAN-1.speed", + "PSU-2 FAN-1.speed" ], "user_defined_checkers": [], "polling_interval": 60, From 577556e4ee1fd650983d5e1537d1fb3a20ffb4bd Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Tue, 21 Feb 2023 15:03:28 +0800 Subject: [PATCH 09/21] Fix system_health_monitoring_config led_color string --- .../pddf/pddf-device.json | 17 ++++++++++++++++- .../x86_64-accton_as5835_54x-r0/platform.json | 2 +- .../system_health_monitoring_config.json | 10 ++++------ .../as5835-54x/sonic_platform/chassis.py | 9 +++++++++ .../as5835-54x/sonic_platform/fan.py | 13 +++++++++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index 9bbdeffd9b2b..de6b082f9fed 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -5,7 +5,7 @@ "num_fantrays":5, "num_fans_pertray":2, "num_ports":54, - "num_temps": 4, + "num_temps": 5, "pddf_dev_types": { "description":"AS5835-54X - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", @@ -671,6 +671,21 @@ ] } }, + "TEMP5" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP5"}, + "dev_attr": { "display_name":"coretemp-isa-0000"}, + "i2c": + { + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon0"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp1_crit"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_input"} + ] + } + }, "SYSSTATUS": { diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json index 9159f73dc296..9345ed8b8ae3 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/platform.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -191,7 +191,7 @@ "high-crit-threshold": true }, { - "name": "CPU Temp", + "name": "coretemp-isa-0000", "controllable": true, "low-threshold": false, "high-threshold": true, diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json index 68363f35e3cb..073403bdf3d2 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -3,15 +3,13 @@ "devices_to_ignore": [ "asic", "psu.voltage", - "psu.temperature", - "PSU-1 FAN-1.speed", - "PSU-2 FAN-1.speed" + "psu.temperature" ], "user_defined_checkers": [], "polling_interval": 60, "led_color": { - "fault": "STATUS_LED_COLOR_AMBER", - "normal": "STATUS_LED_COLOR_GREEN", - "booting": "STATUS_LED_COLOR_GREEN" + "fault": "amber", + "normal": "green", + "booting": "green" } } diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py index dc564a980e95..4624cb9fb117 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py @@ -117,3 +117,12 @@ def get_port_or_cage_type(self, port): else: return SfpBase.SFP_PORT_TYPE_BIT_QSFP | SfpBase.SFP_PORT_TYPE_BIT_QSFP_PLUS | SfpBase.SFP_PORT_TYPE_BIT_QSFP28 + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return 'N/A' \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py index 585652d87dbd..7aa6ebb3878e 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/fan.py @@ -50,3 +50,16 @@ def get_serial(self): string: Serial number of device """ return "N/A" + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if self.is_psu_fan: + return super().get_speed() + else: + return super().get_target_speed() From 04fb343085a4dc253249b3c8e5e438aac0981068 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 22 Feb 2023 18:11:35 +0800 Subject: [PATCH 10/21] Add set/get temp threshold api --- .../pddf/pddf-device.json | 2 +- .../x86_64-accton_as5835_54x-r0/platform.json | 2 +- .../x86_64-accton_as5835_54x-r0/sensors.conf | 2 +- .../system_health_monitoring_config.json | 2 +- .../as5835-54x/sonic_platform/chassis.py | 2 +- .../as5835-54x/sonic_platform/eeprom.py | 76 +---- .../as5835-54x/sonic_platform/helper.py | 267 +++++++++++++++++- .../as5835-54x/sonic_platform/thermal.py | 200 ++++++++++++- 8 files changed, 465 insertions(+), 88 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index de6b082f9fed..af20b7aebce2 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -614,7 +614,7 @@ "TEMP1" : { "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX4"}, - "dev_attr": { "display_name":"CpuBoard_temp(0x4B)"}, + "dev_attr": { "display_name":"CB_temp(0x4B)"}, "i2c": { "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x4B", "dev_type":"lm75"}, diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json index 9345ed8b8ae3..4319aa8fe5f0 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/platform.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -159,7 +159,7 @@ ], "thermals": [ { - "name": "CpuBoard_temp(0x4B)", + "name": "CB_temp(0x4B)", "controllable": true, "low-threshold": false, "high-threshold": true, diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf index c220d28f59e6..4d132ef2a919 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf +++ b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf @@ -48,4 +48,4 @@ chip "lm75-i2c-*-4c" label temp1 "MB_FrontMiddle_temp" chip "lm75-i2c-*-4b" - label temp1 "CpuBoard_temp" + label temp1 "CB_temp" diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json index 073403bdf3d2..930308045951 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -10,6 +10,6 @@ "led_color": { "fault": "amber", "normal": "green", - "booting": "green" + "booting": "off" } } diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py index 4624cb9fb117..9bd98ed18c06 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/chassis.py @@ -112,7 +112,7 @@ def set_status_led(self, color): def get_port_or_cage_type(self, port): from sonic_platform_base.sfp_base import SfpBase - if port in range(1, 48): + if port in range(1, 49): return SfpBase.SFP_PORT_TYPE_BIT_SFP | SfpBase.SFP_PORT_TYPE_BIT_SFP_PLUS else: return SfpBase.SFP_PORT_TYPE_BIT_QSFP | SfpBase.SFP_PORT_TYPE_BIT_QSFP_PLUS | SfpBase.SFP_PORT_TYPE_BIT_QSFP28 diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py index ca9b5ce062d1..a87ecc9f6feb 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/eeprom.py @@ -2,87 +2,13 @@ try: from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom - import os except ImportError as e: raise ImportError(str(e) + "- required module not found") -CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' -CACHE_FILE = 'syseeprom_cache' class Eeprom(PddfEeprom): - _TLV_INFO_MAX_LEN = 256 - pddf_obj = {} - plugin_data = {} def __init__(self, pddf_data=None, pddf_plugin_data=None): - #PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) - if not pddf_data or not pddf_plugin_data: - raise ValueError('PDDF JSON data error') - - self.pddf_obj = pddf_data - self.plugin_data = pddf_plugin_data - - # system EEPROM always has device name EEPROM1 - self.eeprom_path = self.pddf_obj.get_path("EEPROM1", "eeprom") - if self.eeprom_path is None: - return - - super(PddfEeprom, self).__init__(self.eeprom_path, 0, '', True) - self.eeprom_tlv_dict = dict() - - # Create the cache directory if not created - if not os.path.exists(CACHE_ROOT): - try: - os.makedirs(CACHE_ROOT) - except Exception as e: - print("Error in creating Eeprom cache directory - {}".format(str(e))) - - # Assign cache_name in eeprom_base.py - try: - self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) - except: - pass - - try: - self.eeprom_data = self.read_eeprom() - except Exception as e: - self.eeprom_data = "N/A" - raise RuntimeError("Eeprom is not Programmed - Error: {}".format(str(e))) - else: - eeprom = self.eeprom_data - - try: - self.update_cache(eeprom) - except: - pass - - if not self.is_valid_tlvinfo_header(eeprom): - return - - total_length = ((eeprom[9]) << 8) | (eeprom[10]) - tlv_index = self._TLV_INFO_HDR_LEN - tlv_end = self._TLV_INFO_HDR_LEN + total_length - - while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: - if not self.is_valid_tlv(eeprom[tlv_index:]): - break - - tlv = eeprom[tlv_index:tlv_index + 2 - + (eeprom[tlv_index + 1])] - code = "0x%02X" % ((tlv[0])) - - if (tlv[0]) == self._TLV_CODE_VENDOR_EXT: - value = str(((tlv[2]) << 24) | ((tlv[3]) << 16) | - ((tlv[4]) << 8) | (tlv[5])) - value += str(tlv[6:6 + (tlv[1])]) - else: - name, value = self.decoder(None, tlv) - - self.eeprom_tlv_dict[code] = value - if (eeprom[tlv_index]) == self._TLV_CODE_CRC_32: - break - - tlv_index += (eeprom[tlv_index+1]) + 2 - + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py index 09c2af7a8756..24c873934066 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/helper.py @@ -1,8 +1,14 @@ import os import struct -import subprocess +import json +import fcntl from mmap import * from sonic_py_common import device_info +from sonic_py_common import logger +from threading import Lock +from typing import cast +from sonic_py_common.general import getstatusoutput_noshell_pipe +from sonic_py_common.general import getstatusoutput_noshell HOST_CHK_CMD = ["docker"] EMPTY_STRING = "" @@ -51,3 +57,262 @@ def write_txt_file(self, file_path, value): except IOError: return False return True + +class FileLock: + """ + Due to pmon docker not installing the py-filelock, this class + implements a simple file lock feature. + Ref: https://github.com/tox-dev/py-filelock/blob/main/src/filelock/ + """ + + def __init__(self, lock_file): + self._lock_file = lock_file + self._thread_lock = Lock() + self.is_locked = False + + def acquire(self): + with self._thread_lock: + if self.is_locked: + return + + fd = os.open(self._lock_file, flags=(os.O_RDWR | os.O_CREAT | os.O_TRUNC)) + fcntl.flock(fd, fcntl.LOCK_EX) + self._lock_file_fd = fd + self.is_locked = True + + def release(self): + with self._thread_lock: + if self.is_locked: + fd = cast(int, self._lock_file_fd) + self._lock_file_fd = None + fcntl.flock(fd, fcntl.LOCK_UN) + os.close(fd) + self.is_locked = False + + def __enter__(self): + self.acquire() + return self + + def __exit__(self, exc_type, exc_val, traceback): + self.release() + + def __del__(self): + self.release() + + +DEVICE_THRESHOLD_JSON_PATH = "/tmp/device_threshold.json" + +class DeviceThreshold: + HIGH_THRESHOLD = 'high_threshold' + LOW_THRESHOLD = 'low_threshold' + HIGH_CRIT_THRESHOLD = 'high_critical_threshold' + LOW_CRIT_THRESHOLD = 'low_critical_threshold' + NOT_AVAILABLE = 'N/A' + + def __init__(self, th_name = NOT_AVAILABLE): + self.flock = FileLock("{}.lock".format(DEVICE_THRESHOLD_JSON_PATH)) + self.name = th_name + self.__log = logger.Logger(log_identifier="DeviceThreshold") + + self.__db_data = {} + self.__db_mtime = 0 + + def __reload_db(self): + try: + db_data = {} + with self.flock: + with open(DEVICE_THRESHOLD_JSON_PATH, "r") as db_file: + db_data = json.load(db_file) + except Exception as e: + self.__log.log_warning('{}'.format(str(e))) + return None + + return db_data + + def __get_data(self, field): + """ + Retrieves data frome JSON file by field + + Args : + field: String + + Returns: + A string if getting is successfully, 'N/A' if not + """ + if os.path.exists(DEVICE_THRESHOLD_JSON_PATH): + new_mtime = os.path.getmtime(DEVICE_THRESHOLD_JSON_PATH) + if new_mtime != self.__db_mtime: + new_data = self.__reload_db() + if new_data is not None: + self.__db_data = new_data + self.__db_mtime = new_mtime + + if self.name not in self.__db_data.keys(): + return self.NOT_AVAILABLE + + if field not in self.__db_data[self.name].keys(): + return self.NOT_AVAILABLE + + return self.__db_data[self.name][field] + + def __set_data(self, field, new_val): + """ + Set data to JSON file by field + + Args : + field: String + new_val: String + + Returns: + A boolean, True if setting is set successfully, False if not + """ + if self.name not in self.__db_data.keys(): + self.__db_data[self.name] = {} + + old_val = self.__db_data[self.name].get(field, None) + if old_val is not None and old_val == new_val: + return True + + self.__db_data[self.name][field] = new_val + + try: + with self.flock: + db_data = {} + mode = "r+" if os.path.exists(DEVICE_THRESHOLD_JSON_PATH) else "w+" + with open(DEVICE_THRESHOLD_JSON_PATH, mode) as db_file: + if mode == "r+": + db_data = json.load(db_file) + + if self.name not in db_data.keys(): + db_data[self.name] = {} + + db_data[self.name][field] = new_val + + if mode == "r+": + db_file.seek(0) + # erase old data + db_file.truncate(0) + # write all data + json.dump(db_data, db_file, indent=4) + self.__db_mtime = os.path.getmtime(DEVICE_THRESHOLD_JSON_PATH) + except Exception as e: + self.__log.log_error('{}'.format(str(e))) + return False + + return True + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature from JSON file. + + Returns: + string : the high threshold temperature of thermal, + e.g. "30.125" + """ + return self.__get_data(self.HIGH_THRESHOLD) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A string of temperature, e.g. "30.125" + Returns: + A boolean, True if threshold is set successfully, False if not + """ + if isinstance(temperature, str) is not True: + raise TypeError('The parameter requires string type.') + + try: + if temperature != self.NOT_AVAILABLE: + float(temperature) + except ValueError: + raise ValueError('The parameter requires a float string. ex:\"30.1\"') + + return self.__set_data(self.HIGH_THRESHOLD, temperature) + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature from JSON file. + + Returns: + string : the low threshold temperature of thermal, + e.g. "30.125" + """ + return self.__get_data(self.LOW_THRESHOLD) + + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + Args : + temperature: A string of temperature, e.g. "30.125" + Returns: + A boolean, True if threshold is set successfully, False if not + """ + if isinstance(temperature, str) is not True: + raise TypeError('The parameter requires string type.') + + try: + if temperature != self.NOT_AVAILABLE: + float(temperature) + except ValueError: + raise ValueError('The parameter requires a float string. ex:\"30.1\"') + + return self.__set_data(self.LOW_THRESHOLD, temperature) + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature from JSON file. + + Returns: + string : the high critical threshold temperature of thermal, + e.g. "30.125" + """ + return self.__get_data(self.HIGH_CRIT_THRESHOLD) + + def set_high_critical_threshold(self, temperature): + """ + Sets the high critical threshold temperature of thermal + Args : + temperature: A string of temperature, e.g. "30.125" + Returns: + A boolean, True if threshold is set successfully, False if not + """ + if isinstance(temperature, str) is not True: + raise TypeError('The parameter requires string type.') + + try: + if temperature != self.NOT_AVAILABLE: + float(temperature) + except ValueError: + raise ValueError('The parameter requires a float string. ex:\"30.1\"') + + return self.__set_data(self.HIGH_CRIT_THRESHOLD, temperature) + + def get_low_critical_threshold(self): + """ + Retrieves the low critical threshold temperature from JSON file. + + Returns: + string : the low critical threshold temperature of thermal, + e.g. "30.125" + """ + return self.__get_data(self.LOW_CRIT_THRESHOLD) + + def set_low_critical_threshold(self, temperature): + """ + Sets the low critical threshold temperature of thermal + Args : + temperature: A string of temperature, e.g. "30.125" + Returns: + A boolean, True if threshold is set successfully, False if not + """ + if isinstance(temperature, str) is not True: + raise TypeError('The parameter requires string type.') + + try: + if temperature != self.NOT_AVAILABLE: + float(temperature) + except ValueError: + raise ValueError('The parameter requires a float string. ex:\"30.1\"') + + return self.__set_data(self.LOW_CRIT_THRESHOLD, temperature) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py index 8b7769cece25..3240b3933de9 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py @@ -3,9 +3,60 @@ try: from sonic_platform_pddf_base.pddf_thermal import PddfThermal + from .helper import DeviceThreshold except ImportError as e: raise ImportError(str(e) + "- required module not found") +NOT_AVAILABLE = DeviceThreshold.NOT_AVAILABLE +HIGH_THRESHOLD = DeviceThreshold.HIGH_THRESHOLD +LOW_THRESHOLD = DeviceThreshold.LOW_THRESHOLD +HIGH_CRIT_THRESHOLD = DeviceThreshold.HIGH_CRIT_THRESHOLD +LOW_CRIT_THRESHOLD = DeviceThreshold.LOW_CRIT_THRESHOLD + +DEFAULT_THRESHOLD = { + 'CB_temp(0x4B)' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'MB_FrontMiddle_temp(0x4C)' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'MB_RearLeft_temp(0x49)' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'MB_RearLeft_temp(0x4A)' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'coretemp-isa-0000' : { + HIGH_THRESHOLD : '82.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : '104.0', + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'PSU-1 temp sensor 1' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'PSU-2 temp sensor 1' : { + HIGH_THRESHOLD : '80.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + } +} class Thermal(PddfThermal): """PDDF Platform-Specific Thermal class""" @@ -16,6 +67,11 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal= self.pddf_obj = pddf_data self.thermal_obj_name = "TEMP{}".format(self.thermal_index) self.thermal_obj = self.pddf_obj.data[self.thermal_obj_name] + + # Threshold Configuration + self.__conf = DeviceThreshold(self.get_name()) + # Default threshold. + self.__default_threshold = DEFAULT_THRESHOLD[self.get_name()] # Provide the functions/variables below for which implementation is to be overwritten def get_name(self): @@ -25,18 +81,148 @@ def get_name(self): if 'dev_attr' in self.thermal_obj.keys(): if 'display_name' in self.thermal_obj['dev_attr']: return str(self.thermal_obj['dev_attr']['display_name']) + # In case of errors - #return (self.thermal_obj_name) return "Temp sensor {0}".format(self.thermal_index) - #def get_name(self): - # if self.is_psu_thermal: - # return "PSU-{0} temp sensor 1".format(self.thermals_psu_index) - # else: - # return "Temp sensor {0}".format(self.thermal_index) - def get_status(self): get_temp=self.get_temperature() if get_temp is not None: return True if get_temp else False + + def set_high_threshold(self, temperature): + try: + value = float(temperature) + except Exception: + return False + + # The new value can not be more than the default value. + default_value = self.__default_threshold[HIGH_THRESHOLD] + if default_value != NOT_AVAILABLE: + if value > float(default_value): + return False + + try: + self.__conf.set_high_threshold(str(value)) + except Exception: + return False + + return True + + def get_high_threshold(self): + value = self.__conf.get_high_threshold() + if value != NOT_AVAILABLE: + return float(value) + + default_value = self.__default_threshold[HIGH_THRESHOLD] + if default_value != NOT_AVAILABLE: + return float(default_value) + + raise NotImplementedError + + def set_low_threshold(self, temperature): + try: + value = float(temperature) + except Exception: + return False + + # The new value can not be less than the default value. + default_value = self.__default_threshold[LOW_THRESHOLD] + if default_value != NOT_AVAILABLE: + if value < float(default_value): + return False + + try: + self.__conf.set_low_threshold(str(value)) + except Exception: + return False + + return True + + def get_low_threshold(self): + value = self.__conf.get_low_threshold() + if value != NOT_AVAILABLE: + return float(value) + + default_value = self.__default_threshold[LOW_THRESHOLD] + if default_value != NOT_AVAILABLE: + return float(default_value) + + raise NotImplementedError + + def set_high_critical_threshold(self, temperature): + try: + value = float(temperature) + except Exception: + return False + + # The new value can not be more than the default value. + default_value = self.__default_threshold[HIGH_CRIT_THRESHOLD] + if default_value != NOT_AVAILABLE: + if value > float(default_value): + return False + + try: + self.__conf.set_high_critical_threshold(str(value)) + except Exception: + return False + + return True + + def get_high_critical_threshold(self): + value = self.__conf.get_high_critical_threshold() + if value != NOT_AVAILABLE: + return float(value) + + default_value = self.__default_threshold[HIGH_CRIT_THRESHOLD] + if default_value != NOT_AVAILABLE: + return float(default_value) + + raise NotImplementedError + + def set_low_critical_threshold(self, temperature): + try: + value = float(temperature) + except Exception: + return False + + # The new value can not be less than the default value. + default_value = self.__default_threshold[LOW_CRIT_THRESHOLD] + if default_value != NOT_AVAILABLE: + if value < float(default_value): + return False + + try: + self.__conf.set_low_critical_threshold(str(value)) + except Exception: + return False + + return True + + def get_low_critical_threshold(self): + value = self.__conf.get_low_critical_threshold() + if value != NOT_AVAILABLE: + return float(value) + + default_value = self.__default_threshold[LOW_CRIT_THRESHOLD] + if default_value != NOT_AVAILABLE: + return float(default_value) + + raise NotImplementedError + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' \ No newline at end of file From 03bedcacd8473c48ffcc700a4136a6aa1cc9308a Mon Sep 17 00:00:00 2001 From: michael_shih Date: Thu, 16 Mar 2023 14:42:52 +0800 Subject: [PATCH 11/21] [Edgecore][device][platform] Fixed sonic-mgmt pytest failed items Signed-off-by: michael_shih --- .../x86_64-accton_as5835_54x-r0/platform.json | 5 +++++ .../platform_components.json | 14 ++++++++++++++ .../pmon_daemon_control.json | 2 -- .../system_health_monitoring_config.json | 4 +++- .../as5835-54x/classes/fanutil.py | 18 +----------------- .../as5835-54x/utils/accton_as5835_54x_util.py | 2 ++ 6 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 device/accton/x86_64-accton_as5835_54x-r0/platform_components.json diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json index 4319aa8fe5f0..4bcf15cee11a 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/platform.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -1,6 +1,11 @@ { "chassis": { "name": "5835-54X", + "thermal_manager":false, + "status_led": { + "controllable": true, + "colors": ["green", "red", "off"] + }, "components": [ { "name": "MB_CPLD1" diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform_components.json b/device/accton/x86_64-accton_as5835_54x-r0/platform_components.json new file mode 100644 index 000000000000..16f6f73dd7a1 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform_components.json @@ -0,0 +1,14 @@ +{ + "chassis": { + "5835-54X-O-AC-F": { + "component": { + "MB_CPLD1": { }, + "MB_CPLD2": { }, + "MB_CPLD3": { }, + "FAN_CPLD": { }, + "CPU_CPLD": { }, + "BIOS": { } + } + } + } +} diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json index fb49c2978fcd..94592fa8cebc 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json @@ -1,5 +1,3 @@ { "skip_ledd": true - } - diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json index 930308045951..4ea184946b1a 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -3,7 +3,9 @@ "devices_to_ignore": [ "asic", "psu.voltage", - "psu.temperature" + "psu.temperature", + "PSU1_FAN1.speed", + "PSU2_FAN1.speed" ], "user_defined_checkers": [], "polling_interval": 60, diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py index b8b4820f9e4a..c67b5bb67f7e 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py @@ -42,7 +42,7 @@ class FanUtil(object): FAN_NODE_NUM_OF_MAP = 2 FAN_NODE_FAULT_IDX_OF_MAP = 1 FAN_NODE_DIR_IDX_OF_MAP = 2 - + BASE_VAL_PATH = '/sys/bus/i2c/devices/3-0063/{0}' FAN_DUTY_PATH = '/sys/bus/i2c/devices/3-0063/fan_duty_cycle_percentage' @@ -54,12 +54,7 @@ class FanUtil(object): key2 = fan node index (interger) starting from 1 value = path to fan device file (string) """ _fan_to_device_path_mapping = {} - -#fan1_direction -#fan1_fault -#fan1_present - #(FAN_NUM_2_IDX, FAN_NODE_DUTY_IDX_OF_MAP): 'fan2_duty_cycle_percentage', _fan_to_device_node_mapping = { (FAN_NUM_1_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan1_fault', (FAN_NUM_1_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan1_direction', @@ -174,14 +169,10 @@ def get_fan_to_device_path(self, fan_num, node_num): def get_fan_fault(self, fan_num): return self._get_fan_node_val(fan_num, self.FAN_NODE_FAULT_IDX_OF_MAP) - #def get_fan_speed(self, fan_num): - # return self._get_fan_node_val(fan_num, self.FAN_NODE_SPEED_IDX_OF_MAP) - def get_fan_dir(self, fan_num): return self._get_fan_node_val(fan_num, self.FAN_NODE_DIR_IDX_OF_MAP) def get_fan_duty_cycle(self): - #duty_path = self.FAN_DUTY_PATH try: val_file = open(self.FAN_DUTY_PATH) except IOError as e: @@ -203,9 +194,6 @@ def set_fan_duty_cycle(self, val): fan_file.close() return True - #def get_fanr_fault(self, fan_num): - # return self._get_fan_node_val(fan_num, self.FANR_NODE_FAULT_IDX_OF_MAP) - def get_fanr_speed(self, fan_num): return self._get_fan_node_val(fan_num, self.FANR_NODE_SPEED_IDX_OF_MAP) @@ -218,9 +206,5 @@ def get_fan_status(self, fan_num): logging.debug('GET. FAN fault. fan_num, %d', fan_num) return False - #if self.get_fanr_fault(fan_num) is not None and self.get_fanr_fault(fan_num) > 0: - # logging.debug('GET. FANR fault. fan_num, %d', fan_num) - # return False - return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py index 5292d1ec3b18..af4b7c0c33bf 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py @@ -386,6 +386,8 @@ def do_sonic_platform_clean(): else: print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + return + def do_install(): print("Checking system....") if driver_check() == False: From 0929d57c03fcf935bc5fd08e93eebdb808c6cc45 Mon Sep 17 00:00:00 2001 From: michael_shih Date: Thu, 16 Mar 2023 15:33:28 +0800 Subject: [PATCH 12/21] [Edgecore][device][platform] Update pcie.yaml Signed-off-by: michael_shih --- .../x86_64-accton_as5835_54x-r0/pcie.yaml | 112 +++++++++++------- 1 file changed, 69 insertions(+), 43 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml b/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml index ecfe957bcabe..f9e26c35ff3e 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml +++ b/device/accton/x86_64-accton_as5835_54x-r0/pcie.yaml @@ -1,135 +1,161 @@ - bus: '00' dev: '00' fn: '0' - id: 1980 - name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent' + id: '1980' + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent (rev + 11)' - bus: '00' dev: '04' fn: '0' id: 19a1 - name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers' + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers + (rev 11)' - bus: '00' dev: '05' fn: '0' id: 19a2 - name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 Series Root Complex Event Collector' + name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 + Series Root Complex Event Collector (rev 11)' - bus: '00' dev: '06' fn: '0' id: 19a3 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT Root Port' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT + Root Port (rev 11)' - bus: '00' dev: 09 fn: '0' - id: 0x19a4 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #0 ' + id: 19a4 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #0 (rev 11)' - bus: '00' - dev: 'b' + dev: 0b fn: '0' id: 19a6 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #2' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #2 (rev 11)' - bus: '00' - dev: 'e' + dev: 0e fn: '0' id: 19a8 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #4 ' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #4 (rev 11)' - bus: '00' dev: '10' fn: '0' id: 19aa - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root Port #6' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #6 (rev 11)' - bus: '00' dev: '12' fn: '0' id: 19ac - name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller' + name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller + - Host (rev 11)' - bus: '00' - dev: '013' + dev: '13' fn: '0' id: 19b2 - name: 'SATA controller: Intel Corporation Atom Processor C3000 Series SATA Controller 0' + name: 'SATA controller: Intel Corporation Atom Processor C3000 Series SATA Controller + 0 (rev 11)' - bus: '00' dev: '15' fn: '0' id: 19d0 - name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI Controller' + name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI + Controller (rev 11)' - bus: '00' dev: '16' fn: '0' id: 19d1 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN Root Port #0' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN + Root Port #0 (rev 11)' - bus: '00' dev: '17' fn: '0' id: 19d2 - name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN Root Port #1' + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN + Root Port #1 (rev 11)' - bus: '00' dev: '18' fn: '0' id: 19d3 - name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME HECI 1' + name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME + HECI 1 (rev 11)' - bus: '00' - dev: '1a' + dev: 1a fn: '0' id: 19d8 - name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller + (rev 11)' - bus: '00' - dev: '1a' + dev: 1a fn: '1' id: 19d8 - name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller + (rev 11)' - bus: '00' - dev: '1a' + dev: 1a fn: '2' id: 19d8 - name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller' + name: 'Serial controller: Intel Corporation Atom Processor C3000 Series HSUART Controller + (rev 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '0' id: 19dc - name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI' + name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI (rev + 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '1' id: 19dd - name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Primary to Side Band (P2SB) Bridge' + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Primary + to Side Band (P2SB) Bridge (rev 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '2' id: 19de - name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management Controller' + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management + Controller (rev 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '4' id: 19df - name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller' + name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller (rev + 11)' - bus: '00' - dev: '1f' + dev: 1f fn: '5' - id: 0x19e0 - name: 'Serial bus controller [0c80]: Intel Corporation Atom Processor C3000 Series SPI Controller' + id: 19e0 + name: 'Serial bus controller [0c80]: Intel Corporation Atom Processor C3000 Series + SPI Controller (rev 11)' - bus: '01' dev: '00' fn: '0' id: 19e2 - name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology' + name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology + (rev 11)' - bus: '02' dev: '00' fn: '0' id: b771 - name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b771' + name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b771 (rev 01)' - bus: '05' dev: '00' fn: '0' - id: 1533 - name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' - bus: '06' dev: '00' fn: '0' id: 15c2 - name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 Backplane' -- bus: '08' + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 Backplane + (rev 11)' +- bus: 08 dev: '00' fn: '0' id: 15e5 - name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 1GbE' + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 1GbE (rev + 11)' From 31f3df710a30f23c8469a5d946d9718d4dfafef0 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Thu, 13 Apr 2023 15:55:42 +0800 Subject: [PATCH 13/21] Add get_error_description() support to sfp.py --- .../as5835-54x/sonic_platform/sfp.py | 148 +++++++++++++++++- 1 file changed, 144 insertions(+), 4 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py index d8d6cc5de1a3..b94e5d257cea 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py @@ -14,6 +14,17 @@ class Sfp(PddfSfp): PDDF Platform-Specific Sfp class """ + SFP_TYPE_CODE_LIST = [ + 0x03, # SFP/SFP+/SFP28 + 0x0b # DWDM-SFP/SFP+ + ] + QSFP_TYPE_CODE_LIST = [ + 0x0c, # QSFP + 0x0d, # QSFP+ or later + 0x11, # QSFP28 or later + 0xe1 # QSFP28 EDFA + ] + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) self.index = index + 1 @@ -29,7 +40,7 @@ def get_name(self): Retrieves the name of the device Returns: string: The name of the device - """ + """ sfputil_helper = SfpUtilHelper() sfputil_helper.read_porttab_mappings( self.__get_path_to_port_config_file()) @@ -44,14 +55,143 @@ def get_position_in_parent(self): """Retrieves 1-based relative physical position in parent device.""" return self.port_index + def __validate_eeprom_sfp(self): + checksum_test = 0 + eeprom_raw = self.read_eeprom(0, 96) + if eeprom_raw is None: + return None + + for i in range(0, 63): + checksum_test = (checksum_test + eeprom_raw[i]) & 0xFF + else: + if checksum_test != eeprom_raw[63]: + return False + + checksum_test = 0 + for i in range(64, 95): + checksum_test = (checksum_test + eeprom_raw[i]) & 0xFF + else: + if checksum_test != eeprom_raw[95]: + return False + + api = self.get_xcvr_api() + if api is None: + return False + + if api.is_flat_memory(): + return True + + checksum_test = 0 + eeprom_raw = self.read_eeprom(384, 96) + if eeprom_raw is None: + return None + + for i in range(0, 95): + checksum_test = (checksum_test + eeprom_raw[i]) & 0xFF + else: + if checksum_test != eeprom_raw[95]: + return False + + return True + + def __validate_eeprom_qsfp(self): + checksum_test = 0 + eeprom_raw = self.read_eeprom(128, 96) + if eeprom_raw is None: + return None + + for i in range(0, 63): + checksum_test = (checksum_test + eeprom_raw[i]) & 0xFF + else: + if checksum_test != eeprom_raw[63]: + return False + + checksum_test = 0 + for i in range(64, 95): + checksum_test = (checksum_test + eeprom_raw[i]) & 0xFF + else: + if checksum_test != eeprom_raw[95]: + return False + + api = self.get_xcvr_api() + if api is None: + return False + + if api.is_flat_memory(): + return True + + return True + + def validate_eeprom(self): + id_byte_raw = self.read_eeprom(0, 1) + if id_byte_raw is None: + return None + + id = id_byte_raw[0] + if id in self.QSFP_TYPE_CODE_LIST: + return self.__validate_eeprom_qsfp() + elif id in self.SFP_TYPE_CODE_LIST: + return self.__validate_eeprom_sfp() + else: + return False + + def validate_temperature(self): + temperature = self.get_temperature() + if temperature is None: + return None + + threshold_dict = self.get_transceiver_threshold_info() + if threshold_dict is None: + return None + + if isinstance(temperature, float) is not True: + return True + + if isinstance(threshold_dict['temphighalarm'], float) is not True: + return True + + return threshold_dict['temphighalarm'] > temperature + + def __get_error_description(self): + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + + err_stat = self.SFP_STATUS_BIT_INSERTED + + status = self.validate_eeprom() + if status is not True: + err_stat = (err_stat | self.SFP_ERROR_BIT_BAD_EEPROM) + + status = self.validate_temperature() + if status is not True: + err_stat = (err_stat | self.SFP_ERROR_BIT_HIGH_TEMP) + + if err_stat is self.SFP_STATUS_BIT_INSERTED: + return self.SFP_STATUS_OK + else: + err_desc = '' + cnt = 0 + for key in self.SFP_ERROR_BIT_TO_DESCRIPTION_DICT: + if (err_stat & key) != 0: + if cnt > 0: + err_desc = err_desc + "|" + cnt = cnt + 1 + err_desc = err_desc + self.SFP_ERROR_BIT_TO_DESCRIPTION_DICT[key] + + return err_desc + def get_error_description(self): """ Retrives the error descriptions of the SFP module - Returns: String that represents the current error descriptions of vendor specific errors In case there are multiple errors, they should be joined by '|', like: "Bad EEPROM|Unsupported cable" """ - raise NotImplementedError - + try: + ret = super().get_error_description() + if ret is not None: + return ret + except NotImplementedError: + pass + return self.__get_error_description() From 18c0a730f5bec156ddedc73b8545f3704e847165 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 10 May 2023 17:53:07 +0800 Subject: [PATCH 14/21] Support show cpu all core temp --- .../pddf/pddf-device.json | 70 +++++++++++++++-- .../as5835-54x/sonic_platform/thermal.py | 76 +++++++++++++++++-- 2 files changed, 133 insertions(+), 13 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index af20b7aebce2..973ac4c1196f 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -5,7 +5,7 @@ "num_fantrays":5, "num_fans_pertray":2, "num_ports":54, - "num_temps": 5, + "num_temps": 9, "pddf_dev_types": { "description":"AS5835-54X - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", @@ -55,7 +55,6 @@ [ "pddf_custom_psu" ] - }, "SYSTEM": @@ -162,7 +161,7 @@ "dev_info": { "device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU1"}, "i2c": { - "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, + "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, "attr_list": [ { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, @@ -674,10 +673,10 @@ "TEMP5" : { "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP5"}, - "dev_attr": { "display_name":"coretemp-isa-0000"}, + "dev_attr": { "display_name":"CPU_Package_temp"}, "i2c": { - "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon0"}, + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon1"}, "attr_list": [ { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp1_crit"}, @@ -686,7 +685,66 @@ ] } }, - + "TEMP6" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP6"}, + "dev_attr": { "display_name":"CPU_Core_0_temp"}, + "i2c": + { + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon1"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp4_crit"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp4_max"}, + { "attr_name": "temp1_input", "drv_attr_name":"temp4_input"} + ] + } + }, + "TEMP7" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP7"}, + "dev_attr": { "display_name":"CPU_Core_1_temp"}, + "i2c": + { + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon1"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp8_crit"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp8_max"}, + { "attr_name": "temp1_input", "drv_attr_name":"temp8_input"} + ] + } + }, + "TEMP8" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP8"}, + "dev_attr": { "display_name":"CPU_Core_2_temp"}, + "i2c": + { + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon1"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp10_crit"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp10_max"}, + { "attr_name": "temp1_input", "drv_attr_name":"temp10_input"} + ] + } + }, + "TEMP9" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP9"}, + "dev_attr": { "display_name":"CPU_Core_3_temp"}, + "i2c": + { + "path_info": {"sysfs_base_path": "/sys/class/hwmon/hwmon1"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp14_crit"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp14_max"}, + { "attr_name": "temp1_input", "drv_attr_name":"temp14_input"} + ] + } + }, "SYSSTATUS": { "dev_info":{ "device_type":"SYSSTAT", "device_name":"SYSSTATUS"}, diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py index 3240b3933de9..cdd6c0993e39 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/thermal.py @@ -37,8 +37,32 @@ LOW_THRESHOLD : NOT_AVAILABLE, HIGH_CRIT_THRESHOLD : NOT_AVAILABLE, LOW_CRIT_THRESHOLD : NOT_AVAILABLE - }, - 'coretemp-isa-0000' : { + }, + 'CPU_Package_temp' : { + HIGH_THRESHOLD : '82.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : '104.0', + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'CPU_Core_0_temp' : { + HIGH_THRESHOLD : '82.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : '104.0', + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'CPU_Core_1_temp' : { + HIGH_THRESHOLD : '82.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : '104.0', + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'CPU_Core_2_temp' : { + HIGH_THRESHOLD : '82.0', + LOW_THRESHOLD : NOT_AVAILABLE, + HIGH_CRIT_THRESHOLD : '104.0', + LOW_CRIT_THRESHOLD : NOT_AVAILABLE + }, + 'CPU_Core_3_temp' : { HIGH_THRESHOLD : '82.0', LOW_THRESHOLD : NOT_AVAILABLE, HIGH_CRIT_THRESHOLD : '104.0', @@ -72,6 +96,8 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal= self.__conf = DeviceThreshold(self.get_name()) # Default threshold. self.__default_threshold = DEFAULT_THRESHOLD[self.get_name()] + self.min_temperature = None + self.max_temperature = None # Provide the functions/variables below for which implementation is to be overwritten def get_name(self): @@ -91,6 +117,19 @@ def get_status(self): if get_temp is not None: return True if get_temp else False + def get_temperature(self): + current = super().get_temperature() + + if self.min_temperature is None or \ + current < self.min_temperature: + self.min_temperature = current + + if self.max_temperature is None or \ + current > self.max_temperature: + self.max_temperature = current + + return current + def set_high_threshold(self, temperature): try: value = float(temperature) @@ -118,8 +157,8 @@ def get_high_threshold(self): default_value = self.__default_threshold[HIGH_THRESHOLD] if default_value != NOT_AVAILABLE: return float(default_value) - - raise NotImplementedError + + return super().get_high_threshold() def set_low_threshold(self, temperature): try: @@ -178,8 +217,7 @@ def get_high_critical_threshold(self): default_value = self.__default_threshold[HIGH_CRIT_THRESHOLD] if default_value != NOT_AVAILABLE: return float(default_value) - - raise NotImplementedError + return super().get_high_critical_threshold() def set_low_critical_threshold(self, temperature): try: @@ -225,4 +263,28 @@ def get_serial(self): Returns: string: Serial number of device """ - return 'N/A' \ No newline at end of file + return 'N/A' + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if self.min_temperature is None: + self.get_temperature() + + return self.min_temperature + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if self.max_temperature is None: + self.get_temperature() + + return self.max_temperature From dc76cccf4fe300dcf6bbb791721ee381131a4d67 Mon Sep 17 00:00:00 2001 From: roger530-ho Date: Wed, 19 Jul 2023 07:56:57 +0000 Subject: [PATCH 15/21] [Edgecore][device][platform] Fix pytest issue --- .../x86_64-accton_as5835_54x-r0/platform.json | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/platform.json b/device/accton/x86_64-accton_as5835_54x-r0/platform.json index 4bcf15cee11a..c69ab5538191 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/platform.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/platform.json @@ -4,7 +4,7 @@ "thermal_manager":false, "status_led": { "controllable": true, - "colors": ["green", "red", "off"] + "colors": ["green", "amber", "off"] }, "components": [ { @@ -169,7 +169,7 @@ "low-threshold": false, "high-threshold": true, "low-crit-threshold": false, - "high-crit-threshold": true + "high-crit-threshold": false }, { "name": "MB_FrontMiddle_temp(0x4C)", @@ -177,7 +177,7 @@ "low-threshold": false, "high-threshold": true, "low-crit-threshold": false, - "high-crit-threshold": true + "high-crit-threshold": false }, { "name": "MB_RearLeft_temp(0x4A)", @@ -185,7 +185,7 @@ "low-threshold": false, "high-threshold": true, "low-crit-threshold": false, - "high-crit-threshold": true + "high-crit-threshold": false }, { "name": "MB_RearLeft_temp(0x49)", @@ -193,10 +193,42 @@ "low-threshold": false, "high-threshold": true, "low-crit-threshold": false, + "high-crit-threshold": false + }, + { + "name": "CPU_Package_temp", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "CPU_Core_0_temp", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "CPU_Core_1_temp", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "CPU_Core_2_temp", + "controllable": true, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, "high-crit-threshold": true }, { - "name": "coretemp-isa-0000", + "name": "CPU_Core_3_temp", "controllable": true, "low-threshold": false, "high-threshold": true, From 957882c0733c9a8b5a47c45eec66875fe7737f6d Mon Sep 17 00:00:00 2001 From: roger530-ho Date: Mon, 14 Aug 2023 08:47:10 +0000 Subject: [PATCH 16/21] [Edgecore][AS5835-54X] Read the data when the PSU is in the power-good state. --- .../as5835-54x/sonic_platform/psu.py | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py index 48cdbab12132..a05923cc836b 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/psu.py @@ -63,3 +63,68 @@ def get_type(self): A string, the type of PSU (AC/DC) """ return "AC" + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = super().get_model() + if model and model.strip() == "": + return None + + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = super().get_serial() + if serial and serial.strip() == "": + return None + + return serial + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + if self.get_status() is not True: + return 0.0 + + return super().get_voltage() + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, electric current in amperes, + e.g. 15.4 + """ + if self.get_status() is not True: + return 0.0 + + return super().get_current() + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + if self.get_status() is not True: + return 0.0 + + return super().get_power() From 233b63fc4a52b187b831b0164fad9f8762f2b64b Mon Sep 17 00:00:00 2001 From: roger530_ho Date: Tue, 16 Jul 2024 15:20:21 +0800 Subject: [PATCH 17/21] Support fan direction of DC PSU --- .../pddf/pddf-device.json | 8 +- .../as5835-54x/modules/pddf_custom_psu.c | 157 ++++++++++++++++++ 2 files changed, 161 insertions(+), 4 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index 973ac4c1196f..c1a60aca4337 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -165,7 +165,6 @@ "attr_list": [ { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, @@ -189,7 +188,8 @@ "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, "attr_list": [ - { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" }, + { "attr_name":"psu_model_name", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x20", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"12" } ] } }, @@ -217,7 +217,6 @@ "attr_list": [ { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, @@ -241,7 +240,8 @@ "topo_info":{ "parent_bus":"0xc", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, "attr_list": [ - { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" }, + { "attr_name":"psu_model_name", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x20", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"12" } ] } }, diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c index 1591267b0127..9cc71e59ffa8 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/pddf_custom_psu.c @@ -9,10 +9,31 @@ #include #include #include +#include "pddf_client_defs.h" #include "pddf_psu_defs.h" +#include "pddf_psu_driver.h" +#include "pddf_psu_api.h" ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf); extern PSU_SYSFS_ATTR_DATA access_psu_v_out; +int pddf_post_get_custom_psu_model_name(void *i2c_client, PSU_DATA_ATTR *adata, void *data); +extern PSU_SYSFS_ATTR_DATA access_psu_model_name; +int pddf_post_get_custom_psu_fan_dir(void *i2c_client, PSU_DATA_ATTR *adata, void *data); +extern PSU_SYSFS_ATTR_DATA access_psu_fan_dir; +int pddf_custom_psu_post_probe(struct i2c_client *client, const struct i2c_device_id *dev_id); +int pddf_custom_psu_post_remove(struct i2c_client *client); +extern struct pddf_ops_t pddf_psu_ops; + +const char FAN_DIR_F2B[] = "F2B\0"; +const char FAN_DIR_B2F[] = "B2F\0"; + +static LIST_HEAD(psu_eeprom_client_list); +static struct mutex list_lock; + +struct psu_eeprom_client_node { + struct i2c_client *client; + struct list_head list; +}; static int two_complement_to_int(u16 data, u8 valid_bit, int mask) { @@ -95,11 +116,147 @@ ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute * } +int pddf_post_get_custom_psu_model_name(void *i2c_client, PSU_DATA_ATTR *adata, void *data) +{ + struct psu_attr_info *sysfs_attr_info = (struct psu_attr_info *)data; + + if (strlen(sysfs_attr_info->val.strval) > 8) { + sysfs_attr_info->val.strval[8] = '-'; + } + + return 0; +} + +/* + * Get the PSU EEPROM I2C client with the same bus number. + */ +static struct i2c_client *find_psu_eeprom_client(struct i2c_client *pmbus_client) +{ + struct list_head *list_node = NULL; + struct psu_eeprom_client_node *psu_eeprom_node = NULL; + struct i2c_client *eeprom_client = NULL; + + mutex_lock(&list_lock); + list_for_each(list_node, &psu_eeprom_client_list) { + psu_eeprom_node = list_entry(list_node, struct psu_eeprom_client_node, list); + /* Check if the bus adapter is the same or not. */ + if (psu_eeprom_node->client->adapter == pmbus_client->adapter) { + eeprom_client = psu_eeprom_node->client; + break; + } + } + mutex_unlock(&list_lock); + + return eeprom_client; +} + +int pddf_post_get_custom_psu_fan_dir(void *i2c_client, PSU_DATA_ATTR *adata, void *data) +{ + int i; + struct i2c_client *client = (struct i2c_client *)i2c_client; + struct psu_attr_info *psu_fan_dir_attr_info = (struct psu_attr_info *)data; + struct psu_data *psu_eeprom_client_data = NULL; + struct psu_attr_info *psu_eeprom_model_name = NULL; + struct i2c_client *psu_eeprom_client = NULL; + + psu_eeprom_client = find_psu_eeprom_client(client); + if (!psu_eeprom_client) { + return 0; + } + + /* + * Get the model name from the PSU EEPROM I2C client. + */ + psu_eeprom_client_data = i2c_get_clientdata(psu_eeprom_client); + if (!psu_eeprom_client_data) { + return 0; + } + for (i = 0; i < psu_eeprom_client_data->num_attr; i++) { + if (strcmp(psu_eeprom_client_data->attr_info[i].name, "psu_model_name") == 0) { + psu_eeprom_model_name = &psu_eeprom_client_data->attr_info[i]; + break; + } + } + if (!psu_eeprom_model_name) { + return 0; + } + + /* + * Compare the model name, then replace the content of psu_fan_dir. + */ + if (strcmp(psu_eeprom_model_name->val.strval, "YM-2401H-CR") == 0) { + strscpy(psu_fan_dir_attr_info->val.strval, + FAN_DIR_F2B, + sizeof(psu_fan_dir_attr_info->val.strval)); + } else if (strcmp(psu_eeprom_model_name->val.strval, "YM-2401H-DR") == 0) { + strscpy(psu_fan_dir_attr_info->val.strval, + FAN_DIR_B2F, + sizeof(psu_fan_dir_attr_info->val.strval)); + } + + return 0; +} + +int pddf_custom_psu_post_probe(struct i2c_client *client, const struct i2c_device_id *dev_id) +{ + struct psu_eeprom_client_node *psu_eeprom_node; + + if (strcmp(dev_id->name, "psu_eeprom") != 0) { + return 0; + } + + psu_eeprom_node = kzalloc(sizeof(struct psu_eeprom_client_node), GFP_KERNEL); + if (!psu_eeprom_node) { + dev_dbg(&client->dev, "Can't allocate psu_eeprom_client_node (0x%x)\n", client->addr); + return -ENOMEM; + } + + psu_eeprom_node->client = client; + + mutex_lock(&list_lock); + list_add(&psu_eeprom_node->list, &psu_eeprom_client_list); + mutex_unlock(&list_lock); + + return 0; +} + +int pddf_custom_psu_post_remove(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct psu_eeprom_client_node *psu_eeprom_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + + list_for_each(list_node, &psu_eeprom_client_list) { + psu_eeprom_node = list_entry(list_node, struct psu_eeprom_client_node, list); + + if (psu_eeprom_node->client == client) { + list_del_init(&psu_eeprom_node->list); + found = 1; + break; + } + } + + if (found) { + kfree(psu_eeprom_node); + } + + mutex_unlock(&list_lock); + + return 0; +} + static int __init pddf_custom_psu_init(void) { + mutex_init(&list_lock); access_psu_v_out.show = pddf_show_custom_psu_v_out; access_psu_v_out.do_get = NULL; + access_psu_model_name.post_get = pddf_post_get_custom_psu_model_name; + access_psu_fan_dir.post_get = pddf_post_get_custom_psu_fan_dir; + pddf_psu_ops.post_probe = pddf_custom_psu_post_probe; + pddf_psu_ops.post_remove = pddf_custom_psu_post_remove; return 0; } From c2e3a2cf40bbf8382df1cb047ed5c064bdd419f6 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 17 Jul 2024 17:37:02 +0800 Subject: [PATCH 18/21] Addpsu_temp1_threshold and support ddr temp to sensors --- .../x86_64-accton_as5835_54x-r0/pddf/pddf-device.json | 6 ++++-- .../as5835-54x/utils/pddf_post_device_create.sh | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json index c1a60aca4337..a7ab60bcad77 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pddf/pddf-device.json @@ -175,7 +175,8 @@ { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out_max", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xa7", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_high_threshold", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xa8", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] } }, @@ -227,7 +228,8 @@ { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out_max", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xa7", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_high_threshold", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xa8", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] } }, diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh index c1a6660f9e46..f362c67c4784 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/pddf_post_device_create.sh @@ -22,6 +22,11 @@ set_system_led_diag_loc_to_off() i2cset -y -f 3 0x60 0xa 0x1c &>/dev/null } +insmod_jc42_drv() +{ + modprobe jc42 &>/dev/null +} set_qsfp_reset_to_normal_state set_sfp_tx_disable_to_disable set_system_led_diag_loc_to_off +insmod_jc42_drv From 91c82c1097560c8ecef799093e64b3cefcc5fe3a Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Thu, 29 Aug 2024 17:02:45 +0800 Subject: [PATCH 19/21] Add reset() in sfp.py for check sfp_port to avoid fail --- .../as5835-54x/sonic_platform/sfp.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py index b94e5d257cea..c53717d77255 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py @@ -51,6 +51,12 @@ def get_name(self): return name + def reset(self): + if self.sfp_type == 'SFP28': + return False + else: + return super().reset() + def get_position_in_parent(self): """Retrieves 1-based relative physical position in parent device.""" return self.port_index From 60b6c5f41859cbc15739cea7ccfc892d04fc581f Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Thu, 5 Sep 2024 16:25:16 +0800 Subject: [PATCH 20/21] Add get_reset_status() to avoid get fail in sfp_port --- .../as5835-54x/sonic_platform/sfp.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py index c53717d77255..33908b04a5d7 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py @@ -51,11 +51,17 @@ def get_name(self): return name + def get_reset_status(self): + if self.sfp_type == "QSFP28": + return super().get_reset_status() + return False + + def reset(self): - if self.sfp_type == 'SFP28': - return False - else: + if self.sfp_type == "QSFP28": return super().reset() + else: + return False def get_position_in_parent(self): """Retrieves 1-based relative physical position in parent device.""" From 832c39ac0277e0953749354d7da46400f75e2338 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 6 Sep 2024 18:15:33 +0800 Subject: [PATCH 21/21] Modify reset() to return unsupport sfp_type --- .../as5835-54x/sonic_platform/sfp.py | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py index 33908b04a5d7..b5b927680f96 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform/sfp.py @@ -24,7 +24,13 @@ class Sfp(PddfSfp): 0x11, # QSFP28 or later 0xe1 # QSFP28 EDFA ] - + + UNRESETTABLE_TYPE_LIST = [ + 'SFP', + 'SFP+', + 'SFP28' + ] + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) self.index = index + 1 @@ -52,16 +58,24 @@ def get_name(self): return name def get_reset_status(self): - if self.sfp_type == "QSFP28": - return super().get_reset_status() - return False - + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.sfp_type in self.UNRESETTABLE_TYPE_LIST: + return False + return super().get_reset_status() def reset(self): - if self.sfp_type == "QSFP28": - return super().reset() - else: + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + if self.sfp_type in self.UNRESETTABLE_TYPE_LIST: return False + return super().reset() def get_position_in_parent(self): """Retrieves 1-based relative physical position in parent device."""