sonic-buildimage/platform/broadcom/sonic-platform-modules-dell/common/platform_reboot
Arun Saravanan Balachandran bcc6c64335
[DellEMC]: Platform modules Python3 compliance and other changes (#5609)
- Make DellEMC platform modules Python3 compliant.
- Change return type of PSU Platform APIs in DellEMC Z9264, S5232 and Thermal Platform APIs in S5232 to 'float'.
- Remove multiple copies of pcisysfs.py.
- PEP8 style changes for utility scripts.
- Build and install Python3 version of sonic_platform package.
- Fix minor Platform API issues.
2020-10-17 12:31:55 -07:00

24 lines
552 B
Python
Executable File

#!/usr/bin/python3
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)