Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/marvell-teralynx/sonic-platform-marvell-teralynx
Submodule sonic-platform-marvell-teralynx updated 42 files
+2 −4 dbmvtx9180/cfg/dbmvtx9180.conf
+2 −0 dbmvtx9180/cfg/dbmvtx9180_params.conf
+0 −19 dbmvtx9180/modules/Makefile
+0 −2 dbmvtx9180/modules/Module.symvers
+0 −651 dbmvtx9180/modules/marvell_dbmvtx9180_cpld.c
+0 −337 dbmvtx9180/modules/marvell_dbmvtx9180_fan.c
+0 −293 dbmvtx9180/modules/marvell_dbmvtx9180_leds.c
+0 −498 dbmvtx9180/modules/marvell_dbmvtx9180_oom.c
+0 −266 dbmvtx9180/modules/marvell_dbmvtx9180_psu.c
+0 −205 dbmvtx9180/modules/marvell_dbmvtx9180_thermal.c
+0 −469 dbmvtx9180/modules/marvell_i2c_psu.c
+0 −6 dbmvtx9180/scripts/dbmvtx9180-init.sh
+6 −0 dbmvtx9180/scripts/pddf_pre_driver_install.sh
+13 −0 dbmvtx9180/service/pddf-platform-init.service
+0 −14 dbmvtx9180/service/platform-modules-dbmvtx9180.service
+1 −1 dbmvtx9180/setup.py
+3 −1 dbmvtx9180/sonic_platform/__init__.py
+189 −262 dbmvtx9180/sonic_platform/chassis.py
+55 −169 dbmvtx9180/sonic_platform/component.py
+9 −109 dbmvtx9180/sonic_platform/eeprom.py
+181 −223 dbmvtx9180/sonic_platform/fan.py
+16 −101 dbmvtx9180/sonic_platform/fan_drawer.py
+11 −6 dbmvtx9180/sonic_platform/platform.py
+55 −249 dbmvtx9180/sonic_platform/psu.py
+52 −0 dbmvtx9180/sonic_platform/psu_fru.py
+20 −1,569 dbmvtx9180/sonic_platform/sfp.py
+158 −156 dbmvtx9180/sonic_platform/thermal.py
+44 −0 dbmvtx9180/sonic_platform/utils.py
+164 −49 dbmvtx9180/sonic_platform/watchdog.py
+0 −441 dbmvtx9180/utils/marvell_dbmvtx9180_util.py
+0 −24 dbmvtx9180/utils/platform_firmware_version
+0 −4 dbmvtx9180/utils/platform_led
+0 −4 dbmvtx9180/utils/platform_pld
+0 −7 dbmvtx9180/utils/platform_sync
+0 −354 dbmvtx9180/utils/sonic-fanthrml-monitor
+0 −181 dbmvtx9180/utils/sonic-led-monitor
+0 −342 dbmvtx9180/utils/sonic-psu-monitor
+0 −577 dbmvtx9180/utils/sonic-qsfp-monitor
+0 −5 dbmvtx9180/utils/sw_to3200k_watchdog.sh
+31 −40 debian/rules
+3 −3 debian/sonic-platform-marvell-dbmvtx9180.install
+4 −3 debian/sonic-platform-marvell-dbmvtx9180.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,12 @@ static struct i2c_adapter * cel_ms200i_i2c_init(struct platform_device *pdev, in

new_adapter->dev.parent = &pdev->dev;
new_adapter->owner = THIS_MODULE;
new_adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;

#ifdef I2C_CLASS_SPD
new_adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
#else
new_adapter->class = I2C_CLASS_HWMON;
#endif
new_adapter->algo = &ms200i_i2c_algorithm;

snprintf(new_adapter->name, sizeof(new_adapter->name),
Expand Down Expand Up @@ -812,7 +817,7 @@ static int cel_ms200i_lpc_drv_probe(struct platform_device *pdev)
return 0;
}

static int cel_ms200i_lpc_drv_remove(struct platform_device *pdev)
static void cel_ms200i_lpc_drv_remove(struct platform_device *pdev)
{
int portid_count;
struct ms200i_i2c_data *new_data;
Expand All @@ -821,7 +826,6 @@ static int cel_ms200i_lpc_drv_remove(struct platform_device *pdev)

for (portid_count=1 ; portid_count<=LENGTH_PORT_CPLD ; portid_count++)
i2c_del_adapter(cpld_data->i2c_adapter[portid_count-1]);
return 0;
}

static struct platform_driver cel_ms200i_lpc_drv = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,14 @@ static int ms200i_wdt_probe(struct platform_device *pdev)
return ret;
}

static int ms200i_wdt_remove(struct platform_device *pdev)
static void ms200i_wdt_remove(struct platform_device *pdev)
{
struct ms200i_wdt_drvdata *drvdata = platform_get_drvdata(pdev);

watchdog_unregister_device(&drvdata->wdt);
#ifdef ENAB_DEBUG
printk(KERN_INFO "MS200i WDT Remove");
#endif
return 0;
}

static struct platform_driver ms200i_wdt_drv = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ static struct bin_attribute mc24lc64t_bit_attr = {
.read = mc24lc64t_read,
};

static int mc24lc64t_probe(struct i2c_client *client,
const struct i2c_device_id *id)
static int mc24lc64t_probe(struct i2c_client *client)
{
struct i2c_adapter *adapter = client->adapter;
struct mc24lc64t_data *drvdata;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ static int t7132s_drv_probe(struct platform_device *pdev)
int adapter_id = 0;
int chan_id = 0;

cpld_class = class_create(THIS_MODULE, CLASS_NAME);
cpld_class = class_create(CLASS_NAME);
ret = PTR_ERR(cpld_class);

cpld_data = devm_kzalloc(&pdev->dev, sizeof(struct t7132s_cpld),
Expand Down Expand Up @@ -1517,7 +1517,7 @@ static int t7132s_drv_probe(struct platform_device *pdev)
return 0;
}

static int t7132s_drv_remove(struct platform_device *pdev)
static void t7132s_drv_remove(struct platform_device *pdev)
{
int ret = 0;
int port_count = 0;
Expand Down Expand Up @@ -1556,7 +1556,6 @@ static int t7132s_drv_remove(struct platform_device *pdev)
devm_kfree(&pdev->dev, cpld_data);
devm_kfree(&pdev->dev, pwddev);

return 0;
}

static struct platform_driver t7132s_drv = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ static int jc42_detect(struct i2c_client *client, struct i2c_board_info *info)
struct jc42_chips *chip = &jc42_chips[i];
if (manid == chip->manid &&
(devid & chip->devid_mask) == chip->devid) {
strlcpy(info->type, "jc42", I2C_NAME_SIZE);
strncpy(info->type, "jc42", I2C_NAME_SIZE - 1);
info->type[I2C_NAME_SIZE - 1] = '\0'; // Ensure null-termination
Comment on lines +440 to +441
Copy link
Owner

Choose a reason for hiding this comment

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

Please use strscpy instead, that appears to be preferred within the kernel.

return 0;
}
}
Expand Down Expand Up @@ -580,13 +581,17 @@ MODULE_DEVICE_TABLE(of, jc42_of_ids);
#endif

static struct i2c_driver jc42_driver = {
.class = I2C_CLASS_SPD | I2C_CLASS_HWMON,
#ifdef I2C_CLASS_SPD
.class = I2C_CLASS_SPD | I2C_CLASS_HWMON,
#else
.class = I2C_CLASS_HWMON,
#endif
.driver = {
.name = "oldjc42",
.pm = JC42_DEV_PM_OPS,
.of_match_table = of_match_ptr(jc42_of_ids),
},
.probe_new = jc42_probe,
.probe = jc42_probe,
.remove = jc42_remove,
.id_table = jc42_id,
.detect = jc42_detect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,9 @@ static void wistron_cpld_remove_client(struct i2c_client *client)
/*
* I2C init/probing/exit functions
*/
static int wistron_cpld_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int wistron_cpld_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct wistron_cpld_data *data;
int ret = -ENODEV;
const struct attribute_group *group = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static const struct attribute_group wistron_fan_group = {
.attrs = wistron_fan_attributes,
};

static int wistron_fan_probe(struct i2c_client *client, const struct i2c_device_id *dev_id)
static int wistron_fan_probe(struct i2c_client *client)
{
struct wistron_fan_data *data;
int status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,13 @@ static int wistron_led_probe(struct platform_device *pdev)
return ret;
}

static int wistron_led_remove(struct platform_device *pdev)
static void wistron_led_remove(struct platform_device *pdev)
{
int i;

for (i = 0; i < ARRAY_SIZE(wistron_leds); i++) {
led_classdev_unregister(&wistron_leds[i]);
}

return 0;
}

static struct platform_driver wistron_led_driver = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,9 @@ static const struct attribute_group wistron_oom_group = {
.attrs = wistron_oom_attributes,
};

static int wistron_oom_probe(struct i2c_client *client, const struct i2c_device_id *dev_id)
static int wistron_oom_probe(struct i2c_client *client)
{
const struct i2c_device_id *dev_id = i2c_client_get_device_id(client);
struct wistron_oom_data *data;
int status;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ static const struct attribute_group wistron_psu_group = {
.attrs = wistron_psu_attributes,
};

static int wistron_psu_probe(struct i2c_client *client,
const struct i2c_device_id *dev_id)
static int wistron_psu_probe(struct i2c_client *client)
{
const struct i2c_device_id *dev_id = i2c_client_get_device_id(client);
struct wistron_psu_data *data;
int status;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ static const struct attribute_group wistron_syseeprom_group = {
.attrs = wistron_syseeprom_attributes,
};

static int wistron_syseeprom_probe(struct i2c_client *client, const struct i2c_device_id *dev_id)
static int wistron_syseeprom_probe(struct i2c_client *client)
{
const struct i2c_device_id *dev_id = i2c_client_get_device_id(client);
struct wistron_syseeprom_data *data;
int status;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ static const struct attribute_group wistron_thermal_group = {
.attrs = wistron_thermal_attributes,
};

static int wistron_thermal_probe(struct i2c_client *client, const struct i2c_device_id *dev_id)
static int wistron_thermal_probe(struct i2c_client *client)
{
const struct i2c_device_id *dev_id = i2c_client_get_device_id(client);
struct wistron_thermal_data *data;
int status;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ Source: sonic-wistron-platform-modules
Section: main
Priority: extra
Maintainer: Wistron <[email protected]>
Build-Depends: debhelper (>= 8.0.0), bzip2
Build-Depends: debhelper-compat (= 13), python3
Rules-Requires-Root: no
Depends: linux-image-6.12.41+deb13-sonic-amd64-unsigned
Standards-Version: 3.9.3

Package: sonic-platform-wistron-sw-to3200k
Architecture: amd64
Depends: linux-image-6.12.41+deb13-sonic-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: sonic-platform-wistron-6512-32r
Architecture: amd64
Depends: linux-image-6.12.41+deb13-sonic-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp
122 changes: 24 additions & 98 deletions platform/marvell-teralynx/sonic-platform-modules-wistron/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ include /usr/share/dpkg/pkg-info.mk

export INSTALL_MOD_DIR:=extra

PYTHON ?= python2
PYTHON3 ?= python3

PACKAGE_PRE_NAME := sonic-platform-wistron
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
Expand All @@ -27,117 +24,46 @@ SERVICE_DIR := service
CONF_DIR := conf

%:
dh $@ --with systemd,python2,python3 --buildsystem=pybuild
dh $@ --with python3 --buildsystem=pybuild --pybuild-system=setuptools

clean:
dh_testdir
dh_testroot
override_dh_auto_clean:
(set -e; for mod in $(MODULE_DIRS); do \
make clean -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
if [ -f $(MOD_SRC_DIR)/$${mod}/setup.py ]; then \
pybuild --clean -d $${mod}; \
fi; \
done)
dh_clean

build:
#make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC)
(for mod in $(MODULE_DIRS); do \
override_dh_auto_configure:
(set -e; for mod in $(MODULE_DIRS); do \
if [ -f $(MOD_SRC_DIR)/$${mod}/setup.py ]; then \
pybuild --configure -d $${mod}; \
fi; \
done)

override_dh_auto_build:
(set -e; for mod in $(MODULE_DIRS); do \
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
#$(PYTHON) $${mod}/setup.py build; \
cd $(MOD_SRC_DIR)/$${mod}; \
if [ -f setup.py ]; then \
$(PYTHON3) setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \
python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \
echo "Finished making whl package for $$mod"; \
fi; \
cd $(MOD_SRC_DIR); \
done)

binary: binary-arch binary-indep
# Nothing to do

binary-arch:
# Nothing to do

#install: build
#dh_testdir
#dh_testroot
#dh_clean -k
#dh_installdirs
override_dh_auto_test:
# No tests to run

binary-indep:
dh_testdir
dh_installdirs
override_dh_usrlocal:
# Skip dh_usrlocal because we manually install files to /usr/local/bin

# Custom package commands
(for mod in $(MODULE_DIRS); do \
override_dh_auto_install:
(set -e; for mod in $(MODULE_DIRS); do \
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/local/bin; \
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
#cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \
#$(PYTHON) $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \
done)
# Resuming debhelper scripts
dh_testroot
dh_install
dh_installchangelogs
dh_installdocs
dh_installsystemd
dh_installinit
dh_link
dh_fixperms
dh_compress
dh_strip
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
.PHONY: build binary binary-arch binary-indep clean

##!/usr/bin/make -f
#
#export INSTALL_MOD_DIR:=extra
#
#PYTHON ?= python2
#PYTHON3 ?= python3
#
#KVERSION ?= $(shell uname -r)
#KERNEL_SRC := /lib/modules/$(KVERSION)
#MOD_SRC_DIR:= $(shell pwd)
#
#PACKAGE_PRE_NAME := sonic-platform-wistron
#MODULE_DIRS := 3306-32
#MODULE_SRC := modules
##UTILITY_SRC := utils
#SERVICE_SRC := service
#COMMON_SRC := common
#%:
# dh $@
#
#
#override_dh_auto_build:
# (for mod in $(MODULE_DIRS); do \
# make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
# cd $(MOD_SRC_DIR)/$${mod}; \
# python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \
# cd $(MOD_SRC_DIR); \
# done)
#
#override_dh_auto_install:
# (for mod in $(MODULE_DIRS); do \
# dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} \
# $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
# cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_SRC)/*.ko \
# debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
# dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/local/bin; \
## cp $(MOD_SRC_DIR)/$${mod}/$(UTILITY_SRC)/* \
## debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin; \
# dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
# cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_SRC)/*.service \
# debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \
# done)
#
#override_dh_usrlocal:
#
#override_dh_clean:
# dh_clean
# $(RM) -r $(COMMON_SRC)/*.o $(COMMON_SRC)/.*.cmd
# (for mod in $(MODULE_DIRS); do \
# make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
# done)
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static const struct attribute_group wistron_i2c_psu_group = {
.attrs = wistron_i2c_psu_attributes,
};

static int wistron_i2c_psu_probe(struct i2c_client *client, const struct i2c_device_id *dev_id)
static int wistron_i2c_psu_probe(struct i2c_client *client)
{
struct wistron_i2c_psu_data *data;
int status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,9 @@ static void sw_to3200k_cpld_remove_client(struct i2c_client *client)
/*
* I2C init/probing/exit functions
*/
static int sw_to3200k_cpld_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int sw_to3200k_cpld_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct sw_to3200k_cpld_data *data;
int ret = -ENODEV;
const struct attribute_group *group = NULL;
Expand Down
Loading