Skip to content
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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Owner

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.

Copy link
Author

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

image

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
3 changes: 3 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONSOLE_PORT=0x2f8
CONSOLE_DEV=1
CONSOLE_SPEED=115200
810 changes: 810 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/minigraph.xml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/plugins/eeprom.py
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)

102 changes: 102 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py
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'
Copy link
Owner

Choose a reason for hiding this comment

The 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.
oom module has been added to sonic kernel, so you can use it directly.

more information can be found at.
https://github.com/opencomputeproject/oom

Choose a reason for hiding this comment

The 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

68 changes: 68 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/sensors.conf
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
6 changes: 3 additions & 3 deletions installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not modify this file.

Choose a reason for hiding this comment

The 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=""
Expand Down
1 change: 1 addition & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(INVENTEC_D7032Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
$(CEL_DX010_PLATFORM_MODULE) \
$(CEL_HALIBURTON_PLATFORM_MODULE) \
$(DELTA_AG9032V1_PLATFORM_MODULE) \
$(DELTA_AG9064_PLATFORM_MODULE) \
$(DELTA_AG5648_PLATFORM_MODULE) \
Expand Down
15 changes: 13 additions & 2 deletions platform/broadcom/platform-modules-cel.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Celestica DX010 Platform modules
# Celestica Platform modules

CEL_DX010_PLATFORM_MODULE_VERSION = 0.6
CEL_DX010_PLATFORM_MODULE_VERSION = 0.7

export CEL_DX010_PLATFORM_MODULE_VERSION

Expand All @@ -9,3 +9,14 @@ $(CEL_DX010_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-
$(CEL_DX010_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(CEL_DX010_PLATFORM_MODULE)_PLATFORM = x86_64-cel_seastone-r0
SONIC_DPKG_DEBS += $(CEL_DX010_PLATFORM_MODULE)


CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.7

export CEL_HALIBURTON_PLATFORM_MODULE_VERSION

CEL_HALIBURTON_PLATFORM_MODULE = platform-modules-haliburton_$(CEL_HALIBURTON_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_HALIBURTON_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-cel
$(CEL_HALIBURTON_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(CEL_HALIBURTON_PLATFORM_MODULE)_PLATFORM = x86_64-cel_e1031-r0
SONIC_DPKG_DEBS += $(CEL_HALIBURTON_PLATFORM_MODULE)
8 changes: 4 additions & 4 deletions platform/broadcom/sai.mk
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)
2 changes: 1 addition & 1 deletion src/sonic-config-engine/sonic_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("'")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not modify this file.

Choose a reason for hiding this comment

The 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):
Expand Down