DellEMC S6100 CPLD upgrade support (#3834)
* DelllEMC S6100 CPLD upgrade support * Typo: CPLD
This commit is contained in:
parent
ba88f9c0ae
commit
8ad48a5243
32
device/dell/x86_64-dell_s6100_c2538-r0/platform_reboot
Executable file
32
device/dell/x86_64-dell_s6100_c2538-r0/platform_reboot
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import os
|
||||
import struct
|
||||
|
||||
PORT_RES = '/dev/port'
|
||||
POWER_CYCLE = '/tmp/powercycle'
|
||||
|
||||
|
||||
def portio_reg_write(resource, offset, val):
|
||||
fd = os.open(resource, os.O_RDWR)
|
||||
if(fd < 0):
|
||||
print 'file open failed %s" % resource'
|
||||
return
|
||||
if(os.lseek(fd, offset, os.SEEK_SET) != offset):
|
||||
print 'lseek failed on %s' % resource
|
||||
return
|
||||
ret = os.write(fd, struct.pack('B', val))
|
||||
if(ret != 1):
|
||||
print 'write failed %d' % ret
|
||||
return
|
||||
os.close(fd)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# power-cycle the switch
|
||||
if os.path.exists(POWER_CYCLE):
|
||||
print "CPLD upgrade detected. Power-cycling the unit.."
|
||||
os.system('io_rd_wr.py --set --val 05 --offset 210; io_rd_wr.py --set --val 00 --offset 211; io_rd_wr.py --set --val 03 --offset 213')
|
||||
|
||||
portio_reg_write(PORT_RES, 0xcf9, 0xe)
|
||||
|
BIN
device/dell/x86_64-dell_s6100_c2538-r0/s6100_cpld_upgrade
Executable file
BIN
device/dell/x86_64-dell_s6100_c2538-r0/s6100_cpld_upgrade
Executable file
Binary file not shown.
@ -4,7 +4,6 @@ common/dell_i2c_utils.sh usr/local/bin
|
||||
common/io_rd_wr.py usr/local/bin
|
||||
common/fstrim.timer etc/systemd/system
|
||||
common/fstrim.service etc/systemd/system
|
||||
common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
|
||||
s6100/scripts/platform_sensors.py usr/local/bin
|
||||
s6100/scripts/sensors usr/bin
|
||||
s6100/systemd/platform-modules-s6100.service etc/systemd/system
|
||||
|
Loading…
Reference in New Issue
Block a user