[devices]: DellEMC new platform support for z9264f - 64x100 (#26)

* Added new platform support DellEMC - Z92264f - 64x100

* Includes changes with Makefiles, sfputil, eeprom and default minigraph

* Led support for Z9264f platform

* Includes changes on default minigraph

* ipmitool implementation in pmon docker. platform_sensors script is inclued in pmon startup
This commit is contained in:
paavaanan 2018-06-22 23:18:44 +05:30 committed by Guohan Lu
parent 145aa4ff70
commit ecfca8bf23
13 changed files with 2054 additions and 3 deletions

View File

@ -0,0 +1,65 @@
# name lanes alias index
Ethernet0 49,50,51,52 hundredGigE1/1 0
Ethernet4 53,54,55,56 hundredGigE1/2 1
Ethernet8 65,66,67,68 hundredGigE1/3 2
Ethernet12 69,70,71,72 hundredGigE1/4 3
Ethernet16 81,82,83,84 hundredGigE1/5 4
Ethernet20 85,86,87,88 hundredGigE1/6 5
Ethernet24 97,98,99,100 hundredGigE1/7 6
Ethernet28 101,102,103,104 hundredGigE1/8 7
Ethernet32 1,2,3,4 hundredGigE1/9 8
Ethernet36 5,6,7,8 hundredGigE1/10 9
Ethernet40 17,18,19,20 hundredGigE1/11 10
Ethernet44 21,22,23,24 hundredGigE1/12 11
Ethernet48 33,34,35,36 hundredGigE1/13 12
Ethernet52 37,38,39,40 hundredGigE1/14 13
Ethernet56 113,114,115,116 hundredGigE1/15 14
Ethernet60 117,118,119,120 hundredGigE1/16 15
Ethernet64 133,134,135,136 hundredGigE1/17 16
Ethernet68 129,130,131,132 hundredGigE1/18 17
Ethernet72 213,214,215,216 hundredGigE1/19 18
Ethernet76 209,210,211,212 hundredGigE1/20 19
Ethernet80 229,230,231,232 hundredGigE1/21 20
Ethernet84 225,226,227,228 hundredGigE1/22 21
Ethernet88 245,246,247,248 hundredGigE1/23 22
Ethernet92 241,242,243,244 hundredGigE1/24 23
Ethernet96 149,150,151,152 hundredGigE1/25 24
Ethernet100 145,146,147,148 hundredGigE1/26 25
Ethernet104 165,166,167,168 hundredGigE1/27 26
Ethernet108 161,162,163,164 hundredGigE1/28 27
Ethernet112 181,182,183,184 hundredGigE1/29 28
Ethernet116 177,178,179,180 hundredGigE1/30 29
Ethernet120 197,198,199,200 hundredGigE1/31 30
Ethernet124 193,194,195,196 hundredGigE1/32 31
Ethernet128 61,62,63,64 hundredGigE1/33 32
Ethernet132 57,58,59,60 hundredGigE1/34 33
Ethernet136 77,78,79,80 hundredGigE1/35 34
Ethernet140 73,74,75,76 hundredGigE1/36 35
Ethernet144 93,94,95,96 hundredGigE1/37 36
Ethernet148 89,90,91,92 hundredGigE1/38 37
Ethernet152 109,110,111,112 hundredGigE1/39 38
Ethernet156 105,106,107,108 hundredGigE1/40 39
Ethernet160 13,14,15,16 hundredGigE1/41 40
Ethernet164 9,10,11,12 hundredGigE1/42 41
Ethernet168 29,30,31,32 hundredGigE1/43 42
Ethernet172 25,26,27,28 hundredGigE1/44 43
Ethernet176 45,46,47,48 hundredGigE1/45 44
Ethernet180 41,42,43,44 hundredGigE1/46 45
Ethernet184 125,126,127,128 hundredGigE1/47 46
Ethernet188 121,122,123,124 hundredGigE1/48 47
Ethernet192 137,138,139,140 hundredGigE1/49 48
Ethernet196 141,142,143,144 hundredGigE1/50 49
Ethernet200 217,218,219,220 hundredGigE1/51 50
Ethernet204 221,222,223,224 hundredGigE1/52 51
Ethernet208 233,234,235,236 hundredGigE1/53 52
Ethernet212 237,238,239,240 hundredGigE1/54 53
Ethernet216 249,250,251,252 hundredGigE1/55 54
Ethernet220 253,254,255,256 hundredGigE1/56 55
Ethernet224 153,154,155,156 hundredGigE1/57 56
Ethernet228 157,158,159,160 hundredGigE1/58 57
Ethernet232 169,170,171,172 hundredGigE1/59 58
Ethernet236 173,174,175,176 hundredGigE1/60 59
Ethernet240 185,186,187,188 hundredGigE1/61 60
Ethernet244 189,190,191,192 hundredGigE1/62 61
Ethernet248 201,202,203,204 hundredGigE1/63 62
Ethernet252 205,206,207,208 hundredGigE1/64 63

View File

@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/th2-z9264f-64x100G.config.bcm

View File

@ -0,0 +1,3 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200

View File

@ -0,0 +1,111 @@
# LED microprocessor initialization for DellEMC-Z9264f
m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=32 REMAP_PORT_2=33 REMAP_PORT_1=34 REMAP_PORT_0=35
m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=36 REMAP_PORT_6=37 REMAP_PORT_5=38 REMAP_PORT_4=39
m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=4 REMAP_PORT_10=5 REMAP_PORT_9=6 REMAP_PORT_8=7
m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=0 REMAP_PORT_14=1 REMAP_PORT_13=2 REMAP_PORT_12=3
m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=56 REMAP_PORT_18=57 REMAP_PORT_17=58 REMAP_PORT_16=59
m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=60 REMAP_PORT_22=61 REMAP_PORT_21=62 REMAP_PORT_20=63
m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=28 REMAP_PORT_26=29 REMAP_PORT_25=30 REMAP_PORT_24=31
m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=24 REMAP_PORT_30=25 REMAP_PORT_29=26 REMAP_PORT_28=27
m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=48 REMAP_PORT_34=49 REMAP_PORT_33=50 REMAP_PORT_32=51
m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=52 REMAP_PORT_38=53 REMAP_PORT_37=54 REMAP_PORT_36=55
m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=20 REMAP_PORT_42=21 REMAP_PORT_41=22 REMAP_PORT_40=23
m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=16 REMAP_PORT_46=17 REMAP_PORT_45=18 REMAP_PORT_44=19
m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=40 REMAP_PORT_50=41 REMAP_PORT_49=42 REMAP_PORT_48=43
m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=44 REMAP_PORT_54=45 REMAP_PORT_53=46 REMAP_PORT_52=47
m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=12 REMAP_PORT_58=13 REMAP_PORT_57=14 REMAP_PORT_56=15
m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=8 REMAP_PORT_62=9 REMAP_PORT_61=10 REMAP_PORT_60=11
m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=0 REMAP_PORT_2=1 REMAP_PORT_1=2 REMAP_PORT_0=3
m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=4 REMAP_PORT_6=5 REMAP_PORT_5=6 REMAP_PORT_4=7
m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=38 REMAP_PORT_8=39 REMAP_PORT_11=36 REMAP_PORT_10=37
m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=32 REMAP_PORT_14=33 REMAP_PORT_13=34 REMAP_PORT_12=35
m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=8 REMAP_PORT_18=9 REMAP_PORT_17=10 REMAP_PORT_16=11
m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=12 REMAP_PORT_22=13 REMAP_PORT_21=14 REMAP_PORT_20=15
m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=44 REMAP_PORT_26=45 REMAP_PORT_25=46 REMAP_PORT_24=47
m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=40 REMAP_PORT_30=41 REMAP_PORT_29=42 REMAP_PORT_28=43
m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 REMAP_PORT_34=17 REMAP_PORT_33=18 REMAP_PORT_32=19
m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 REMAP_PORT_38=21 REMAP_PORT_37=22 REMAP_PORT_36=23
m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=52 REMAP_PORT_42=53 REMAP_PORT_41=54 REMAP_PORT_40=55
m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=48 REMAP_PORT_46=49 REMAP_PORT_45=50 REMAP_PORT_44=51
m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=24 REMAP_PORT_50=25 REMAP_PORT_49=26 REMAP_PORT_48=27
m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=28 REMAP_PORT_54=29 REMAP_PORT_53=30 REMAP_PORT_52=31
m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=60 REMAP_PORT_58=61 REMAP_PORT_57=62 REMAP_PORT_56=63
m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=56 REMAP_PORT_62=57 REMAP_PORT_61=58 REMAP_PORT_60=59
m CMIC_LEDUP2_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=60 REMAP_PORT_2=61 REMAP_PORT_1=62 REMAP_PORT_0=63
m CMIC_LEDUP2_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=56 REMAP_PORT_6=57 REMAP_PORT_5=58 REMAP_PORT_4=59
m CMIC_LEDUP2_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=24 REMAP_PORT_10=25 REMAP_PORT_9=26 REMAP_PORT_8=27
m CMIC_LEDUP2_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=28 REMAP_PORT_14=29 REMAP_PORT_13=30 REMAP_PORT_12=31
m CMIC_LEDUP2_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=52 REMAP_PORT_18=53 REMAP_PORT_17=54 REMAP_PORT_16=55
m CMIC_LEDUP2_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=48 REMAP_PORT_22=49 REMAP_PORT_21=50 REMAP_PORT_20=51
m CMIC_LEDUP2_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=16 REMAP_PORT_26=17 REMAP_PORT_25=18 REMAP_PORT_24=19
m CMIC_LEDUP2_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=20 REMAP_PORT_30=21 REMAP_PORT_29=22 REMAP_PORT_28=23
m CMIC_LEDUP2_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=44 REMAP_PORT_34=45 REMAP_PORT_33=46 REMAP_PORT_32=47
m CMIC_LEDUP2_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=40 REMAP_PORT_38=41 REMAP_PORT_37=42 REMAP_PORT_36=43
m CMIC_LEDUP2_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=8 REMAP_PORT_42=9 REMAP_PORT_41=10 REMAP_PORT_40=11
m CMIC_LEDUP2_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=12 REMAP_PORT_46=13 REMAP_PORT_45=14 REMAP_PORT_44=15
m CMIC_LEDUP2_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=36 REMAP_PORT_50=37 REMAP_PORT_49=38 REMAP_PORT_48=39
m CMIC_LEDUP2_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=32 REMAP_PORT_54=33 REMAP_PORT_53=34 REMAP_PORT_52=35
m CMIC_LEDUP2_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=0 REMAP_PORT_58=1 REMAP_PORT_57=2 REMAP_PORT_56=3
m CMIC_LEDUP2_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=4 REMAP_PORT_62=5 REMAP_PORT_61=6 REMAP_PORT_60=7
m CMIC_LEDUP3_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=28 REMAP_PORT_2=29 REMAP_PORT_1=30 REMAP_PORT_0=31
m CMIC_LEDUP3_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=24 REMAP_PORT_6=25 REMAP_PORT_5=26 REMAP_PORT_4=27
m CMIC_LEDUP3_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 REMAP_PORT_10=57 REMAP_PORT_9=58 REMAP_PORT_8=59
m CMIC_LEDUP3_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 REMAP_PORT_14=61 REMAP_PORT_13=62 REMAP_PORT_12=63
m CMIC_LEDUP3_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=4 REMAP_PORT_18=5 REMAP_PORT_17=6 REMAP_PORT_16=7
m CMIC_LEDUP3_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=0 REMAP_PORT_22=1 REMAP_PORT_21=2 REMAP_PORT_20=3
m CMIC_LEDUP3_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=32 REMAP_PORT_26=33 REMAP_PORT_25=34 REMAP_PORT_24=35
m CMIC_LEDUP3_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=36 REMAP_PORT_30=37 REMAP_PORT_29=38 REMAP_PORT_28=39
m CMIC_LEDUP3_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=12 REMAP_PORT_34=13 REMAP_PORT_33=14 REMAP_PORT_32=15
m CMIC_LEDUP3_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=8 REMAP_PORT_38=9 REMAP_PORT_37=10 REMAP_PORT_36=11
m CMIC_LEDUP3_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=40 REMAP_PORT_42=41 REMAP_PORT_41=42 REMAP_PORT_40=43
m CMIC_LEDUP3_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=44 REMAP_PORT_46=45 REMAP_PORT_45=46 REMAP_PORT_44=47
m CMIC_LEDUP3_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=20 REMAP_PORT_50=21 REMAP_PORT_49=22 REMAP_PORT_48=23
m CMIC_LEDUP3_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=16 REMAP_PORT_54=17 REMAP_PORT_53=18 REMAP_PORT_52=19
m CMIC_LEDUP3_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=48 REMAP_PORT_58=49 REMAP_PORT_57=50 REMAP_PORT_56=51
m CMIC_LEDUP3_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=52 REMAP_PORT_62=53 REMAP_PORT_61=54 REMAP_PORT_60=55
m CMIC_LEDUP4_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=1 REMAP_PORT_1=0
led 0 stop
led 0 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 0 auto on
led 0 start
led 1 stop
led 1 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 1 auto on
led 1 start
led 2 stop
led 2 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 2 auto on
led 2 start
led 3 stop
led 3 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 3 auto on
led 3 start

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
#############################################################################
# DellEMC Z9264f
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class board(eeprom_tlvinfo.TlvInfoDecoder):
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,97 @@
#
# psuutil.py
# Platform-specific PSU status interface for SONiC
#
import os.path
import logging
import commands
Z9264F_MAX_PSUS = 2
IPMI_SENSOR_DATA = "ipmitool sdr list"
PSU_PRESENCE = "PSU{0}_state"
# Use this for older firmware
# PSU_PRESENCE="PSU{0}_prsnt"
ipmi_sdr_list = ""
try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
def __init__(self):
PsuBase.__init__(self)
# Fetch a BMC register
def get_pmc_register(self, reg_name):
status = 1
global ipmi_sdr_list
ipmi_dev_node = "/dev/pmi0"
ipmi_cmd = IPMI_SENSOR_DATA
status, ipmi_sdr_list = commands.getstatusoutput(ipmi_cmd)
if status:
logging.error('Failed to execute:' + ipmi_sdr_list)
sys.exit(0)
for item in ipmi_sdr_list.split("\n"):
if reg_name in item:
output = item.strip()
if not output:
print('\nFailed to fetch: ' + reg_name + ' sensor ')
sys.exit(0)
output = output.split('|')[1]
logging.basicConfig(level=logging.DEBUG)
return output
def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device
:return: An integer, the number of PSUs available on the device
"""
Z9264F_MAX_PSUS = 2
return Z9264F_MAX_PSUS
def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is\
faulty
"""
#Until psu_status is implemented this is hardcoded temporarily
status = 1
return status
def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
status = 0
psu_reg_name = PSU_PRESENCE.format(index)
psu_status = int(self.get_pmc_register(psu_reg_name),16)
if (psu_status != 'ERR'):
# Check for PSU presence
if (psu_status):
status = 1
return status

View File

@ -0,0 +1,192 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import struct
import sys
import getopt
import time
from sonic_sfp.sfputilbase import SfpUtilBase
from os import *
from mmap import *
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""
PORT_START = 0
PORT_END = 63
PORTS_IN_BLOCK = 32
BASE_RES_PATH = "/sys/bus/pci/devices/0000:04:00.0/resource0"
_port_to_eeprom_mapping = {}
@property
def port_start(self):
return self.PORT_START
@property
def port_end(self):
return self.PORT_END
@property
def qsfp_ports(self):
return range(0, self.PORTS_IN_BLOCK + 1)
@property
def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping
def pci_mem_read(self, mm, offset):
mm.seek(offset)
read_data_stream=mm.read(4)
reg_val=struct.unpack('I',read_data_stream)
mem_val = str(reg_val)[1:-2]
# print "reg_val read:%x"%reg_val
return mem_val
def pci_mem_write(self, mm, offset, data):
mm.seek(offset)
# print "data to write:%x"%data
mm.write(struct.pack('I',data))
def pci_set_value(self, resource, val, offset):
fd=open(resource,O_RDWR)
mm=mmap(fd,0)
return self.pci_mem_write(mm,offset,val)
def pci_get_value(self, resource, offset):
fd=open(resource,O_RDWR)
mm=mmap(fd,0)
return self.pci_mem_read(mm, offset)
def __init__(self):
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
for x in range(0, self.port_end + 1):
port_num = x + 2
self.port_to_eeprom_mapping[x] = eeprom_path.format(
port_num)
port_num = 0
SfpUtilBase.__init__(self)
def get_presence(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
# Port offset starts with 0x4004
port_offset = 16388 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 4)
# ModPrsL is active low
if reg_value & mask == 0:
return True
return False
def get_low_power_mode(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# LPMode is active high
if reg_value & mask == 0:
return False
return True
def set_low_power_mode(self, port_num, lpmode):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# LPMode is active high; set or clear the bit accordingly
if lpmode is True:
reg_value = reg_value | mask
else:
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
return True
def reset(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# ResetL is active low
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
# Sleep 1 second to allow it to settle
time.sleep(1)
reg_value = reg_value | mask
# Convert our register value back to a hex string and write back
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
return True

View File

@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
# Install required packages
RUN apt-get install -y python-pip libpython2.7 sensord fancontrol
RUN apt-get install -y python-pip libpython2.7 sensord fancontrol ipmitool
{% if docker_platform_monitor_debs.strip() -%}
# Copy locally-built Debian package dependencies

View File

@ -21,6 +21,17 @@ function postStartAction()
rm -fr /host/fast-reboot
fi
docker exec swss touch /ready # signal swssconfig.sh to go
{%- elif docker_container_name == "pmon" %}
DEVPATH="/usr/share/sonic/device"
REBOOT="platform_reboot"
PSENSOR="/usr/local/bin/platform_sensors.py"
if [ -d ${DEVPATH}/${PLATFORM} ] && [ -f $PSENSOR ]; then
exist=`docker exec -i pmon ls /usr/bin/platform_sensors.py "$@" 2>/dev/null`
if [ -z "$exist" ]; then
docker cp $PSENSOR pmon:/usr/bin/
fi
fi
{%- elif docker_container_name == "snmp" %}
docker exec -i database redis-cli -n 6 HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
{%- else %}

View File

@ -5,6 +5,7 @@ $(SONIC_ONE_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(DELL_Z9264F_PLATFORM_MODULE) \
$(DELL_Z9100_PLATFORM_MODULE) \
$(DELL_S6100_PLATFORM_MODULE) \
$(INGRASYS_S8900_54XC_PLATFORM_MODULE) \

View File

@ -1,8 +1,10 @@
# Dell Z9100 and S6100 Platform modules
# Dell Z9100, S6100, Z9264F Platform modules
DELL_Z9264F_PLATFORM_MODULE_VERSION = 1.1
DELL_Z9100_PLATFORM_MODULE_VERSION = 1.1
DELL_S6100_PLATFORM_MODULE_VERSION = 1.1
export DELL_Z9264F_PLATFORM_MODULE_VERSION
export DELL_Z9100_PLATFORM_MODULE_VERSION
export DELL_S6100_PLATFORM_MODULE_VERSION
@ -16,4 +18,9 @@ DELL_S6100_PLATFORM_MODULE = platform-modules-s6100_$(DELL_S6100_PLATFORM_MODULE
$(DELL_S6100_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6100_c2538-r0
$(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_S6100_PLATFORM_MODULE)))
DELL_Z9264F_PLATFORM_MODULE = platform-modules-z9264f_$(DELL_Z9264F_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELL_Z9264F_PLATFORM_MODULE)_PLATFORM = x86_64-dellemc_z9264f_c3538-r0
$(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_Z9264F_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(DELL_Z9100_PLATFORM_MODULE)

@ -1 +1 @@
Subproject commit 31993888a17291eb28ef674d6e2c973c539e806d
Subproject commit 6cfea2267688b7fb5cd11a867057ed264a01502c