Skip to content

Commit cf3f6b5

Browse files
rchandramouliRamasamy Chandramouli
authored andcommitted
platform-modules-cel: adapt for kernel 6.12 and trixie
The following are the changes to get the modules compile: * Update `probe` function signature in the `i2c_driver instance dropping `i2c_device_id` parameter. This parameter is mostly unused in the probe function, if used, can be derived from the passed client pointer. * Remove `llseek` assignment to `no_llseek` in `file_operations`. * Remove `I2C_CLASS_SPD` attribute added by the modules. * Add missing import to `PMBUS` namespace. * Update `remove` function signature in the `platform_driver` and `pci_driver` instances, dropping return values. * Update `i2c_mux_add_adapter` args, dropping more than 3 args, if passed. * Fix `-Wint-conversion` errors occurring when `resource_size_t` is set to `NULL` instead of `0`. * Replace `strlcpy` with `strscpy`. The following changes are done to align with trixie build (and other platforms): * Remove `debian/compat` file. * Update compat level to 13 and kernel version in `debian/control`. * Update `debian/rules` to use `pybuild` for non-PDDF modules and the conventional wheel package build for the PDDF modules. Also set shell option to exit upon encountering error. * Cleanup copying of wheel package in non-PDDF modules as the scripts are installed as part of debian package. * Make wheel package available under `build-<mod>` instead of under `modules`. The changes are tested by building the platform packages through invoking the below command: `make NOBUSTER=1 NOBULLSEYE=1 NOBOOKWORM=1 target/debs/trixie/platform-modules-dx010_1.0_amd64.deb` Additionally, with further changes to rebranding of platform (not part of this commit, will be raised separately) and skipping inclusion of other platforms, verified install/boot of the `sonic-broadcom.bin` on a `DS3000` unit. platform-celestica: config and script fixes for pddf init (#55) The following fixes applicable to platforms (ds1000, ds2000, ds3000, ds4000/silverstone-v2) for correct pddf intialization and access of platform devices: * Update pddf-device json eliminating the need for additional indexing, multiplication operations in raw ipmi get. * The PDDF infra expects `num_components` as part of json config, update the same. * The ASIC PCIe firmware version uses `bcmcmd` to fetch the version. However, when syncd is not running, the error string is reported as version, fix this by return version as `Unknown` instead. * The PDDF component init passes pddf_data and pddf_plugin_data parameters, accommodate this. * Lookup correct overridden fan names from the PDDF plugin data accommodating fantray/psu and fan indices. * Lookup correct overridden thermal names from the PDDF plugin data. * Update platform specific monitoring service to start after `pddf-platform-init` service as this service imports `sonic_platform` module. * Update references of `/sys/class/i2c-adapter` to `/sys/bus/i2c/devices` instead. Tested these changes on ds1000, ds2000, ds3000 and silverstone-v2 platforms with accessing platform commands querying PDDF components. Verified that the accesses to the components are ok. Co-authored-by: Ramasamy Chandramouli <[email protected]>
1 parent df1af7f commit cf3f6b5

93 files changed

Lines changed: 428 additions & 421 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

device/celestica/x86_64-cel_ds1000-r0/pddf/pddf-device.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"num_fans_pertray":1,
77
"num_ports":56,
88
"num_temps":4,
9+
"num_components":1,
910
"pddf_dev_types":
1011
{
1112
"description":"DS1000 - 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 <dev-address> <dev-type> > <path>/new_device' method",

device/celestica/x86_64-cel_ds2000-r0/pddf/pddf-device-bmc.json

Lines changed: 52 additions & 60 deletions
Large diffs are not rendered by default.

device/celestica/x86_64-cel_ds2000-r0/pddf/pddf-device-nonbmc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"num_ports":56,
88
"num_temps":8,
99
"bmc_present": "False",
10+
"num_components": 7,
1011
"pddf_dev_types":
1112
{
1213
"description":" - 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 <dev-address> <dev-type> > <path>/new_device' method",

device/celestica/x86_64-cel_ds2000-r0/plugins/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
class board(eeprom_tlvinfo.TlvInfoDecoder):
1919

2020
def __init__(self, name, path, cpld_root, ro):
21-
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0056/eeprom"
21+
self.eeprom_path = "/sys/bus/i2c/devices/i2c-0/0-0056/eeprom"
2222
super(board, self).__init__(self.eeprom_path, 0, '', True)
2323

device/celestica/x86_64-cel_ds3000-r0/pddf/pddf-device-bmc.json

Lines changed: 57 additions & 58 deletions
Large diffs are not rendered by default.

device/celestica/x86_64-cel_e1031-r0/plugins/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
class board(eeprom_tlvinfo.TlvInfoDecoder):
1717

1818
def __init__(self, name, path, cpld_root, ro):
19-
self.eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0050/eeprom"
19+
self.eeprom_path = "/sys/bus/i2c/devices/i2c-2/2-0050/eeprom"
2020
super(board, self).__init__(self.eeprom_path, 0, '', True)

device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Tlv(eeprom_tlvinfo.TlvInfoDecoder):
3232
EEPROM_DECODE_HEADLINES = 6
3333

3434
def __init__(self):
35-
self._eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0050/eeprom"
35+
self._eeprom_path = "/sys/bus/i2c/devices/i2c-2/2-0050/eeprom"
3636
self._eeprom = None
3737
super(Tlv, self).__init__(self._eeprom_path, 0, '', True)
3838

device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@
8787
}
8888
}
8989
NULL_VAL = "N/A"
90-
I2C_ADAPTER_PATH = "/sys/class/i2c-adapter"
90+
I2C_ADAPTER_PATH = "/sys/bus/i2c/devices"
9191

9292

9393
class Thermal(ThermalBase):
9494
"""Platform-specific Thermal class"""
9595

96-
MAINBOARD_SS_PATH = "/sys/class/i2c-adapter/i2c-11/11-001a/hwmon/hwmon2"
97-
CPUBOARD_SS_PATH = "/sys/class/i2c-adapter/i2c-3/3-001a/hwmon/hwmon1"
96+
MAINBOARD_SS_PATH = "/sys/bus/i2c/devices/i2c-11/11-001a/hwmon/hwmon2"
97+
CPUBOARD_SS_PATH = "/sys/bus/i2c/devices/i2c-3/3-001a/hwmon/hwmon1"
9898
SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_e1031-r0/sensors.conf"
9999

100100
def __init__(self, thermal_index, airflow):

device/celestica/x86_64-cel_midstone-r0/plugins/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
class board(eeprom_tlvinfo.TlvInfoDecoder):
1717

1818
def __init__(self, name, path, cpld_root, ro):
19-
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0056/eeprom"
19+
self.eeprom_path = "/sys/bus/i2c/devices/i2c-0/0-0056/eeprom"
2020
super(board, self).__init__(self.eeprom_path, 0, '', True)

device/celestica/x86_64-cel_midstone-r0/plugins/sfputil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def port_to_eeprom_mapping(self):
3939
return self._port_to_eeprom_mapping
4040

4141
def __init__(self):
42-
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
42+
eeprom_path = "/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom"
4343

4444
if self.port_start == 1:
4545
offset = self.EEPROM_OFFSET - 1

0 commit comments

Comments
 (0)