From 73a2e64d9f3cdb5643d0a71cfb9d7981f2ba4f07 Mon Sep 17 00:00:00 2001 From: byu343 Date: Tue, 3 Jul 2018 17:10:11 -0700 Subject: [PATCH] [arista]: Add platform support for DCS-7170-64C (#1718) --- .gitmodules | 3 + .../Arista-7170-64C/port_config.ini | 67 ++++++++++++++++++ .../arista/x86_64-arista_7170_64c/fancontrol | 10 +++ .../x86_64-arista_7170_64c/minigraph.xml | 70 +++++++++++++++++++ .../x86_64-arista_7170_64c/plugins/eeprom.py | 8 +++ .../plugins/led_control.py | 8 +++ .../x86_64-arista_7170_64c/plugins/psuutil.py | 12 ++++ .../x86_64-arista_7170_64c/plugins/sfputil.py | 8 +++ .../x86_64-arista_7170_64c/sensors.conf | 53 ++++++++++++++ files/Aboot/boot0.j2 | 6 ++ platform/p4/one-aboot.mk | 12 ++++ platform/p4/platform-modules-arista.mk | 22 ++++++ platform/p4/rules.mk | 2 + platform/p4/sonic-platform-modules-arista | 1 + 14 files changed, 282 insertions(+) create mode 100644 device/arista/x86_64-arista_7170_64c/Arista-7170-64C/port_config.ini create mode 100644 device/arista/x86_64-arista_7170_64c/fancontrol create mode 100644 device/arista/x86_64-arista_7170_64c/minigraph.xml create mode 100644 device/arista/x86_64-arista_7170_64c/plugins/eeprom.py create mode 100644 device/arista/x86_64-arista_7170_64c/plugins/led_control.py create mode 100644 device/arista/x86_64-arista_7170_64c/plugins/psuutil.py create mode 100644 device/arista/x86_64-arista_7170_64c/plugins/sfputil.py create mode 100644 device/arista/x86_64-arista_7170_64c/sensors.conf create mode 100644 platform/p4/one-aboot.mk create mode 100644 platform/p4/platform-modules-arista.mk create mode 160000 platform/p4/sonic-platform-modules-arista diff --git a/.gitmodules b/.gitmodules index e0cfc0869d05..bb4eae528c72 100755 --- a/.gitmodules +++ b/.gitmodules @@ -77,3 +77,6 @@ [submodule "platform/broadcom/sonic-platform-modules-mitac"] path = platform/broadcom/sonic-platform-modules-mitac url = https://github.com/MiTAC-EBU/sonic-platform-modules-mitac.git +[submodule "platform/p4/sonic-platform-modules-arista"] + path = platform/p4/sonic-platform-modules-arista + url = https://github.com/aristanetworks/sonic diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/port_config.ini b/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/port_config.ini new file mode 100644 index 000000000000..1020ea1382c2 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/port_config.ini @@ -0,0 +1,67 @@ +# name lanes alias port +Ethernet0 444,445,446,447 Ethernet1/1 1 +Ethernet4 52,53,54,55 Ethernet2/1 2 +Ethernet8 436,437,438,439 Ethernet3/1 3 +Ethernet12 432,433,434,435 Ethernet4/1 4 +Ethernet16 412,413,414,415 Ethernet5/1 5 +Ethernet20 424,425,426,427 Ethernet6/1 6 +Ethernet24 404,405,406,407 Ethernet7/1 7 +Ethernet28 0,1,2,3 Ethernet8/1 8 +Ethernet32 12,13,14,15 Ethernet9/1 9 +Ethernet36 8,9,10,11 Ethernet10/1 10 +Ethernet40 24,25,26,27 Ethernet11/1 11 +Ethernet44 32,33,34,35 Ethernet12/1 12 +Ethernet48 44,45,46,47 Ethernet13/1 13 +Ethernet52 40,41,42,43 Ethernet14/1 14 +Ethernet56 396,397,398,399 Ethernet15/1 15 +Ethernet60 392,393,394,395 Ethernet16/1 16 +Ethernet64 260,261,262,263 Ethernet17/1 17 +Ethernet68 384,385,386,387 Ethernet18/1 18 +Ethernet72 180,181,182,183 Ethernet19/1 19 +Ethernet76 172,173,174,175 Ethernet20/1 20 +Ethernet80 160,161,162,163 Ethernet21/1 21 +Ethernet84 164,165,166,167 Ethernet22/1 22 +Ethernet88 148,149,150,151 Ethernet23/1 23 +Ethernet92 140,141,142,143 Ethernet24/1 24 +Ethernet96 272,273,274,275 Ethernet25/1 25 +Ethernet100 132,133,134,135 Ethernet26/1 26 +Ethernet104 280,281,282,283 Ethernet27/1 27 +Ethernet108 284,285,286,287 Ethernet28/1 28 +Ethernet112 304,305,306,307 Ethernet29/1 29 +Ethernet116 292,293,294,295 Ethernet30/1 30 +Ethernet120 312,313,314,315 Ethernet31/1 31 +Ethernet124 316,317,318,319 Ethernet32/1 32 +Ethernet128 56,57,58,59 Ethernet33/1 33 +Ethernet132 60,61,62,63 Ethernet34/1 34 +Ethernet136 428,429,430,431 Ethernet35/1 35 +Ethernet140 440,441,442,443 Ethernet36/1 36 +Ethernet144 420,421,422,423 Ethernet37/1 37 +Ethernet148 416,417,418,419 Ethernet38/1 38 +Ethernet152 128,129,130,131 Ethernet39/1 39 +Ethernet156 408,409,410,411 Ethernet40/1 40 +Ethernet160 4,5,6,7 Ethernet41/1 41 +Ethernet164 16,17,18,19 Ethernet42/1 42 +Ethernet168 28,29,30,31 Ethernet43/1 43 +Ethernet172 20,21,22,23 Ethernet44/1 44 +Ethernet176 36,37,38,39 Ethernet45/1 45 +Ethernet180 48,49,50,51 Ethernet46/1 46 +Ethernet184 388,389,390,391 Ethernet47/1 47 +Ethernet188 400,401,402,403 Ethernet48/1 48 +Ethernet192 256,257,258,259 Ethernet49/1 49 +Ethernet196 264,265,266,267 Ethernet50/1 50 +Ethernet200 176,177,178,179 Ethernet51/1 51 +Ethernet204 184,185,186,187 Ethernet52/1 52 +Ethernet208 168,169,170,171 Ethernet53/1 53 +Ethernet212 156,157,158,159 Ethernet54/1 54 +Ethernet216 144,145,146,147 Ethernet55/1 55 +Ethernet220 152,153,154,155 Ethernet56/1 56 +Ethernet224 136,137,138,139 Ethernet57/1 57 +Ethernet228 268,269,270,271 Ethernet58/1 58 +Ethernet232 288,289,290,291 Ethernet59/1 59 +Ethernet236 276,277,278,279 Ethernet60/1 60 +Ethernet240 296,297,298,299 Ethernet61/1 61 +Ethernet244 300,301,302,303 Ethernet62/1 62 +Ethernet248 188,189,190,191 Ethernet63/1 63 +Ethernet252 308,309,310,311 Ethernet64/1 64 +Ethernet256 64 Ethernet65 65 +Ethernet260 65 Ethernet66 66 diff --git a/device/arista/x86_64-arista_7170_64c/fancontrol b/device/arista/x86_64-arista_7170_64c/fancontrol new file mode 100644 index 000000000000..639185a7119f --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/fancontrol @@ -0,0 +1,10 @@ +INTERVAL=5 +DEVPATH=hwmon1=devices/pci0000:00/0000:00:1c.0/0000:06:00.0/i2c-8/8-004c hwmon3=devices/pci0000:ff/0000:ff:0b.3/i2c-93/93-0060 +DEVNAME=hwmon1=max6658 hwmon3=rook_cpld +FCTEMPS=hwmon3/pwm4=hwmon1/temp1_input hwmon3/pwm3=hwmon1/temp1_input hwmon3/pwm2=hwmon1/temp1_input hwmon3/pwm1=hwmon1/temp1_input +FCFANS=hwmon3/pwm4=hwmon3/fan4_input hwmon3/pwm3=hwmon3/fan3_input hwmon3/pwm2=hwmon3/fan2_input hwmon3/pwm1=hwmon3/fan1_input +MINTEMP=hwmon3/pwm4=50 hwmon3/pwm3=50 hwmon3/pwm2=50 hwmon3/pwm1=50 +MINPWM=hwmon3/pwm4=128 hwmon3/pwm3=128 hwmon3/pwm2=128 hwmon3/pwm1=128 +MAXTEMP=hwmon3/pwm4=60 hwmon3/pwm3=60 hwmon3/pwm2=60 hwmon3/pwm1=60 +MINSTART=hwmon3/pwm4=128 hwmon3/pwm3=128 hwmon3/pwm2=128 hwmon3/pwm1=128 +MINSTOP=hwmon3/pwm4=128 hwmon3/pwm3=128 hwmon3/pwm2=128 hwmon3/pwm1=128 diff --git a/device/arista/x86_64-arista_7170_64c/minigraph.xml b/device/arista/x86_64-arista_7170_64c/minigraph.xml new file mode 100644 index 000000000000..2b2586cf7596 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/minigraph.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + HostIP + Loopback0 + + 100.1.0.1/32 + + 100.1.0.1/32 + + + + + + + ManagementIP1 + Management0 + + 172.24.37.166/18 + + 172.24.37.166/18 + + + + + + + sonic + + + + + + + + + + + + + + + + + + sonic + Arista-7170-64C + + + + + + + + sonic + Arista-7170-64C + diff --git a/device/arista/x86_64-arista_7170_64c/plugins/eeprom.py b/device/arista/x86_64-arista_7170_64c/plugins/eeprom.py new file mode 100644 index 000000000000..d439e442ee33 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/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_7170_64c/plugins/led_control.py b/device/arista/x86_64-arista_7170_64c/plugins/led_control.py new file mode 100644 index 000000000000..fae2d504beb6 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/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_7170_64c/plugins/psuutil.py b/device/arista/x86_64-arista_7170_64c/plugins/psuutil.py new file mode 100644 index 000000000000..1a8682ae3c67 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/plugins/psuutil.py @@ -0,0 +1,12 @@ +# psuutil.py +# +# Platform-specific PSU interface for SONiC +# + +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_7170_64c/plugins/sfputil.py b/device/arista/x86_64-arista_7170_64c/plugins/sfputil.py new file mode 100644 index 000000000000..1357ad786434 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/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_7170_64c/sensors.conf b/device/arista/x86_64-arista_7170_64c/sensors.conf new file mode 100644 index 000000000000..196769f95c0c --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/sensors.conf @@ -0,0 +1,53 @@ +# libsensors configuration file for DCS-7260CX3-64 +# ------------------------------------------------ + +bus "i2c-6" "SCD 0000:06:00.0 SMBus master 0 bus 5" +bus "i2c-7" "SCD 0000:06:00.0 SMBus master 0 bus 6" +bus "i2c-8" "SCD 0000:06:00.0 SMBus master 0 bus 7" +bus "i2c-81" "SCD 0000:ff:0b.3 SMBus master 0 bus 0" +bus "i2c-93" "SCD 0000:ff:0b.3 SMBus master 3 bus 0" +bus "i2c-96" "SCD 0000:ff:0b.3 SMBus master 3 bus 3" + +chip "max6658-i2c-8-4c" + label temp1 "Temp sensor near ASIC" + + set temp1_max 100 + set temp1_crit 110 + + ignore temp2 + +chip "dps1900-i2c-6-58" + label temp1 "PSU1 primary hotspot temp" + label temp2 "PSU1 inlet temp" + label temp3 "PSU1 exhaust temp" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + +chip "dps1900-i2c-7-58" + label temp1 "PSU2 primary hotspot temp" + label temp2 "PSU2 inlet temp" + label temp3 "PSU2 exhaust temp" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + +chip "max6658-i2c-81-4c" + label temp1 "Rear air temp1" + label temp2 "Rear air temp2" + + set temp1_max 50 + set temp1_crit 60 + set temp2_max 50 + set temp2_crit 60 + +chip "lm73-i2c-96-48" + label temp1 "Front air temp" + + set temp1_max 65 diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index ee77746676e0..ab2cdedb6383 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -169,6 +169,11 @@ platform_specific() { aboot_machine=arista_7260cx3_64 flash_size=28000 fi + if [ "$sid" = "Alhambra" ] || [ "$sid" = "AlhambraSsd" ]; then + aboot_machine=arista_7170_64c + flash_size=28000 + echo "hugepages=128" >> /tmp/append + fi if [ "$platform" = "rook" ]; then if [ -x /bin/readprefdl ]; then readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl @@ -176,6 +181,7 @@ platform_specific() { cp /etc/prefdl /mnt/flash/.system-prefdl chmod a+r /mnt/flash/.system-prefdl fi + echo "reassign_prefmem" >> /tmp/append fi if [ $flash_size -ge 28000 ]; then diff --git a/platform/p4/one-aboot.mk b/platform/p4/one-aboot.mk new file mode 100644 index 000000000000..95babf045c00 --- /dev/null +++ b/platform/p4/one-aboot.mk @@ -0,0 +1,12 @@ +# sonic broadcom one image installer + +SONIC_ONE_ABOOT_IMAGE = sonic-aboot-p4.swi +$(SONIC_ONE_ABOOT_IMAGE)_MACHINE = p4 +$(SONIC_ONE_ABOOT_IMAGE)_IMAGE_TYPE = aboot +$(SONIC_ONE_ABOOT_IMAGE)_INSTALLS += $(ARISTA_PLATFORM_MODULE_DRIVERS) $(ARISTA_PLATFORM_MODULE_PYTHON2) $(ARISTA_PLATFORM_MODULE_PYTHON3) $(ARISTA_PLATFORM_MODULE) + +# FIXME: this is a temporary workaround for testing the platform driver +$(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += docker-platform-monitor.gz +# $(SONIC_ONE_ABOOT_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) + +SONIC_INSTALLERS += $(SONIC_ONE_ABOOT_IMAGE) diff --git a/platform/p4/platform-modules-arista.mk b/platform/p4/platform-modules-arista.mk new file mode 100644 index 000000000000..ec7566318c8d --- /dev/null +++ b/platform/p4/platform-modules-arista.mk @@ -0,0 +1,22 @@ +# Arista Platform modules + +ARISTA_PLATFORM_MODULE_VERSION = 1.0 + +export ARISTA_PLATFORM_MODULE_VERSION + +ARISTA_PLATFORM_MODULE = sonic-platform-arista_$(ARISTA_PLATFORM_MODULE_VERSION)_amd64.deb +$(ARISTA_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-arista +$(ARISTA_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +SONIC_MAKE_DEBS += $(ARISTA_PLATFORM_MODULE) + +ARISTA_PLATFORM_MODULE_PYTHON2 = python-sonic-platform-arista_$(ARISTA_PLATFORM_MODULE_VERSION)_all.deb +$(eval $(call add_extra_package,$(ARISTA_PLATFORM_MODULE),$(ARISTA_PLATFORM_MODULE_PYTHON2))) + +ARISTA_PLATFORM_MODULE_PYTHON3 = python3-sonic-platform-arista_$(ARISTA_PLATFORM_MODULE_VERSION)_all.deb +$(eval $(call add_extra_package,$(ARISTA_PLATFORM_MODULE),$(ARISTA_PLATFORM_MODULE_PYTHON3))) + +ARISTA_PLATFORM_MODULE_DRIVERS = drivers-sonic-platform-arista_$(ARISTA_PLATFORM_MODULE_VERSION)_amd64.deb +$(eval $(call add_extra_package,$(ARISTA_PLATFORM_MODULE),$(ARISTA_PLATFORM_MODULE_DRIVERS))) + +export ARISTA_PLATFORM_MODULE ARISTA_PLATFORM_MODULE_PYTHON2 ARISTA_PLATFORM_MODULE_PYTHON3 ARISTA_PLATFORM_MODULE_DRIVERS + diff --git a/platform/p4/rules.mk b/platform/p4/rules.mk index 7fe6a60fadac..ea3e31e973e2 100644 --- a/platform/p4/rules.mk +++ b/platform/p4/rules.mk @@ -1,4 +1,6 @@ # include $(PLATFORM_PATH)/p4-softswitch.mk +include $(PLATFORM_PATH)/platform-modules-arista.mk +include $(PLATFORM_PATH)/one-aboot.mk include $(PLATFORM_PATH)/tenjin.mk include $(PLATFORM_PATH)/p4-hlir.mk include $(PLATFORM_PATH)/p4c-bm.mk diff --git a/platform/p4/sonic-platform-modules-arista b/platform/p4/sonic-platform-modules-arista new file mode 160000 index 000000000000..02b22ae91135 --- /dev/null +++ b/platform/p4/sonic-platform-modules-arista @@ -0,0 +1 @@ +Subproject commit 02b22ae91135d4e4a9e11e06656dcff3056e2c7f