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 Broadcom XLR/GTS ((BCM9COMX2XMC) support for Tomahawk switch (BCM956960K) #2675

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
77 changes: 77 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/config_th_32x100.bcm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
portmap_1=1:100
portmap_2=5:100
portmap_3=9:100
portmap_4=13:100
portmap_5=17:100
portmap_6=21:100
portmap_7=25:100
portmap_8=29:100
portmap_34=33:100
portmap_35=37:100
portmap_36=41:100
portmap_37=45:100
portmap_38=49:100
portmap_39=53:100
portmap_40=57:100
portmap_41=61:100
portmap_68=65:100
portmap_69=69:100
portmap_70=73:100
portmap_71=77:100
portmap_72=81:100
portmap_73=85:100
portmap_74=89:100
portmap_75=93:100
portmap_102=97:100
portmap_103=101:100
portmap_104=105:100
portmap_105=109:100
portmap_106=113:100
portmap_107=117:100
portmap_108=121:100
portmap_109=125:100
oversubscribe_mode=1
portmap_66=129:10
portmap_100=131:10
pbmp_xport_xe=0x3fd000000ff4000003fc000001fe
portmap_33=132:10
portmap_67=133:10
portmap_101=134:10
portmap_135=135:10
xgxs_tx_lane_map_ce18=0x1032
xgxs_rx_lane_map_ce18=0x1032
xgxs_rx_lane_map_ce19=0x2301
xgxs_rx_lane_map_ce20=0x2301
xgxs_rx_lane_map_ce21=0x2301
xgxs_rx_lane_map_ce22=0x2301
xgxs_rx_lane_map_ce23=0x2301
xgxs_rx_lane_map_ce24=0x2301
xgxs_rx_lane_map_ce25=0x2301
xgxs_rx_lane_map_ce26=0x2301
xgxs_rx_lane_map_ce27=0x2301
xgxs_rx_lane_map_ce28=0x2301
phy_xaui_rx_polarity_flip_ce4=0x2
phy_xaui_tx_polarity_flip_ce5=0x8
phy_xaui_rx_polarity_flip_ce5=0x5
phy_xaui_rx_polarity_flip_ce6=0x2
phy_xaui_tx_polarity_flip_ce7=0x8
phy_xaui_tx_polarity_flip_ce8=0x8
phy_xaui_rx_polarity_flip_ce8=0x8
phy_xaui_tx_polarity_flip_ce10=0x8
phy_xaui_rx_polarity_flip_ce10=0x1
phy_xaui_rx_polarity_flip_ce11=0x2
phy_xaui_tx_polarity_flip_ce19=0x2
phy_xaui_rx_polarity_flip_ce19=0x3
phy_xaui_tx_polarity_flip_ce20=0x8
phy_xaui_rx_polarity_flip_ce21=0x4
phy_xaui_tx_polarity_flip_ce22=0x8
phy_xaui_rx_polarity_flip_ce22=0x8
phy_xaui_rx_polarity_flip_ce23=0x4
phy_xaui_rx_polarity_flip_ce24=0x4
phy_xaui_tx_polarity_flip_ce25=0x8
phy_xaui_rx_polarity_flip_ce25=0x8
phy_xaui_rx_polarity_flip_ce26=0x4
phy_xaui_tx_polarity_flip_ce27=0x8
phy_xaui_rx_polarity_flip_ce27=0x8
l2xmsg_mode=1
fpem_mem_entries=32768
33 changes: 33 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/port_config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name lanes alias index speed
Ethernet0 1,2,3,4 Ethernet1/0/1 0 100000
Ethernet4 5,6,7,8 Ethernet1/0/5 1 100000
Ethernet8 9,10,11,12 Ethernet1/0/9 2 100000
Ethernet12 13,14,15,16 Ethernet1/0/13 3 100000
Ethernet16 17,18,19,20 Ethernet1/0/17 4 100000
Ethernet20 21,22,23,24 Ethernet1/0/21 5 100000
Ethernet24 25,26,27,28 Ethernet1/0/25 6 100000
Ethernet28 29,30,31,32 Ethernet1/0/29 7 100000
Ethernet32 33,34,35,36 Ethernet1/0/33 8 100000
Ethernet36 37,38,39,40 Ethernet1/0/37 9 100000
Ethernet40 41,42,43,44 Ethernet1/0/41 10 100000
Ethernet44 45,46,47,48 Ethernet1/0/45 11 100000
Ethernet48 49,50,51,52 Ethernet1/0/49 12 100000
Ethernet52 53,54,55,56 Ethernet1/0/53 13 100000
Ethernet56 57,58,59,60 Ethernet1/0/57 14 100000
Ethernet60 61,62,63,64 Ethernet1/0/61 15 100000
Ethernet64 65,66,67,68 Ethernet1/0/65 16 100000
Ethernet68 69,70,71,72 Ethernet1/0/69 17 100000
Ethernet72 73,74,75,76 Ethernet1/0/73 18 100000
Ethernet76 77,78,79,80 Ethernet1/0/77 19 100000
Ethernet80 81,82,83,84 Ethernet1/0/81 20 100000
Ethernet84 85,86,87,88 Ethernet1/0/85 21 100000
Ethernet88 89,90,91,92 Ethernet1/0/89 22 100000
Ethernet92 93,94,95,96 Ethernet1/0/93 23 100000
Ethernet96 97,98,99,100 Ethernet1/0/97 24 100000
Ethernet100 101,102,103,104 Ethernet1/0/101 25 100000
Ethernet104 105,106,107,108 Ethernet1/0/105 26 100000
Ethernet108 109,110,111,112 Ethernet1/0/109 27 100000
Ethernet112 113,114,115,116 Ethernet1/0/113 28 100000
Ethernet116 117,118,119,120 Ethernet1/0/117 29 100000
Ethernet120 121,122,123,124 Ethernet1/0/121 30 100000
Ethernet124 125,126,127,128 Ethernet1/0/125 31 100000
1 change: 1 addition & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/sai.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_th_32x100.bcm
1 change: 1 addition & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bcm_xlr t1
9 changes: 9 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if [ -d /sys/devices/pci0000:00/0000:00:13.0 ]; then
CONSOLE_PORT=0x3e8
CONSOLE_DEV=2
else
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
fi
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.dma=0 libata.noacpi=1"
CONSOLE_SPEED=115200
29 changes: 29 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

#############################################################################
# Broadcom XLR/GTS 'eeprom' support
#
# 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
#
# Note: the file /etc/sys_eeprom.bin is generated by the script
# brcm-xlr-gts-create-eeprom-file.py
#############################################################################

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 = "/etc/sys_eeprom.bin"
super(board, self).__init__(self.eeprom_path, 0, '', False, True)

def serial_number_str(self, e):
"""Return service tag instead of serial number"""
return "No service tag"
41 changes: 41 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python

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)

def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device

:return: An integer, the number of PSUs available on the device
"""
return 0

def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined by 1-based index <index>

:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is faulty
"""
return False

def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined by 1-based index <index>

:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
return False
50 changes: 50 additions & 0 deletions device/broadcom/x86_64-bcm_xlr-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env python

try:
import time
import os
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 = 1
PORT_END = 52
_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 []

@property
def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

def __init__(self):
SfpUtilBase.__init__(self)

def get_presence(self, port_num):
return False

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, timeout=0):
raise NotImplementedError
3 changes: 2 additions & 1 deletion platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(QUANTA_IX1B_32X_PLATFORM_MODULE) \
$(MITAC_LY1200_32X_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60A0_320FV2_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE)
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) \
$(BRCM_XLR_GTS_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
15 changes: 15 additions & 0 deletions platform/broadcom/platform-modules-brcm-xlr-gts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Broadcom XLR/GTS Platform modules

BRCM_XLR_GTS_PLATFORM_MODULE_VERSION = 1.0

export BRCM_XLR_GTS_PLATFORM_MODULE_VERSION

BRCM_XLR_GTS_PLATFORM_MODULE = sonic-platform-brcm-xlr-gts_$(BRCM_XLR_GTS_PLATFORM_MODULE_VERSION)_amd64.deb
$(BRCM_XLR_GTS_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-brcm-xlr-gts
$(BRCM_XLR_GTS_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(BRCM_XLR_GTS_PLATFORM_MODULE)_PLATFORM = x86_64-bcm_xlr-r0
SONIC_MAKE_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE)

export BRCM_XLR_GTS_PLATFORM_MODULE

SONIC_STRETCH_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE)
1 change: 1 addition & 0 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include $(PLATFORM_PATH)/platform-modules-cel.mk
include $(PLATFORM_PATH)/platform-modules-delta.mk
include $(PLATFORM_PATH)/platform-modules-quanta.mk
#include $(PLATFORM_PATH)/platform-modules-mitac.mk
include $(PLATFORM_PATH)/platform-modules-brcm-xlr-gts.mk
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk
Expand Down
14 changes: 14 additions & 0 deletions platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SHELL = /bin/bash
.ONESHELL:
.SHELLFLAGS += -e

MAIN_TARGET = $(BRCM_XLR_GTS_PLATFORM_MODULE)

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Build the package
export PYBUILD_INSTALL_ARGS_python2=--install-scripts=/dev/null
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS)

mv $(addprefix ../, $* $(EXTRA_TARGETS)) $(DEST)/

$(addprefix $(DEST)/, $(EXTRA_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Broadcom XLR/GTS platform setup
Before=systemd-logind docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/brcm-xlr-gts-platform-setup

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sonic-platform-brcm-xlr-gts (1.0) unstable;

* Initial release

-- Olivier Singla <olivier.singla@broadcom.com> Thursday, 14 Feb 2019 11:11:11 -0800
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Source: sonic-platform-brcm-xlr-gts
Section: main
Priority: extra
Maintainer: Olivier Singla <olivier.singla@broadcom.com>
Build-Depends:
dh-python,
debhelper (>= 9.0.0),
python-all,
python(>=2.7-3~),
python-setuptools,
python3(>=3.2),
python3-setuptools,
bzip2
Standards-Version: 1.0.0
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.2
XS-Python-Version: >= 2.7
XS-Python3-Version: >= 3.2

Package: sonic-platform-brcm-xlr-gts
Architecture: amd64
Depends:
${python:Depends},
${misc:Depends},
python(>=2.7),
i2c-tools
Description: Miscellaneous XLR scripts and tools
Loading