-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[devices] add new accton platform minipack (#2670)
[devices] add new accton platform minipack. Add support for new platform, minipack. It has CPU: Broadwell DE – D1527 MAC: Tomahawk3(BCM56980). PHY:Broadcom BCM81724, 4 pcs, Gearbox for PIM-16Q BMC:AST2520 8 hot-swappable Port-Interface-Modules, each of them has 16*100G QSFP. - What I did Add device and platform files for minipack. - How I did it Add as SONiC Porting Guide. - How to verify it decode-syseeprom sensors psuutil sfputil thermal monitor bcmsh on port status (port LEDs may not working)
- Loading branch information
Showing
22 changed files
with
4,983 additions
and
1 deletion.
There are no files selected for viewing
1,485 changes: 1,485 additions & 0 deletions
1,485
device/accton/x86_64-accton_minipack-r0/Accton-MINIPACK/config_16Q_FEC544_EVTA_100G.bcm
Large diffs are not rendered by default.
Oops, something went wrong.
1,487 changes: 1,487 additions & 0 deletions
1,487
device/accton/x86_64-accton_minipack-r0/Accton-MINIPACK/config_16Q_FEC544_EVTB_100G.bcm
Large diffs are not rendered by default.
Oops, something went wrong.
129 changes: 129 additions & 0 deletions
129
device/accton/x86_64-accton_minipack-r0/Accton-MINIPACK/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,129 @@ | ||
# name lanes alias index | ||
Ethernet1 5,6 onehundredGigE1 0 | ||
Ethernet2 7,8 onehundredGigE2 1 | ||
Ethernet3 1,2 onehundredGigE3 2 | ||
Ethernet4 3,4 onehundredGigE4 3 | ||
Ethernet5 37,38 onehundredGigE5 4 | ||
Ethernet6 39,40 onehundredGigE6 5 | ||
Ethernet7 33,34 onehundredGigE7 6 | ||
Ethernet8 35,36 onehundredGigE8 7 | ||
Ethernet9 69,70 onehundredGigE9 8 | ||
Ethernet10 71,72 onehundredGigE10 9 | ||
Ethernet11 65,66 onehundredGigE11 10 | ||
Ethernet12 67,68 onehundredGigE12 11 | ||
Ethernet13 101,102 onehundredGigE13 12 | ||
Ethernet14 103,104 onehundredGigE14 13 | ||
Ethernet15 97,98 onehundredGigE15 14 | ||
Ethernet16 99,100 onehundredGigE16 15 | ||
Ethernet17 13,14 onehundredGigE17 16 | ||
Ethernet18 15,16 onehundredGigE18 17 | ||
Ethernet19 9,10 onehundredGigE19 18 | ||
Ethernet20 11,12 onehundredGigE20 19 | ||
Ethernet21 45,46 onehundredGigE21 20 | ||
Ethernet22 47,48 onehundredGigE22 21 | ||
Ethernet23 41,42 onehundredGigE23 22 | ||
Ethernet24 43,44 onehundredGigE24 23 | ||
Ethernet25 77,78 onehundredGigE25 24 | ||
Ethernet26 79,80 onehundredGigE26 25 | ||
Ethernet27 73,74 onehundredGigE27 26 | ||
Ethernet28 75,76 onehundredGigE28 27 | ||
Ethernet29 109,110 onehundredGigE29 28 | ||
Ethernet30 111,112 onehundredGigE30 29 | ||
Ethernet31 105,106 onehundredGigE31 30 | ||
Ethernet32 107,108 onehundredGigE32 31 | ||
Ethernet33 21,22 onehundredGigE33 32 | ||
Ethernet34 23,24 onehundredGigE34 33 | ||
Ethernet35 17,18 onehundredGigE35 34 | ||
Ethernet36 19,20 onehundredGigE36 35 | ||
Ethernet37 53,54 onehundredGigE37 36 | ||
Ethernet38 55,56 onehundredGigE38 37 | ||
Ethernet39 49,50 onehundredGigE39 38 | ||
Ethernet40 51,52 onehundredGigE40 39 | ||
Ethernet41 85,86 onehundredGigE41 40 | ||
Ethernet42 87,88 onehundredGigE42 41 | ||
Ethernet43 81,82 onehundredGigE43 42 | ||
Ethernet44 83,84 onehundredGigE44 43 | ||
Ethernet45 117,118 onehundredGigE45 44 | ||
Ethernet46 119,120 onehundredGigE46 45 | ||
Ethernet47 113,114 onehundredGigE47 46 | ||
Ethernet48 115,116 onehundredGigE48 47 | ||
Ethernet49 29,30 onehundredGigE49 48 | ||
Ethernet50 31,32 onehundredGigE50 49 | ||
Ethernet51 25,26 onehundredGigE51 50 | ||
Ethernet52 27,28 onehundredGigE52 51 | ||
Ethernet53 61,62 onehundredGigE53 52 | ||
Ethernet54 63,64 onehundredGigE54 53 | ||
Ethernet55 57,58 onehundredGigE55 54 | ||
Ethernet56 59,60 onehundredGigE56 55 | ||
Ethernet57 93,94 onehundredGigE57 56 | ||
Ethernet58 95,96 onehundredGigE58 57 | ||
Ethernet59 89,90 onehundredGigE59 58 | ||
Ethernet60 91,92 onehundredGigE60 59 | ||
Ethernet61 125,126 onehundredGigE61 60 | ||
Ethernet62 127,128 onehundredGigE62 61 | ||
Ethernet63 121,122 onehundredGigE63 62 | ||
Ethernet64 123,124 onehundredGigE64 63 | ||
Ethernet65 133,134 onehundredGigE65 64 | ||
Ethernet66 135,136 onehundredGigE66 65 | ||
Ethernet67 129,130 onehundredGigE67 66 | ||
Ethernet68 131,132 onehundredGigE68 67 | ||
Ethernet69 165,166 onehundredGigE69 68 | ||
Ethernet70 167,168 onehundredGigE70 69 | ||
Ethernet71 161,162 onehundredGigE71 70 | ||
Ethernet72 163,164 onehundredGigE72 71 | ||
Ethernet73 197,198 onehundredGigE73 72 | ||
Ethernet74 199,200 onehundredGigE74 73 | ||
Ethernet75 193,194 onehundredGigE75 74 | ||
Ethernet76 195,196 onehundredGigE76 75 | ||
Ethernet77 229,230 onehundredGigE77 76 | ||
Ethernet78 231,232 onehundredGigE78 77 | ||
Ethernet79 225,226 onehundredGigE79 78 | ||
Ethernet80 227,228 onehundredGigE80 79 | ||
Ethernet81 141,142 onehundredGigE81 80 | ||
Ethernet82 143,144 onehundredGigE82 81 | ||
Ethernet83 137,138 onehundredGigE83 82 | ||
Ethernet84 139,140 onehundredGigE84 83 | ||
Ethernet85 173,174 onehundredGigE85 84 | ||
Ethernet86 175,176 onehundredGigE86 85 | ||
Ethernet87 169,170 onehundredGigE87 86 | ||
Ethernet88 171,172 onehundredGigE88 87 | ||
Ethernet89 205,206 onehundredGigE89 88 | ||
Ethernet90 207,208 onehundredGigE90 89 | ||
Ethernet91 201,202 onehundredGigE91 90 | ||
Ethernet92 203,204 onehundredGigE92 91 | ||
Ethernet93 237,238 onehundredGigE93 92 | ||
Ethernet94 239,240 onehundredGigE94 93 | ||
Ethernet95 233,234 onehundredGigE95 94 | ||
Ethernet96 235,236 onehundredGigE96 95 | ||
Ethernet97 149,150 onehundredGigE97 96 | ||
Ethernet98 151,152 onehundredGigE98 97 | ||
Ethernet99 145,146 onehundredGigE99 98 | ||
Ethernet100 147,148 onehundredGigE100 99 | ||
Ethernet101 181,182 onehundredGigE101 100 | ||
Ethernet102 183,184 onehundredGigE102 101 | ||
Ethernet103 177,178 onehundredGigE103 102 | ||
Ethernet104 179,180 onehundredGigE104 103 | ||
Ethernet105 213,214 onehundredGigE105 104 | ||
Ethernet106 215,216 onehundredGigE106 105 | ||
Ethernet107 209,210 onehundredGigE107 106 | ||
Ethernet108 211,212 onehundredGigE108 107 | ||
Ethernet109 245,246 onehundredGigE109 108 | ||
Ethernet110 247,248 onehundredGigE110 109 | ||
Ethernet111 241,242 onehundredGigE111 110 | ||
Ethernet112 243,244 onehundredGigE112 111 | ||
Ethernet113 157,158 onehundredGigE113 112 | ||
Ethernet114 159,160 onehundredGigE114 113 | ||
Ethernet115 153,154 onehundredGigE115 114 | ||
Ethernet116 155,156 onehundredGigE116 115 | ||
Ethernet117 189,190 onehundredGigE117 116 | ||
Ethernet118 191,192 onehundredGigE118 117 | ||
Ethernet119 185,186 onehundredGigE119 118 | ||
Ethernet120 187,188 onehundredGigE120 119 | ||
Ethernet121 221,222 onehundredGigE121 120 | ||
Ethernet122 223,224 onehundredGigE122 121 | ||
Ethernet123 217,218 onehundredGigE123 122 | ||
Ethernet124 219,220 onehundredGigE124 123 | ||
Ethernet125 253,254 onehundredGigE125 124 | ||
Ethernet126 255,256 onehundredGigE126 125 | ||
Ethernet127 249,250 onehundredGigE127 126 | ||
Ethernet128 251,252 onehundredGigE128 127 |
1 change: 1 addition & 0 deletions
1
device/accton/x86_64-accton_minipack-r0/Accton-MINIPACK/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 @@ | ||
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_16Q_FEC544_EVTB_100G.bcm |
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 @@ | ||
Accton-MINIPACK t1 |
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=57600 | ||
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="pcie_aspm=off" |
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 @@ | ||
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,21 @@ | ||
#!/usr/bin/env python | ||
|
||
try: | ||
import exceptions | ||
import binascii | ||
import time | ||
import optparse | ||
import warnings | ||
import os | ||
import sys | ||
from sonic_eeprom import eeprom_base | ||
from sonic_eeprom import eeprom_tlvinfo | ||
import subprocess | ||
except ImportError, e: | ||
raise ImportError (str(e) + "- required module not found") | ||
|
||
class board(eeprom_tlvinfo.TlvInfoDecoder): | ||
_TLV_INFO_MAX_LEN = 256 | ||
def __init__(self, name, path, cpld_root, ro): | ||
self.eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" | ||
super(board, self).__init__(self.eeprom_path, 0x200, '', True) |
57 changes: 57 additions & 0 deletions
57
device/accton/x86_64-accton_minipack-r0/plugins/psuutil.py
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,57 @@ | ||
#!/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.num = 4 | ||
self.psu_path = "/sys/bus/platform/devices/minipack_psensor/" | ||
self.psu_voltage = "/in{0}_input" | ||
|
||
def get_num_psus(self): | ||
return self.num | ||
|
||
def get_psu_status(self, index): | ||
if index is None: | ||
return False | ||
|
||
status = 0 | ||
node = self.psu_path + self.psu_voltage.format(index*2-1) | ||
try: | ||
with open(node, 'r') as power_status: | ||
status = int(power_status.read()) | ||
except IOError: | ||
return False | ||
|
||
return status > 0 | ||
|
||
def get_psu_presence(self, index): | ||
if index is None: | ||
return False | ||
|
||
status = 0 | ||
node = self.psu_path + self.psu_voltage.format(index*2) | ||
try: | ||
with open(node, 'r') as presence_status: | ||
status = int(presence_status.read()) | ||
except IOError: | ||
return False | ||
|
||
return status > 0 |
94 changes: 94 additions & 0 deletions
94
device/accton/x86_64-accton_minipack-r0/plugins/sfputil.py
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,94 @@ | ||
# sfputil.py | ||
# | ||
# Platform-specific SFP transceiver interface for SONiC | ||
# | ||
|
||
try: | ||
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""" | ||
|
||
PORT_START = 0 | ||
PORT_END = 128 | ||
|
||
BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/" | ||
|
||
_port_to_is_present = {} | ||
_port_to_lp_mode = {} | ||
|
||
_port_to_eeprom_mapping = {} | ||
|
||
@property | ||
def port_start(self): | ||
return self.PORT_START | ||
|
||
@property | ||
def port_end(self): | ||
return self.PORT_END | ||
|
||
@property | ||
def qsfp_ports(self): | ||
return range(self.PORT_START, self.PORT_END + 1) | ||
|
||
@property | ||
def port_to_eeprom_mapping(self): | ||
return self._port_to_eeprom_mapping | ||
|
||
def sfp_map(self, index): | ||
port = index + 1 | ||
base = ((port-1)/8*8) + 10 | ||
index = (port - 1) % 8 | ||
index = 7 - index | ||
if (index%2): | ||
index = index -1 | ||
else: | ||
index = index +1 | ||
bus = base + index | ||
return bus | ||
|
||
|
||
def __init__(self): | ||
eeprom_path = self.BASE_OOM_PATH + "eeprom" | ||
|
||
for x in range(0, self.port_end+1): | ||
bus = self.sfp_map(x) | ||
self.port_to_eeprom_mapping[x] = eeprom_path.format( | ||
bus) | ||
|
||
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 | ||
|
||
eeprom_path = self.port_to_eeprom_mapping[port_num] | ||
with open(eeprom_path) as f: | ||
try: | ||
content = f.read(1) | ||
except IOError as e: | ||
#Not print any error, for if any, treat as Not present. | ||
return False | ||
return True | ||
|
||
def get_low_power_mode(self, port_num): | ||
raise NotImplementedError | ||
|
||
def set_low_power_mode(self, port_num, lpmode): | ||
raise NotImplementedError | ||
|
||
def reset(self, port_num): | ||
raise NotImplementedError | ||
|
||
def get_transceiver_change_event(self): | ||
""" | ||
TODO: This function need to be implemented | ||
when decide to support monitoring SFP(Xcvrd) | ||
on this platform. | ||
""" | ||
raise NotImplementedError |
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,3 @@ | ||
# libsensors configuration file | ||
# ------------------------------------------------ | ||
|
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
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
Empty file.
1 change: 1 addition & 0 deletions
1
platform/broadcom/sonic-platform-modules-accton/minipack/modules/Makefile
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 @@ | ||
obj-m:= minipack_psensor.o |
Oops, something went wrong.