Skip to content

Commit e9350f0

Browse files
rchandramoulisaiarcot895
authored andcommitted
[PR:16737, PR:16739] platform-modules: pddf, broadcom/cel: adapt for kernel 6.1 and bookworm (sonic-net#16954)
* sonic-platform-modules-cel: broadcom: adapt for kernel 6.1 and bookworm The i2c_driver->remove API declaration has been updated to return void instead of int, as part of cleanup patches in 6.1. More details can be referred from here: [1]. Update the remove API definition in the modules accordingly and cleanup variables that go unused from the remove API. Update python build commands for bookworm. The packaging based on calling setup.py is deprecated and using build module/pip utility is the recommended method for python packaging/installation. Further details can be referred to from here: [2], [3]. The build module is picky about the package information file, which needs to be either setup.py or pyproject.toml. Additionally, fix formatting inconsistencies in debian/changelog reported by `dh_installchangelogs` during the build. Tested the changes by compiling the changes as below: make sonic-slave-bash NOBUSTER=1 NOBULLSEYE=1 sudo dpkg -i target/debs/bookworm/linux-headers-6.1.0-11-2-*.deb cd platform/broadcom/sonic-platform-modules-cel KVERSION=6.1.0-11-2-amd64 dpkg-buildpackage Also verified the python scripts under the sonic-platform-modules-cel with pyflakes to ensure no new errors are flagged (with exception of unused modules). References: [1] - torvalds/linux@ed5c2f5f [2] - https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.htm [3] - 0b20a48 (Update Python build commands for Bookworm, 2023-09-07) Signed-off-by: Ramasamy Chandramouli <[email protected]> * platform/pddf: i2c: adapt for kernel 6.1 and bookworm * Fixup i2c_driver->remove API due to changes in the function prototype (ref: [1]). * Cleanup `MODULE_SUPPORTED_DEVICE` macros that were cleaned up in the upstream (ref: [2]). * Sanitize python packaging and installation using the `build` module instead of calling the setup.py directly (ref: [3]. [4]). Tested the changes by compiling pddf module as below: make sonic-slave-bash NOBUSTER=1 NOBULLSEYE=1 sudo dpkg -i target/debs/bookworm/linux-headers-6.1.0-11-2-*.deb cd platform/pddf/i2c KVERSION=6.1.0-11-2-amd64 dpkg-buildpackage References: [1] - torvalds/linux@ed5c2f5f [2] - torvalds/linux@6417f031 [2] - https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.htm [3] - 0b20a48 (Update Python build commands for Bookworm, 2023-09-07) Signed-off-by: Ramasamy Chandramouli <[email protected]> * platform/broadcom: include platform-modules-cel in builds With pddf modules patched for 6.1, platform-modules-cel can be compiled and included in the final image. Testing by building sonic-broadcom.bin/sonic-broadcom-dnx.bin. Signed-off-by: Ramasamy Chandramouli <[email protected]> * pddf/i2c: revert correct rootdir for pip install The pip install directory has been set to test-pkg1/ for testing the build and incorrectly retained as is. Revert this to the correct path $(PACKAGE_PRE_NAME). Signed-off-by: Ramasamy Chandramouli <[email protected]> * platform/broadcom: include pddf/modules-cel in the base package Without this change, the modules were built but not packaged in the final .bin. The final sonic-broadcom.bin has been tested for bootup on Celestica's Silverstone platform. admin@sonic:~$ uname -a Linux sonic 6.1.0-11-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux admin@sonic:~$ show platform summary Platform: x86_64-cel_silverstone-r0 HwSKU: Silverstone ASIC: broadcom ASIC Count: 1 Serial Number: R4009B2F062504LK200024 Model Number: N/A Hardware Revision: N/A admin@sonic:~$ show version | head SONiC Software Version: SONiC.g0aad6c67c-rachandr SONiC OS Version: 12 Distribution: Debian 12.2 Kernel: 6.1.0-11-2-amd64 Build commit: 0aad6c67c Build date: Thu Oct 26 07:13:47 UTC 2023 Built by: rachandr@AZUHPS14 Platform: x86_64-cel_silverstone-r0 Signed-off-by: Ramasamy Chandramouli <[email protected]> --------- Signed-off-by: Ramasamy Chandramouli <[email protected]>
1 parent 9898f3b commit e9350f0

19 files changed

Lines changed: 25 additions & 54 deletions

File tree

platform/broadcom/rules.dep

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/sai.dep
55
# * Nokia
66
# * Dell
77
# * Accton
8-
# * Celestica
98
# * Juniper
109
# * Ragile
1110
include $(PLATFORM_PATH)/platform-modules-s6000.dep
@@ -15,7 +14,7 @@ include $(PLATFORM_PATH)/platform-modules-ingrasys.dep
1514
#include $(PLATFORM_PATH)/platform-modules-accton.dep
1615
include $(PLATFORM_PATH)/platform-modules-alphanetworks.dep
1716
include $(PLATFORM_PATH)/platform-modules-inventec.dep
18-
#include $(PLATFORM_PATH)/platform-modules-cel.dep
17+
include $(PLATFORM_PATH)/platform-modules-cel.dep
1918
include $(PLATFORM_PATH)/platform-modules-delta.dep
2019
include $(PLATFORM_PATH)/platform-modules-quanta.dep
2120
#include $(PLATFORM_PATH)/platform-modules-mitac.dep

platform/broadcom/rules.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/sai.mk
44
# * Nokia
55
# * Dell
66
# * Accton
7-
# * Celestica
87
# * Juniper
98
# * Ragile
109
# * Ufispace
@@ -15,7 +14,7 @@ include $(PLATFORM_PATH)/platform-modules-arista.mk
1514
#include $(PLATFORM_PATH)/platform-modules-accton.mk
1615
include $(PLATFORM_PATH)/platform-modules-alphanetworks.mk
1716
#include $(PLATFORM_PATH)/platform-modules-inventec.mk
18-
#include $(PLATFORM_PATH)/platform-modules-cel.mk
17+
include $(PLATFORM_PATH)/platform-modules-cel.mk
1918
#include $(PLATFORM_PATH)/platform-modules-delta.mk
2019
include $(PLATFORM_PATH)/platform-modules-quanta.mk
2120
##include $(PLATFORM_PATH)/platform-modules-mitac.mk

platform/broadcom/sonic-platform-modules-cel/belgite/modules/mc24lc64t.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,9 @@ static int mc24lc64t_probe(struct i2c_client *client,
142142
return err;
143143
}
144144

145-
static int mc24lc64t_remove(struct i2c_client *client)
145+
static void mc24lc64t_remove(struct i2c_client *client)
146146
{
147-
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
148147
sysfs_remove_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr);
149-
150-
return 0;
151148
}
152149

153150
static const struct i2c_device_id mc24lc64t_id[] = {

platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform_setup.py renamed to platform/broadcom/sonic-platform-modules-cel/belgite/pddf/setup.py

File renamed without changes.

platform/broadcom/sonic-platform-modules-cel/debian/changelog

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ sonic-cel-platform-modules (0.6) unstable; urgency=low
2222
* Remove unused port-mode switch script. This should be done by hwsku config script.
2323
* Add script to turn off QSFP low power mode when boot up.
2424

25-
-- Pradchaya Phucharoen <[email protected]> Wed, 26 July 2017 10:43:00 +0700
25+
-- Pradchaya Phucharoen <[email protected]> Wed, 26 Jul 2017 10:43:00 +0700
2626

2727
sonic-cel-platform-modules (0.5) unstable; urgency=low
2828

2929
* Add port-mode switch script to support 100G 50G 10G_50G qsfp modes.
3030
* Fix garbage data when using sfputil to read QSFP-transceiver's eeprom.
3131
* Fix incorrect endian in eeprom read word data.
3232

33-
-- Pradchaya Phucharoen <[email protected]> Tue, 18 July 2017 11:30:00 +0700
33+
-- Pradchaya Phucharoen <[email protected]> Tue, 18 Jul 2017 11:30:00 +0700
3434

3535
sonic-cel-platform-modules (0.4) unstable; urgency=low
3636

3737
* Add support for DX010's fancontrol, automatic run-up and FIX bug lpmod
3838

39-
-- Pariwat Leamsumran <[email protected]> Thu, 14 June 2017 16:25:00 +0700
39+
-- Pariwat Leamsumran <[email protected]> Thu, 14 Jun 2017 16:25:00 +0700
4040

4141
sonic-cel-platform-modules (0.3) unstable; urgency=low
4242

platform/broadcom/sonic-platform-modules-cel/debian/rules

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@ override_dh_auto_build:
1616
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
1717
if [ $$mod = "seastone2" ]; then \
1818
cd $(MOD_SRC_DIR)/services/platform_api; \
19-
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
19+
python3 -m build --wheel --no-isolation --outdir $(MOD_SRC_DIR)/$${mod}/modules; \
2020
continue; \
2121
fi; \
2222
if [ $$mod = "belgite" ]; then \
2323
cd $(MOD_SRC_DIR); \
2424
if [ -d $(MOD_SRC_DIR)/$${mod}/pddf ]; then \
25-
cd $(MOD_SRC_DIR)/$${mod}/pddf; \
26-
if [ -f sonic_platform_setup.py ]; then \
27-
python3 sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/pddf; \
28-
echo "Finished makig pddf whl package for $$mod"; \
29-
fi; \
25+
cd $(MOD_SRC_DIR)/$${mod}/pddf; \
26+
python3 -m build --wheel --no-isolation --outdir $(MOD_SRC_DIR)/$${mod}/pddf; \
27+
echo "Finished making pddf whl package for $$mod"; \
3028
fi; \
3129
continue; \
3230
fi; \
3331
cd $(MOD_SRC_DIR)/$${mod}; \
34-
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
32+
python3 -m build --wheel --no-isolation --outdir $(MOD_SRC_DIR)/$${mod}/modules; \
3533
done)
3634

3735
override_dh_auto_install:

platform/broadcom/sonic-platform-modules-cel/dx010/modules/emc2305.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static const struct sensor_device_attribute *emc2305_fan_attrs[] = {
618618
* driver interface
619619
*/
620620

621-
static int emc2305_remove(struct i2c_client *client)
621+
static void emc2305_remove(struct i2c_client *client)
622622
{
623623
struct emc2305_data *data = i2c_get_clientdata(client);
624624
int fan_idx, i;
@@ -636,7 +636,6 @@ static int emc2305_remove(struct i2c_client *client)
636636
&emc2305_attr_common[i].dev_attr);
637637

638638
kfree(data);
639-
return 0;
640639
}
641640

642641

platform/broadcom/sonic-platform-modules-cel/dx010/modules/mc24lc64t.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ static int mc24lc64t_probe(struct i2c_client *client,
108108
return err;
109109
}
110110

111-
static int mc24lc64t_remove(struct i2c_client *client)
111+
static void mc24lc64t_remove(struct i2c_client *client)
112112
{
113113
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
114114

115115
i2c_unregister_device(drvdata->fake_client);
116116

117117
sysfs_remove_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr);
118-
119-
return 0;
120118
}
121119

122120
static const struct i2c_device_id mc24lc64t_id[] = {

platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static const struct sensor_device_attribute *emc2305_fan_attrs[] = {
638638
* driver interface
639639
*/
640640

641-
static int emc2305_remove(struct i2c_client *client)
641+
static void emc2305_remove(struct i2c_client *client)
642642
{
643643
struct emc2305_data *data = i2c_get_clientdata(client);
644644
int fan_idx, i;
@@ -656,7 +656,6 @@ static int emc2305_remove(struct i2c_client *client)
656656
&emc2305_attr_common[i].dev_attr);
657657

658658
kfree(data);
659-
return 0;
660659
}
661660

662661

platform/broadcom/sonic-platform-modules-cel/haliburton/modules/mc24lc64t.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ static int mc24lc64t_probe(struct i2c_client *client,
108108
return err;
109109
}
110110

111-
static int mc24lc64t_remove(struct i2c_client *client)
111+
static void mc24lc64t_remove(struct i2c_client *client)
112112
{
113113
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
114114

115115
i2c_unregister_device(drvdata->fake_client);
116116

117117
sysfs_remove_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr);
118-
119-
return 0;
120118
}
121119

122120
static const struct i2c_device_id mc24lc64t_id[] = {

0 commit comments

Comments
 (0)