diff --git a/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py index 4844d220158..eca0abc39ee 100644 --- a/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as7326_56x-r0/plugins/sfputil.py @@ -5,6 +5,8 @@ try: import time + import string + from ctypes import create_string_buffer from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -193,11 +195,63 @@ def get_presence(self, port_num): return False - def get_low_power_mode(self, port_num): - raise NotImplementedError + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False - def set_low_power_mode(self, port_num, lpmode): - raise NotImplementedError + try: + eeprom = None + + if not self.get_presence(port_num): + return False + + eeprom = open(self.port_to_eeprom_mapping[port_num], "rb") + eeprom.seek(93) + lpmode = ord(eeprom.read(1)) + + if ((lpmode & 0x3) == 0x1): + return False # High Power Mode if "Power override" bit is 1 and "Power set" bit is 0 + else: + return True # Low Power Mode if one of the following conditions is matched: + # 1. Power override" bit is 0 + # 2. Power override" bit is 1 and "Power set" bit is 1 + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + try: + eeprom = None + + if not self.get_presence(port_num): + return False # Port is not present, unable to set the eeprom + + # Fill in write buffer + regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode + buffer = create_string_buffer(1) + buffer[0] = chr(regval) + + # Write to eeprom + eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b") + eeprom.seek(93) + eeprom.write(buffer[0]) + return True + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) def reset(self, port_num): raise NotImplementedError diff --git a/device/arista/x86_64-arista_7280cr3_32d4 b/device/arista/x86_64-arista_7280cr3_32d4 new file mode 120000 index 00000000000..d6e2ddbb64b --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32d4 @@ -0,0 +1 @@ +x86_64-arista_7280cr3_32p4 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32D4 b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32D4 new file mode 120000 index 00000000000..cfdaca201c0 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32D4 @@ -0,0 +1 @@ +Arista-7280CR3-C32P4 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/port_config.ini b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/port_config.ini new file mode 100644 index 00000000000..976eae864d5 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/port_config.ini @@ -0,0 +1,37 @@ +# name lanes alias index speed +Ethernet0 1,2 Ethernet1/1 1 100000 +Ethernet4 3,4 Ethernet2/1 2 100000 +Ethernet8 5,6 Ethernet3/1 3 100000 +Ethernet12 7,8 Ethernet4/1 4 100000 +Ethernet16 9,10 Ethernet5/1 5 100000 +Ethernet20 11,12 Ethernet6/1 6 100000 +Ethernet24 13,14 Ethernet7/1 7 100000 +Ethernet28 15,16 Ethernet8/1 8 100000 +Ethernet32 17,18 Ethernet9/1 9 100000 +Ethernet36 19,20 Ethernet10/1 10 100000 +Ethernet40 21,22 Ethernet11/1 11 100000 +Ethernet44 23,24 Ethernet12/1 12 100000 +Ethernet48 25,26 Ethernet13/1 13 100000 +Ethernet52 27,28 Ethernet14/1 14 100000 +Ethernet56 29,30 Ethernet15/1 15 100000 +Ethernet60 31,32 Ethernet16/1 16 100000 +Ethernet64 73,74 Ethernet17/1 17 100000 +Ethernet68 75,76 Ethernet18/1 18 100000 +Ethernet72 77,78 Ethernet19/1 19 100000 +Ethernet76 79,80 Ethernet20/1 20 100000 +Ethernet80 65,66 Ethernet21/1 21 100000 +Ethernet84 67,68 Ethernet22/1 22 100000 +Ethernet88 69,70 Ethernet23/1 23 100000 +Ethernet92 71,72 Ethernet24/1 24 100000 +Ethernet96 57,58 Ethernet25/1 25 100000 +Ethernet100 59,60 Ethernet26/1 26 100000 +Ethernet104 61,62 Ethernet27/1 27 100000 +Ethernet108 63,64 Ethernet28/1 28 100000 +Ethernet112 49,50 Ethernet29/1 29 100000 +Ethernet116 51,52 Ethernet30/1 30 100000 +Ethernet120 53,54 Ethernet31/1 31 100000 +Ethernet124 55,56 Ethernet32/1 32 100000 +Ethernet128 33,34,35,36,37,38,39,40 Ethernet33/1 33 400000 +Ethernet132 41,42,43,44,45,46,47,48 Ethernet34/1 34 400000 +Ethernet136 89,90,91,92,93,94,95,96 Ethernet35/1 35 400000 +Ethernet140 81,82,83,84,85,86,87,88 Ethernet36/1 36 400000 diff --git a/device/arista/x86_64-arista_7280cr3_32p4/default_sku b/device/arista/x86_64-arista_7280cr3_32p4/default_sku new file mode 100644 index 00000000000..a65e1f845ad --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/default_sku @@ -0,0 +1 @@ +Arista-7280CR3-C32P4 t1 diff --git a/device/arista/x86_64-arista_7280cr3_32p4/fancontrol b/device/arista/x86_64-arista_7280cr3_32p4/fancontrol new file mode 100644 index 00000000000..1c0415b7e46 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/fancontrol @@ -0,0 +1,10 @@ +INTERVAL=5 +DEVPATH=hwmon2=devices/pci0000:00/0000:00:09.0 hwmon4=devices/pci0000:00/0000:00:09.0/i2c-56/56-004c +DEVNAME=hwmon2=scd_fan_p3 hwmon4=max6658 +FCTEMPS=hwmon2/pwm6=hwmon4/temp1_input hwmon2/pwm5=hwmon4/temp1_input hwmon2/pwm4=hwmon4/temp1_input hwmon2/pwm4=hwmon4/temp1_input hwmon2/pwm2=hwmon4/temp1_input hwmon2/pwm1=hwmon4/temp1_input +FCFANS=hwmon2/pwm6=hwmon2/fan6_input hwmon2/pwm5=hwmon2/fan5_input hwmon2/pwm4=hwmon2/fan4_input hwmon2/pwm3=hwmon2/fan3_input hwmon2/pwm2=hwmon2/fan2_input hwmon2/pwm1=hwmon2/fan1_input +MINTEMP=hwmon2/pwm6=50 hwmon2/pwm5=50 hwmon2/pwm4=50 hwmon2/pwm3=50 hwmon2/pwm2=50 hwmon2/pwm1=50 +MINPWM=hwmon2/pwm6=128 hwmon2/pwm5=128 hwmon2/pwm4=128 hwmon2/pwm3=128 hwmon2/pwm2=128 hwmon2/pwm1=128 +MAXTEMP=hwmon2/pwm6=60 hwmon2/pwm5=60 hwmon2/pwm4=60 hwmon2/pwm3=60 hwmon2/pwm2=60 hwmon2/pwm1=60 +MINSTART=hwmon2/pwm6=128 hwmon2/pwm5=128 hwmon2/pwm4=128 hwmon2/pwm3=128 hwmon2/pwm2=128 hwmon2/pwm1=128 +MINSTOP=hwmon2/pwm6=128 hwmon2/pwm5=128 hwmon2/pwm4=128 hwmon2/pwm3=128 hwmon2/pwm2=128 hwmon2/pwm1=128 diff --git a/device/arista/x86_64-arista_7280cr3_32p4/platform_reboot b/device/arista/x86_64-arista_7280cr3_32p4/platform_reboot new file mode 120000 index 00000000000..7f94a49e38b --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/platform_reboot @@ -0,0 +1 @@ +../x86_64-arista_common/platform_reboot \ No newline at end of file diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py new file mode 100644 index 00000000000..d439e442ee3 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +try: + import arista.utils.sonic_eeprom as arista_eeprom +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py new file mode 100644 index 00000000000..fae2d504beb --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +try: + import arista.utils.sonic_leds as arista_leds +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py new file mode 100644 index 00000000000..d5ff3063dd8 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py @@ -0,0 +1,8 @@ +# psuutil.py + +try: + import arista.utils.sonic_psu as arista_psuutil +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py new file mode 100644 index 00000000000..1357ad78643 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +try: + import arista.utils.sonic_sfputil as arista_sfputil +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/sensors.conf b/device/arista/x86_64-arista_7280cr3_32p4/sensors.conf new file mode 100644 index 00000000000..2a80dbd612a --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/sensors.conf @@ -0,0 +1,66 @@ +# libsensors configuration file for DCS-7280CR3-32P4 +# ------------------------------------------------# + +bus "i2c-8" "SCD 0000:02:00.0 SMBus master 0 bus 0" +bus "i2c-14" "SCD 0000:02:00.0 SMBus master 0 bus 6" +bus "i2c-15" "SCD 0000:02:00.0 SMBus master 0 bus 7" +bus "i2c-56" "SCD 0000:00:09.0 SMBus master 0 bus 0" + +chip "tmp468-i2c-8-48" + label temp1 "Board sensor" + label temp2 "Front air (inlet) sensor" + label temp3 "Rear air sensor" + label temp4 "Front left sensor" + label temp5 "Front right sensor" + label temp6 "Rear left sensor" + label temp7 "Rear right sensor" + label temp8 "Asic temp sensor 1" + label temp9 "Asic temp sensor 2" + + set temp1_max 75 + set temp1_crit 80 + set temp2_max 65 + set temp2_crit 75 + set temp3_max 65 + set temp3_crit 75 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + set temp8_max 100 + set temp8_crit 110 + set temp9_max 100 + set temp9_crit 110 + +chip "pmbus-i2c-14-58" + label temp1 "Power supply 1 hotspot sensor" + label temp2 "Power supply 1 inlet temp sensor" + label temp3 "Power supply 1 exhaust temp sensor" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + ignore fan4 + +chip "pmbus-i2c-15-58" + label temp1 "Power supply 2 hotspot sensor" + label temp2 "Power supply 2 inlet temp sensor" + label temp3 "Power supply 2 exhaust temp sensor" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + ignore fan4 + +chip "max6658-i2c-56-4c" + label temp1 "Back panel temp sensor 1" + label temp2 "Back panel temp sensor 2" + + set temp1_max 75 + set temp1_crit 85 + set temp2_max 75 + set temp2_crit 85 diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index bab1801dc91..64b1414fc18 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -255,8 +255,13 @@ platform_specific() { aboot_machine=arista_7060dx4_32 flash_size=28000 fi - if [ "$platform" = "rook" ]; then - echo "iommu=on intel_iommu=on tsc=reliable pcie_ports=native" >>/tmp/append + if [ "$sid" = "Smartsville" ]; then + aboot_machine=arista_7280cr3_32p4 + flash_size=7382 + fi + if [ "$platform" = "rook" ] || [ "$platform" = "magpie" ] || + [ "$platform" = "woodpecker" ]; then + echo "tsc=reliable pcie_ports=native" >>/tmp/append echo "rhash_entries=1 usb-storage.delay_use=0" >>/tmp/append if [ -x /bin/readprefdl ]; then readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl @@ -266,6 +271,12 @@ platform_specific() { fi echo "reassign_prefmem" >> /tmp/append fi + if [ "$platform" = "rook" ] || [ "$platform" = "magpie" ]; then + echo "iommu=on intel_iommu=on" >>/tmp/append + fi + if [ "$platform" = "woodpecker" ]; then + echo "amd_iommu=off modprobe.blacklist=snd_hda_intel,hdaudio" >> /tmp/append + fi if [ $flash_size -ge 28000 ]; then varlog_size=4096 diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 96ca3f74630..0ed1df5a7d6 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 96ca3f74630b1b7cb07ef68e863d479bb2dcf85d +Subproject commit 0ed1df5a7d6c88319ce41b10ce604c2727afab69 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 96ca3f74630..0ed1df5a7d6 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 96ca3f74630b1b7cb07ef68e863d479bb2dcf85d +Subproject commit 0ed1df5a7d6c88319ce41b10ce604c2727afab69 diff --git a/sonic-slave-stretch/Dockerfile b/sonic-slave-stretch/Dockerfile index 43e8b6ff9c0..5cb328f6b25 100644 --- a/sonic-slave-stretch/Dockerfile +++ b/sonic-slave-stretch/Dockerfile @@ -290,6 +290,12 @@ RUN pip install setuptools==40.8.0 # Install dependencies for isc-dhcp-relay build RUN apt-get -y build-dep isc-dhcp +# Install vim +RUN apt-get install -y vim + +# Install rsyslog +RUN apt-get install -y rsyslog + RUN cd /usr/src/gtest && cmake . && make -C /usr/src/gtest RUN mkdir /var/run/sshd diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index a711ca1301e..3f7951248c6 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -109,13 +109,13 @@ TODO(taoyl): Current version of config db only supports BGP admin states. @staticmethod def to_serialized(data): - for table in data: - if type(data[table]) is dict: - data[table] = OrderedDict(natsorted(data[table].items())) - for key in data[table].keys(): - new_key = ConfigDBConnector.serialize_key(key) - if new_key != key: - data[table][new_key] = data[table].pop(key) + if type(data) is dict: + data = OrderedDict(natsorted(data.items())) + for key in data.keys(): + new_key = ConfigDBConnector.serialize_key(key) + if new_key != key: + data[new_key] = data.pop(key) + data[new_key] = FormatConverter.to_serialized(data[new_key]) return data @staticmethod diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 8af58ad80df..485db073a17 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 8af58ad80df531fc7fe1fa197a1caf2c5520dbb3 +Subproject commit 485db073a17d2ac0cd9d6f29b0b8d7c245c66663