Skip to content

Commit

Permalink
Merge pull request sonic-net#162 from SONIC-DEV/201911
Browse files Browse the repository at this point in the history
update from azure/201911
  • Loading branch information
Alex-Dai authored May 8, 2020
2 parents 4310a25 + fedaec7 commit 3324e99
Show file tree
Hide file tree
Showing 262 changed files with 9,694 additions and 3,038 deletions.
5 changes: 5 additions & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# through http.
# * ENABLE_ZTP: Enables zero touch provisioning.
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
# * INSTALL_KUBERNETES: Allows including Kubernetes
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
# * by default for TOR switch.
# * ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
Expand Down Expand Up @@ -165,6 +166,10 @@ SONIC_BUILD_INSTRUCTION := make \
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
ENABLE_ZTP=$(ENABLE_ZTP) \
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
INSTALL_KUBERNETES=$(INSTALL_KUBERNETES) \
KUBERNETES_VERSION=$(KUBERNETES_VERSION) \
K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \
K8s_CNI_CALICO_VERSION=$(K8s_CNI_CALICO_VERSION) \
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
SONIC_INSTALL_DEBUG_TOOLS=$(INSTALL_DEBUG_TOOLS) \
Expand Down
16 changes: 16 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION}
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common gnupg2

if [ "$INSTALL_KUBERNETES" == "y" ]
then
## Install Kubernetes
echo '[INFO] Install kubernetes'
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT curl -fsSL \
https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add -
## Check out the sources list update matches current Debian version
sudo cp files/image_config/kubernetes/kubernetes.list $FILESYSTEM_ROOT/etc/apt/sources.list.d/
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${KUBERNETES_VERSION}-00
# kubeadm package auto install kubelet & kubectl
else
echo '[INFO] Skipping Install kubernetes'
fi

## Add docker config drop-in to specify dockerd command line
sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/
## Note: $_ means last argument of last command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def get_presence(self):
presence = int(sfp_presence.read(), 16)
except IOError:
return False
logger.log_info("debug:port_ %s sfp presence is %s" % (str(self.index)), % (str(presence))
logger.log_info("debug:port_ %s sfp presence is %s" % (str(self.index), str(presence)))
return presence

def get_model(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__all__ = ['ttypes', 'constants', 'pltfm_mgr_rpc']
__all__ = ['ttypes', 'pltfm_mgr_rpc']
2 changes: 1 addition & 1 deletion device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/sai.profile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_th_32x100.bcm
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th_32x100.config.bcm
10 changes: 7 additions & 3 deletions device/broadcom/x86_64-bcm_xlr-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
# - 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
# Note: the file /usr/share/sonic/platform/sys_eeprom.bin is generated
# by the script brcm-xlr-gts-create-eeprom-file.py
#############################################################################

import os

try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
Expand All @@ -21,7 +23,9 @@
class board(eeprom_tlvinfo.TlvInfoDecoder):

def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/etc/sys_eeprom.bin"
self.eeprom_path = "/usr/share/sonic/platform/sys_eeprom.bin"
if os.path.isfile(self.eeprom_path) is False:
self.eeprom_path = "/usr/share/sonic/device/x86_64-bcm_xlr-r0/sys_eeprom.bin"
super(board, self).__init__(self.eeprom_path, 0, '', False, True)

def serial_number_str(self, e):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# name lanes alias index speed
Ethernet0 65,66 Eth1/1 1 50000
Ethernet2 67,68 Eth1/2 1 50000
Ethernet4 69,70 Eth2/1 2 50000
Ethernet6 71,72 Eth2/2 2 50000
Ethernet8 73,74 Eth3/1 3 50000
Ethernet10 75,76 Eth3/2 3 50000
Ethernet12 77,78 Eth4/1 4 50000
Ethernet14 79,80 Eth4/2 4 50000
Ethernet16 33,34 Eth5/1 5 50000
Ethernet18 35,36 Eth5/2 5 50000
Ethernet20 37,38 Eth6/1 6 50000
Ethernet22 39,40 Eth6/2 6 50000
Ethernet24 41,42 Eth7/1 7 50000
Ethernet26 43,44 Eth7/2 7 50000
Ethernet28 45,46 Eth8/1 8 50000
Ethernet30 47,48 Eth8/2 8 50000
Ethernet32 49,50 Eth9/1 9 50000
Ethernet34 51,52 Eth9/2 9 50000
Ethernet36 53,54 Eth10/1 10 50000
Ethernet38 55,56 Eth10/2 10 50000
Ethernet40 57,58 Eth11/1 11 50000
Ethernet42 59,60 Eth11/2 11 50000
Ethernet44 61,62 Eth12/1 12 50000
Ethernet46 63,64 Eth12/2 12 50000
Ethernet48 81,82 Eth13/1 13 50000
Ethernet50 83,84 Eth13/2 13 50000
Ethernet52 85,86 Eth14/1 14 50000
Ethernet54 87,88 Eth14/2 14 50000
Ethernet56 89,90 Eth15/1 15 50000
Ethernet58 91,92 Eth15/2 15 50000
Ethernet60 93,94 Eth16/1 16 50000
Ethernet62 95,96 Eth16/2 16 50000
Ethernet64 97,98 Eth17/1 17 50000
Ethernet66 99,100 Eth17/2 17 50000
Ethernet68 101,102 Eth18/1 18 50000
Ethernet70 103,104 Eth18/2 18 50000
Ethernet72 105,106 Eth19/1 19 50000
Ethernet74 107,108 Eth19/2 19 50000
Ethernet76 109,110 Eth20/1 20 50000
Ethernet78 111,112 Eth20/2 20 50000
Ethernet80 1,2 Eth21/1 21 50000
Ethernet82 3,4 Eth21/2 21 50000
Ethernet84 5,6 Eth22/1 22 50000
Ethernet86 7,8 Eth22/2 22 50000
Ethernet88 9,10 Eth23/1 23 50000
Ethernet90 11,12 Eth23/2 23 50000
Ethernet92 13,14 Eth24/1 24 50000
Ethernet94 15,16 Eth24/2 24 50000
Ethernet96 17,18,19,20 Eth25 25 40000
Ethernet100 21,22,23,24 Eth26 26 40000
Ethernet104 25,26,27,28 Eth27 27 40000
Ethernet108 29,30,31,32 Eth28 28 40000
Ethernet112 113,114,115,116 Eth29 29 40000
Ethernet116 117,118,119,120 Eth30 30 40000
Ethernet120 121,122,123,124 Eth31 31 40000
Ethernet124 125,126,127,128 Eth32 32 40000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/platform/th-seastone-dx010-config-flex-all.bcm
24 changes: 22 additions & 2 deletions device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def __init__(self):
thermal = Thermal(index)
self._thermal_list.append(thermal)
# sfp index start from 1
self._sfp_list.append(None)
for index in range(1, NUM_SFP+1):
for index in range(0, NUM_SFP):
sfp = Sfp(index)
self._sfp_list.append(sfp)
for index in range(0, NUM_COMPONENT):
Expand Down Expand Up @@ -159,3 +158,24 @@ def get_watchdog(self):
self._watchdog = Watchdog()

return self._watchdog

def get_sfp(self, index):
"""
Retrieves sfp represented by (1-based) index <index>
Args:
index: An integer, the index (1-based) of the sfp to retrieve.
The index should be the sequence of a physical port in a chassis,
starting from 1.
For example, 1 for Ethernet0, 2 for Ethernet4 and so on.
Returns:
An object dervied from SfpBase representing the specified sfp
"""
sfp = None

try:
# The index will start from 1
sfp = self._sfp_list[index-1]
except IndexError:
sys.stderr.write("SFP index {} out of range (1-{})\n".format(
index, len(self._sfp_list)))
return sfp
12 changes: 6 additions & 6 deletions device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Sfp(SfpBase):
def __init__(self, sfp_index):
# Init index
self.index = sfp_index
self.port_num = self.index
self.port_num = self.index + 1

# Init eeprom path
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom'
Expand Down Expand Up @@ -593,7 +593,7 @@ def get_lpmode(self):
reg_value = int(content, 16)

# Determind if port_num start from 1 or 0
bit_index = self.port_num - 1 if self.PORT_START == 1 else self.port_num
bit_index = self.index

# Mask off the bit corresponding to our port
mask = (1 << bit_index)
Expand Down Expand Up @@ -710,7 +710,7 @@ def reset(self):
reg_value = int(content, 16)

# Determind if port_num start from 1 or 0
bit_index = self.port_num - 1 if self.PORT_START == 1 else self.port_num
bit_index = self.index

# Mask off the bit corresponding to our port
mask = (1 << bit_index)
Expand Down Expand Up @@ -823,7 +823,7 @@ def set_lpmode(self, lpmode):
reg_value = int(content, 16)

# Determind if port_num start from 1 or 0
bit_index = self.port_num - 1 if self.PORT_START == 1 else self.port_num
bit_index = self.index

# Mask off the bit corresponding to our port
mask = (1 << bit_index)
Expand Down Expand Up @@ -907,7 +907,7 @@ def get_presence(self):
reg_value = int(content, 16)

# Determind if port_num start from 1 or 0
bit_index = self.port_num - 1 if self.PORT_START == 1 else self.port_num
bit_index = self.index

# Mask off the bit corresponding to our port
mask = (1 << bit_index)
Expand Down Expand Up @@ -942,4 +942,4 @@ def get_status(self):
Returns:
A boolean value, True if device is operating properly, False if not
"""
return self.get_presence() and self.get_transceiver_bulk_status()
return self.get_presence() and not self.get_reset_status()
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Ethernet112 113,114,115,116 hundredGigE1/29 29 100000
Ethernet116 117,118,119,120 hundredGigE1/30 30 100000
Ethernet120 121,122,123,124 hundredGigE1/31 31 100000
Ethernet124 125,126,127,128 hundredGigE1/32 32 100000
Ethernet128 128 tenGigE1/33 33 10000
Ethernet129 129 tenGigE1/34 34 10000
Ethernet128 129 tenGigE1/33 33 10000
Ethernet129 128 tenGigE1/34 34 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,5 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT-LOSSLESS-P3P4"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,4 @@ dport_map_port_66=127
dport_map_port_130=128

mmu_init_config="TD3-DEFAULT"
sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc
1 change: 0 additions & 1 deletion device/dell/x86_64-dellemc_s5232f_c3538-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
4 changes: 2 additions & 2 deletions device/dell/x86_64-dellemc_s5232f_c3538-r0/led_proc_init.soc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
#
#Led0
#led stop
m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
led stop
#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin
m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin
#led auto on
led start
Loading

0 comments on commit 3324e99

Please sign in to comment.