-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[devices]: platform_reboot support for Dell S6100/Z9100 platforms (#2420
- Loading branch information
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
platform/broadcom/sonic-platform-modules-dell/common/platform_reboot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters