Skip to content

Commit

Permalink
DellEMC bullseye merge (#2)
Browse files Browse the repository at this point in the history
Upgrade DellEMC platforms to bullseye.
  • Loading branch information
aravindmani-1 authored and saiarcot895 committed Nov 10, 2021
1 parent 5b28476 commit c3c6a17
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 144 deletions.
65 changes: 32 additions & 33 deletions device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,39 @@ class SfpUtil(SfpUtilBase):
PORTS_IN_BLOCK = 34

BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0"

_port_to_i2c_mapping = {
1: 4,
2: 5,
3: 6,
4: 7,
5: 8,
6: 9,
7: 10,
8: 11,
9: 12,
10: 13,
11: 14,
12: 15,
13: 16,
14: 17,
15: 18,
16: 19,
17: 20,
18: 21,
19: 22,
20: 23,
21: 24,
22: 25,
23: 26,
24: 27,
25: 28,
26: 29,
27: 30,
28: 31,
29: 32,
30: 33,
31: 34,
32: 35,
1: 10,
2: 11,
3: 12,
4: 13,
5: 14,
6: 15,
7: 16,
8: 17,
9: 18,
10: 19,
11: 20,
12: 21,
13: 22,
14: 23,
15: 24,
16: 25,
17: 26,
18: 27,
19: 28,
20: 29,
21: 30,
22: 31,
23: 32,
24: 33,
25: 34,
26: 35,
27: 36,
28: 37,
29: 38,
30: 39,
31: 40,
32: 41,
33: 1,
34: 2,
}
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(PLATFORM_PATH)/sai-modules.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/platform-modules-nokia.mk
#include $(PLATFORM_PATH)/platform-modules-dell.mk
include $(PLATFORM_PATH)/platform-modules-dell.mk
#include $(PLATFORM_PATH)/platform-modules-arista.mk
#include $(PLATFORM_PATH)/platform-modules-ingrasys.mk
include $(PLATFORM_PATH)/platform-modules-accton.mk
Expand Down
14 changes: 7 additions & 7 deletions platform/broadcom/sonic-platform-modules-dell/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ Standards-Version: 3.9.3

Package: platform-modules-s6000
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-z9100
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-s6100
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-z9264f
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-s5212f
Expand All @@ -37,12 +37,12 @@ Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-s5232f
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-s5248f
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-n3248te
Expand All @@ -52,7 +52,7 @@ Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-z9332f
Architecture: amd64
Depends: linux-image-4.19.0-12-2-amd64-unsigned
Depends: linux-image-5.10.0-8-2-amd64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-n3248pxe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ elif [ "$1" == "deinit" ]; then

modprobe -r i2c-mux-pca954x
modprobe -r i2c-dev
remove_python_api_package
modprobe -r acpi_ipmi
modprobe -r ipmi_devintf
modprobe -r ipmi_si
remove_python_api_package
else
echo "s5224f_platform : Invalid option !"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,10 @@ platform_firmware_versions() {
install_python_api_package() {
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
}

remove_python_api_package() {
rv=$(pip show sonic-platform > /dev/null 2>/dev/null)
if [ $? -eq 0 ]; then
rv=$(pip uninstall -y sonic-platform > /dev/null 2>/dev/null)
fi

rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -eq 0 ]; then
rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null)
Expand Down Expand Up @@ -201,7 +194,7 @@ init_devnum

if [ "$1" == "init" ]; then
modprobe i2c-dev
modprobe i2c-mux-pca954x force_deselect_on_exit=1
modprobe i2c-mux-pca954x
modprobe ipmi_devintf
modprobe ipmi_si kipmid_max_busy_us=1000
modprobe i2c_ocores
Expand All @@ -217,6 +210,11 @@ if [ "$1" == "init" ]; then
/usr/bin/qsfp_irq_enable.py
platform_firmware_versions
echo 1000 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us
echo -2 > /sys/bus/i2c/drivers/pca954x/603-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/604-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/605-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/606-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/607-0074/idle_state

elif [ "$1" == "deinit" ]; then
sys_eeprom "delete_device"
Expand All @@ -225,9 +223,12 @@ elif [ "$1" == "deinit" ]; then
switch_board_qsfp_mux "delete_device"
modprobe -r i2c-mux-pca954x
modprobe -r i2c-dev
remove_python_api_package
modprobe -r acpi_ipmi
modprobe -r ipmi_devintf
modprobe -r ipmi_si
modprobe -r i2c_ocores
modprobe -r dell_s5232f_fpga_ocores
remove_python_api_package
else
echo "s5232f_platform : Invalid option !"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ init_devnum

if [ "$1" == "init" ]; then
modprobe i2c-dev
modprobe i2c-mux-pca954x force_deselect_on_exit=1
modprobe i2c-mux-pca954x
modprobe ipmi_devintf
modprobe ipmi_si
modprobe i2c_ocores
Expand All @@ -162,15 +162,27 @@ if [ "$1" == "init" ]; then
#/usr/bin/qsfp_irq_enable.py
install_python_api_package
platform_firmware_versions
echo -2 > /sys/bus/i2c/drivers/pca954x/603-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/604-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/605-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/606-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/607-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/608-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/609-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/610-0074/idle_state

elif [ "$1" == "deinit" ]; then
sys_eeprom "delete_device"
switch_board_qsfp "delete_device"
switch_board_qsfp_mux "delete_device"

remove_python_api_package
modprobe -r i2c-mux-pca954x
modprobe -r i2c-dev
modprobe -r acpi_ipmi
modprobe -r ipmi_devintf
modprobe -r ipmi_si
modprobe -r i2c_ocores
modprobe -r dell_s5248f_fpga_ocores
remove_python_api_package
else
echo "s5248f_platform : Invalid option !"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ init_devnum

if [ "$1" == "init" ]; then
modprobe i2c-dev
modprobe i2c-mux-pca954x force_deselect_on_exit=1
modprobe i2c-mux-pca954x
modprobe ipmi_devintf
modprobe ipmi_si
modprobe i2c_ocores
Expand All @@ -162,14 +162,32 @@ if [ "$1" == "init" ]; then
switch_board_led_default
#python /usr/bin/qsfp_irq_enable.py
platform_firmware_versions
echo -2 > /sys/bus/i2c/drivers/pca954x/603-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/604-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/605-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/606-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/607-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/608-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/609-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/610-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/611-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/612-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/613-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/614-0074/idle_state
echo -2 > /sys/bus/i2c/drivers/pca954x/615-0074/idle_state

elif [ "$1" == "deinit" ]; then
sys_eeprom "delete_device"
switch_board_qsfp "delete_device"
switch_board_qsfp_mux "delete_device"

modprobe -r i2c-mux-pca954x
modprobe -r i2c-dev
modprobe -r acpi_ipmi
modprobe -r ipmi_devintf
modprobe -r ipmi_si
modprobe -r i2c_ocores
modprobe -r dell_s5296f_fpga_ocores
remove_python_api_package
else
echo "s5296f_platform : Invalid option !"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <linux/i2c/sff-8436.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/gpio_keys.h>
#include <linux/nvram.h>

#define S6000_MUX_BASE_NR 10
Expand Down Expand Up @@ -47,17 +49,23 @@ static struct i2c_mux_gpio_platform_data s6000_mux_platform_data = {
.base_nr = S6000_MUX_BASE_NR,
.values = s6000_mux_values,
.n_values = ARRAY_SIZE(s6000_mux_values),
#if 0
.gpios = s6000_mux_gpios,
.n_gpios = ARRAY_SIZE(s6000_mux_gpios),
#endif
.idle = 0,
};

static struct gpiod_lookup_table dell_gpio_desc = {
.dev_id = "i2c-mux-gpio",
.table = {
GPIO_LOOKUP_IDX("sch_gpio.3168", 1, "mux", 0, GPIO_ACTIVE_HIGH ),
GPIO_LOOKUP_IDX("sch_gpio.3168", 2, "mux", 1, GPIO_ACTIVE_HIGH ),
{ },
},
};

static struct platform_device s6000_mux = {
.name = "i2c-mux-gpio",
.id = 0,
.dev = {
.init_name = "i2c-mux-gpio",
.platform_data = &s6000_mux_platform_data,
.release = device_release
},
Expand Down Expand Up @@ -1295,7 +1303,6 @@ static int __init dell_s6000_platform_init(void)
bool gpio_allocated = false;

printk("dell_s6000_platform module initialization\n");

ret = gpio_request(GPIO_I2C_MUX_PIN, "gpio10");
if(ret < 0) {
printk(KERN_WARNING "Failed to request gpio 10");
Expand All @@ -1315,6 +1322,7 @@ static int __init dell_s6000_platform_init(void)
goto error_gpio_init;
}

gpiod_add_lookup_table(&dell_gpio_desc);
ret = platform_driver_register(&cpld_driver);
if (ret) {
printk(KERN_WARNING "Fail to register cpld driver\n");
Expand Down Expand Up @@ -1382,7 +1390,7 @@ static int __init dell_s6000_platform_init(void)
static void __exit dell_s6000_platform_exit(void)
{
int i;

gpiod_remove_lookup_table(&dell_gpio_desc);
for (i = 0; i < MUX_CHANNEL_NUM; i++)
platform_device_unregister(&s6000_qsfp_mux[i]);
platform_device_unregister(&s6000_cpld);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,10 @@ switch_board_qsfp_lpmode() {
install_python_api_package() {
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
rv=$(pip install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)

}

remove_python_api_package() {
rv=$(pip show sonic-platform > /dev/null 2>/dev/null)
if [ $? -eq 0 ]; then
rv=$(pip uninstall -y sonic-platform > /dev/null 2>/dev/null)
fi

rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -eq 0 ]; then
rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null)
Expand Down
Loading

0 comments on commit c3c6a17

Please sign in to comment.