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

merge with master #1

Merged
merged 28 commits into from
Apr 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c6a9201
[mellanox]: Update MLNX SAI and SDK pointers (#1531)
Mar 26, 2018
9b14add
[platform]: Upgrade Nephos SAI to v1.2.4 (#1530)
simonJi2018 Mar 26, 2018
9f3d3f1
[device] Update Arista drivers submodule (#1533)
Staphylo Mar 27, 2018
da42bd7
[config]: Apply CRM default config to DB on start (#1534)
Mar 27, 2018
f74de89
[telemetry]: SONiC system telemetry Support (#1526)
jipanyang Mar 27, 2018
2a1ae65
Update sonic-utilities to the latest master (#1537)
pavel-shirshov Mar 28, 2018
4daf002
[updategraph] Remove pending_initialization flag after first boot (#1…
taoyl-ms Mar 28, 2018
208ca43
[hostcfgd] Fix a bug that tacacs key is wrongly modified (#1536)
taoyl-ms Mar 28, 2018
f435804
quagga container processes could be restarted within a second (#1541)
pavel-shirshov Mar 28, 2018
5e2773d
[submodules]: update swss and sairedis (#1535)
lguohan Mar 29, 2018
ad0ad91
[device]: Accton 5712 Modify sfp to support oom and sfp access by cpl…
jostar-yang Mar 29, 2018
37d0ff3
[utililities] update sonic-utilities submodule (#1546)
yxieca Mar 29, 2018
a5bfa2c
[device]: do not export gpio{1,2} if already exist on S6000 (#1547)
lguohan Mar 30, 2018
d66e79d
[installer]: remove single quotes around the value when create machin…
lguohan Mar 30, 2018
8572f84
[sonic-utilities] include reboot scripts improvements (#1554)
yxieca Mar 31, 2018
11b0cd9
[baseimage]: bring down eth0 before restart networking (#1555)
lguohan Apr 2, 2018
a04401f
[minigraph.py] Add support to parse tacacs server information (#1549)
taoyl-ms Apr 2, 2018
dc7c524
[mellanox]: Update MLNX SAI pointer (#1557)
Apr 3, 2018
1c32321
[device]: Add a new supported device accton-as7116 (#1539)
simonJi2018 Apr 3, 2018
ed915e3
[build templates] Add environment variables for mellanox syncd cont…
keboliu Apr 3, 2018
0996356
[installer]: Suppress tar xz warning about time stamp in the future, …
qiluo-msft Apr 5, 2018
1051d82
Revert "[installer]: Suppress tar xz warning about time stamp in the …
lguohan Apr 5, 2018
4754b43
[installer]: Suppress tar xz warning about time stamp in the future, …
qiluo-msft Apr 5, 2018
e6015d8
[sonic-platform-common] Update submodule (#1563)
jleveque Apr 6, 2018
ac2861e
[Arista] Set MAC address of mangement port in initramfs (#1565)
byu343 Apr 6, 2018
30466b2
[router advertiser] Only start radvd process if device role is 'ToRRo…
jleveque Apr 7, 2018
5a47b81
[submodules]: update sonic-swss (#1570)
lguohan Apr 7, 2018
4d3f44b
[submodules]: update sonic-utilities (#1571)
lguohan Apr 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dockers/docker-router-advertiser/Dockerfile
dockers/docker-snmp-sv2/Dockerfile
dockers/docker-teamd/Dockerfile
dockers/docker-sonic-mgmt/Dockerfile
dockers/docker-sonic-telemetry/Dockerfile
platform/*/docker-syncd-*/Dockerfile
platform/*/docker-syncd-*-rpc/Dockerfile
platform/vs/docker-sonic-vs/Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ SONIC_BUILD_INSTRUCTION := make \
USERNAME=$(USERNAME) \
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
HTTP_PROXY=$(http_proxy) \
HTTPS_PROXY=$(https_proxy)
HTTPS_PROXY=$(https_proxy) \
ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY)

.PHONY: sonic-slave-build sonic-slave-bash init reset

Expand Down
61 changes: 61 additions & 0 deletions device/accton/x86_64-accton_as5712_54x-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python

#############################################################################
# Accton
#
# Module contains an implementation of SONiC PSU Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################

import os.path

try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError (str(e) + "- required module not found")

class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""

def __init__(self):
PsuBase.__init__(self)

self.psu_path = "/sys/bus/i2c/devices/"
self.psu_presence = "/psu_present"
self.psu_oper_status = "/psu_power_good"
self.psu_mapping = {
1: "57-0038",
2: "58-003b",
}

def get_num_psus(self):
return len(self.psu_mapping)

def get_psu_status(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index]+self.psu_oper_status
try:
with open(node, 'r') as power_status:
status = int(power_status.read())
except IOError:
return False

return status == 1

def get_psu_presence(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index] + self.psu_presence
try:
with open(node, 'r') as presence_status:
status = int(presence_status.read())
except IOError:
return False

return status == 1
170 changes: 88 additions & 82 deletions device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,87 @@ class SfpUtil(SfpUtilBase):
QSFP_PORT_END = 72

BASE_VAL_PATH = "/sys/class/i2c-adapter/i2c-{0}/{1}-0050/"
BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/"
BASE_CPLD2_PATH = "/sys/bus/i2c/devices/0-0061/"
BASE_CPLD3_PATH = "/sys/bus/i2c/devices/0-0062/"

_port_to_is_present = {}
_port_to_lp_mode = {}

_port_to_eeprom_mapping = {}
_port_to_i2c_mapping = {
0: [2, 2],
1: [3, 3],
2: [4, 4],
3: [5, 5],
4: [6, 6],
5: [7, 7],
6: [8, 8],
7: [9, 9],
8: [10, 10],
9: [11, 11],
10: [12, 12],
11: [13, 13],
12: [14, 14],
13: [15, 15],
14: [16, 16],
15: [17, 17],
16: [18, 18],
17: [19, 19],
18: [20, 20],
19: [21, 21],
20: [22, 22],
21: [23, 23],
22: [24, 24],
23: [25, 25],
24: [26, 26],
25: [27, 27],
26: [28, 28],
27: [29, 29],
28: [30, 30],
29: [31, 31],
30: [32, 32],
31: [33, 33],
32: [34, 34],
33: [35, 35],
34: [36, 36],
35: [37, 37],
36: [38, 38],
37: [39, 39],
38: [40, 40],
39: [41, 41],
40: [42, 42],
41: [43, 43],
42: [44, 44],
43: [45, 45],
44: [46, 46],
45: [47, 47],
46: [48, 48],
47: [49, 49],
48: [50, 50], #QSFP49
49: [50, 50],
50: [50, 50],
51: [50, 50],
52: [52, 52], #QSFP50
53: [52, 52],
54: [52, 52],
55: [52, 52],
56: [54, 54], #QSFP51
57: [54, 54],
58: [54, 54],
59: [54, 54],
60: [51, 51], #QSFP52
61: [51, 51],
62: [51, 51],
63: [51, 51],
0: [1, 2],
1: [2, 3],
2: [3, 4],
3: [4, 5],
4: [5, 6],
5: [6, 7],
6: [7, 8],
7: [8, 9],
8: [9, 10],
9: [10, 11],
10: [11, 12],
11: [12, 13],
12: [13, 14],
13: [14, 15],
14: [15, 16],
15: [16, 17],
16: [17, 18],
17: [18, 19],
18: [19, 20],
19: [20, 21],
20: [21, 22],
21: [22, 23],
22: [23, 24],
23: [24, 25],
24: [25, 26],
25: [26, 27],
26: [27, 28],
27: [28, 29],
28: [29, 30],
29: [30, 31],
30: [31, 32],
31: [32, 33],
32: [33, 34],
33: [34, 35],
34: [35, 36],
35: [36, 37],
36: [37, 38],
37: [38, 39],
38: [39, 40],
39: [40, 41],
40: [41, 42],
41: [42, 43],
42: [43, 44],
43: [44, 45],
44: [45, 46],
45: [46, 47],
46: [47, 48],
47: [48, 49],
48: [49, 50],#QSFP49
49: [49, 50],
50: [49, 50],
51: [49, 50],
52: [50, 52],#QSFP50
53: [50, 52],
54: [50, 52],
55: [50, 52],
56: [51, 54],#QSFP51
57: [51, 54],
58: [51, 54],
59: [51, 54],
60: [52, 51],#QSFP52
61: [52, 51],
62: [52, 51],
63: [52, 51],
64: [53, 53], #QSFP53
65: [53, 53],
66: [53, 53],
67: [53, 53],
68: [55, 55], #QSFP54
69: [55, 55],
70: [55, 55],
71: [55, 55],
68: [54, 55],#QSFP54
69: [54, 55],
70: [54, 55],
71: [54, 55],
}

@property
Expand Down Expand Up @@ -125,12 +128,12 @@ def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

def __init__(self):
eeprom_path = self.BASE_VAL_PATH + "sfp_eeprom"
eeprom_path = self.BASE_OOM_PATH + "eeprom"

for x in range(0, self.port_end+1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(
self._port_to_i2c_mapping[x][0],
self._port_to_i2c_mapping[x][1])
self._port_to_i2c_mapping[x][1]
)

SfpUtilBase.__init__(self)

Expand All @@ -139,8 +142,13 @@ def get_presence(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False

present_path = self.BASE_VAL_PATH + "sfp_is_present"
self.__port_to_is_present = present_path.format(self._port_to_i2c_mapping[port_num][0], self._port_to_i2c_mapping[port_num][1])
if port_num < 24:
present_path = self.BASE_CPLD2_PATH + "module_present_" + str(self._port_to_i2c_mapping[port_num][0])
else:
present_path = self.BASE_CPLD3_PATH + "module_present_" + str(self._port_to_i2c_mapping[port_num][0])

self.__port_to_is_present = present_path


try:
val_file = open(self.__port_to_is_present)
Expand All @@ -161,11 +169,10 @@ def get_low_power_mode(self, port_num):
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

lp_mode_path = self.BASE_VAL_PATH + "sfp_lp_mode"
self.__port_to_lp_mode = lp_mode_path.format(self._port_to_i2c_mapping[port_num][0], self._port_to_i2c_mapping[port_num][1])
lp_mode_path = self.BASE_CPLD3_PATH + "module_lp_mode_" + str(self._port_to_i2c_mapping[port_num][0])

try:
val_file = open(self.__port_to_lp_mode)
val_file = open(lp_mode_path)
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
Expand All @@ -183,11 +190,10 @@ def set_low_power_mode(self, port_num, lpmode):
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

lp_mode_path = self.BASE_VAL_PATH + "sfp_lp_mode"
self.__port_to_lp_mode = lp_mode_path.format(self._port_to_i2c_mapping[port_num][0], self._port_to_i2c_mapping[port_num][1])
lp_mode_path = self.BASE_CPLD3_PATH + "module_lp_mode_" + str(self._port_to_i2c_mapping[port_num][0])

try:
reg_file = open(self.__port_to_lp_mode, 'r+')
reg_file = open(lp_mode_path, 'r+')
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
Expand All @@ -206,10 +212,10 @@ def reset(self, port_num):
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

mod_rst_path = self.BASE_VAL_PATH + "sfp_mod_rst"
self.__port_to_mod_rst = mod_rst_path.format(self._port_to_i2c_mapping[port_num][0], self._port_to_i2c_mapping[port_num][1])
mod_rst_path = lp_mode_path = self.BASE_CPLD3_PATH + "module_reset_" + str(self._port_to_i2c_mapping[port_num][0])

try:
reg_file = open(self.__port_to_mod_rst, 'r+')
reg_file = open(mod_rst_path, 'r+')
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# name lanes alias index
Ethernet0 8 Ethernet1/1 0
Ethernet1 9 Ethernet2/1 1
Ethernet2 10 Ethernet3/1 2
Ethernet3 11 Ethernet4/1 3
Ethernet4 12 Ethernet5/1 4
Ethernet5 13 Ethernet6/1 5
Ethernet6 14 Ethernet7/1 6
Ethernet7 15 Ethernet8/1 7
Ethernet8 16 Ethernet9/1 8
Ethernet9 17 Ethernet10/1 9
Ethernet10 18 Ethernet11/1 10
Ethernet11 19 Ethernet12/1 11
Ethernet12 20 Ethernet13/1 12
Ethernet13 21 Ethernet14/1 13
Ethernet14 22 Ethernet15/1 14
Ethernet15 23 Ethernet16/1 15
Ethernet16 32 Ethernet17/1 16
Ethernet17 33 Ethernet18/1 17
Ethernet18 34 Ethernet19/1 18
Ethernet19 35 Ethernet20/1 19
Ethernet20 40 Ethernet21/1 20
Ethernet21 41 Ethernet22/1 21
Ethernet22 42 Ethernet23/1 22
Ethernet23 43 Ethernet24/1 23
Ethernet24 48 Ethernet25/1 24
Ethernet25 49 Ethernet26/1 25
Ethernet26 50 Ethernet27/1 26
Ethernet27 51 Ethernet28/1 27
Ethernet28 56 Ethernet29/1 28
Ethernet29 57 Ethernet30/1 29
Ethernet30 58 Ethernet31/1 30
Ethernet31 59 Ethernet32/1 31
Ethernet32 64 Ethernet33/1 32
Ethernet33 65 Ethernet34/1 33
Ethernet34 66 Ethernet35/1 34
Ethernet35 67 Ethernet36/1 35
Ethernet36 68 Ethernet37/1 36
Ethernet37 69 Ethernet38/1 37
Ethernet38 70 Ethernet39/1 38
Ethernet39 71 Ethernet40/1 39
Ethernet40 72 Ethernet41/1 40
Ethernet41 73 Ethernet42/1 41
Ethernet42 74 Ethernet43/1 42
Ethernet43 75 Ethernet44/1 43
Ethernet44 76 Ethernet45/1 44
Ethernet45 77 Ethernet46/1 45
Ethernet46 78 Ethernet47/1 46
Ethernet47 79 Ethernet48/1 47
Ethernet48 80 Ethernet49/1 48
Ethernet49 81 Ethernet50/1 49
Ethernet50 82 Ethernet51/1 50
Ethernet51 83 Ethernet52/1 51
Ethernet52 84,85,86,87 Ethernet53/1 52
Ethernet53 104,105,106,107 Ethernet54/1 53
Ethernet54 108,109,110,111 Ethernet55/1 54
Ethernet55 112,113,114,115 Ethernet56/1 55
Ethernet56 116,117,118,119 Ethernet57/1 56
Loading