[Accton]: Add a new supported platform, AS5712-54X (#1167)

* Switch Vendor: Edge-core
* Switch SKU: AS5712-54X
* ASIC Vendor: Broadcom
* Swich ASIC: TRIDENT2
* Port Configuration: 48x10G+6x40G
* SONiC Image: SONiC-ONIE-Broadcom

Signed-off-by: polly_hsu@accton.com
This commit is contained in:
Polly Hsu 2017-11-22 18:59:28 +08:00 committed by lguohan
parent 21764008da
commit 0f903d008b
7 changed files with 220 additions and 248 deletions

View File

@ -1,74 +1,73 @@
# name lanes alias
Ethernet0 13 tenGigE0
Ethernet1 14 tenGigE1
Ethernet2 15 tenGigE2
Ethernet3 16 tenGigE3
Ethernet4 21 tenGigE4
Ethernet5 22 tenGigE5
Ethernet6 23 tenGigE6
Ethernet7 24 tenGigE7
Ethernet8 25 tenGigE8
Ethernet9 26 tenGigE9
Ethernet10 27 tenGigE10
Ethernet11 28 tenGigE11
Ethernet12 29 tenGigE12
Ethernet13 30 tenGigE13
Ethernet14 31 tenGigE14
Ethernet15 32 tenGigE15
Ethernet16 45 tenGigE16
Ethernet17 46 tenGigE17
Ethernet18 47 tenGigE18
Ethernet19 48 tenGigE19
Ethernet20 49 tenGigE20
Ethernet21 50 tenGigE21
Ethernet22 51 tenGigE22
Ethernet23 52 tenGigE23
Ethernet24 53 tenGigE24
Ethernet25 54 tenGigE25
Ethernet26 55 tenGigE26
Ethernet27 56 tenGigE27
Ethernet28 57 tenGigE28
Ethernet29 58 tenGigE29
Ethernet30 59 tenGigE30
Ethernet31 60 tenGigE31
Ethernet32 61 tenGigE32
Ethernet33 62 tenGigE33
Ethernet34 63 tenGigE34
Ethernet35 64 tenGigE35
Ethernet36 65 tenGigE36
Ethernet37 66 tenGigE37
Ethernet38 67 tenGigE38
Ethernet39 68 tenGigE39
Ethernet40 69 tenGigE40
Ethernet41 70 tenGigE41
Ethernet42 71 tenGigE42
Ethernet43 72 tenGigE43
Ethernet44 73 tenGigE44
Ethernet45 74 tenGigE45
Ethernet46 75 tenGigE46
Ethernet47 76 tenGigE47
Ethernet48 97 tenGigE48
Ethernet49 98 tenGigE49
Ethernet50 99 tenGigE50
Ethernet51 100 tenGigE51
Ethernet52 101 tenGigE52
Ethernet53 102 tenGigE53
Ethernet54 103 tenGigE54
Ethernet55 104 tenGigE55
Ethernet56 81 tenGigE56
Ethernet57 82 tenGigE57
Ethernet58 83 tenGigE58
Ethernet59 84 tenGigE59
Ethernet60 105 tenGigE60
Ethernet61 106 tenGigE61
Ethernet62 107 tenGigE62
Ethernet63 108 tenGigE63
Ethernet64 109 tenGigE64
Ethernet65 110 tenGigE65
Ethernet66 111 tenGigE66
Ethernet67 112 tenGigE67
Ethernet68 77 tenGigE68
Ethernet69 78 tenGigE69
Ethernet70 79 tenGigE70
Ethernet71 80 tenGigE71
# name lanes alias index
Ethernet0 13 tenGigE0 0
Ethernet1 14 tenGigE1 1
Ethernet2 15 tenGigE2 2
Ethernet3 16 tenGigE3 3
Ethernet4 21 tenGigE4 4
Ethernet5 22 tenGigE5 5
Ethernet6 23 tenGigE6 6
Ethernet7 24 tenGigE7 7
Ethernet8 25 tenGigE8 8
Ethernet9 26 tenGigE9 9
Ethernet10 27 tenGigE10 10
Ethernet11 28 tenGigE11 11
Ethernet12 29 tenGigE12 12
Ethernet13 30 tenGigE13 13
Ethernet14 31 tenGigE14 14
Ethernet15 32 tenGigE15 15
Ethernet16 45 tenGigE16 16
Ethernet17 46 tenGigE17 17
Ethernet18 47 tenGigE18 18
Ethernet19 48 tenGigE19 19
Ethernet20 49 tenGigE20 20
Ethernet21 50 tenGigE21 21
Ethernet22 51 tenGigE22 22
Ethernet23 52 tenGigE23 23
Ethernet24 53 tenGigE24 24
Ethernet25 54 tenGigE25 25
Ethernet26 55 tenGigE26 26
Ethernet27 56 tenGigE27 27
Ethernet28 57 tenGigE28 28
Ethernet29 58 tenGigE29 29
Ethernet30 59 tenGigE30 30
Ethernet31 60 tenGigE31 31
Ethernet32 61 tenGigE32 32
Ethernet33 62 tenGigE33 33
Ethernet34 63 tenGigE34 34
Ethernet35 64 tenGigE35 35
Ethernet36 65 tenGigE36 36
Ethernet37 66 tenGigE37 37
Ethernet38 67 tenGigE38 38
Ethernet39 68 tenGigE39 39
Ethernet40 69 tenGigE40 40
Ethernet41 70 tenGigE41 41
Ethernet42 71 tenGigE42 42
Ethernet43 72 tenGigE43 43
Ethernet44 73 tenGigE44 44
Ethernet45 74 tenGigE45 45
Ethernet46 75 tenGigE46 46
Ethernet47 76 tenGigE47 47
Ethernet48 97 tenGigE48 48
Ethernet49 98 tenGigE49 49
Ethernet50 99 tenGigE50 50
Ethernet51 100 tenGigE51 51
Ethernet52 101 tenGigE52 52
Ethernet53 102 tenGigE53 53
Ethernet54 103 tenGigE54 54
Ethernet55 104 tenGigE55 55
Ethernet56 81 tenGigE56 56
Ethernet57 82 tenGigE57 57
Ethernet58 83 tenGigE58 58
Ethernet59 84 tenGigE59 59
Ethernet60 105 tenGigE60 60
Ethernet61 106 tenGigE61 61
Ethernet62 107 tenGigE62 62
Ethernet63 108 tenGigE63 63
Ethernet64 109 tenGigE64 64
Ethernet65 110 tenGigE65 65
Ethernet66 111 tenGigE66 66
Ethernet67 112 tenGigE67 67
Ethernet68 77 tenGigE68 68
Ethernet69 78 tenGigE69 69
Ethernet70 79 tenGigE70 70
Ethernet71 80 tenGigE71 71

View File

@ -1,2 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/td2-as5712-72x10G.config.bcm

92
device/accton/x86_64-accton_as5712_54x-r0/minigraph.xml Normal file → Executable file
View File

@ -4,18 +4,18 @@
<PeeringSessions>
<BGPSession>
<StartRouter>OCPSCH0104001MS</StartRouter>
<StartPeer>10.10.1.26</StartPeer>
<EndRouter>switch1</EndRouter>
<EndPeer>10.10.1.25</EndPeer>
<StartPeer>10.10.1.2</StartPeer>
<EndRouter>OCPSCH01040AALF</EndRouter>
<EndPeer>10.10.1.1</EndPeer>
<Multihop>1</Multihop>
<HoldTime>10</HoldTime>
<KeepAliveTime>3</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>OCPSCH0104002MS</StartRouter>
<StartPeer>10.10.2.26</StartPeer>
<EndRouter>switch1</EndRouter>
<EndPeer>10.10.2.25</EndPeer>
<StartPeer>10.10.2.2</StartPeer>
<EndRouter>OCPSCH01040AALF</EndRouter>
<EndPeer>10.10.2.1</EndPeer>
<Multihop>1</Multihop>
<HoldTime>10</HoldTime>
<KeepAliveTime>3</KeepAliveTime>
@ -24,15 +24,15 @@
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:BGPRouterDeclaration>
<a:ASN>64536</a:ASN>
<a:Hostname>switch1</a:Hostname>
<a:Hostname>OCPSCH01040AALF</a:Hostname>
<a:Peers>
<BGPPeer>
<Address>10.10.1.26</Address>
<Address>10.10.1.1</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.10.2.26</Address>
<Address>10.10.2.1</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
@ -59,29 +59,37 @@
<Name>HostIP</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux">
<b:IPPrefix>100.0.0.9/32</b:IPPrefix>
<b:IPPrefix>100.0.0.3/32</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>100.0.0.9/32</a:PrefixStr>
<a:PrefixStr>100.0.0.3/32</a:PrefixStr>
</a:LoopbackIPInterface>
</LoopbackIPInterfaces>
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:ManagementIPInterface>
<Name>ManagementIP1</Name>
<AttachTo>Management0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.NetMux">
<b:IPPrefix>192.168.200.12/24</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>192.168.200.12/24</a:PrefixStr>
</a:ManagementIPInterface>
</ManagementIPInterfaces>
<MplsInterfaces/>
<MplsTeInterfaces/>
<RsvpInterfaces/>
<Hostname>switch1</Hostname>
<Hostname>OCPSCH01040AALF</Hostname>
<PortChannelInterfaces/>
<VlanInterfaces/>
<IPInterfaces>
<IPInterface>
<Name i:nil="true"/>
<AttachTo>Ethernet48</AttachTo>
<Prefix>10.10.1.25/30</Prefix>
<AttachTo>tenGigE0</AttachTo>
<Prefix>10.10.1.1/30</Prefix>
</IPInterface>
<IPInterface>
<Name i:nil="true"/>
<AttachTo>Ethernet52</AttachTo>
<Prefix>10.10.2.25/30</Prefix>
<AttachTo>tenGigE4</AttachTo>
<Prefix>10.10.2.1/30</Prefix>
</IPInterface>
</IPInterfaces>
<DataAcls/>
@ -93,59 +101,33 @@
<PngDec>
<DeviceInterfaceLinks>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<Bandwidth>40000</Bandwidth>
<Bandwidth>10000</Bandwidth>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>OCPSCH0104001MS</EndDevice>
<EndPort>Ethernet24</EndPort>
<StartDevice>switch1</StartDevice>
<StartPort>Ethernet48</StartPort>
<EndPort>tenGigE0</EndPort>
<StartDevice>OCPSCH01040AALF</StartDevice>
<StartPort>tenGigE0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<Bandwidth>40000</Bandwidth>
<Bandwidth>10000</Bandwidth>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>OCPSCH0104002MS</EndDevice>
<EndPort>Ethernet24</EndPort>
<StartDevice>switch1</StartDevice>
<StartPort>Ethernet52</StartPort>
<EndPort>tenGigE0</EndPort>
<StartDevice>OCPSCH01040AALF</StartDevice>
<StartPort>tenGigE4</StartPort>
</DeviceLinkBase>
</DeviceInterfaceLinks>
<Devices>
<Devices>
<Device i:type="LeafRouter">
<Hostname>switch1</Hostname>
<Hostname>OCPSCH01040AALF</Hostname>
<HwSku>Accton-AS5712-54X</HwSku>
</Device>
</Devices>
</PngDec>
</PngDec>
<MetadataDeclaration>
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:DeviceMetadata>
<a:Name>switch1</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>
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration>
<Hostname>switch1</Hostname>
<Hostname>OCPSCH01040AALF</Hostname>
<HwSku>Accton-AS5712-54X</HwSku>
</DeviceMiniGraph>

View File

@ -14,12 +14,90 @@ class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""
PORT_START = 0
PORT_END = 31
PORTS_IN_BLOCK = 32
PORT_END = 71
PORTS_IN_BLOCK = 72
QSFP_PORT_START = 72
QSFP_PORT_END = 72
EEPROM_OFFSET = 20
BASE_VAL_PATH = "/sys/class/i2c-adapter/i2c-{0}/{1}-0050/"
_port_to_is_present = {}
_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],
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],
}
@property
def port_start(self):
@ -31,17 +109,19 @@ class SfpUtil(SfpUtilBase):
@property
def qsfp_ports(self):
return range(0, self.PORTS_IN_BLOCK + 1)
return range(self.QSFP_PORT_START, 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"
eeprom_path = self.BASE_VAL_PATH + "sfp_eeprom"
for x in range(0, self.port_end + 1):
self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET)
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])
SfpUtilBase.__init__(self)
@ -50,126 +130,29 @@ class SfpUtil(SfpUtilBase):
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])
try:
reg_file = open("/sys/devices/platform/accton/qsfp_modprs")
val_file = open(self.__port_to_is_present)
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to open file: %s" % str(e)
return False
content = reg_file.readline().rstrip()
content = val_file.readline().rstrip()
val_file.close()
# content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# ModPrsL is active low
if reg_value & mask == 0:
# content is a string, either "0" or "1"
if content == "1":
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/devices/platform/accton/qsfp_lpmode")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
content = reg_file.readline().rstrip()
# content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# LPMode is active high
if reg_value & mask == 0:
return False
return True
raise NotImplementedError
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/devices/platform/accton/qsfp_lpmode", "r+")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
content = reg_file.readline().rstrip()
# content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# LPMode is active high; set or clear the bit accordingly
if lpmode is True:
reg_value = reg_value | mask
else:
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
content = hex(reg_value)
reg_file.seek(0)
reg_file.write(content)
reg_file.close()
return True
raise NotImplementedError
def reset(self, port_num):
QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/accton/qsfp_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
content = reg_file.readline().rstrip()
# File content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# ResetL is active low
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
reg_file.seek(0)
reg_file.write(hex(reg_value))
reg_file.close()
# Sleep 1 second to allow it to settle
time.sleep(1)
# Flip the bit back high and write back to the register to take port out of reset
try:
reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "w")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
reg_value = reg_value | mask
reg_file.seek(0)
reg_file.write(hex(reg_value))
reg_file.close()
return True
raise NotImplementedError

1
platform/broadcom/one-image.mk Normal file → Executable file
View File

@ -12,6 +12,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(INGRASYS_S9100_PLATFORM_MODULE) \
$(INGRASYS_S8810_32Q_PLATFORM_MODULE) \
$(ACCTON_AS7712_32X_PLATFORM_MODULE) \
$(ACCTON_AS5712_54X_PLATFORM_MODULE) \
$(INVENTEC_D7032Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
$(CEL_DX010_PLATFORM_MODULE)

10
platform/broadcom/platform-modules-accton.mk Normal file → Executable file
View File

@ -1,11 +1,19 @@
# Accton Platform modules
ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION = 1.0
ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION = 1.1
export ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION
export ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION
ACCTON_AS7712_32X_PLATFORM_MODULE = sonic-platform-accton-as7712-32x_$(ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_AS7712_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton
$(ACCTON_AS7712_32X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(ACCTON_AS7712_32X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7712_32x-r0
SONIC_DPKG_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE)
ACCTON_AS5712_54X_PLATFORM_MODULE = sonic-platform-accton-as5712-54x_$(ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_AS5712_54X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton
$(ACCTON_AS5712_54X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(ACCTON_AS5712_54X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5712_54x-r0
SONIC_DPKG_DEBS += $(ACCTON_AS5712_54X_PLATFORM_MODULE)

@ -1 +1 @@
Subproject commit 99607d63220de336a61d81f6b4d1e64062761abe
Subproject commit 3fbde584ba15f0178dc22cb7e56f2bb8481692d4