Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# name lanes alias index speed
Ethernet0 0 twentyfiveGigE1 1 25000
Ethernet1 1 twentyfiveGigE2 2 25000
Ethernet2 2 twentyfiveGigE3 3 25000
Ethernet3 3 twentyfiveGigE4 4 25000
Ethernet4 4 twentyfiveGigE5 5 25000
Ethernet5 5 twentyfiveGigE6 6 25000
Ethernet6 6 twentyfiveGigE7 7 25000
Ethernet7 7 twentyfiveGigE8 8 25000
Ethernet8 8 twentyfiveGigE9 9 25000
Ethernet9 9 twentyfiveGigE10 10 25000
Ethernet10 10 twentyfiveGigE11 11 25000
Ethernet11 11 twentyfiveGigE12 12 25000
Ethernet12 12 twentyfiveGigE13 13 25000
Ethernet13 13 twentyfiveGigE14 14 25000
Ethernet14 14 twentyfiveGigE15 15 25000
Ethernet15 15 twentyfiveGigE16 16 25000
Ethernet16 16 twentyfiveGigE17 17 25000
Ethernet17 17 twentyfiveGigE18 18 25000
Ethernet18 18 twentyfiveGigE19 19 25000
Ethernet19 19 twentyfiveGigE20 20 25000
Ethernet20 20 twentyfiveGigE21 21 25000
Ethernet21 21 twentyfiveGigE22 22 25000
Ethernet22 22 twentyfiveGigE23 23 25000
Ethernet23 23 twentyfiveGigE24 24 25000
Ethernet24 24 twentyfiveGigE25 25 25000
Ethernet25 25 twentyfiveGigE26 26 25000
Ethernet26 27,28,29,30 hundredGigE27 27 100000
Ethernet30 31,32,33,34,35,36,37,38 fourHundredGigE28 28 400000
Ethernet38 39,40,41,42 hundredGigE29 29 100000
Ethernet42 43,44,45,46,47,48,49,50 fourHundredGigE30 30 400000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions device/accton/x86_64-accton_as7535_32xb-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accton-AS7535-32XB t1
4 changes: 4 additions & 0 deletions device/accton/x86_64-accton_as7535_32xb-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=ast,ipmi_msghandler,ipmi_ssif,ipmi_si,ipmi_devintf"
12 changes: 12 additions & 0 deletions device/accton/x86_64-accton_as7535_32xb-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python

try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)
59 changes: 59 additions & 0 deletions device/accton/x86_64-accton_as7535_32xb-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python

#############################################################################
# Accton
#
# Module contains an implementation of SONiC PSU Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################

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)

self.psu_path = "/sys/devices/platform/as7535_32xb_psu/psu"
self.psu_presence = "_present"
self.psu_oper_status = "_power_good"
self.psu_mapping = {
1: "1",
2: "2"
}

def get_num_psus(self):
return len(self.psu_mapping)

def get_psu_status(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index]+self.psu_oper_status
try:
with open(node, 'r') as power_status:
status = int(power_status.read())
except IOError:
return False

return status == 1

def get_psu_presence(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index] + self.psu_presence
try:
with open(node, 'r') as presence_status:
status = int(presence_status.read())
except IOError:
return False

return status == 1
238 changes: 238 additions & 0 deletions device/accton/x86_64-accton_as7535_32xb-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#

try:
import sys
import time
from ctypes import create_string_buffer
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))

SFP_STATUS_INSERTED = '1'
SFP_STATUS_REMOVED = '0'

class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""

PORT_START = 1
PORT_END = 30
QSFP_PORT_START = 27
QSFP_PORT_END = 30
CPLD_FMT = '/sys/bus/i2c/devices/{bus}-00{addr}/'

_port_to_eeprom_mapping = {}
_port_to_i2c_mapping = {
1: 25,
2: 26,
3: 27,
4: 28,
5: 29,
6: 30,
7: 31,
8: 32,
9: 33,
10: 34,
11: 35,
12: 36,
13: 37,
14: 38,
15: 39,
16: 40,
17: 41,
18: 42,
19: 43,
20: 44,
21: 45,
22: 46,
23: 47,
24: 48,
25: 49,
26: 50,
27: 23,
28: 21,
29: 24,
30: 22
}

@property
def port_start(self):
return self.PORT_START

@property
def port_end(self):
return self.PORT_END

@property
def qsfp_port_start(self):
return self.QSFP_PORT_START

@property
def qsfp_port_end(self):
return self.QSFP_PORT_END

@property
def qsfp_ports(self):
return range(self.QSFP_PORT_START, self.QSFP_PORT_END + 1)

@property
def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

def __init__(self):
eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom'
for x in range(self.port_start, self.port_end+1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(
self._port_to_i2c_mapping[x])

SfpUtilBase.__init__(self)

def get_cpld_path(self, port_num):
return self.CPLD_FMT.format(bus=str(12), addr=str(61))

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

content = None
port_ps = self.get_cpld_path(port_num) + 'module_present_{0}'.format(port_num)

try:
with open(port_ps) as val_file:
content = val_file.readline().rstrip()
except IOError as e:
print('GET. unable to open file: %s', str(e))
return False

# content is a string, either "0" or "1"
return content == "1"

def get_low_power_mode(self, port_num):
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

if not self.get_presence(port_num):
return False

try:
eeprom = open(self.port_to_eeprom_mapping[port_num], mode="rb", buffering=0)
eeprom.seek(93)
lpmode = ord(eeprom.read(1))

if not (lpmode & 0x1): # 'Power override' bit is 0
return False # Default High Power Mode
else:
if ((lpmode & 0x2) == 0x2):
return True # Low Power Mode if "Power set" bit is 1
else:
return False # High Power Mode if "Power set" bit is 0
except IOError as e:
print ('Error: unable to open file: ', str(e))
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def set_low_power_mode(self, port_num, lpmode):
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

try:
eeprom = None

if not self.get_presence(port_num):
return False # Port is not present, unable to set the eeprom

# Fill in write buffer
regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode
buffer = create_string_buffer(1)
if sys.version_info[0] >= 3:
buffer[0] = regval
else:
buffer[0] = chr(regval)

# Write to eeprom
eeprom = open(self.port_to_eeprom_mapping[port_num], mode="r+b", buffering=0)
eeprom.seek(93)
eeprom.write(buffer[0])
return True
except IOError as e:
print ('Error: unable to open file: ', str(e))
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def reset(self, port_num):
# Check for invalid port_num
if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end:
return False

port_ps = self.get_cpld_path(port_num) + 'module_reset_{0}'.format(port_num)

try:
reg_file = open(port_ps, mode="w")
except IOError as e:
print ('Error: unable to open file: ', str(e))
return False

#toggle reset
reg_file.seek(0)
reg_file.write('1')
time.sleep(0.2)
reg_file.seek(0)
reg_file.write('0')
reg_file.close()

return True

@property
def get_transceiver_status(self):
bitmap = 0

for port in range(self.port_start, self.port_end+1):
if not self.get_presence(port):
continue
bitmap |= (1 << (port - self.port_start))

return bitmap

data = {'valid': 0, 'last': 0, 'present': 0}

def get_transceiver_change_event(self, timeout=2000):
now = time.time()
port_dict = {}
port = 0

if timeout < 1000:
timeout = 1000
timeout = (timeout) / float(1000) # Convert to secs

if now < (self.data['last'] + timeout) and self.data['valid']:
return True, {}

reg_value = self.get_transceiver_status
changed_ports = self.data['present'] ^ reg_value
if changed_ports:
for port in range(self.port_start, self.port_end+1):
# Mask off the bit corresponding to our port
fp_port = port
mask = (1 << (fp_port - 1))
if changed_ports & mask:
if (reg_value & mask) == 0:
port_dict[port] = SFP_STATUS_REMOVED
else:
port_dict[port] = SFP_STATUS_INSERTED

# Update cache
self.data['present'] = reg_value
self.data['last'] = now
self.data['valid'] = 1
return True, port_dict
else:
return True, {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"skip_ledd": true,
"skip_pcied": true,
"skip_thermalctld": true
}
1 change: 1 addition & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(ACCTON_AS5835_54T_PLATFORM_MODULE) \
$(ACCTON_AS7312_54XS_PLATFORM_MODULE) \
$(ACCTON_AS7315_27XB_PLATFORM_MODULE) \
$(ACCTON_AS7535_32XB_PLATFORM_MODULE) \
$(INVENTEC_D7032Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7264Q28B_PLATFORM_MODULE) \
Expand Down
6 changes: 6 additions & 0 deletions platform/broadcom/platform-modules-accton.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ACCTON_AS9726_32D_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS5835_54T_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS7312_54XS_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS7315_27XB_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS7535_32XB_PLATFORM_MODULE_VERSION = 1.1

export ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION
export ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION
Expand All @@ -41,6 +42,7 @@ export ACCTON_AS9726_32D_PLATFORM_MODULE_VERSION
export ACCTON_AS5835_54T_PLATFORM_MODULE_VERSION
export ACCTON_AS7312_54XS_PLATFORM_MODULE_VERSION
export ACCTON_AS7315_27XB_PLATFORM_MODULE_VERSION
export ACCTON_AS7535_32XB_PLATFORM_MODULE_VERSION

ACCTON_AS7712_32X_PLATFORM_MODULE = sonic-platform-accton-as7712-32x_$(ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_AS7712_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton
Expand Down Expand Up @@ -123,3 +125,7 @@ $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS
ACCTON_AS7315_27XB_PLATFORM_MODULE = sonic-platform-accton-as7315-27xb_$(ACCTON_AS7315_27XB_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_AS7315_27XB_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7315_27xb-r0
$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS7315_27XB_PLATFORM_MODULE)))

ACCTON_AS7535_32XB_PLATFORM_MODULE = sonic-platform-accton-as7535-32xb_$(ACCTON_AS7535_32XB_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_AS7535_32XB_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7535_32xb-r0
$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS7535_32XB_PLATFORM_MODULE)))
Loading