Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM support, Sfputil not showing qsfp devices after powercycle bugfix #1338

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
obj-m += inv_cpld.o inv_psoc.o
obj-m += inv_platform.o
obj-m += inv_eeprom.o
obj-m += optoe.o
obj-m += swps.o
swps-objs := inv_swps.o io_expander.o transceiver.o

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,7 @@ common_ioexp_init(struct ioexp_obj_s *self) {

int chip_id, offset, err_code;
struct ioexp_addr_s *addr_p;

if (self->mode == IOEXP_MODE_DIRECT) { ///important
goto update_common_ioexp_init;
}

/* Setup default value to each physical IO Expander */
for (chip_id=0; chip_id<(self->ioexp_map_p->chip_amount); chip_id++){
/* Get address mapping */
Expand All @@ -390,7 +387,6 @@ common_ioexp_init(struct ioexp_obj_s *self) {
}
}

update_common_ioexp_init:
/* Check and update info to object */
err_code = self->update_all(self, 1, "common_ioexp_init");
if (err_code < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def exec_cmd(cmd, show):
'inv_platform',
'inv_psoc',
'inv_cpld',
'optoe',
'swps']


Expand Down Expand Up @@ -152,29 +153,44 @@ def system_install():
return status

for i in range(22,30):
status, output =exec_cmd("echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-4/i2c-"+str(i)+"/new_device", 1)
status, output =exec_cmd("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-4/i2c-"+str(i)+"/new_device", 1)
if status:
print output
if FORCE == 0:
return status
for i in range(30,38):
status, output =exec_cmd("echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-5/i2c-"+str(i)+"/new_device", 1)
status, output =exec_cmd("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-5/i2c-"+str(i)+"/new_device", 1)
if status:
print output
if FORCE == 0:
return status
for i in range(6,14):
status, output =exec_cmd("echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-2/i2c-"+str(i)+"/new_device", 1)
status, output =exec_cmd("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-2/i2c-"+str(i)+"/new_device", 1)
if status:
print output
if FORCE == 0:
return status
for i in range(14,22):
status, output =exec_cmd("echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-3/i2c-"+str(i)+"/new_device", 1)
status, output =exec_cmd("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-0/i2c-3/i2c-"+str(i)+"/new_device", 1)
if status:
print output
if FORCE == 0:
return status
return status
#Initialize the port_name
for i in range(22,38):
port=i-22
status, output =exec_cmd("echo port"+str(port)+"> /sys/bus/i2c/devices/"+str(i)+"-0050/port_name", 1)
if status:
print output
if FORCE == 0:
return status
for i in range(6,22):
port=i+10
status, output =exec_cmd("echo port"+str(port)+"> /sys/bus/i2c/devices/"+str(i)+"-0050/port_name", 1)
if status:
print output
if FORCE == 0:
return status
return


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
obj-m += inv_cpld.o inv_psoc.o
obj-m += inv_platform.o
obj-m += inv_eeprom.o
obj-m += optoe.o
obj-m += swps.o
swps-objs := inv_swps.o io_expander.o transceiver.o

Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,6 @@ common_ioexp_init(struct ioexp_obj_s *self) {
int chip_id, offset, err_code;
struct ioexp_addr_s *addr_p;

if (self->mode == IOEXP_MODE_DIRECT) { ///important
goto update_common_ioexp_init;
}
/* Setup default value to each physical IO Expander */
for (chip_id=0; chip_id<(self->ioexp_map_p->chip_amount); chip_id++){
/* Get address mapping */
Expand All @@ -432,7 +429,6 @@ common_ioexp_init(struct ioexp_obj_s *self) {
}
}

update_common_ioexp_init:
/* Check and update info to object */
err_code = self->update_all(self, 1, "common_ioexp_init");
if (err_code < 0) {
Expand Down