[platform] Complete support for Arista-7050QX-32S (#661)
* 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
This commit is contained in:
parent
e0d22acc9e
commit
7d33387e7c
@ -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()
|
||||
|
@ -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"
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
@ -104,6 +107,10 @@ 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
|
||||
@ -111,8 +118,6 @@ platform_specific() {
|
||||
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
|
||||
|
@ -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"
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 43ed7b2330f2c7928f8098ca6c78bd9533b918c5
|
||||
Subproject commit 393e5e1f19fd33853bb375d70a10fa7cf4613e4a
|
Reference in New Issue
Block a user