Skip to content

Alliedtelesis x980#27763

Open
cpackham-atlnz wants to merge 5 commits into
sonic-net:masterfrom
cpackham-atlnz:alliedtelesis-x980
Open

Alliedtelesis x980#27763
cpackham-atlnz wants to merge 5 commits into
sonic-net:masterfrom
cpackham-atlnz:alliedtelesis-x980

Conversation

@cpackham-atlnz

Copy link
Copy Markdown
Contributor

Why I did it

This adds support for the Allied Telesis x980-32CQ and x980-32DQ.

The x980-32CQ has 32 x 100G QSFP28 ports.
The x980-32DQ has 32 x 400G QSFP56-DD ports and 2 x 10G SFP+ ports.

Both switches use Marvell Prestera Silicon.

How I did it

The support is based around some of the existing Marvell based platforms but uses some newer features like PDDF.

Tested branch (Please provide the tested image version)

  • master (marvell-prestera)

Description for the changelog

Add support for the Allied Telesis x980-32CQ and x980-32DQ

Add support for the Allied Telesis x980-32CQ board. This uses a
Marvell Falcon switch ASIc and has 32 100G QSFP28 ports.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Add device support for the Allied Telesis x980-32CQ. This includes the
necessary hardware description of the board and its peripherals.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Add support for the Allied Telesis x980-32DQ hardware platform. This has
a Marvell Falcon switch ASIC, 32 400G QSFP-DD ports and 2 SFP+ ports.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Add device support for the Allied Telesis x980-32DQ. This includes the
necessary hardware description of the board and its peripherals

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
@cpackham-atlnz cpackham-atlnz requested a review from lguohan as a code owner June 9, 2026 00:42
Copilot AI review requested due to automatic review settings June 9, 2026 00:42
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds AlliedTelesis x980-32cq and x980-32dq platform support to the Marvell Prestera SONiC build, including platform API implementations, init/utility scripts, packaging, and device/hwsku configuration.

Changes:

  • Add platform API implementation modules (chassis/psu/fan/sfp/thermal/watchdog) and PDDF hook scripts for x980-32cq and x980-32dq.
  • Add Debian packaging and build glue to produce/install the platform .debs and include them in the marvell-prestera one-image build.
  • Add device definitions (hwsku, port_config, thermal policy, sensors configs, PCIe inventory, etc.) for both platforms.

Reviewed changes

Copilot reviewed 131 out of 139 changed files in this pull request and generated no comments.

Show a summary per file
File Description
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/syncd_start.sh Adds syncd start-pre gating on Falcon PCIe readiness (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/syncd_pre_stop.sh Adds pre-stop PCIe/AER handling on cold shutdown (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/pddf_pre_driver_install.sh Adds PDDF pre-driver-install hook stub (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/pddf_pre_device_create.sh Adds PDDF pre-device-create hook (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/pddf_post_driver_install.sh Adds PDDF post-driver-install hook (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/pddf_post_device_create.sh Adds PDDF post-device-create actions (LED + mgmt MAC) (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-mgmt-mac.py Adds utility to set eth0 MAC derived from base MAC (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-base-mac.py Adds utility to print base MAC (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform_setup.py Adds setuptools build file for DQ platform wheel.
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py Adds watchdog implementation (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/voltage_sensor.py Adds voltage sensor customization (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_manager.py Adds thermal manager registration module (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_infos.py Adds thermal info collectors for policy engine (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py Adds thermal condition matchers for policy engine (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_actions.py Adds actions (fan speed, shutdown, algorithm) for thermal policy (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal.py Adds thermal device class & threshold configuration (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/sfp.py Adds SFP implementation (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/psu.py Adds PSU implementation (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/platform.py Adds Platform class wrapper (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/fan_drawer.py Adds fan drawer + FRU decode logic (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/fan.py Adds fan implementation including RPM computation (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/eeprom.py Adds EEPROM TLV parsing customization (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/component.py Adds component wrapper implementation (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/chassis.py Adds chassis implementation and change event logic (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/init.py Exposes platform package modules (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/service/sysled.service Adds systemd oneshot to turn SYS LED off on shutdown (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/service/pddf-platform-init.service Links to common PDDF platform init unit (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/scripts/pddf_pre_driver_install.sh Adds script stub (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/modules/Makefile Adds extra symbols for kernel module build (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/Makefile Installs service units into build root (DQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/syncd_start.sh Adds syncd start-pre gating on Falcon PCIe readiness (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/pddf_pre_driver_install.sh Adds PDDF pre-driver-install hook stub (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/pddf_pre_device_create.sh Adds PDDF pre-device-create hook (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/pddf_post_driver_install.sh Adds PDDF post-driver-install hook (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/pddf_post_device_create.sh Loads Marvell drivers + sets LED + mgmt MAC (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-mgmt-mac.py Adds utility to set eth0 MAC derived from base MAC (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-base-mac.py Adds utility to print base MAC (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/udev/70-persistent-net.rules Adds udev rules for mgmt NIC naming and PCI remove (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform_setup.py Adds setuptools build file for CQ platform wheel.
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/watchdog.py Adds watchdog implementation (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/voltage_sensor.py Adds voltage sensor customization (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_manager.py Adds thermal manager registration module (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_infos.py Adds thermal info collectors for policy engine (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py Adds thermal condition matchers for policy engine (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_actions.py Adds actions (fan speed, shutdown, algorithm) for thermal policy (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal.py Adds thermal device class & threshold configuration (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/sfp.py Adds SFP implementation (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/psu.py Adds PSU implementation (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/platform.py Adds Platform class wrapper (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/fan_drawer.py Adds fan drawer + FRU decode logic (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/fan.py Adds fan implementation including PWM mapping (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/eeprom.py Adds EEPROM TLV parsing customization (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/component.py Adds component wrapper implementation (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/chassis.py Adds chassis implementation and change event logic (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/init.py Exposes platform package modules (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/service/sysled.service Adds systemd oneshot to turn SYS LED off on shutdown (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/service/pddf-platform-init.service Links to common PDDF platform init unit (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/scripts/pddf_pre_driver_install.sh Adds script stub (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/modules/Makefile Adds extra symbols and module list (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/Makefile Installs service units into build root (CQ).
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/sonic-platform-alliedtelesis-x980-32dq.postinst Enables/starts PDDF init service after install (DQ package).
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/sonic-platform-alliedtelesis-x980-32dq.install Installs platform artifacts for DQ package.
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/sonic-platform-alliedtelesis-x980-32cq.postinst Enables/starts PDDF init + sysled services after install (CQ package).
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/sonic-platform-alliedtelesis-x980-32cq.install Installs platform artifacts for CQ package.
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/rules Adds dkms-style module build + wheel build/install steps.
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/control Defines the CQ/DQ platform packages.
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/compat Sets debhelper compat level.
platform/marvell-prestera/sonic-platform-alliedtelesis/debian/changelog Adds initial changelog entry for AlliedTelesis support.
platform/marvell-prestera/rules.mk Includes AlliedTelesis platform build rules.
platform/marvell-prestera/rules.dep Includes AlliedTelesis platform dependency tracking.
platform/marvell-prestera/platform-alliedtelesis.mk Adds the AlliedTelesis platform .deb build definitions.
platform/marvell-prestera/platform-alliedtelesis.dep Adds depfile wiring for the AlliedTelesis platform .deb.
platform/marvell-prestera/one-image.mk Adds AlliedTelesis platform packages and PDDF module to the one-image.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/sai.profile Adds SAI init profile for x980-32dq.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/profile.ini Adds profile.ini for x980-32dq (switch MAC).
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/port_config.ini Adds DQ port configuration mapping.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/hwsku.json Adds DQ hwsku interface defaults.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/buffers_defaults_t1.j2 Adds DQ buffer defaults template (t1).
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/buffers_defaults_t0.j2 Adds DQ buffer defaults template (t0).
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/SAI-F12_8T-2x10G-32x400G.md5 Adds DQ SAI profile md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/ASK-PP-F12_8T-2x10G-32x400G.md5 Adds DQ ASK-PP md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/ASK-L1-F12_8T-2x10G-32x400G.md5 Adds DQ ASK-L1 md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/ASK-Board-F12_8T-2x10G-32x400G.md5 Adds DQ ASK-Board md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/thermal_policy.json Adds DQ thermal policy configuration.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/system_health_monitoring_config.json Adds DQ health monitoring ignore list.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/sensors.conf Adds DQ lm-sensors configuration.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/pmon_daemon_control.json Adds DQ pmon daemon control settings.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/plugins/eeprom.py Adds DQ EEPROM plugin pointing at sysfs path.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/platform_components.json Adds DQ platform component inventory.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/platform_asic Declares ASIC type for DQ.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/pddf/pd-plugin.json Adds DQ PDDF plugin mappings/valmaps.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/pcie.yaml Adds DQ PCIe inventory file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/installer.conf Adds DQ installer kernel cmdline settings.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/default_sku Sets default SKU/topology for DQ.
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/buffers_defaults_t1.j2 Adds chassis-level DQ buffer defaults template (t1).
device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/buffers_defaults_t0.j2 Adds chassis-level DQ buffer defaults template (t0).
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/sai.profile Adds SAI init profile for x980-32cq.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/profile.ini Adds profile.ini for x980-32cq (switch MAC).
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/port_config.ini Adds CQ port configuration mapping.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/hwsku.json Adds CQ hwsku interface defaults.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/buffers_defaults_t1.j2 Adds CQ buffer defaults template (t1).
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/buffers_defaults_t0.j2 Adds CQ buffer defaults template (t0).
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/buffers.json.j2 Adds CQ include wrapper for buffer config.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/SAI-F3_2T-32x100G.md5 Adds CQ SAI profile md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/ASK-PP-F3_2T-32x100G.md5 Adds CQ ASK-PP md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/ASK-L1-F3_2T-32x100G.md5 Adds CQ ASK-L1 md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/ASK-Board-F3_2T-32x100G.md5 Adds CQ ASK-Board md5 file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/thermal_policy.json Adds CQ thermal policy configuration.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/system_health_monitoring_config.json Adds CQ health monitoring ignore list.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/sensors.yaml Adds CQ sensor monitoring YAML configuration.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/sensors.conf Adds CQ lm-sensors configuration.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/pmon_daemon_control.json Adds CQ pmon daemon control settings.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/plugins/eeprom.py Adds CQ EEPROM plugin pointing at sysfs path.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/platform_components.json Adds CQ platform component inventory.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/platform_asic Declares ASIC type for CQ.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/pddf/pd-plugin.json Adds CQ PDDF plugin mappings/valmaps.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/pcie.yaml Adds CQ PCIe inventory file.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/installer.conf Adds CQ installer kernel cmdline settings.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/default_sku Sets default SKU/topology for CQ.
device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/ASK-PP-F3_2T-32x100G.md5 Adds chassis-level CQ ASK-PP md5 file.
Comments suppressed due to low confidence (23)

platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/syncd_start.sh:1

  • return 0/return 1 is not valid in a standalone /bin/sh script (it only works in sourced scripts/functions). Also $((WAITED += 1)) is being executed as a command instead of updating the variable. Replace return with exit and increment WAITED via assignment (e.g., WAITED=$((WAITED+1))).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/syncd_start.sh:1
  • return 0/return 1 is not valid in a standalone /bin/sh script (it only works in sourced scripts/functions). Also $((WAITED += 1)) is being executed as a command instead of updating the variable. Replace return with exit and increment WAITED via assignment (e.g., WAITED=$((WAITED+1))).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-base-mac.py:1
  • This script uses Python 2 syntax (except ImportError, e and print statements without parentheses) but is invoked/packaged in a Python 3 environment elsewhere in this PR (e.g., platform wheel classifiers and python3 usage). Update it to valid Python 3 syntax and use a Python 3 shebang to avoid runtime failures.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-base-mac.py:1
  • This script uses Python 2 syntax (except ImportError, e and print statements without parentheses) but is invoked/packaged in a Python 3 environment elsewhere in this PR (e.g., platform wheel classifiers and python3 usage). Update it to valid Python 3 syntax and use a Python 3 shebang to avoid runtime failures.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-base-mac.py:1
  • This script uses Python 2 syntax (except ImportError, e and print statements without parentheses) but is invoked/packaged in a Python 3 environment elsewhere in this PR (e.g., platform wheel classifiers and python3 usage). Update it to valid Python 3 syntax and use a Python 3 shebang to avoid runtime failures.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-base-mac.py:1
  • This script uses Python 2 syntax (except ImportError, e and print statements without parentheses) but is invoked/packaged in a Python 3 environment elsewhere in this PR (e.g., platform wheel classifiers and python3 usage). Update it to valid Python 3 syntax and use a Python 3 shebang to avoid runtime failures.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/chassis.py:1
  • Code after return self._watchdog is unreachable, so the try/except watchdog initialization path will never execute. Remove the unreachable block and keep a single initialization path (with error handling if needed).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/chassis.py:1
  • Code after return self._watchdog is unreachable, so the try/except watchdog initialization path will never execute. Remove the unreachable block and keep a single initialization path (with error handling if needed).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/chassis.py:1
  • get_sfp() is implemented as 1-based indexing (self._sfp_list[index-1]), but this loop starts at 0 and passes 0 into get_sfp(), which will index -1 and read the wrong SFP. Change the loop to iterate 1..N (as in the DQ variant) or update get_sfp()/call sites to consistently use 0-based indexing.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class definitions with the same names (AnyThermalOverHighThresholdCondition and AnyThermalBelowLowThresholdCondition) for different JSON types. The later definitions overwrite the earlier ones, so only one behavior will be registered/used. Rename the classes to match the JSON types (e.g., AllThermalBelowHighThresholdCondition, AllThermalOverLowThresholdCondition) so both conditions can coexist.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class definitions with the same names (AnyThermalOverHighThresholdCondition and AnyThermalBelowLowThresholdCondition) for different JSON types. The later definitions overwrite the earlier ones, so only one behavior will be registered/used. Rename the classes to match the JSON types (e.g., AllThermalBelowHighThresholdCondition, AllThermalOverLowThresholdCondition) so both conditions can coexist.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class definitions with the same names (AnyThermalOverHighThresholdCondition and AnyThermalBelowLowThresholdCondition) for different JSON types. The later definitions overwrite the earlier ones, so only one behavior will be registered/used. Rename the classes to match the JSON types (e.g., AllThermalBelowHighThresholdCondition, AllThermalOverLowThresholdCondition) so both conditions can coexist.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class definitions with the same names (AnyThermalOverHighThresholdCondition and AnyThermalBelowLowThresholdCondition) for different JSON types. The later definitions overwrite the earlier ones, so only one behavior will be registered/used. Rename the classes to match the JSON types (e.g., AllThermalBelowHighThresholdCondition, AllThermalOverLowThresholdCondition) so both conditions can coexist.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no watchdog device is found, but _set_arm() unconditionally unpacks its return value, which will raise a TypeError. Also, the except SystemExit: pass path can leave watchdog undefined, causing an UnboundLocalError at the return. Make _get_wdt() always return a consistent tuple (e.g., (None, None)) and handle the 'not found' case in _set_arm() (and any other callers).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no watchdog device is found, but _set_arm() unconditionally unpacks its return value, which will raise a TypeError. Also, the except SystemExit: pass path can leave watchdog undefined, causing an UnboundLocalError at the return. Make _get_wdt() always return a consistent tuple (e.g., (None, None)) and handle the 'not found' case in _set_arm() (and any other callers).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no watchdog device is found, but _set_arm() unconditionally unpacks its return value, which will raise a TypeError. Also, the except SystemExit: pass path can leave watchdog undefined, causing an UnboundLocalError at the return. Make _get_wdt() always return a consistent tuple (e.g., (None, None)) and handle the 'not found' case in _set_arm() (and any other callers).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no matching watchdog device is found, but __init__() unconditionally unpacks the return and then formats sysfs paths with self.wdt_main_dev_name. This will raise at startup on systems where the device node is missing or the identity check fails. Return a consistent tuple (e.g., (None, None)) and guard initialization logic when no watchdog is present.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/udev/70-persistent-net.rules:1
  • The first rule matches any PCI-backed net device add event and always removes 0000:01:00.0, which can trigger unexpectedly and repeatedly during boot/hotplug. Tighten the match criteria (e.g., match the specific device by KERNELS==, ATTRS{vendor}, ATTRS{device}, etc.) so the removal only happens for the intended device/event.
    device/alliedtelesis/x86_64-alliedtelesis_x980_32dq-r0/x980-32dq/profile.ini:1
  • This hard-codes a placeholder switchMacAddress, which can result in duplicate MACs across devices if not overridden during manufacturing/provisioning. Use a per-device value (e.g., derived from EEPROM/base MAC during init) or ensure this file is generated with the correct MAC at build/provision time.
    device/alliedtelesis/x86_64-alliedtelesis_x980_32cq-r0/x980-32cq/profile.ini:1
  • This hard-codes a placeholder switchMacAddress, which can result in duplicate MACs across devices if not overridden during manufacturing/provisioning. Use a per-device value (e.g., derived from EEPROM/base MAC during init) or ensure this file is generated with the correct MAC at build/provision time.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/voltage_sensor.py:1
  • Writing sysfs attributes via subprocess.getstatusoutput('echo ... > ...') relies on a shell and hard-codes the hwmonN index, which is not stable across boots. Prefer writing to the sysfs files directly from Python and locate the correct hwmon path via a stable device path (e.g., /sys/bus/i2c/devices/.../hwmon/hwmon*/) to avoid breakage.
    platform/marvell-prestera/sonic-platform-alliedtelesis/debian/rules:1
  • The build uses sonic_platform_setup.py (not setup.py) for the wheel build steps later, but the pybuild clean/configure steps are conditioned on setup.py existing, so they will never run. Either add a real setup.py, adjust these checks to the actual build entrypoint being used, or remove the pybuild-specific logic to avoid dead/ineffective packaging steps.
    platform/marvell-prestera/sonic-platform-alliedtelesis/debian/rules:1
  • The build uses sonic_platform_setup.py (not setup.py) for the wheel build steps later, but the pybuild clean/configure steps are conditioned on setup.py existing, so they will never run. Either add a real setup.py, adjust these checks to the actual build entrypoint being used, or remove the pybuild-specific logic to avoid dead/ineffective packaging steps.

Use subprocess.run() instead of os.system() to avoid a potential shell
injection.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Copilot AI review requested due to automatic review settings June 9, 2026 01:13
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 131 out of 139 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (29)

platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/syncd_start.sh:1

  • return is only valid when the script is sourced or inside a shell function; in a standalone /bin/sh script this will fail. Also, $((WAITED += 1)) is being executed as a command (due to the leading $) rather than updating the variable. Use exit 0/1 for script termination and update WAITED with an assignment (e.g., WAITED=$((WAITED+1))).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/syncd_start.sh:1
  • return is only valid when the script is sourced or inside a shell function; in a standalone /bin/sh script this will fail. Also, $((WAITED += 1)) is being executed as a command (due to the leading $) rather than updating the variable. Use exit 0/1 for script termination and update WAITED with an assignment (e.g., WAITED=$((WAITED+1))).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-base-mac.py:1
  • This script uses Python 2-only syntax (except ImportError, e and print statements). On systems where /usr/bin/env python resolves to Python 3 (common in SONiC), this will crash immediately. Update to Python 3 syntax and prefer an explicit Python 3 shebang to match the rest of the platform tooling.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-base-mac.py:1
  • This script uses Python 2-only syntax (except ImportError, e and print statements). On systems where /usr/bin/env python resolves to Python 3 (common in SONiC), this will crash immediately. Update to Python 3 syntax and prefer an explicit Python 3 shebang to match the rest of the platform tooling.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-base-mac.py:1
  • This script uses Python 2-only syntax (except ImportError, e and print statements). On systems where /usr/bin/env python resolves to Python 3 (common in SONiC), this will crash immediately. Update to Python 3 syntax and prefer an explicit Python 3 shebang to match the rest of the platform tooling.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-base-mac.py:1
  • This script uses Python 2-only syntax (except ImportError, e and print statements). On systems where /usr/bin/env python resolves to Python 3 (common in SONiC), this will crash immediately. Update to Python 3 syntax and prefer an explicit Python 3 shebang to match the rest of the platform tooling.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-mgmt-mac.py:1
  • The script uses subprocess.run(..., check=True), which is Python 3-only; with a #!/usr/bin/env python shebang this can execute under Python 2 on some systems and fail. Also, if increment_mac() returns an empty string, the ip link set ... address invocation will fail; add an explicit check and return a non-zero exit code before calling ip when mgmt_mac is empty.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/get-mgmt-mac.py:1
  • The script uses subprocess.run(..., check=True), which is Python 3-only; with a #!/usr/bin/env python shebang this can execute under Python 2 on some systems and fail. Also, if increment_mac() returns an empty string, the ip link set ... address invocation will fail; add an explicit check and return a non-zero exit code before calling ip when mgmt_mac is empty.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-mgmt-mac.py:1
  • The script uses subprocess.run(..., check=True), which is Python 3-only; with a #!/usr/bin/env python shebang this can execute under Python 2 on some systems and fail. Also, if increment_mac() returns an empty string, the ip link set ... address invocation will fail; add an explicit check and return a non-zero exit code before calling ip when mgmt_mac is empty.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/utils/get-mgmt-mac.py:1
  • The script uses subprocess.run(..., check=True), which is Python 3-only; with a #!/usr/bin/env python shebang this can execute under Python 2 on some systems and fail. Also, if increment_mac() returns an empty string, the ip link set ... address invocation will fail; add an explicit check and return a non-zero exit code before calling ip when mgmt_mac is empty.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no watchdog is found, but _set_arm() unconditionally unpacks its return value into two variables, which will raise a TypeError. Make _get_wdt() consistently return a 2-tuple (e.g., (None, None)) or raise a controlled exception, and handle the 'not found' case in _set_arm()/arm().
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/watchdog.py:1
  • _get_wdt() returns None when no watchdog is found, but _set_arm() unconditionally unpacks its return value into two variables, which will raise a TypeError. Make _get_wdt() consistently return a 2-tuple (e.g., (None, None)) or raise a controlled exception, and handle the 'not found' case in _set_arm()/arm().
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/chassis.py:1
  • The code after return self._watchdog is unreachable, and it references sonic_logger which is not defined in this file snippet. Remove the unreachable block and keep a single, clear initialization/error-handling path.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/chassis.py:1
  • The code after return self._watchdog is unreachable, and it references sonic_logger which is not defined in this file snippet. Remove the unreachable block and keep a single, clear initialization/error-handling path.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_infos.py:1
  • Two logic bugs: (1) the presence check uses fantray not in self._presence_fans instead of fan not in self._presence_fans, so fan presence tracking will be incorrect; (2) the 'restore from high speed warning' branch uses fan_rpm > FAN_HIGH_WARNING_SPEED again, so it will clear the warning while still above the threshold. The restore condition should be when the RPM drops back below the threshold (mirroring the low-warning logic).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_infos.py:1
  • Two logic bugs: (1) the presence check uses fantray not in self._presence_fans instead of fan not in self._presence_fans, so fan presence tracking will be incorrect; (2) the 'restore from high speed warning' branch uses fan_rpm > FAN_HIGH_WARNING_SPEED again, so it will clear the warning while still above the threshold. The restore condition should be when the RPM drops back below the threshold (mirroring the low-warning logic).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_infos.py:1
  • Two logic bugs: (1) the presence check uses fantray not in self._presence_fans instead of fan not in self._presence_fans, so fan presence tracking will be incorrect; (2) the 'restore from high speed warning' branch uses fan_rpm > FAN_HIGH_WARNING_SPEED again, so it will clear the warning while still above the threshold. The restore condition should be when the RPM drops back below the threshold (mirroring the low-warning logic).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_infos.py:1
  • Two logic bugs: (1) the presence check uses fantray not in self._presence_fans instead of fan not in self._presence_fans, so fan presence tracking will be incorrect; (2) the 'restore from high speed warning' branch uses fan_rpm > FAN_HIGH_WARNING_SPEED again, so it will clear the warning while still above the threshold. The restore condition should be when the RPM drops back below the threshold (mirroring the low-warning logic).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_conditions.py:1
  • There are duplicate class names (AnyThermalOverHighThresholdCondition is defined twice, and AnyThermalBelowLowThresholdCondition is defined twice). Even if the decorators register different condition types, the second definition overwrites the first in the module namespace, making debugging and introspection harder. Rename the latter two classes to names matching their JSON types (e.g., AllThermalsBelowHighThresholdCondition and AllThermalsOverLowThresholdCondition).
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/voltage_sensor.py:1
  • Hard-coding hwmon9 is fragile because hwmon indices can change across boots/kernel updates/device enumeration order. Prefer resolving the correct hwmon directory by device path (e.g., via /sys/bus/i2c/devices/.../hwmon/hwmon*/) or by matching the name file under hwmon, then writing the threshold files in that resolved directory.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/voltage_sensor.py:1
  • Hard-coding hwmon45 is fragile because hwmon indices can change across boots/kernel updates/device enumeration order. Prefer resolving the correct hwmon directory by device path (e.g., via /sys/bus/i2c/devices/.../hwmon/hwmon*/) or by matching the name file under hwmon, then writing the threshold files in that resolved directory.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32cq/sonic_platform/thermal_actions.py:1
  • Corrected spelling of 'interger' to 'integer'.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/sonic_platform/thermal_actions.py:1
  • Corrected spelling of 'interger' to 'integer'.
    platform/marvell-prestera/sonic-platform-alliedtelesis/x980-32dq/utils/pddf_pre_driver_install.sh:1
  • This comment is grammatically unclear and doesn't describe what the hook actually does (the script currently has no implementation). Either implement the intended behavior or update the comment to clearly state what drivers are being renamed/disabled and why, or remove the comment to avoid misleading future maintainers.

Comment on lines +1 to +5
voltage_sensors:
- name : "12V"
sensor: "/sys/class/hwmon/hwmon45/in1_input"
high_thresholds: [ "13800", "13200" ]
low_thresholds: [ "10200", "10800" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants