sonic-buildimage/device/dell/x86_64-dellemc_z9264f_c3538-r0/platform_reboot
Sudharsan D.G 1ffb34b4e3 [devices]: Dell z9264f bringup (#2415)
* Updating Z9264f for A01 board

* Adding platform_reboot plugin to Z9264f

* Change execute mode for platform_reboot

* Indenting python files

* Adding missed service file

* Addressing code review comments

* Modified the polling logic in transceiver change event
2019-01-08 21:14:18 -08:00

26 lines
561 B
Python

#!/usr/bin/python
import sys
import os
import struct
PORT_RES = '/dev/port'
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__":
portio_reg_write(PORT_RES, 0xcf9, 0xe)