Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[devices] add new accton platform minipack. #2670

Merged
merged 7 commits into from
Mar 15, 2019
Merged
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# name lanes alias index
Ethernet1 5,6 onehundredGigE1 0
Ethernet2 7,8 onehundredGigE2 1
Ethernet3 1,2 onehundredGigE3 2
Ethernet4 3,4 onehundredGigE4 3
Ethernet5 37,38 onehundredGigE5 4
Ethernet6 39,40 onehundredGigE6 5
Ethernet7 33,34 onehundredGigE7 6
Ethernet8 35,36 onehundredGigE8 7
Ethernet9 69,70 onehundredGigE9 8
Ethernet10 71,72 onehundredGigE10 9
Ethernet11 65,66 onehundredGigE11 10
Ethernet12 67,68 onehundredGigE12 11
Ethernet13 101,102 onehundredGigE13 12
Ethernet14 103,104 onehundredGigE14 13
Ethernet15 97,98 onehundredGigE15 14
Ethernet16 99,100 onehundredGigE16 15
Ethernet17 13,14 onehundredGigE17 16
Ethernet18 15,16 onehundredGigE18 17
Ethernet19 9,10 onehundredGigE19 18
Ethernet20 11,12 onehundredGigE20 19
Ethernet21 45,46 onehundredGigE21 20
Ethernet22 47,48 onehundredGigE22 21
Ethernet23 41,42 onehundredGigE23 22
Ethernet24 43,44 onehundredGigE24 23
Ethernet25 77,78 onehundredGigE25 24
Ethernet26 79,80 onehundredGigE26 25
Ethernet27 73,74 onehundredGigE27 26
Ethernet28 75,76 onehundredGigE28 27
Ethernet29 109,110 onehundredGigE29 28
Ethernet30 111,112 onehundredGigE30 29
Ethernet31 105,106 onehundredGigE31 30
Ethernet32 107,108 onehundredGigE32 31
Ethernet33 21,22 onehundredGigE33 32
Ethernet34 23,24 onehundredGigE34 33
Ethernet35 17,18 onehundredGigE35 34
Ethernet36 19,20 onehundredGigE36 35
Ethernet37 53,54 onehundredGigE37 36
Ethernet38 55,56 onehundredGigE38 37
Ethernet39 49,50 onehundredGigE39 38
Ethernet40 51,52 onehundredGigE40 39
Ethernet41 85,86 onehundredGigE41 40
Ethernet42 87,88 onehundredGigE42 41
Ethernet43 81,82 onehundredGigE43 42
Ethernet44 83,84 onehundredGigE44 43
Ethernet45 117,118 onehundredGigE45 44
Ethernet46 119,120 onehundredGigE46 45
Ethernet47 113,114 onehundredGigE47 46
Ethernet48 115,116 onehundredGigE48 47
Ethernet49 29,30 onehundredGigE49 48
Ethernet50 31,32 onehundredGigE50 49
Ethernet51 25,26 onehundredGigE51 50
Ethernet52 27,28 onehundredGigE52 51
Ethernet53 61,62 onehundredGigE53 52
Ethernet54 63,64 onehundredGigE54 53
Ethernet55 57,58 onehundredGigE55 54
Ethernet56 59,60 onehundredGigE56 55
Ethernet57 93,94 onehundredGigE57 56
Ethernet58 95,96 onehundredGigE58 57
Ethernet59 89,90 onehundredGigE59 58
Ethernet60 91,92 onehundredGigE60 59
Ethernet61 125,126 onehundredGigE61 60
Ethernet62 127,128 onehundredGigE62 61
Ethernet63 121,122 onehundredGigE63 62
Ethernet64 123,124 onehundredGigE64 63
Ethernet65 133,134 onehundredGigE65 64
Ethernet66 135,136 onehundredGigE66 65
Ethernet67 129,130 onehundredGigE67 66
Ethernet68 131,132 onehundredGigE68 67
Ethernet69 165,166 onehundredGigE69 68
Ethernet70 167,168 onehundredGigE70 69
Ethernet71 161,162 onehundredGigE71 70
Ethernet72 163,164 onehundredGigE72 71
Ethernet73 197,198 onehundredGigE73 72
Ethernet74 199,200 onehundredGigE74 73
Ethernet75 193,194 onehundredGigE75 74
Ethernet76 195,196 onehundredGigE76 75
Ethernet77 229,230 onehundredGigE77 76
Ethernet78 231,232 onehundredGigE78 77
Ethernet79 225,226 onehundredGigE79 78
Ethernet80 227,228 onehundredGigE80 79
Ethernet81 141,142 onehundredGigE81 80
Ethernet82 143,144 onehundredGigE82 81
Ethernet83 137,138 onehundredGigE83 82
Ethernet84 139,140 onehundredGigE84 83
Ethernet85 173,174 onehundredGigE85 84
Ethernet86 175,176 onehundredGigE86 85
Ethernet87 169,170 onehundredGigE87 86
Ethernet88 171,172 onehundredGigE88 87
Ethernet89 205,206 onehundredGigE89 88
Ethernet90 207,208 onehundredGigE90 89
Ethernet91 201,202 onehundredGigE91 90
Ethernet92 203,204 onehundredGigE92 91
Ethernet93 237,238 onehundredGigE93 92
Ethernet94 239,240 onehundredGigE94 93
Ethernet95 233,234 onehundredGigE95 94
Ethernet96 235,236 onehundredGigE96 95
Ethernet97 149,150 onehundredGigE97 96
Ethernet98 151,152 onehundredGigE98 97
Ethernet99 145,146 onehundredGigE99 98
Ethernet100 147,148 onehundredGigE100 99
Ethernet101 181,182 onehundredGigE101 100
Ethernet102 183,184 onehundredGigE102 101
Ethernet103 177,178 onehundredGigE103 102
Ethernet104 179,180 onehundredGigE104 103
Ethernet105 213,214 onehundredGigE105 104
Ethernet106 215,216 onehundredGigE106 105
Ethernet107 209,210 onehundredGigE107 106
Ethernet108 211,212 onehundredGigE108 107
Ethernet109 245,246 onehundredGigE109 108
Ethernet110 247,248 onehundredGigE110 109
Ethernet111 241,242 onehundredGigE111 110
Ethernet112 243,244 onehundredGigE112 111
Ethernet113 157,158 onehundredGigE113 112
Ethernet114 159,160 onehundredGigE114 113
Ethernet115 153,154 onehundredGigE115 114
Ethernet116 155,156 onehundredGigE116 115
Ethernet117 189,190 onehundredGigE117 116
Ethernet118 191,192 onehundredGigE118 117
Ethernet119 185,186 onehundredGigE119 118
Ethernet120 187,188 onehundredGigE120 119
Ethernet121 221,222 onehundredGigE121 120
Ethernet122 223,224 onehundredGigE122 121
Ethernet123 217,218 onehundredGigE123 122
Ethernet124 219,220 onehundredGigE124 123
Ethernet125 253,254 onehundredGigE125 124
Ethernet126 255,256 onehundredGigE126 125
Ethernet127 249,250 onehundredGigE127 126
Ethernet128 251,252 onehundredGigE128 127
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_16Q_FEC544_EVTB_100G.bcm
1 change: 1 addition & 0 deletions device/accton/x86_64-accton_minipack-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accton-MINIPACK t1
4 changes: 4 additions & 0 deletions device/accton/x86_64-accton_minipack-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=57600
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="pcie_aspm=off"
1 change: 1 addition & 0 deletions device/accton/x86_64-accton_minipack-r0/led_proc_init.soc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

21 changes: 21 additions & 0 deletions device/accton/x86_64-accton_minipack-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

try:
import exceptions
import binascii
import time
import optparse
import warnings
import os
import sys
from sonic_eeprom import eeprom_base
from sonic_eeprom import eeprom_tlvinfo
import subprocess
except ImportError, 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/1-0057/eeprom"
super(board, self).__init__(self.eeprom_path, 0x200, '', True)
57 changes: 57 additions & 0 deletions device/accton/x86_64-accton_minipack-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/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
#
#############################################################################

import os.path

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.num = 4
self.psu_path = "/sys/bus/platform/devices/minipack_psensor/"
self.psu_voltage = "/in{0}_input"

def get_num_psus(self):
return self.num

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

status = 0
node = self.psu_path + self.psu_voltage.format(index*2-1)
try:
with open(node, 'r') as power_status:
status = int(power_status.read())
except IOError:
return False

return status > 0

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

status = 0
node = self.psu_path + self.psu_voltage.format(index*2)
try:
with open(node, 'r') as presence_status:
status = int(presence_status.read())
except IOError:
return False

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

try:
import time
from sonic_sfp.sfputilbase import SfpUtilBase
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 = 128

BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/"

_port_to_is_present = {}
_port_to_lp_mode = {}

_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(self.PORT_START, self.PORT_END + 1)

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

def sfp_map(self, index):
port = index + 1
base = ((port-1)/8*8) + 10
index = (port - 1) % 8
index = 7 - index
if (index%2):
index = index -1
else:
index = index +1
bus = base + index
return bus


def __init__(self):
eeprom_path = self.BASE_OOM_PATH + "eeprom"

for x in range(0, self.port_end+1):
bus = self.sfp_map(x)
self.port_to_eeprom_mapping[x] = eeprom_path.format(
bus)

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

eeprom_path = self.port_to_eeprom_mapping[port_num]
with open(eeprom_path) as f:
try:
content = f.read(1)
except IOError as e:
#Not print any error, for if any, treat as Not present.
return False
return True

def get_low_power_mode(self, port_num):
raise NotImplementedError

def set_low_power_mode(self, port_num, lpmode):
raise NotImplementedError

def reset(self, port_num):
raise NotImplementedError

def get_transceiver_change_event(self):
"""
TODO: This function need to be implemented
when decide to support monitoring SFP(Xcvrd)
on this platform.
"""
raise NotImplementedError
3 changes: 3 additions & 0 deletions device/accton/x86_64-accton_minipack-r0/sensors.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# libsensors configuration file
# ------------------------------------------------

1 change: 1 addition & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(ACCTON_AS7716_32XB_PLATFORM_MODULE) \
$(ACCTON_AS6712_32X_PLATFORM_MODULE) \
$(ACCTON_AS7726_32X_PLATFORM_MODULE) \
$(ACCTON_MINIPACK_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 @@ -9,6 +9,7 @@ ACCTON_AS7326_56X_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS7716_32XB_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS6712_32X_PLATFORM_MODULE_VERSION = 1.1
ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION = 1.1
ACCTON_MINIPACK_PLATFORM_MODULE_VERSION = 1.1

export ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION
export ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION
Expand All @@ -19,6 +20,7 @@ export ACCTON_AS7326_56X_PLATFORM_MODULE_VERSION
export ACCTON_AS7716_32XB_PLATFORM_MODULE_VERSION
export ACCTON_AS6712_32X_PLATFORM_MODULE_VERSION
export ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION
export ACCTON_MINIPACK_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 @@ -58,4 +60,8 @@ ACCTON_AS7726_32X_PLATFORM_MODULE = sonic-platform-accton-as7726-32x_$(ACCTON_AS
$(ACCTON_AS7726_32X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7726_32x-r0
$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS7726_32X_PLATFORM_MODULE)))

ACCTON_MINIPACK_PLATFORM_MODULE = sonic-platform-accton-minipack_$(ACCTON_MINIPACK_PLATFORM_MODULE_VERSION)_amd64.deb
$(ACCTON_MINIPACK_PLATFORM_MODULE)_PLATFORM = x86_64-accton_minipack-r0
$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_MINIPACK_PLATFORM_MODULE)))

SONIC_STRETCH_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE)
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ Package: sonic-platform-accton-as7726-32x
Architecture: amd64
Description: kernel modules for platform devices such as fan, led, sfp

Package: sonic-platform-accton-minipack
Architecture: amd64
Description: kernel modules for platform devices such as fan, led, sfp

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PACKAGE_PRE_NAME := sonic-platform-accton
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
MOD_SRC_DIR:= $(shell pwd)
MODULE_DIRS:= as7712-32x as5712-54x as7816-64x as7716-32x as7716-32xb as7312-54x as7326-56x as6712-32x as7726-32x
MODULE_DIRS:= as7712-32x as5712-54x as7816-64x as7716-32x as7716-32xb as7312-54x as7326-56x as6712-32x as7726-32x minipack
MODULE_DIR := modules
UTILS_DIR := utils
SERVICE_DIR := service
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-m:= minipack_psensor.o
Loading