-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Haliburton e1031 platform #27
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# name lanes alias index | ||
Ethernet-SFP-1 49 Eth1 14 | ||
Ethernet-SFP-2 50 Eth2 15 | ||
Ethernet-SFP-3 51 Eth3 16 | ||
Ethernet-SFP-4 52 Eth4 17 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SAI_INIT_CONFIG_FILE=/etc/bcm/helix4-e1031-48x1G+4x10G.config.bcm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONSOLE_PORT=0x2f8 | ||
CONSOLE_DEV=1 | ||
CONSOLE_SPEED=115200 |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python | ||
|
||
############################################################################# | ||
# Celestica Haliburton | ||
# | ||
# 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-2/2-0050/eeprom" | ||
super(board, self).__init__(self.eeprom_path, 0, '', True) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/usr/bin/env python | ||
# | ||
# 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 = 14 | ||
PORT_END = 17 | ||
PORTS_IN_BLOCK = 0 | ||
|
||
_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(0, self.PORTS_IN_BLOCK + 1) | ||
|
||
@property | ||
def port_to_eeprom_mapping(self): | ||
return self._port_to_eeprom_mapping | ||
|
||
def __init__(self): | ||
# Override port_to_eeprom_mapping for class initialization | ||
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the eeprom driver only works for qsfp module, need to use oom module to support sfp module. more information can be found at. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I will use oom driver to support qsfp and sfp module |
||
|
||
for x in range(self.PORT_START, self.PORT_END + 1): | ||
self.port_to_eeprom_mapping[x] = eeprom_path.format( x ) | ||
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 | ||
|
||
try: | ||
reg_file = open("/sys/devices/platform/haliburton_cpld/qsfp_modprs", "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) | ||
|
||
# ModPrsL is active low | ||
if reg_value & mask == 0: | ||
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/haliburton_cpld/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 | ||
if reg_value & mask == 0: | ||
return False | ||
|
||
return True | ||
|
||
def set_low_power_mode(self, port_num, lpmode): | ||
raise NotImplementedError | ||
|
||
def reset(self, port_num): | ||
raise NotImplementedError | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# libsensors configuration file for Celestica DX010. | ||
# The i2c bus portion is omit because adapter name | ||
# changes every time when system boot up. | ||
|
||
#chip "dps460-i2c-*-5a" | ||
# label temp1 "Power Supply 1 temp sensor 1" | ||
# label temp2 "Power Supply 1 temp sensor 2" | ||
# label temp3 "Power Supply 1 temp sensor 3" | ||
# ignore fan2 | ||
#ignore fan3 | ||
|
||
#chip "dps460-i2c-*-5b" | ||
# label temp1 "Power Supply 2 temp sensor 1" | ||
# label temp2 "Power Supply 2 temp sensor 2" | ||
# label temp3 "Power Supply 2 temp sensor 3" | ||
#ignore fan2 | ||
# ignore fan3 | ||
|
||
chip "dps200-i2c-*-5a" | ||
|
||
chip "dps200-i2c-*-5b" | ||
|
||
chip "max6697-i2c-3-1a" | ||
label temp1 "temp sensor 1" | ||
label temp2 "temp sensor 2" | ||
label temp3 "temp sensor 3" | ||
ignore temp4 | ||
ignore temp5 | ||
ignore temp6 | ||
ignore temp7 | ||
|
||
chip "max6697-i2c-11-1a" | ||
label temp1 "temp sensor 1" | ||
label temp2 "temp sensor 2" | ||
label temp3 "temp sensor 3" | ||
label temp4 "temp sensor 4" | ||
label temp5 "temp sensor 5" | ||
ignore temp6 | ||
ignore temp7 | ||
|
||
|
||
|
||
# These sensors located on Main Switch Board. | ||
#chip "dx010_lm75b-i2c-*-48" | ||
# label temp1 "Front-panel temp sensor 1" | ||
# set temp1_max 43 | ||
# set temp1_max_hyst 28 | ||
# | ||
#chip "dx010_lm75b-i2c-*-49" | ||
# label temp1 "Front-panel temp sensor 2" | ||
# set temp1_max 43 | ||
# set temp1_max_hyst 28 | ||
|
||
#chip "dx010_lm75b-i2c-*-4a" | ||
# label temp1 "ASIC temp sensor" | ||
# set temp1_max 43 | ||
# set temp1_max_hyst 28# | ||
|
||
# These sensors located on CPU Board. | ||
#chip "dx010_lm75b-i2c-*-48" | ||
## label temp1 "Rear-panel temp sensor 1" | ||
# set temp1_max 43 | ||
# set temp1_max_hyst 28 | ||
|
||
#chip "dx010_lm75b-i2c-*-4e" | ||
# label temp1 "Rear-panel temp sensor 2" | ||
# set temp1_max 43 | ||
# set temp1_max_hyst 28 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,9 +65,9 @@ fi | |
echo "onie_platform: $onie_platform" | ||
|
||
# default console settings | ||
CONSOLE_PORT=0x3f8 | ||
CONSOLE_DEV=0 | ||
CONSOLE_SPEED=9600 | ||
CONSOLE_PORT=0x2f8 | ||
CONSOLE_DEV=1 | ||
CONSOLE_SPEED=115200 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please do not modify this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, but we found the issue that we can't access SONiC console after we install it with this old config |
||
|
||
# Get platform specific linux kernel command line arguments | ||
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
BRCM_SAI = libsaibcm_3.1.3.4-7_amd64.deb | ||
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.1.3.4-7_amd64.deb?sv=2015-04-05&sr=b&sig=elzOgHCA3G8oKKMfWcbFa%2BvQzAh727mtYJnnVOzVJtY%3D&se=2155-02-07T23%3A37%3A54Z&sp=r" | ||
BRCM_SAI = libsaibcm_3.1.3.4-8_amd64.deb | ||
$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm_3.1.3.4-8_amd64.deb?sv=2015-04-05&sr=b&sig=bYM539jLDK2wqWYYgEcf%2BPLChJ%2FkUc6wfyWJTpqJQkM%3D&se=2155-02-19T10%3A58%3A03Z&sp=r" | ||
|
||
BRCM_SAI_DEV = libsaibcm-dev_3.1.3.4-7_amd64.deb | ||
BRCM_SAI_DEV = libsaibcm-dev_3.1.3.4-8_amd64.deb | ||
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) | ||
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.1.3.4-7_amd64.deb?sv=2015-04-05&sr=b&sig=rysxdbCA%2BaqBgDnxztdRA2ixiME3ypqRvzyEds8hLw4%3D&se=2155-02-07T23%3A38%3A39Z&sp=r" | ||
$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsaibcm-dev_3.1.3.4-8_amd64.deb?sv=2015-04-05&sr=b&sig=CNopVxzI4nPSUb6bw56EPUvi03pjKXLGJR%2BfO1jxP2I%3D&se=2155-02-19T11%3A00%3A27Z&sp=r" | ||
|
||
SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV) | ||
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ def get_machine_info(): | |
tokens = line.split('=') | ||
if len(tokens) < 2: | ||
continue | ||
machine_vars[tokens[0]] = tokens[1].strip() | ||
machine_vars[tokens[0]] = tokens[1].strip().strip("'") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not modify this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, but we found this method return machine name with the single quote mark |
||
return machine_vars | ||
|
||
def get_platform_info(machine_info): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you remove all 1g ports? Can you keep the origin format? also I do not understand why you change lane information on 10G sfp ports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, i will bring 1g port back.
For the lanes, i reference from R0882-M1011-01- Rev1.0 Haliburton HW Design Spec.pdf