Skip to content

Commit

Permalink
DellEMC: N3248PXE Initial platform commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun LK authored and Arun LK committed Aug 30, 2021
1 parent 16b7c20 commit e9d0963
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ phy_an_c73=3
oversubscribe_mode=1
core_clock_frequency=1525

#25G,10G and 1G support
serdes_10g_at_25g_vco=1
serdes_1000x_at_25g_vco=1

l2xmsg_mode=1

l2xmsg_hostbuf_size=16384
Expand Down Expand Up @@ -360,5 +364,26 @@ riot_overlay_ecmp_resilient_hash_size=16384
pfc_deadlock_seq_control=1

#Common configs from broadcom/x86_64-broadcom_common/x86_64-broadcom_b77/broadcom-sonic-td3.config.bcm (Lower version of Td3 (0xb771))

mem_cache_enable=0
ifp_inports_support_enable=1
ipv6_lpm_128b_enable=0x1
l3_max_ecmp_mode=1
lpm_scaling_enable=0
bcm_num_cos=10
default_cpu_tx_queue=9
mmu_lossless=0
host_as_route_disable=1
sai_eapp_config_file=/etc/broadcom/eapps_cfg.json
sai_fast_convergence_support=1
flow_init_mode=1
sai_interface_type_auto_detect=0
mpls_mem_entries=16384
vlan_xlate_1_mem_entries=65536
vlan_xlate_2_mem_entries=16384
sai_load_hw_config=/usr/lib/cancun/
sai_nbr_bcast_ifp_optimized=1
sai_brcm_sonic_acl_enhancements=1
# Reduced Trap Group QSET for BRCM Sonic
sai_brcm_sonic_trap_group=1
l2_entry_used_as_my_station=1
multi_hash_recurse_depth_l3=2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#

import commands
import os
import sys

SENSORS_CMD = "docker exec -i pmon /usr/bin/sensors"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_cpld_register(self, reg_name):
try:
with open(reg_file, 'r') as fd:
retval = fd.read()
except Exception as error:
except Exception:
print("Unable to open ", reg_file, "file !")

retval = retval.rstrip('\r\n')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

try:
import time
import datetime
import os
import struct
import traceback
from socket import *
from select import *
from sonic_sfp.sfputilbase import SfpUtilBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# * FAN trays
# * PSU


import os
import sys
import logging
import subprocess

output = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def main(argv):
opts = ''
val = ''
choice = ''
resouce = ''
offset = ''

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"""

try:
import os
import sys
import time
from datetime import datetime
from swsscommon import swsscommon
from sonic_py_common import daemon_base, logger
Expand Down Expand Up @@ -89,9 +86,6 @@ def main():
helper_logger.log_notice("Start port_notify")
# Connect to APP_DB and create transceiver dom info table
appl_db = daemon_base.db_connect("APPL_DB")
cst = swsscommon.SubscriberStateTable(appl_db, swsscommon.APP_PORT_TABLE_NAME)

app_port_tbl = swsscommon.ProducerStateTable(appl_db, swsscommon.APP_PORT_TABLE_NAME)

app_status_port_tbl = swsscommon.ProducerStateTable(appl_db,
swsscommon.APP_PORT_APP_STATUS_TABLE_NAME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

#############################################################################
# DELLEMC N3248TE
# DELLEMC N3248PXE
#
# Module contains an implementation of SONiC Platform Base API and
# provides the platform information
Expand All @@ -10,7 +10,6 @@

try:
import os
import select
import sys
import time
from sonic_platform_base.chassis_base import ChassisBase
Expand All @@ -26,11 +25,11 @@
raise ImportError(str(e) + "- required module not found")


MAX_N3248TE_FANTRAY = 3
MAX_N3248TE_FAN = 1
MAX_N3248TE_PSU = 2
MAX_N3248TE_THERMAL = 5
MAX_N3248TE_COMPONENT = 3 # BIOS, CPU CPLD and SYS CPLD
MAX_N3248PXE_FANTRAY = 3
MAX_N3248PXE_FAN = 1
MAX_N3248PXE_PSU = 2
MAX_N3248PXE_THERMAL = 5
MAX_N3248PXE_COMPONENT = 3 # BIOS, CPU CPLD and SYS CPLD

media_part_num_list = set([ \
"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC",
Expand Down Expand Up @@ -60,14 +59,16 @@ class Chassis(ChassisBase):
50: 21,
51: 22,
52: 23,
53: 24,
54: 25,
}

def __init__(self):
ChassisBase.__init__(self)
# sfp.py will read eeprom contents and retrive the eeprom data.
# We pass the eeprom path from chassis.py
self.PORT_START = 1
self.PORT_END = 52
self.PORT_END = 54
self.PORTS_IN_BLOCK = (self.PORT_END + 1)
self.SFP_PORT_START = 49
self._sfp_port = range(self.SFP_PORT_START, self.PORTS_IN_BLOCK)
Expand All @@ -81,21 +82,21 @@ def __init__(self):

self._eeprom = Eeprom()
self._watchdog = Watchdog()
self._num_sfps = 52
self._num_fans = MAX_N3248TE_FANTRAY * MAX_N3248TE_FAN
self._fan_list = [Fan(i, j) for i in range(MAX_N3248TE_FANTRAY) \
for j in range(MAX_N3248TE_FAN)]
for k in range(MAX_N3248TE_FANTRAY):
self._num_sfps = 54
self._num_fans = MAX_N3248PXE_FANTRAY * MAX_N3248PXE_FAN
self._fan_list = [Fan(i, j) for i in range(MAX_N3248PXE_FANTRAY) \
for j in range(MAX_N3248PXE_FAN)]
for k in range(MAX_N3248PXE_FANTRAY):
fandrawer = FanDrawer(k)
self._fan_drawer_list.append(fandrawer)
self._fan_list.extend(fandrawer._fan_list)

self._psu_list = [Psu(i) for i in range(MAX_N3248TE_PSU)]
self._thermal_list = [Thermal(i) for i in range(MAX_N3248TE_THERMAL)]
self._component_list = [Component(i) for i in range(MAX_N3248TE_COMPONENT)]
self._psu_list = [Psu(i) for i in range(MAX_N3248PXE_PSU)]
self._thermal_list = [Thermal(i) for i in range(MAX_N3248PXE_THERMAL)]
self._component_list = [Component(i) for i in range(MAX_N3248PXE_COMPONENT)]
for port_num in self._sfp_port:
# sfp get uses zero-indexing, but port numbers start from 1
presence = self.get_sfp(port_num-1).get_presence()
presence = self.get_sfp(port_num).get_presence()
self._global_port_pres_dict[port_num] = '1' if presence else '0'

self._watchdog = Watchdog()
Expand All @@ -119,13 +120,12 @@ def _set_cpld_register(self, reg_name, value):
cpld_reg_file = self.CPLD_DIR + '/' + reg_name

if (not os.path.isfile(cpld_reg_file)):
#print "open error"
return rv

try:
with open(cpld_reg_file, 'w') as fd:
rv = fd.write(str(value))
except:
except Exception:
rv = 'ERR'

return rv
Expand All @@ -143,7 +143,7 @@ def get_change_event(self, timeout=0):
while True:
for port_num in self._sfp_port:
# sfp get uses zero-indexing, but port numbers start from 1
presence = self.get_sfp(port_num-1).get_presence()
presence = self.get_sfp(port_num).get_presence()
if(presence and self._global_port_pres_dict[port_num] == '0'):
self._global_port_pres_dict[port_num] = '1'
port_dict[port_num] = '1'
Expand Down Expand Up @@ -175,7 +175,7 @@ def get_sfp(self, index):

try:
# The index will start from 0
sfp = self._sfp_list[index]
sfp = self._sfp_list[index-1]
except IndexError:
sys.stderr.write("SFP index {} out of range (0-{})\n".format(
index, len(self._sfp_list)-1))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

########################################################################
# DELLEMC N3248TE
# DELLEMC N3248PXE
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Components' (e.g., BIOS, CPLD, FPGA, BMC etc.) available in
Expand All @@ -10,8 +10,6 @@
########################################################################

try:
import os
import re
import subprocess
from sonic_platform_base.component_base import ComponentBase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

#############################################################################
# DellEmc Z9332F
# DellEmc N3248PXE
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

########################################################################
# DellEMC Z9332F
# DellEMC N3248PXE
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Fans' information which are available in the platform.
Expand Down Expand Up @@ -66,7 +66,7 @@ def get_model(self):
"""
try:
val = open(self.eeprom, "rb").read()[13:19]
except:
except Exception:
val = None
return val.decode()

Expand All @@ -78,7 +78,7 @@ def get_serial(self):
"""
try:
val = open(self.eeprom, "rb").read()[21:41]
except:
except Exception:
val = None
return val.decode()

Expand Down Expand Up @@ -126,7 +126,7 @@ def get_direction(self):
else:
try:
val = open(self.eeprom, "rb").read()[0xe1:0xe8]
except:
except Exception:
return None
direction = 'Exhaust' if val == 'FORWARD' else 'Intake'
return direction
Expand All @@ -147,7 +147,7 @@ def get_speed(self):
dps_dir = self.dps_hwmon + '/' + os.listdir(self.dps_hwmon)[0]
rpm_file = dps_dir + '/' + 'fan1_input'
fan_speed = int(open(rpm_file, "rb").read())
except:
except Exception:
return None
speed = (100 * fan_speed)//self.max_speed
return speed
Expand All @@ -166,6 +166,6 @@ def get_speed_rpm(self):
dps_dir = self.dps_hwmon + '/' + os.listdir(self.dps_hwmon)[0]
rpm_file = dps_dir + '/' + 'fan1_input'
fan_speed = int(open(rpm_file, "rb").read())
except:
except Exception:
return None
return fan_speed
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

########################################################################
# DellEMC N3248TE
# DellEMC N3248PXE
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Fan-Drawers' information available in the platform.
Expand All @@ -14,7 +14,7 @@
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

N3248TE_FANS_PER_FANTRAY = 2
N3248PXE_FANS_PER_FANTRAY = 2


class FanDrawer(FanDrawerBase):
Expand All @@ -25,7 +25,7 @@ def __init__(self, fantray_index):
FanDrawerBase.__init__(self)
# FanTray is 1-based in DellEMC platforms
self.fantrayindex = fantray_index + 1
for i in range(N3248TE_FANS_PER_FANTRAY):
for i in range(N3248PXE_FANS_PER_FANTRAY):
self._fan_list.append(Fan(fantray_index, i))

def get_name(self):
Expand Down
Loading

0 comments on commit e9d0963

Please sign in to comment.