Skip to content

Commit

Permalink
[platform] Complete support for Arista-7050QX-32S (#661)
Browse files Browse the repository at this point in the history
* Bump sonic-platform-modules-arista submodule

* Use sonic_sfputil plugin from the arista library

* Fix undefined variable varlog_size

* Prevent minigraph.xml to be removed from the flash

* Update DCS-7050QX-32 sensors config
  • Loading branch information
Staphylo authored and lguohan committed Jun 2, 2017
1 parent e0d22ac commit 7d33387
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 91 deletions.
22 changes: 2 additions & 20 deletions device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#!/usr/bin/env python

try:
from sonic_sfp.sfputilbase import sfputilbase
import arista.utils.sonic_sfputil as arista_sfputil
except ImportError, e:
raise ImportError (str(e) + "- required module not found")


class sfputil(sfputilbase):
"""Platform specific sfputil class"""

port_start = 0
port_end = 31
ports_in_block = 32

eeprom_offset = 10

port_to_eeprom_mapping = {}

_qsfp_ports = range(0, ports_in_block + 1)

def __init__(self, port_num):
# Override port_to_eeprom_mapping for class initialization
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
for x in range(0, self.port_end + 1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset)
sfputilbase.__init__(self, port_num)
sfputil = arista_sfputil.getSfpUtil()
47 changes: 25 additions & 22 deletions device/arista/x86_64-arista_7050_qx32/sensors.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# libsensors configuration file
# ----------------------------------------------
#
# libsensors configuration file for DCS-7050QX-32
# ------------------------------------------------
#

bus "i2c-2" "SCD SMBus master 0 bus 0"
bus "i2c-3" "SCD SMBus master 0 bus 1"
bus "i2c-5" "SCD SMBus master 0 bus 3"
Expand All @@ -13,31 +13,33 @@ chip "k10temp-pci-00c3"

chip "lm73-i2c-3-48"
label temp1 "Rear Temp Sensor"
set temp1_max 65
set temp1_max 65
#set temp1_max_alarm 75 # read-only

chip "lm86-i2c-2-4c"
chip "max6658-i2c-2-4c"
label temp1 "Board Temp Sensor"
set temp1_max 65
set temp1_max 65
set temp1_crit 75

label temp2 "Front-panel Temp Sensor"
set temp2_max 65
set temp2_crit 75

chip "pmbus-i2c-3-4e"
label temp1 "Power Controller Sensor 1"
set temp1_max 60
set temp1_crit 70

label temp2 "Power Controller Sensor 2"
set temp2_max 60
set temp2_crit 70

ignore curr1

chip "pmbus-i2c-5-58"
# disabled because of some eeprom corruption risks
#chip "pmbus-i2c-3-4e"
# label temp1 "Power Controller Sensor 1"
# set temp1_max 60
# set temp1_crit 70

# label temp2 "Power Controller Sensor 2"
# set temp2_max 60
# set temp2_crit 70

# ignore curr1

chip "dps460-i2c-5-58"
label temp1 "Power Supply 1 Sensor 1"
# maximum and critical thresholds are not supported for this psu
set temp1_max 60
set temp1_crit 70

Expand All @@ -56,16 +58,17 @@ chip "pmbus-i2c-5-58"
set curr1_crit 5.30
set curr2_max 36
set curr2_crit 37
chip "pmbus-i2c-6-58"

chip "dps460-i2c-6-58"
label temp1 "Power Supply 2 Sensor 1"
# maximum and critical thresholds are not supported for this psu
set temp1_max 60
set temp1_crit 70

label temp2 "Power Supply 2 Sensor 2"
set temp2_max 60
set temp2_crit 70

ignore temp3

set in1_max 250
Expand Down
25 changes: 2 additions & 23 deletions device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
#!/usr/bin/env python

try:
from sonic_sfp.sfputilbase import sfputilbase
import arista.utils.sonic_sfputil as arista_sfputil
except ImportError, e:
raise ImportError (str(e) + "- required module not found")


class sfputil(sfputilbase):
"""Platform specific sfputil class"""

port_start = 0
port_end = 31
ports_in_block = 32

eeprom_offset = 10

port_to_eeprom_mapping = {}

_qsfp_ports = range(0, ports_in_block + 1)

# also has sfp[1-4] ports handled by a mux to choose against qsfp5
# i2c-40 to i2c-43

def __init__(self, port_num):
# Override port_to_eeprom_mapping for class initialization
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
for x in range(0, self.port_end + 1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset)
sfputilbase.__init__(self, port_num)
sfputil = arista_sfputil.getSfpUtil()
23 changes: 2 additions & 21 deletions device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
#!/usr/bin/env python

try:
from sonic_sfp.sfputilbase import sfputilbase
import arista.utils.sonic_sfputil as arista_sfputil
except ImportError, e:
raise ImportError (str(e) + "- required module not found")


class sfputil(sfputilbase):
"""Platform specific sfputil class"""

port_start = 0
port_end = 33
ports_in_block = 34

eeprom_offset = 18

port_to_eeprom_mapping = {}

_qsfp_ports = range(0, 32 + 1)
_sfp_ports = range(33, 34 + 1)

def __init__(self, port_num):
# Override port_to_eeprom_mapping for class initialization
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
for x in range(0, self.port_end + 1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(x + self.eeprom_offset)
sfputilbase.__init__(self, port_num)
sfputil = arista_sfputil.getSfpUtil()
11 changes: 8 additions & 3 deletions files/Aboot/boot0.j2
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ parse_environment_config() {
clean_flash() {
## Remove all the other unnecssary files except swi file, boot-config
for f in $(ls -A $target_path); do
if [ $f != "${swipath##*/}" ] && [ $f != "boot-config" ]; then
if [ $f != "${swipath##*/}" ] &&
[ $f != "boot-config" ] &&
[ $f != "minigraph.xml" ]
then
rm -rf "$target_path/$f"
fi
done
Expand Down Expand Up @@ -104,15 +107,17 @@ EOF
platform_specific() {
local platform="$(grep -Eo 'platform=[^ ]+' /etc/cmdline | cut -f2 -d=)"
local sid="$(grep -Eo 'sid=[^ ]+' /etc/cmdline | cut -f2 -d=)"

# set varlog size to 100MB
echo "varlog_size=100" >>/tmp/append

# This is temporary as the platform= and sid= parameters don't provide enough
# information to identify the SKU
# An initramfs hook or a later processing done by the initscripts will be
# required to read the system eeprom
if [ "$platform" = "raven" ]; then
aboot_machine=arista_7050_qx32
echo "modprobe.blacklist=radeon" >>/tmp/append
# set varlog size to 100MB
echo "varlog_size=100" >>/tmp/append
fi
if [ "$platform" = "crow" ]; then
aboot_machine=arista_7050_qx32s
Expand Down
2 changes: 1 addition & 1 deletion files/initramfs-tools/arista-convertfs.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ run_cmd() {

create_varlog_file() {
local err_msg="Error: create var-log ext4 file"
local cmd="[ -n $varlog_size ] && mkdir -p $root_mnt/disk-img && dd if=/dev/zero of=$root_mnt/disk-img/var-log.ext4 count=$((2048*$varlog_size)) && mke2fs -t ext4 -q -F $root_mnt/disk-img/var-log.ext4"
local cmd="[ -n "$varlog_size" ] && mkdir -p $root_mnt/disk-img && dd if=/dev/zero of=$root_mnt/disk-img/var-log.ext4 count=$((2048*$varlog_size)) && mke2fs -t ext4 -q -F $root_mnt/disk-img/var-log.ext4"
run_cmd "$cmd" "$err_msg"
}

Expand Down

0 comments on commit 7d33387

Please sign in to comment.