Skip to content

Commit 29b9d90

Browse files
author
sonic
committed
[Ingrasys] Add platform support for S9280-64X with Barefoot ASIC
1 parent 2afd4c0 commit 29b9d90

File tree

12 files changed

+770
-1
lines changed

12 files changed

+770
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# name lanes alias speed autoneg fec index
2+
Ethernet0 0,1,2,3 Ethernet0 100000 0 0 0
3+
Ethernet4 4,5,6,7 Ethernet4 100000 0 0 1
4+
Ethernet8 8,9,10,11 Ethernet8 100000 0 0 2
5+
Ethernet12 12,13,14,15 Ethernet12 100000 0 0 3
6+
Ethernet16 16,17,18,19 Ethernet16 100000 0 0 4
7+
Ethernet20 20,21,22,23 Ethernet20 100000 0 0 5
8+
Ethernet24 24,25,26,27 Ethernet24 100000 0 0 6
9+
Ethernet28 28,29,30,31 Ethernet28 100000 0 0 7
10+
Ethernet32 32,33,34,35 Ethernet32 100000 0 0 8
11+
Ethernet36 36,37,38,39 Ethernet36 100000 0 0 9
12+
Ethernet40 40,41,42,43 Ethernet40 100000 0 0 10
13+
Ethernet44 44,45,46,47 Ethernet44 100000 0 0 11
14+
Ethernet48 48,49,50,51 Ethernet48 100000 0 0 12
15+
Ethernet52 52,53,54,55 Ethernet52 100000 0 0 13
16+
Ethernet56 56,57,58,59 Ethernet56 100000 0 0 14
17+
Ethernet60 60,61,62,63 Ethernet60 100000 0 0 15
18+
Ethernet64 64,65,66,67 Ethernet64 100000 0 0 16
19+
Ethernet68 68,69,70,71 Ethernet68 100000 0 0 17
20+
Ethernet72 72,73,74,75 Ethernet72 100000 0 0 18
21+
Ethernet76 76,77,78,79 Ethernet76 100000 0 0 19
22+
Ethernet80 80,81,82,83 Ethernet80 100000 0 0 20
23+
Ethernet84 84,85,86,87 Ethernet84 100000 0 0 21
24+
Ethernet88 88,89,90,91 Ethernet88 100000 0 0 22
25+
Ethernet92 92,93,94,95 Ethernet92 100000 0 0 23
26+
Ethernet96 96,97,98,99 Ethernet96 100000 0 0 24
27+
Ethernet100 100,101,102,103 Ethernet100 100000 0 0 25
28+
Ethernet104 104,105,106,107 Ethernet104 100000 0 0 26
29+
Ethernet108 108,109,110,111 Ethernet108 100000 0 0 27
30+
Ethernet112 112,113,114,115 Ethernet112 100000 0 0 28
31+
Ethernet116 116,117,118,119 Ethernet116 100000 0 0 29
32+
Ethernet120 120,121,122,123 Ethernet120 100000 0 0 30
33+
Ethernet124 124,125,126,127 Ethernet124 100000 0 0 31
34+
Ethernet128 128,129,130,131 Ethernet128 100000 0 0 32
35+
Ethernet132 132,133,134,135 Ethernet132 100000 0 0 33
36+
Ethernet136 136,137,138,139 Ethernet136 100000 0 0 34
37+
Ethernet140 140,141,142,143 Ethernet140 100000 0 0 35
38+
Ethernet144 144,145,146,147 Ethernet144 100000 0 0 36
39+
Ethernet148 148,149,150,151 Ethernet148 100000 0 0 37
40+
Ethernet152 152,153,154,155 Ethernet152 100000 0 0 38
41+
Ethernet156 156,157,158,159 Ethernet156 100000 0 0 39
42+
Ethernet160 160,161,162,163 Ethernet160 100000 0 0 40
43+
Ethernet164 164,165,166,167 Ethernet164 100000 0 0 41
44+
Ethernet168 168,169,170,171 Ethernet168 100000 0 0 42
45+
Ethernet172 172,173,174,175 Ethernet172 100000 0 0 43
46+
Ethernet176 176,177,178,179 Ethernet176 100000 0 0 44
47+
Ethernet180 180,181,182,183 Ethernet180 100000 0 0 45
48+
Ethernet184 184,185,186,187 Ethernet184 100000 0 0 46
49+
Ethernet188 188,189,190,191 Ethernet188 100000 0 0 47
50+
Ethernet192 192,193,194,195 Ethernet192 100000 0 0 48
51+
Ethernet196 196,197,198,199 Ethernet196 100000 0 0 49
52+
Ethernet200 200,201,202,203 Ethernet200 100000 0 0 50
53+
Ethernet204 204,205,206,207 Ethernet204 100000 0 0 51
54+
Ethernet208 208,209,210,211 Ethernet208 100000 0 0 52
55+
Ethernet212 212,213,214,215 Ethernet212 100000 0 0 53
56+
Ethernet216 216,217,218,219 Ethernet216 100000 0 0 54
57+
Ethernet220 220,221,222,223 Ethernet220 100000 0 0 55
58+
Ethernet224 224,225,226,227 Ethernet224 100000 0 0 56
59+
Ethernet228 228,229,230,231 Ethernet228 100000 0 0 57
60+
Ethernet232 232,233,234,235 Ethernet232 100000 0 0 58
61+
Ethernet236 236,237,238,239 Ethernet236 100000 0 0 59
62+
Ethernet240 240,241,242,243 Ethernet240 100000 0 0 60
63+
Ethernet244 244,245,246,247 Ethernet244 100000 0 0 61
64+
Ethernet248 248,249,250,251 Ethernet248 100000 0 0 62
65+
Ethernet252 252,253,254,255 Ethernet252 100000 0 0 63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"chip_list": [
3+
{
4+
"id": "asic-0",
5+
"chip_family": "Tofino",
6+
"instance": 0,
7+
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0",
8+
"pcie_domain": 0,
9+
"pcie_bus": 5,
10+
"pcie_fn": 0,
11+
"pcie_dev": 0,
12+
"pcie_int_mode": 1,
13+
"sds_fw_path": "share/tofino_sds_fw/avago/firmware"
14+
}
15+
],
16+
"instance": 0,
17+
"p4_program_list": [
18+
{
19+
"id": "pgm-0",
20+
"instance": 0,
21+
"path": "switch",
22+
"program-name": "switch",
23+
"pd": "lib/tofinopd/switch/libpd.so",
24+
"pd-thrift": "lib/tofinopd/switch/libpdthrift.so",
25+
"table-config": "share/tofinopd/switch/context.json",
26+
"tofino-bin": "share/tofinopd/switch/tofino.bin",
27+
"switchapi": "lib/libswitchapi.so",
28+
"switchsai": "lib/libswitchsai.so",
29+
"agent0": "lib/platform/x86_64-ingrasys_s9280_64x-r0/libpltfm_mgr.so",
30+
"switchapi_port_add": false
31+
}
32+
]
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
INTERVAL=10
2+
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
3+
DEVNAME=hwmon1=w83795adg
4+
FCTEMPS=hwmon1/device/pwm2=hwmon3/temp1_input
5+
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
6+
MINTEMP=hwmon1/device/pwm2=20
7+
MAXTEMP=hwmon1/device/pwm2=60
8+
MINSTART=hwmon1/device/pwm2=75
9+
MINSTOP=hwmon1/device/pwm2=22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONSOLE_PORT=0x3f8
2+
CONSOLE_DEV=0
3+
CONSOLE_SPEED=115200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<DeviceMiniGraph xmlns="Microsoft.Search.Autopilot.Evolution" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
2+
<CpgDec>
3+
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
4+
<PeeringSessions>
5+
<BGPSession>
6+
<StartRouter>OCPSCH0104001MS</StartRouter>
7+
<StartPeer>10.10.1.26</StartPeer>
8+
<EndRouter>OCPSCH01040GGLF</EndRouter>
9+
<EndPeer>10.10.1.25</EndPeer>
10+
<Multihop>1</Multihop>
11+
<HoldTime>10</HoldTime>
12+
<KeepAliveTime>3</KeepAliveTime>
13+
</BGPSession>
14+
<BGPSession>
15+
<StartRouter>OCPSCH0104002MS</StartRouter>
16+
<StartPeer>10.10.2.26</StartPeer>
17+
<EndRouter>OCPSCH01040GGLF</EndRouter>
18+
<EndPeer>10.10.2.25</EndPeer>
19+
<Multihop>1</Multihop>
20+
<HoldTime>10</HoldTime>
21+
<KeepAliveTime>3</KeepAliveTime>
22+
</BGPSession>
23+
</PeeringSessions>
24+
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
25+
<a:BGPRouterDeclaration>
26+
<a:ASN>64536</a:ASN>
27+
<a:Hostname>OCPSCH01040GGLF</a:Hostname>
28+
<a:Peers>
29+
<BGPPeer>
30+
<Address>10.10.1.26</Address>
31+
<RouteMapIn i:nil="true"/>
32+
<RouteMapOut i:nil="true"/>
33+
</BGPPeer>
34+
<BGPPeer>
35+
<Address>10.10.2.26</Address>
36+
<RouteMapIn i:nil="true"/>
37+
<RouteMapOut i:nil="true"/>
38+
</BGPPeer>
39+
</a:Peers>
40+
<a:RouteMaps/>
41+
</a:BGPRouterDeclaration>
42+
<a:BGPRouterDeclaration>
43+
<a:ASN>64542</a:ASN>
44+
<a:Hostname>OCPSCH0104001MS</a:Hostname>
45+
<a:RouteMaps/>
46+
</a:BGPRouterDeclaration>
47+
<a:BGPRouterDeclaration>
48+
<a:ASN>64543</a:ASN>
49+
<a:Hostname>OCPSCH0104002MS</a:Hostname>
50+
<a:RouteMaps/>
51+
</a:BGPRouterDeclaration>
52+
</Routers>
53+
</CpgDec>
54+
<DpgDec>
55+
<DeviceDataPlaneInfo>
56+
<IPSecTunnels/>
57+
<LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
58+
<a:LoopbackIPInterface>
59+
<Name>HostIP</Name>
60+
<AttachTo>Loopback0</AttachTo>
61+
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux">
62+
<b:IPPrefix>100.0.0.9/32</b:IPPrefix>
63+
</a:Prefix>
64+
<a:PrefixStr>100.0.0.9/32</a:PrefixStr>
65+
</a:LoopbackIPInterface>
66+
</LoopbackIPInterfaces>
67+
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
68+
</ManagementIPInterfaces>
69+
<MplsInterfaces/>
70+
<MplsTeInterfaces/>
71+
<RsvpInterfaces/>
72+
<Hostname>OCPSCH01040GGLF</Hostname>
73+
<PortChannelInterfaces/>
74+
<VlanInterfaces/>
75+
<IPInterfaces>
76+
<IPInterface>
77+
<Name i:nil="true"/>
78+
<AttachTo>Ethernet0</AttachTo>
79+
<Prefix>10.10.1.25/30</Prefix>
80+
</IPInterface>
81+
<IPInterface>
82+
<Name i:nil="true"/>
83+
<AttachTo>Ethernet4</AttachTo>
84+
<Prefix>10.10.2.25/30</Prefix>
85+
</IPInterface>
86+
</IPInterfaces>
87+
<DataAcls/>
88+
<AclInterfaces/>
89+
<DownstreamSummaries/>
90+
<DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
91+
</DeviceDataPlaneInfo>
92+
</DpgDec>
93+
<PngDec>
94+
<DeviceInterfaceLinks>
95+
<DeviceLinkBase i:type="DeviceInterfaceLink">
96+
<Bandwidth>40000</Bandwidth>
97+
<ElementType>DeviceInterfaceLink</ElementType>
98+
<EndDevice>OCPSCH0104001MS</EndDevice>
99+
<EndPort>Ethernet24</EndPort>
100+
<StartDevice>OCPSCH01040GGLF</StartDevice>
101+
<StartPort>Ethernet0</StartPort>
102+
</DeviceLinkBase>
103+
<DeviceLinkBase i:type="DeviceInterfaceLink">
104+
<Bandwidth>40000</Bandwidth>
105+
<ElementType>DeviceInterfaceLink</ElementType>
106+
<EndDevice>OCPSCH0104002MS</EndDevice>
107+
<EndPort>Ethernet24</EndPort>
108+
<StartDevice>OCPSCH01040GGLF</StartDevice>
109+
<StartPort>Ethernet4</StartPort>
110+
</DeviceLinkBase>
111+
</DeviceInterfaceLinks>
112+
<Devices>
113+
<Device i:type="LeafRouter">
114+
<Hostname>OCPSCH01040GGLF</Hostname>
115+
<HwSku>INGRASYS-S9280-64X</HwSku>
116+
</Device>
117+
</Devices>
118+
</PngDec>
119+
<MetadataDeclaration>
120+
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
121+
<a:DeviceMetadata>
122+
<a:Name>OCPSCH01040GGLF</a:Name>
123+
<a:Properties>
124+
<a:DeviceProperty>
125+
<a:Name>DhcpResources</a:Name>
126+
<a:Reference i:nil="true"/>
127+
<a:Value></a:Value>
128+
</a:DeviceProperty>
129+
<a:DeviceProperty>
130+
<a:Name>NtpResources</a:Name>
131+
<a:Reference i:nil="true"/>
132+
<a:Value>0.debian.pool.ntp.org;1.debian.pool.ntp.org;2.debian.pool.ntp.org;3.debian.pool.ntp.org</a:Value>
133+
</a:DeviceProperty>
134+
<a:DeviceProperty>
135+
<a:Name>SyslogResources</a:Name>
136+
<a:Reference i:nil="true"/>
137+
<a:Value></a:Value>
138+
</a:DeviceProperty>
139+
<a:DeviceProperty>
140+
<a:Name>ErspanDestinationIpv4</a:Name>
141+
<a:Reference i:nil="true"/>
142+
<a:Value>2.2.2.2</a:Value>
143+
</a:DeviceProperty>
144+
</a:Properties>
145+
</a:DeviceMetadata>
146+
</Devices>
147+
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
148+
</MetadataDeclaration>
149+
<Hostname>OCPSCH01040GGLF</Hostname>
150+
<HwSku>INGRASYS-S9280-64X</HwSku>
151+
</DeviceMiniGraph>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
3+
#############################################################################
4+
# Ingrasys S9280-64X
5+
#
6+
# Platform and model specific eeprom subclass, inherits from the base class,
7+
# and provides the followings:
8+
# - the eeprom format definition
9+
# - specific encoder/decoder if there is special need
10+
#############################################################################
11+
12+
try:
13+
from sonic_eeprom import eeprom_tlvinfo
14+
except ImportError, e:
15+
raise ImportError (str(e) + "- required module not found")
16+
17+
18+
class board(eeprom_tlvinfo.TlvInfoDecoder):
19+
20+
def __init__(self, name, path, cpld_root, ro):
21+
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0051/eeprom"
22+
super(board, self).__init__(self.eeprom_path, 0, '', True)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#
2+
# psuutil.py
3+
# Platform-specific PSU status interface for SONiC
4+
#
5+
6+
7+
import os.path
8+
9+
try:
10+
from sonic_psu.psu_base import PsuBase
11+
except ImportError as e:
12+
raise ImportError(str(e) + "- required module not found")
13+
14+
15+
class PsuUtil(PsuBase):
16+
"""Platform-specific PSUutil class"""
17+
18+
# TODO: need to check if the patch mapping correct
19+
SYSFS_PSU_DIR = ["/sys/bus/i2c/devices/i2c-18/18-0050",
20+
"/sys/bus/i2c/devices/i2c-17/17-0050"]
21+
22+
def __init__(self):
23+
PsuBase.__init__(self)
24+
25+
26+
# Get sysfs attribute
27+
def get_attr_value(self, attr_path):
28+
29+
retval = 'ERR'
30+
if (not os.path.isfile(attr_path)):
31+
return retval
32+
33+
try:
34+
with open(attr_path, 'r') as fd:
35+
retval = fd.read()
36+
except Exception as error:
37+
logging.error("Unable to open ", attr_path, " file !")
38+
39+
retval = retval.rstrip('\r\n')
40+
return retval
41+
42+
def get_num_psus(self):
43+
"""
44+
Retrieves the number of PSUs available on the device
45+
:return: An integer, the number of PSUs available on the device
46+
"""
47+
MAX_PSUS = 2
48+
return MAX_PSUS
49+
50+
def get_psu_status(self, index):
51+
"""
52+
Retrieves the oprational status of power supply unit (PSU) defined
53+
by index <index>
54+
:param index: An integer, index of the PSU of which to query status
55+
:return: Boolean, True if PSU is operating properly, False if PSU is\
56+
faulty
57+
"""
58+
status = 0
59+
attr_file = 'psu_pg'
60+
attr_path = self.SYSFS_PSU_DIR[index-1] +'/' + attr_file
61+
62+
attr_value = self.get_attr_value(attr_path)
63+
64+
if (attr_value != 'ERR'):
65+
attr_value = int(attr_value, 16)
66+
# Check for PSU status
67+
if (attr_value == 1):
68+
status = 1
69+
70+
return status
71+
72+
def get_psu_presence(self, index):
73+
"""
74+
Retrieves the presence status of power supply unit (PSU) defined
75+
by index <index>
76+
:param index: An integer, index of the PSU of which to query status
77+
:return: Boolean, True if PSU is plugged, False if not
78+
"""
79+
status = 0
80+
psu_absent = 0
81+
attr_file ='psu_abs'
82+
attr_path = self.SYSFS_PSU_DIR[index-1] +'/' + attr_file
83+
84+
attr_value = self.get_attr_value(attr_path)
85+
86+
if (attr_value != 'ERR'):
87+
attr_value = int(attr_value, 16)
88+
# Check for PSU presence
89+
if (attr_value == 0):
90+
status = 1
91+
92+
return status
93+

0 commit comments

Comments
 (0)