[Quanta]: Add a new supported device and platform, IX1B-32X (#1372)

* [Quanta]: Add a new supported device and platform, IX1B-32X

Switch Vendor: Quanta
Switch SKU:    IX1B-32X
ASIC Vendor:   Broadcom
Swich ASIC:    Tomahawk
Port Config:   32x100G

Signed-off-by: Chih-Pei.Chang@qct.io
This commit is contained in:
cpchang 2018-02-12 11:11:26 +08:00 committed by lguohan
parent 345430ca6f
commit ed408cde54
12 changed files with 1334 additions and 1 deletions

4
.gitmodules vendored Normal file → Executable file
View File

@ -74,3 +74,7 @@
[submodule "platform/nephos/sonic-platform-modules-ingrasys"] [submodule "platform/nephos/sonic-platform-modules-ingrasys"]
path = platform/nephos/sonic-platform-modules-ingrasys path = platform/nephos/sonic-platform-modules-ingrasys
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys-nephos.git url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys-nephos.git
[submodule "platform/broadcom/sonic-platform-modules-quanta"]
path = platform/broadcom/sonic-platform-modules-quanta
url = https://github.com/QuantaSwitchONIE/sonic-platform-modules-quanta.git

View File

@ -0,0 +1,33 @@
# name lanes alias
Ethernet0 65,66,67,68 hundredGigE1
Ethernet4 69,70,71,72 hundredGigE2
Ethernet8 73,74,75,76 hundredGigE3
Ethernet12 77,78,79,80 hundredGigE4
Ethernet16 45,46,47,48 hundredGigE5
Ethernet20 41,42,43,44 hundredGigE6
Ethernet24 53,54,55,56 hundredGigE7
Ethernet28 49,50,51,52 hundredGigE8
Ethernet32 61,62,63,64 hundredGigE9
Ethernet36 57,58,59,60 hundredGigE10
Ethernet40 37,38,39,40 hundredGigE11
Ethernet44 33,34,35,36 hundredGigE12
Ethernet48 81,82,83,84 hundredGigE13
Ethernet52 85,86,87,88 hundredGigE14
Ethernet56 89,90,91,92 hundredGigE15
Ethernet60 93,94,95,96 hundredGigE16
Ethernet64 97,98,99,100 hundredGigE17
Ethernet68 101,102,103,104 hundredGigE18
Ethernet72 105,106,107,108 hundredGigE19
Ethernet76 109,110,111,112 hundredGigE20
Ethernet80 29,30,31,32 hundredGigE21
Ethernet84 25,26,27,28 hundredGigE22
Ethernet88 5,6,7,8 hundredGigE23
Ethernet92 1,2,3,4 hundredGigE24
Ethernet96 13,14,15,16 hundredGigE25
Ethernet100 9,10,11,12 hundredGigE26
Ethernet104 21,22,23,24 hundredGigE27
Ethernet108 17,18,19,20 hundredGigE28
Ethernet112 113,114,115,116 hundredGigE29
Ethernet116 117,118,119,120 hundredGigE30
Ethernet120 121,122,123,124 hundredGigE31
Ethernet124 125,126,127,128 hundredGigE32

View File

@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/th-ix1b-32x100G.config.bcm

View File

@ -0,0 +1,3 @@
CONSOLE_PORT=0x2f8
CONSOLE_DEV=1
CONSOLE_SPEED=115200

View File

@ -0,0 +1,10 @@
led 0 stop
led 1 stop
led 0 prog 02 00 60 F3 67 1A 86 F3 06 F3 D2 40 74 04 12 F0 85 05 D2 0A 71 18 52 00 3A 80 28 60 F3 67 40 67 22 57 06 F3 12 A0 F8 15 1A 05 75 2E 77 38 06 F3 12 A0 F8 15 1A 04 75 4C 16 F0 DA 05 75 4C 77 54 06 F3 12 A0 F8 15 1A 00 75 4C 77 54 32 0F 87 57 32 0E 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
led 1 prog 02 00 60 F3 67 1A 86 F3 06 F3 D2 40 74 04 12 F0 85 05 D2 0A 71 18 52 00 3A 80 28 60 F3 67 40 67 22 57 06 F3 12 A0 F8 15 1A 05 75 2E 77 38 06 F3 12 A0 F8 15 1A 04 75 4C 16 F0 DA 05 75 4C 77 54 06 F3 12 A0 F8 15 1A 00 75 4C 77 54 32 0F 87 57 32 0E 87 57 32 0E 87 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
led 0 auto on
led 1 auto on
led 0 start
led 1 start

File diff suppressed because it is too large Load Diff

View File

@ -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/22-0054/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,171 @@
#!/usr/bin/env python
try:
import time
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class SfpUtil(SfpUtilBase):
"""Platform specific SfpUtill class"""
_port_start = 0
_port_end = 31
ports_in_block = 32
_port_to_eeprom_mapping = {}
port_to_i2c_mapping = {
1 : 32,
2 : 33,
3 : 34,
4 : 35,
5 : 36,
6 : 37,
7 : 38,
8 : 39,
9 : 40,
10 : 41,
11 : 42,
12 : 43,
13 : 44,
14 : 45,
15 : 46,
16 : 47,
17 : 48,
18 : 49,
19 : 50,
20 : 51,
21 : 52,
22 : 53,
23 : 54,
24 : 55,
25 : 56,
26 : 57,
27 : 58,
28 : 59,
29 : 60,
30 : 61,
31 : 62,
32 : 63,
}
_qsfp_ports = range(0, ports_in_block + 1)
def __init__(self):
eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom'
for x in range(0, self._port_end + 1):
port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x+1])
self._port_to_eeprom_mapping[x] = port_eeprom_path
SfpUtilBase.__init__(self)
def reset(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/cpld-qsfp28/port-"+str(port_num+1)+"/reset", "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("/sys/class/cpld-qsfp28/port-"+str(port_num+1)+"/reset", "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
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/cpld-qsfp28/port-"+str(port_num+1)+"/lpmode", "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 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/cpld-qsfp28/port-"+str(port_num+1)+"/lpmode")
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 False
return True
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
#path = "/sys/class/cpld-qsfp28/port-{0}/module_present"
#port_ps = path.format(self.port_to_i2c_mapping[port_num+1])
try:
reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num+1)+"/module_present")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
reg_value = reg_file.readline().rstrip()
if reg_value == '1':
return True
return False
@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(0, self.ports_in_block + 1)
@property
def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

View File

@ -19,6 +19,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(INVENTEC_D7032Q28B_PLATFORM_MODULE) \ $(INVENTEC_D7032Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \ $(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
$(CEL_DX010_PLATFORM_MODULE) \ $(CEL_DX010_PLATFORM_MODULE) \
$(DELTA_AG9032V1_PLATFORM_MODULE) $(DELTA_AG9032V1_PLATFORM_MODULE) \
$(QUANTA_IX1B_32X_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)

View File

@ -0,0 +1,13 @@
# Quanta Platform modules
QUANTA_IX1B_32X_PLATFORM_MODULE_VERSION = 1.0
export QUANTA_IX1B_32X_PLATFORM_MODULE_VERSION
QUANTA_IX1B_32X_PLATFORM_MODULE = sonic-platform-quanta-ix1b-32x_$(QUANTA_IX1B_32X_PLATFORM_MODULE_VERSION)_amd64.deb
$(QUANTA_IX1B_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-quanta
$(QUANTA_IX1B_32X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(QUANTA_IX1B_32X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix1b_32x-r0
SONIC_DPKG_DEBS += $(QUANTA_IX1B_32X_PLATFORM_MODULE)

View File

@ -8,6 +8,7 @@ include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/platform-modules-inventec.mk include $(PLATFORM_PATH)/platform-modules-inventec.mk
include $(PLATFORM_PATH)/platform-modules-cel.mk include $(PLATFORM_PATH)/platform-modules-cel.mk
include $(PLATFORM_PATH)/platform-modules-delta.mk include $(PLATFORM_PATH)/platform-modules-delta.mk
include $(PLATFORM_PATH)/platform-modules-quanta.mk
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk

@ -0,0 +1 @@
Subproject commit 40ffdcb54ad747974f6db2396ac1c72cc21294ab