-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add Inventec D7054 platform support and update D7032 platform support #1052
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
83c33d7
D7032 updates and D7054 platform support
715de9c
Add D7054 device support
d575326
Inventec onie bugfix
3e827d2
Removed unnecessary import/changes
829081d
Removed onie changes
Balaselvi ac5e02d
Updated review comments
Balaselvi 95e54bd
Updated review comments
Balaselvi c18b8ec
Updated review comment
Balaselvi aad24b6
Updated review comment
Balaselvi 35d4397
Remove trailing line from EOF
Balaselvi 65b6dbc
Remove trailing lines from EOF.
Balaselvi d7bf629
Removed white spaces
Balaselvi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
#!/usr/bin/env python | ||
# sfputil.py | ||
# | ||
# Platform-specific SFP transceiver interface for SONiC | ||
# | ||
|
||
try: | ||
from sonic_sfp.sfputilbase import sfputilbase | ||
except ImportError, e: | ||
raise ImportError (str(e) + "- required module not found") | ||
import time | ||
from sonic_sfp.sfputilbase import SfpUtilBase | ||
except ImportError as e: | ||
raise ImportError("%s - required module not found" % str(e)) | ||
|
||
|
||
class sfputil(sfputilbase): | ||
"""Platform specific sfputil class""" | ||
class SfpUtil(SfpUtilBase): | ||
"""Platform-specific SfpUtil class""" | ||
|
||
port_start = 0 | ||
port_end = 31 | ||
ports_in_block = 32 | ||
PORT_START = 0 | ||
PORT_END = 31 | ||
PORTS_IN_BLOCK = 32 | ||
|
||
port_to_eeprom_mapping = {} | ||
_port_to_eeprom_mapping = {} | ||
port_to_i2c_mapping = { | ||
0: 22, | ||
1: 23, | ||
|
@@ -49,12 +53,118 @@ class sfputil(sfputilbase): | |
31: 21 | ||
} | ||
|
||
_qsfp_ports = range(0, ports_in_block + 1) | ||
@property | ||
def port_start(self): | ||
return self.PORT_START | ||
|
||
def __init__(self, port_num): | ||
# Override port_to_eeprom_mapping for class initialization | ||
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom' | ||
for x in range(self.port_start, self.port_end + 1): | ||
@property | ||
def port_end(self): | ||
return self.PORT_END | ||
|
||
@property | ||
def qsfp_ports(self): | ||
return range(0, self.PORTS_IN_BLOCK + 1) | ||
|
||
@property | ||
def port_to_eeprom_mapping(self): | ||
return self._port_to_eeprom_mapping | ||
|
||
def __init__(self): | ||
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" | ||
|
||
for x in range(0, self.port_end + 1): | ||
port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) | ||
self.port_to_eeprom_mapping[x] = port_eeprom_path | ||
sfputilbase.__init__(self, port_num) | ||
SfpUtilBase.__init__(self) | ||
|
||
def get_presence(self, port_num): | ||
# Check for invalid port_num | ||
if port_num < self.port_start or port_num > self.port_end: | ||
return False | ||
|
||
try: | ||
reg_file = open("/sys/class/swps/port"+str(port_num)+"/present") | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
reg_value = int(reg_file.readline().rstrip()) | ||
|
||
if reg_value == 0: | ||
return True | ||
|
||
return False | ||
|
||
def get_low_power_mode(self, port_num): | ||
# Check for invalid port_num | ||
if port_num < self.port_start or port_num > self.port_end: | ||
return False | ||
|
||
try: | ||
reg_file = open("/sys/class/swps/port"+str(port_num)+"/lpmod") | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
|
||
reg_value = int(reg_file.readline().rstrip()) | ||
|
||
if reg_value == 0: | ||
return False | ||
|
||
return True | ||
|
||
def set_low_power_mode(self, port_num, lpmode): | ||
# Check for invalid port_num | ||
if port_num < self.port_start or port_num > self.port_end: | ||
return False | ||
|
||
try: | ||
reg_file = open("/sys/class/swps/port"+str(port_num)+"/lpmod", "r+") | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
reg_value = int(reg_file.readline().rstrip()) | ||
|
||
# LPMode is active high; set or clear the bit accordingly | ||
if lpmode is True: | ||
reg_value = 1 | ||
else: | ||
reg_value = 0 | ||
|
||
reg_file.write(hex(reg_value)) | ||
reg_file.close() | ||
|
||
return True | ||
|
||
def reset(self, port_num): | ||
QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/class/swps/port"+str(port_num)+"/reset" | ||
# Check for invalid port_num | ||
if port_num < self.port_start or port_num > self.port_end: | ||
return False | ||
|
||
try: | ||
reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "r+") | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
reg_value = 0 | ||
reg_file.write(hex(reg_value)) | ||
reg_file.close() | ||
|
||
# Sleep 2 second to allow it to settle | ||
time.sleep(2) | ||
|
||
# Flip the value back write back to the register to take port out of reset | ||
try: | ||
reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "r+") | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
reg_value = 1 | ||
reg_file.write(hex(reg_value)) | ||
reg_file.close() | ||
|
||
return True | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of removing the extra trailing newline, it appears you added spaces? Please remove this line altogether. |
56 changes: 56 additions & 0 deletions
56
device/inventec/x86_64-inventec_d7054q28b-r0/INVENTEC-D7054Q28B-S48-Q6/port_config.ini
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,56 @@ | ||
# 48x25G + 6x100G | ||
# name lanes alias | ||
Ethernet0 2 Ethernet0 | ||
Ethernet4 1 Ethernet4 | ||
Ethernet8 4 Ethernet8 | ||
Ethernet12 3 Ethernet12 | ||
Ethernet16 6 Ethernet16 | ||
Ethernet20 5 Ethernet20 | ||
Ethernet24 8 Ethernet24 | ||
Ethernet28 7 Ethernet28 | ||
Ethernet32 10 Ethernet32 | ||
Ethernet36 9 Ethernet36 | ||
Ethernet40 12 Ethernet40 | ||
Ethernet44 11 Ethernet44 | ||
Ethernet48 22 Ethernet48 | ||
Ethernet52 21 Ethernet52 | ||
Ethernet56 24 Ethernet56 | ||
Ethernet60 23 Ethernet60 | ||
Ethernet64 34 Ethernet64 | ||
Ethernet68 33 Ethernet68 | ||
Ethernet72 36 Ethernet72 | ||
Ethernet76 35 Ethernet76 | ||
Ethernet80 38 Ethernet80 | ||
Ethernet84 37 Ethernet84 | ||
Ethernet88 40 Ethernet88 | ||
Ethernet92 39 Ethernet92 | ||
Ethernet96 42 Ethernet96 | ||
Ethernet100 41 Ethernet100 | ||
Ethernet104 44 Ethernet104 | ||
Ethernet108 43 Ethernet108 | ||
Ethernet112 50 Ethernet112 | ||
Ethernet116 49 Ethernet116 | ||
Ethernet120 52 Ethernet120 | ||
Ethernet124 51 Ethernet124 | ||
Ethernet128 54 Ethernet128 | ||
Ethernet132 53 Ethernet132 | ||
Ethernet136 56 Ethernet136 | ||
Ethernet140 55 Ethernet140 | ||
Ethernet144 66 Ethernet144 | ||
Ethernet148 65 Ethernet148 | ||
Ethernet152 68 Ethernet152 | ||
Ethernet156 67 Ethernet156 | ||
Ethernet160 70 Ethernet160 | ||
Ethernet164 69 Ethernet164 | ||
Ethernet168 72 Ethernet168 | ||
Ethernet172 71 Ethernet172 | ||
Ethernet176 82 Ethernet176 | ||
Ethernet180 81 Ethernet180 | ||
Ethernet184 84 Ethernet184 | ||
Ethernet188 83 Ethernet188 | ||
Ethernet192 85,86,87,88 Ethernet192 | ||
Ethernet196 97,98,99,100 Ethernet196 | ||
Ethernet200 105,106,107,108 Ethernet200 | ||
Ethernet204 101,102,103,104 Ethernet204 | ||
Ethernet208 117,118,119,120 Ethernet208 | ||
Ethernet212 109,110,111,112 Ethernet212 |
2 changes: 2 additions & 0 deletions
2
device/inventec/x86_64-inventec_d7054q28b-r0/INVENTEC-D7054Q28B-S48-Q6/sai.profile
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,2 @@ | ||
SAI_INIT_CONFIG_FILE=/etc/bcm/th-d7054q28b-48x10g-6x100g.config.bcm | ||
SAI_NUM_ECMP_MEMBERS=32 |
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,4 @@ | ||
CONSOLE_PORT=0x3f8 | ||
CONSOLE_DEV=0 | ||
CONSOLE_SPEED=115200 | ||
VAR_LOG_SIZE=1024 |
146 changes: 146 additions & 0 deletions
146
device/inventec/x86_64-inventec_d7054q28b-r0/minigraph.xml
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,146 @@ | ||
<DeviceMiniGraph xmlns="Microsoft.Search.Autopilot.Evolution" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | ||
<CpgDec> | ||
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> | ||
<PeeringSessions> | ||
<BGPSession> | ||
<StartRouter>OCPSCH0104001MS</StartRouter> | ||
<StartPeer>10.10.1.26</StartPeer> | ||
<EndRouter>SONiC-Inventec-d7054</EndRouter> | ||
<EndPeer>10.10.1.25</EndPeer> | ||
<Multihop>1</Multihop> | ||
<HoldTime>10</HoldTime> | ||
<KeepAliveTime>3</KeepAliveTime> | ||
</BGPSession> | ||
<BGPSession> | ||
<StartRouter>OCPSCH0104002MS</StartRouter> | ||
<StartPeer>10.10.2.26</StartPeer> | ||
<EndRouter>SONiC-Inventec-d7054</EndRouter> | ||
<EndPeer>10.10.2.25</EndPeer> | ||
<Multihop>1</Multihop> | ||
<HoldTime>10</HoldTime> | ||
<KeepAliveTime>3</KeepAliveTime> | ||
</BGPSession> | ||
</PeeringSessions> | ||
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
<a:BGPRouterDeclaration> | ||
<a:ASN>64536</a:ASN> | ||
<a:Hostname>SONiC-Inventec-d7054</a:Hostname> | ||
<a:Peers> | ||
<BGPPeer> | ||
<Address>10.10.1.26</Address> | ||
<RouteMapIn i:nil="true"/> | ||
<RouteMapOut i:nil="true"/> | ||
</BGPPeer> | ||
<BGPPeer> | ||
<Address>10.10.2.26</Address> | ||
<RouteMapIn i:nil="true"/> | ||
<RouteMapOut i:nil="true"/> | ||
</BGPPeer> | ||
</a:Peers> | ||
<a:RouteMaps/> | ||
</a:BGPRouterDeclaration> | ||
<a:BGPRouterDeclaration> | ||
<a:ASN>64542</a:ASN> | ||
<a:Hostname>OCPSCH0104001MS</a:Hostname> | ||
<a:RouteMaps/> | ||
</a:BGPRouterDeclaration> | ||
<a:BGPRouterDeclaration> | ||
<a:ASN>64543</a:ASN> | ||
<a:Hostname>OCPSCH0104002MS</a:Hostname> | ||
<a:RouteMaps/> | ||
</a:BGPRouterDeclaration> | ||
</Routers> | ||
</CpgDec> | ||
<DpgDec> | ||
<DeviceDataPlaneInfo> | ||
<IPSecTunnels/> | ||
<LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
<a:LoopbackIPInterface> | ||
<Name>HostIP</Name> | ||
<AttachTo>Loopback0</AttachTo> | ||
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux"> | ||
<b:IPPrefix>100.0.0.9/32</b:IPPrefix> | ||
</a:Prefix> | ||
<a:PrefixStr>100.0.0.9/32</a:PrefixStr> | ||
</a:LoopbackIPInterface> | ||
</LoopbackIPInterfaces> | ||
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
</ManagementIPInterfaces> | ||
<MplsInterfaces/> | ||
<MplsTeInterfaces/> | ||
<RsvpInterfaces/> | ||
<Hostname>SONiC-Inventec-d7054</Hostname> | ||
<PortChannelInterfaces/> | ||
<VlanInterfaces/> | ||
<IPInterfaces> | ||
<IPInterface> | ||
<Name i:nil="true"/> | ||
<AttachTo>Ethernet0</AttachTo> | ||
<Prefix>10.10.1.25/30</Prefix> | ||
</IPInterface> | ||
<IPInterface> | ||
<Name i:nil="true"/> | ||
<AttachTo>Ethernet4</AttachTo> | ||
<Prefix>10.10.2.25/30</Prefix> | ||
</IPInterface> | ||
</IPInterfaces> | ||
<DataAcls/> | ||
<AclInterfaces/> | ||
<DownstreamSummaries/> | ||
<DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> | ||
</DeviceDataPlaneInfo> | ||
</DpgDec> | ||
<PngDec> | ||
<DeviceInterfaceLinks> | ||
<DeviceLinkBase i:type="DeviceInterfaceLink"> | ||
<Bandwidth>40000</Bandwidth> | ||
<ElementType>DeviceInterfaceLink</ElementType> | ||
<EndDevice>OCPSCH0104001MS</EndDevice> | ||
<EndPort>Ethernet24</EndPort> | ||
<StartDevice>SONiC-Inventec-d7054</StartDevice> | ||
<StartPort>Ethernet0</StartPort> | ||
</DeviceLinkBase> | ||
<DeviceLinkBase i:type="DeviceInterfaceLink"> | ||
<Bandwidth>40000</Bandwidth> | ||
<ElementType>DeviceInterfaceLink</ElementType> | ||
<EndDevice>OCPSCH0104002MS</EndDevice> | ||
<EndPort>Ethernet24</EndPort> | ||
<StartDevice>SONiC-Inventec-d7054</StartDevice> | ||
<StartPort>Ethernet4</StartPort> | ||
</DeviceLinkBase> | ||
</DeviceInterfaceLinks> | ||
<Devices> | ||
<Device i:type="LeafRouter"> | ||
<Hostname>SONiC-Inventec-d7054</Hostname> | ||
<HwSku>INVENTEC-D7054Q28B-S48-Q6</HwSku> | ||
</Device> | ||
</Devices> | ||
</PngDec> | ||
<MetadataDeclaration> | ||
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"> | ||
<a:DeviceMetadata> | ||
<a:Name>SONiC-Inventec-d7054</a:Name> | ||
<a:Properties> | ||
<a:DeviceProperty> | ||
<a:Name>DhcpResources</a:Name> | ||
<a:Reference i:nil="true"/> | ||
<a:Value></a:Value> | ||
</a:DeviceProperty> | ||
<a:DeviceProperty> | ||
<a:Name>NtpResources</a:Name> | ||
<a:Reference i:nil="true"/> | ||
<a:Value>0.debian.pool.ntp.org;1.debian.pool.ntp.org;2.debian.pool.ntp.org;3.debian.pool.ntp.org</a:Value> | ||
</a:DeviceProperty> | ||
<a:DeviceProperty> | ||
<a:Name>SyslogResources</a:Name> | ||
<a:Reference i:nil="true"/> | ||
<a:Value></a:Value> | ||
</a:DeviceProperty> | ||
</a:Properties> | ||
</a:DeviceMetadata> | ||
</Devices> | ||
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/> | ||
</MetadataDeclaration> | ||
<Hostname>SONiC-Inventec-d7054</Hostname> | ||
<HwSku>INVENTEC-D7054Q28B-S48-Q6</HwSku> | ||
</DeviceMiniGraph> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace remains. Please remove.