Skip to content

Commit

Permalink
[Ingrasys] Add platform support for S9280-64X with Barefoot ASIC
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic committed Jun 8, 2018
1 parent 2afd4c0 commit 29b9d90
Show file tree
Hide file tree
Showing 12 changed files with 770 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# name lanes alias speed autoneg fec index
Ethernet0 0,1,2,3 Ethernet0 100000 0 0 0
Ethernet4 4,5,6,7 Ethernet4 100000 0 0 1
Ethernet8 8,9,10,11 Ethernet8 100000 0 0 2
Ethernet12 12,13,14,15 Ethernet12 100000 0 0 3
Ethernet16 16,17,18,19 Ethernet16 100000 0 0 4
Ethernet20 20,21,22,23 Ethernet20 100000 0 0 5
Ethernet24 24,25,26,27 Ethernet24 100000 0 0 6
Ethernet28 28,29,30,31 Ethernet28 100000 0 0 7
Ethernet32 32,33,34,35 Ethernet32 100000 0 0 8
Ethernet36 36,37,38,39 Ethernet36 100000 0 0 9
Ethernet40 40,41,42,43 Ethernet40 100000 0 0 10
Ethernet44 44,45,46,47 Ethernet44 100000 0 0 11
Ethernet48 48,49,50,51 Ethernet48 100000 0 0 12
Ethernet52 52,53,54,55 Ethernet52 100000 0 0 13
Ethernet56 56,57,58,59 Ethernet56 100000 0 0 14
Ethernet60 60,61,62,63 Ethernet60 100000 0 0 15
Ethernet64 64,65,66,67 Ethernet64 100000 0 0 16
Ethernet68 68,69,70,71 Ethernet68 100000 0 0 17
Ethernet72 72,73,74,75 Ethernet72 100000 0 0 18
Ethernet76 76,77,78,79 Ethernet76 100000 0 0 19
Ethernet80 80,81,82,83 Ethernet80 100000 0 0 20
Ethernet84 84,85,86,87 Ethernet84 100000 0 0 21
Ethernet88 88,89,90,91 Ethernet88 100000 0 0 22
Ethernet92 92,93,94,95 Ethernet92 100000 0 0 23
Ethernet96 96,97,98,99 Ethernet96 100000 0 0 24
Ethernet100 100,101,102,103 Ethernet100 100000 0 0 25
Ethernet104 104,105,106,107 Ethernet104 100000 0 0 26
Ethernet108 108,109,110,111 Ethernet108 100000 0 0 27
Ethernet112 112,113,114,115 Ethernet112 100000 0 0 28
Ethernet116 116,117,118,119 Ethernet116 100000 0 0 29
Ethernet120 120,121,122,123 Ethernet120 100000 0 0 30
Ethernet124 124,125,126,127 Ethernet124 100000 0 0 31
Ethernet128 128,129,130,131 Ethernet128 100000 0 0 32
Ethernet132 132,133,134,135 Ethernet132 100000 0 0 33
Ethernet136 136,137,138,139 Ethernet136 100000 0 0 34
Ethernet140 140,141,142,143 Ethernet140 100000 0 0 35
Ethernet144 144,145,146,147 Ethernet144 100000 0 0 36
Ethernet148 148,149,150,151 Ethernet148 100000 0 0 37
Ethernet152 152,153,154,155 Ethernet152 100000 0 0 38
Ethernet156 156,157,158,159 Ethernet156 100000 0 0 39
Ethernet160 160,161,162,163 Ethernet160 100000 0 0 40
Ethernet164 164,165,166,167 Ethernet164 100000 0 0 41
Ethernet168 168,169,170,171 Ethernet168 100000 0 0 42
Ethernet172 172,173,174,175 Ethernet172 100000 0 0 43
Ethernet176 176,177,178,179 Ethernet176 100000 0 0 44
Ethernet180 180,181,182,183 Ethernet180 100000 0 0 45
Ethernet184 184,185,186,187 Ethernet184 100000 0 0 46
Ethernet188 188,189,190,191 Ethernet188 100000 0 0 47
Ethernet192 192,193,194,195 Ethernet192 100000 0 0 48
Ethernet196 196,197,198,199 Ethernet196 100000 0 0 49
Ethernet200 200,201,202,203 Ethernet200 100000 0 0 50
Ethernet204 204,205,206,207 Ethernet204 100000 0 0 51
Ethernet208 208,209,210,211 Ethernet208 100000 0 0 52
Ethernet212 212,213,214,215 Ethernet212 100000 0 0 53
Ethernet216 216,217,218,219 Ethernet216 100000 0 0 54
Ethernet220 220,221,222,223 Ethernet220 100000 0 0 55
Ethernet224 224,225,226,227 Ethernet224 100000 0 0 56
Ethernet228 228,229,230,231 Ethernet228 100000 0 0 57
Ethernet232 232,233,234,235 Ethernet232 100000 0 0 58
Ethernet236 236,237,238,239 Ethernet236 100000 0 0 59
Ethernet240 240,241,242,243 Ethernet240 100000 0 0 60
Ethernet244 244,245,246,247 Ethernet244 100000 0 0 61
Ethernet248 248,249,250,251 Ethernet248 100000 0 0 62
Ethernet252 252,253,254,255 Ethernet252 100000 0 0 63
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"chip_list": [
{
"id": "asic-0",
"chip_family": "Tofino",
"instance": 0,
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0",
"pcie_domain": 0,
"pcie_bus": 5,
"pcie_fn": 0,
"pcie_dev": 0,
"pcie_int_mode": 1,
"sds_fw_path": "share/tofino_sds_fw/avago/firmware"
}
],
"instance": 0,
"p4_program_list": [
{
"id": "pgm-0",
"instance": 0,
"path": "switch",
"program-name": "switch",
"pd": "lib/tofinopd/switch/libpd.so",
"pd-thrift": "lib/tofinopd/switch/libpdthrift.so",
"table-config": "share/tofinopd/switch/context.json",
"tofino-bin": "share/tofinopd/switch/tofino.bin",
"switchapi": "lib/libswitchapi.so",
"switchsai": "lib/libswitchsai.so",
"agent0": "lib/platform/x86_64-ingrasys_s9280_64x-r0/libpltfm_mgr.so",
"switchapi_port_add": false
}
]
}
9 changes: 9 additions & 0 deletions device/ingrasys/x86_64-ingrasys_s9280_64x-r0/fancontrol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
INTERVAL=10
DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-16/16-002f hwmon3=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-6/6-004e
DEVNAME=hwmon1=w83795adg
FCTEMPS=hwmon1/device/pwm2=hwmon3/temp1_input
FCFANS=hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm2=hwmon1/device/fan3_input hwmon1/device/pwm2=hwmon1/device/fan1_input
MINTEMP=hwmon1/device/pwm2=20
MAXTEMP=hwmon1/device/pwm2=60
MINSTART=hwmon1/device/pwm2=75
MINSTOP=hwmon1/device/pwm2=22
3 changes: 3 additions & 0 deletions device/ingrasys/x86_64-ingrasys_s9280_64x-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
151 changes: 151 additions & 0 deletions device/ingrasys/x86_64-ingrasys_s9280_64x-r0/minigraph.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<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>OCPSCH01040GGLF</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>OCPSCH01040GGLF</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>OCPSCH01040GGLF</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>OCPSCH01040GGLF</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>OCPSCH01040GGLF</StartDevice>
<StartPort>Ethernet0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<Bandwidth>40000</Bandwidth>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>OCPSCH0104002MS</EndDevice>
<EndPort>Ethernet24</EndPort>
<StartDevice>OCPSCH01040GGLF</StartDevice>
<StartPort>Ethernet4</StartPort>
</DeviceLinkBase>
</DeviceInterfaceLinks>
<Devices>
<Device i:type="LeafRouter">
<Hostname>OCPSCH01040GGLF</Hostname>
<HwSku>INGRASYS-S9280-64X</HwSku>
</Device>
</Devices>
</PngDec>
<MetadataDeclaration>
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:DeviceMetadata>
<a:Name>OCPSCH01040GGLF</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:DeviceProperty>
<a:Name>ErspanDestinationIpv4</a:Name>
<a:Reference i:nil="true"/>
<a:Value>2.2.2.2</a:Value>
</a:DeviceProperty>
</a:Properties>
</a:DeviceMetadata>
</Devices>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration>
<Hostname>OCPSCH01040GGLF</Hostname>
<HwSku>INGRASYS-S9280-64X</HwSku>
</DeviceMiniGraph>
22 changes: 22 additions & 0 deletions device/ingrasys/x86_64-ingrasys_s9280_64x-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python

#############################################################################
# Ingrasys S9280-64X
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################

try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
raise ImportError (str(e) + "- required module not found")


class board(eeprom_tlvinfo.TlvInfoDecoder):

def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0051/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)
93 changes: 93 additions & 0 deletions device/ingrasys/x86_64-ingrasys_s9280_64x-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# psuutil.py
# Platform-specific PSU status interface for SONiC
#


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"""

# TODO: need to check if the patch mapping correct
SYSFS_PSU_DIR = ["/sys/bus/i2c/devices/i2c-18/18-0050",
"/sys/bus/i2c/devices/i2c-17/17-0050"]

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


# Get sysfs attribute
def get_attr_value(self, attr_path):

retval = 'ERR'
if (not os.path.isfile(attr_path)):
return retval

try:
with open(attr_path, 'r') as fd:
retval = fd.read()
except Exception as error:
logging.error("Unable to open ", attr_path, " file !")

retval = retval.rstrip('\r\n')
return retval

def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device
:return: An integer, the number of PSUs available on the device
"""
MAX_PSUS = 2
return MAX_PSUS

def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is\
faulty
"""
status = 0
attr_file = 'psu_pg'
attr_path = self.SYSFS_PSU_DIR[index-1] +'/' + attr_file

attr_value = self.get_attr_value(attr_path)

if (attr_value != 'ERR'):
attr_value = int(attr_value, 16)
# Check for PSU status
if (attr_value == 1):
status = 1

return status

def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
status = 0
psu_absent = 0
attr_file ='psu_abs'
attr_path = self.SYSFS_PSU_DIR[index-1] +'/' + attr_file

attr_value = self.get_attr_value(attr_path)

if (attr_value != 'ERR'):
attr_value = int(attr_value, 16)
# Check for PSU presence
if (attr_value == 0):
status = 1

return status

Loading

0 comments on commit 29b9d90

Please sign in to comment.