Skip to content

Commit 708999a

Browse files
olivier-singlalguohan
authored andcommitted
[devices]: Add Broadcom XLR/GTS (BCM9COMX2XMC) support for Tomahawk switch (BCM956960K) (#2682)
These patches add support for the Broadcom XMC card (XLR/GTS). At this moment only Tomahawk switch (BCM956960K) is supported. Add device/broadcom/x86_64-bcm_xlr-r0 and platform/broadcom/sonic-platform-modules-brcm-xlr-gts files
1 parent 3d2955a commit 708999a

25 files changed

Lines changed: 1528 additions & 1 deletion
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
portmap_1=1:100
2+
portmap_2=5:100
3+
portmap_3=9:100
4+
portmap_4=13:100
5+
portmap_5=17:100
6+
portmap_6=21:100
7+
portmap_7=25:100
8+
portmap_8=29:100
9+
portmap_34=33:100
10+
portmap_35=37:100
11+
portmap_36=41:100
12+
portmap_37=45:100
13+
portmap_38=49:100
14+
portmap_39=53:100
15+
portmap_40=57:100
16+
portmap_41=61:100
17+
portmap_68=65:100
18+
portmap_69=69:100
19+
portmap_70=73:100
20+
portmap_71=77:100
21+
portmap_72=81:100
22+
portmap_73=85:100
23+
portmap_74=89:100
24+
portmap_75=93:100
25+
portmap_102=97:100
26+
portmap_103=101:100
27+
portmap_104=105:100
28+
portmap_105=109:100
29+
portmap_106=113:100
30+
portmap_107=117:100
31+
portmap_108=121:100
32+
portmap_109=125:100
33+
oversubscribe_mode=1
34+
portmap_66=129:10
35+
portmap_100=131:10
36+
pbmp_xport_xe=0x3fd000000ff4000003fc000001fe
37+
portmap_33=132:10
38+
portmap_67=133:10
39+
portmap_101=134:10
40+
portmap_135=135:10
41+
xgxs_tx_lane_map_ce18=0x1032
42+
xgxs_rx_lane_map_ce18=0x1032
43+
xgxs_rx_lane_map_ce19=0x2301
44+
xgxs_rx_lane_map_ce20=0x2301
45+
xgxs_rx_lane_map_ce21=0x2301
46+
xgxs_rx_lane_map_ce22=0x2301
47+
xgxs_rx_lane_map_ce23=0x2301
48+
xgxs_rx_lane_map_ce24=0x2301
49+
xgxs_rx_lane_map_ce25=0x2301
50+
xgxs_rx_lane_map_ce26=0x2301
51+
xgxs_rx_lane_map_ce27=0x2301
52+
xgxs_rx_lane_map_ce28=0x2301
53+
phy_xaui_rx_polarity_flip_ce4=0x2
54+
phy_xaui_tx_polarity_flip_ce5=0x8
55+
phy_xaui_rx_polarity_flip_ce5=0x5
56+
phy_xaui_rx_polarity_flip_ce6=0x2
57+
phy_xaui_tx_polarity_flip_ce7=0x8
58+
phy_xaui_tx_polarity_flip_ce8=0x8
59+
phy_xaui_rx_polarity_flip_ce8=0x8
60+
phy_xaui_tx_polarity_flip_ce10=0x8
61+
phy_xaui_rx_polarity_flip_ce10=0x1
62+
phy_xaui_rx_polarity_flip_ce11=0x2
63+
phy_xaui_tx_polarity_flip_ce19=0x2
64+
phy_xaui_rx_polarity_flip_ce19=0x3
65+
phy_xaui_tx_polarity_flip_ce20=0x8
66+
phy_xaui_rx_polarity_flip_ce21=0x4
67+
phy_xaui_tx_polarity_flip_ce22=0x8
68+
phy_xaui_rx_polarity_flip_ce22=0x8
69+
phy_xaui_rx_polarity_flip_ce23=0x4
70+
phy_xaui_rx_polarity_flip_ce24=0x4
71+
phy_xaui_tx_polarity_flip_ce25=0x8
72+
phy_xaui_rx_polarity_flip_ce25=0x8
73+
phy_xaui_rx_polarity_flip_ce26=0x4
74+
phy_xaui_tx_polarity_flip_ce27=0x8
75+
phy_xaui_rx_polarity_flip_ce27=0x8
76+
l2xmsg_mode=1
77+
fpem_mem_entries=32768
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# name lanes alias index speed
2+
Ethernet0 1,2,3,4 Ethernet1/0/1 0 100000
3+
Ethernet4 5,6,7,8 Ethernet1/0/5 1 100000
4+
Ethernet8 9,10,11,12 Ethernet1/0/9 2 100000
5+
Ethernet12 13,14,15,16 Ethernet1/0/13 3 100000
6+
Ethernet16 17,18,19,20 Ethernet1/0/17 4 100000
7+
Ethernet20 21,22,23,24 Ethernet1/0/21 5 100000
8+
Ethernet24 25,26,27,28 Ethernet1/0/25 6 100000
9+
Ethernet28 29,30,31,32 Ethernet1/0/29 7 100000
10+
Ethernet32 33,34,35,36 Ethernet1/0/33 8 100000
11+
Ethernet36 37,38,39,40 Ethernet1/0/37 9 100000
12+
Ethernet40 41,42,43,44 Ethernet1/0/41 10 100000
13+
Ethernet44 45,46,47,48 Ethernet1/0/45 11 100000
14+
Ethernet48 49,50,51,52 Ethernet1/0/49 12 100000
15+
Ethernet52 53,54,55,56 Ethernet1/0/53 13 100000
16+
Ethernet56 57,58,59,60 Ethernet1/0/57 14 100000
17+
Ethernet60 61,62,63,64 Ethernet1/0/61 15 100000
18+
Ethernet64 65,66,67,68 Ethernet1/0/65 16 100000
19+
Ethernet68 69,70,71,72 Ethernet1/0/69 17 100000
20+
Ethernet72 73,74,75,76 Ethernet1/0/73 18 100000
21+
Ethernet76 77,78,79,80 Ethernet1/0/77 19 100000
22+
Ethernet80 81,82,83,84 Ethernet1/0/81 20 100000
23+
Ethernet84 85,86,87,88 Ethernet1/0/85 21 100000
24+
Ethernet88 89,90,91,92 Ethernet1/0/89 22 100000
25+
Ethernet92 93,94,95,96 Ethernet1/0/93 23 100000
26+
Ethernet96 97,98,99,100 Ethernet1/0/97 24 100000
27+
Ethernet100 101,102,103,104 Ethernet1/0/101 25 100000
28+
Ethernet104 105,106,107,108 Ethernet1/0/105 26 100000
29+
Ethernet108 109,110,111,112 Ethernet1/0/109 27 100000
30+
Ethernet112 113,114,115,116 Ethernet1/0/113 28 100000
31+
Ethernet116 117,118,119,120 Ethernet1/0/117 29 100000
32+
Ethernet120 121,122,123,124 Ethernet1/0/121 30 100000
33+
Ethernet124 125,126,127,128 Ethernet1/0/125 31 100000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_th_32x100.bcm
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bcm_xlr t1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if [ -d /sys/devices/pci0000:00/0000:00:13.0 ]; then
2+
CONSOLE_PORT=0x3e8
3+
CONSOLE_DEV=2
4+
else
5+
CONSOLE_PORT=0x3f8
6+
CONSOLE_DEV=0
7+
fi
8+
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.dma=0 libata.noacpi=1"
9+
CONSOLE_SPEED=115200
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python
2+
3+
#############################################################################
4+
# Broadcom XLR/GTS 'eeprom' support
5+
#
6+
# Platform and model specific eeprom subclass, inherits from the base class,
7+
# and provides the followings:
8+
# - the eeprom format definition
9+
# - specific encoder/decoder if there is special need
10+
#
11+
# Note: the file /etc/sys_eeprom.bin is generated by the script
12+
# brcm-xlr-gts-create-eeprom-file.py
13+
#############################################################################
14+
15+
try:
16+
from sonic_eeprom import eeprom_tlvinfo
17+
except ImportError, e:
18+
raise ImportError (str(e) + "- required module not found")
19+
20+
21+
class board(eeprom_tlvinfo.TlvInfoDecoder):
22+
23+
def __init__(self, name, path, cpld_root, ro):
24+
self.eeprom_path = "/etc/sys_eeprom.bin"
25+
super(board, self).__init__(self.eeprom_path, 0, '', False, True)
26+
27+
def serial_number_str(self, e):
28+
"""Return service tag instead of serial number"""
29+
return "No service tag"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python
2+
3+
import os.path
4+
5+
try:
6+
from sonic_psu.psu_base import PsuBase
7+
except ImportError as e:
8+
raise ImportError(str(e) + "- required module not found")
9+
10+
11+
class PsuUtil(PsuBase):
12+
"""Platform-specific PSUutil class"""
13+
14+
def __init__(self):
15+
PsuBase.__init__(self)
16+
17+
def get_num_psus(self):
18+
"""
19+
Retrieves the number of PSUs available on the device
20+
21+
:return: An integer, the number of PSUs available on the device
22+
"""
23+
return 0
24+
25+
def get_psu_status(self, index):
26+
"""
27+
Retrieves the oprational status of power supply unit (PSU) defined by 1-based index <index>
28+
29+
:param index: An integer, 1-based index of the PSU of which to query status
30+
:return: Boolean, True if PSU is operating properly, False if PSU is faulty
31+
"""
32+
return False
33+
34+
def get_psu_presence(self, index):
35+
"""
36+
Retrieves the presence status of power supply unit (PSU) defined by 1-based index <index>
37+
38+
:param index: An integer, 1-based index of the PSU of which to query status
39+
:return: Boolean, True if PSU is plugged, False if not
40+
"""
41+
return False
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env python
2+
3+
try:
4+
import time
5+
import os
6+
from sonic_sfp.sfputilbase import SfpUtilBase
7+
except ImportError as e:
8+
raise ImportError("%s - required module not found" % str(e))
9+
10+
11+
class SfpUtil(SfpUtilBase):
12+
"""Platform-specific SfpUtil class"""
13+
14+
PORT_START = 1
15+
PORT_END = 52
16+
_port_to_eeprom_mapping = {}
17+
18+
@property
19+
def port_start(self):
20+
return self.PORT_START
21+
22+
@property
23+
def port_end(self):
24+
return self.PORT_END
25+
26+
@property
27+
def qsfp_ports(self):
28+
return []
29+
30+
@property
31+
def port_to_eeprom_mapping(self):
32+
return self._port_to_eeprom_mapping
33+
34+
def __init__(self):
35+
SfpUtilBase.__init__(self)
36+
37+
def get_presence(self, port_num):
38+
return False
39+
40+
def get_low_power_mode(self, port_num):
41+
raise NotImplementedError
42+
43+
def set_low_power_mode(self, port_num, lpmode):
44+
raise NotImplementedError
45+
46+
def reset(self, port_num):
47+
raise NotImplementedError
48+
49+
def get_transceiver_change_event(self, timeout=0):
50+
raise NotImplementedError

platform/broadcom/one-image.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
3838
$(QUANTA_IX1B_32X_PLATFORM_MODULE) \
3939
$(MITAC_LY1200_32X_PLATFORM_MODULE) \
4040
$(ALPHANETWORKS_SNH60A0_320FV2_PLATFORM_MODULE) \
41-
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE)
41+
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) \
42+
$(BRCM_XLR_GTS_PLATFORM_MODULE)
4243
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
4344
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Broadcom XLR/GTS Platform modules
2+
3+
BRCM_XLR_GTS_PLATFORM_MODULE_VERSION = 1.0
4+
5+
export BRCM_XLR_GTS_PLATFORM_MODULE_VERSION
6+
7+
BRCM_XLR_GTS_PLATFORM_MODULE = sonic-platform-brcm-xlr-gts_$(BRCM_XLR_GTS_PLATFORM_MODULE_VERSION)_amd64.deb
8+
$(BRCM_XLR_GTS_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-brcm-xlr-gts
9+
$(BRCM_XLR_GTS_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
10+
$(BRCM_XLR_GTS_PLATFORM_MODULE)_PLATFORM = x86_64-bcm_xlr-r0
11+
SONIC_MAKE_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE)
12+
13+
export BRCM_XLR_GTS_PLATFORM_MODULE
14+
15+
SONIC_STRETCH_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE)

0 commit comments

Comments
 (0)