-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for Accton AS7712-32X platform #1299
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9d9255d
Add support as7716_32x sfp/psu/portled/eeprom
jostar-yang bd13540
Add as7716_32x drv code(not inlcude .*.o)
jostar-yang edc8f65
Update platform-modules-accton.mk
jostar-yang 3ab816a
Update platform-modules-accton.mk
jostar-yang cf0b611
Add as7716_32x build to debian control,rule
jostar-yang fd938d3
Merge branch '20180112_a0001' of https://github.com/jostar-yang/sonic…
jostar-yang 0b2259d
Add as7716_32x export
jostar-yang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
device/accton/x86_64-accton_as7716_32x-r0/led_proc_init.soc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=31 REMAP_PORT_1=30 REMAP_PORT_2=29 REMAP_PORT_3=28 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=27 REMAP_PORT_5=26 REMAP_PORT_6=25 REMAP_PORT_7=24 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=23 REMAP_PORT_9=22 REMAP_PORT_10=21 REMAP_PORT_11=20 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=19 REMAP_PORT_13=18 REMAP_PORT_14=17 REMAP_PORT_15=16 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=63 REMAP_PORT_17=62 REMAP_PORT_18=61 REMAP_PORT_19=60 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=59 REMAP_PORT_21=58 REMAP_PORT_22=57 REMAP_PORT_23=56 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=55 REMAP_PORT_25=54 REMAP_PORT_26=53 REMAP_PORT_27=52 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=51 REMAP_PORT_29=50 REMAP_PORT_30=49 REMAP_PORT_31=48 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=47 REMAP_PORT_33=46 REMAP_PORT_34=45 REMAP_PORT_35=44 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=43 REMAP_PORT_37=42 REMAP_PORT_38=41 REMAP_PORT_39=40 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=39 REMAP_PORT_41=38 REMAP_PORT_42=37 REMAP_PORT_43=36 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=35 REMAP_PORT_45=34 REMAP_PORT_46=33 REMAP_PORT_47=32 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 REMAP_PORT_49=14 REMAP_PORT_50=13 REMAP_PORT_51=12 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 REMAP_PORT_53=10 REMAP_PORT_54=9 REMAP_PORT_55=8 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 REMAP_PORT_57=6 REMAP_PORT_58=5 REMAP_PORT_59=4 | ||
m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 REMAP_PORT_61=2 REMAP_PORT_62=1 REMAP_PORT_63=0 | ||
|
||
m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=35 REMAP_PORT_1=34 REMAP_PORT_2=33 REMAP_PORT_3=32 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=39 REMAP_PORT_5=38 REMAP_PORT_6=37 REMAP_PORT_7=36 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=43 REMAP_PORT_9=42 REMAP_PORT_10=41 REMAP_PORT_11=40 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=47 REMAP_PORT_13=46 REMAP_PORT_14=45 REMAP_PORT_15=44 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=3 REMAP_PORT_17=2 REMAP_PORT_18=1 REMAP_PORT_19=0 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=7 REMAP_PORT_21=6 REMAP_PORT_22=5 REMAP_PORT_23=4 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=11 REMAP_PORT_25=10 REMAP_PORT_26=9 REMAP_PORT_27=8 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=15 REMAP_PORT_29=14 REMAP_PORT_30=13 REMAP_PORT_31=12 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 REMAP_PORT_33=18 REMAP_PORT_34=17 REMAP_PORT_35=16 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 REMAP_PORT_37=22 REMAP_PORT_38=21 REMAP_PORT_39=20 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 REMAP_PORT_41=26 REMAP_PORT_42=25 REMAP_PORT_43=24 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 REMAP_PORT_45=30 REMAP_PORT_46=29 REMAP_PORT_47=28 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=51 REMAP_PORT_49=50 REMAP_PORT_50=49 REMAP_PORT_51=48 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=55 REMAP_PORT_53=54 REMAP_PORT_54=53 REMAP_PORT_55=52 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=59 REMAP_PORT_57=58 REMAP_PORT_58=57 REMAP_PORT_59=56 | ||
m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=63 REMAP_PORT_61=62 REMAP_PORT_62=61 REMAP_PORT_63=60 | ||
|
||
led 0 prog 02 FD 42 80 02 FF 42 00 02 FE 42 00 02 FA 42 E0 02 FB 42 40 06 F9 D2 00 74 1E 02 F9 42 03 67 AC 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 86 FE 06 FB D6 FE 74 1E 86 FC 3E FA 06 FE 88 4A 03 71 4C 67 84 57 67 84 57 67 98 57 06 FE 88 80 4A 00 27 97 75 4F 90 4A 00 27 4A 01 27 B7 97 71 69 77 42 06 F9 D6 FC 74 7C 02 F9 4A 07 37 4E 07 02 FC 42 00 4E 07 06 F9 0A 07 71 4F 77 42 16 FF 06 FD 17 4D DA 07 74 95 12 FF 52 00 86 FD 57 86 FF 57 16 FF 06 FD 07 4D DA 07 74 A9 12 FF 52 00 86 FD 57 86 FF 57 06 FE C2 FC 98 98 12 F4 50 C2 FC 98 98 F2 F0 14 06 F4 C2 03 88 77 D1 06 FE C2 FC 98 98 F2 E0 14 06 FE C2 03 88 18 71 E2 80 18 71 DD 67 98 67 98 57 67 84 67 98 57 80 18 71 EB 67 98 67 84 57 67 84 67 84 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
led 0 start | ||
|
||
led 1 prog 02 FD 42 80 02 FF 42 00 02 FE 42 00 02 FA 42 E0 02 FB 42 40 06 F9 D2 00 74 1E 02 F9 42 03 67 AC 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 86 FE 67 C3 67 52 86 FE 06 FB D6 FE 74 1E 86 FC 3E FA 06 FE 88 4A 03 71 4C 67 84 57 67 84 57 67 98 57 06 FE 88 80 4A 00 27 97 75 4F 90 4A 00 27 4A 01 27 B7 97 71 69 77 42 06 F9 D6 FC 74 7C 02 F9 4A 07 37 4E 07 02 FC 42 00 4E 07 06 F9 0A 07 71 4F 77 42 16 FF 06 FD 17 4D DA 07 74 95 12 FF 52 00 86 FD 57 86 FF 57 16 FF 06 FD 07 4D DA 07 74 A9 12 FF 52 00 86 FD 57 86 FF 57 06 FE C2 FC 98 98 12 F4 50 C2 FC 98 98 F2 F0 14 06 F4 C2 03 88 77 D1 06 FE C2 FC 98 98 F2 E0 14 06 FE C2 03 88 18 71 E2 80 18 71 DD 67 98 67 98 57 67 84 67 98 57 80 18 71 EB 67 98 67 84 57 67 84 67 84 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ||
led 1 start | ||
|
||
led auto on |
24 changes: 24 additions & 0 deletions
24
device/accton/x86_64-accton_as7716_32x-r0/plugins/eeprom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/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-0056/eeprom" | ||
#Two i2c buses might get flipped order, check them both. | ||
if not os.path.exists(self.eeprom_path): | ||
self.eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom" | ||
super(board, self).__init__(self.eeprom_path, 0, '', True) |
61 changes: 61 additions & 0 deletions
61
device/accton/x86_64-accton_as7716_32x-r0/plugins/psuutil.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/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.psu_path = "/sys/bus/i2c/devices/" | ||
self.psu_presence = "/psu_present" | ||
self.psu_oper_status = "/psu_power_good" | ||
self.psu_mapping = { | ||
1: "18-0053", | ||
2: "17-0050", | ||
} | ||
|
||
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 |
134 changes: 134 additions & 0 deletions
134
device/accton/x86_64-accton_as7716_32x-r0/plugins/sfputil.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# 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 = 31 | ||
PORTS_IN_BLOCK = 32 | ||
|
||
BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/" | ||
BASE_CPLD_PATH = "/sys/bus/i2c/devices/11-0060/" | ||
|
||
_port_to_is_present = {} | ||
_port_to_lp_mode = {} | ||
|
||
_port_to_eeprom_mapping = {} | ||
_port_to_i2c_mapping = { | ||
0: [1, 29], | ||
1: [2, 30], | ||
2: [3, 31], | ||
3: [4, 32], | ||
4: [5, 34], | ||
5: [6, 33], | ||
6: [7, 36], | ||
7: [8, 35], | ||
8: [9, 25], | ||
9: [10, 26], | ||
10: [11, 27], | ||
11: [12, 28], | ||
12: [14, 37], | ||
13: [15, 38], | ||
14: [16, 39], | ||
15: [17, 40], | ||
16: [18, 41], | ||
17: [19, 42], | ||
18: [20, 43], | ||
19: [21, 44], | ||
20: [22, 53], | ||
21: [23, 54], | ||
22: [24, 55], | ||
23: [25, 56], | ||
24: [26, 45], | ||
25: [27, 46], | ||
26: [28, 47], | ||
27: [29, 48], | ||
28: [30, 49], | ||
29: [31, 50], | ||
30: [32, 51], | ||
31: [33, 52], | ||
} | ||
|
||
@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.PORTS_IN_BLOCK + 1) | ||
|
||
@property | ||
def port_to_eeprom_mapping(self): | ||
return self._port_to_eeprom_mapping | ||
|
||
def __init__(self): | ||
eeprom_path = self.BASE_OOM_PATH + "eeprom" | ||
|
||
for x in range(0, self.port_end+1): | ||
self.port_to_eeprom_mapping[x] = eeprom_path.format( | ||
self._port_to_i2c_mapping[x][1] | ||
) | ||
|
||
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 | ||
|
||
present_path = self.BASE_CPLD_PATH + "module_present_" + str(port_num+1) | ||
self.__port_to_is_present = present_path | ||
|
||
try: | ||
val_file = open(self.__port_to_is_present) | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
content = val_file.readline().rstrip() | ||
val_file.close() | ||
|
||
# content is a string, either "0" or "1" | ||
if content == "1": | ||
return True | ||
|
||
return False | ||
|
||
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): | ||
if port_num < self.port_start or port_num > self.port_end: | ||
return False | ||
|
||
mod_rst_path = self.BASE_CPLD_PATH + "module_reset_" + str(port_num+1) | ||
self.__port_to_mod_rst = mod_rst_path | ||
try: | ||
reg_file = open(self.__port_to_mod_rst, 'r+') | ||
except IOError as e: | ||
print "Error: unable to open file: %s" % str(e) | ||
return False | ||
|
||
reg_value = '1' | ||
|
||
reg_file.write(reg_value) | ||
reg_file.close() | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule sonic-platform-modules-accton
updated
18 files
+0 −0 | as7716-32x/classes/__init__.py | |
+254 −0 | as7716-32x/classes/fanutil.py | |
+123 −0 | as7716-32x/classes/thermalutil.py | |
+21 −0 | as7716-32x/modules/Makefile | |
+781 −0 | as7716-32x/modules/accton_as7716_32x_cpld1.c | |
+794 −0 | as7716-32x/modules/accton_as7716_32x_fan.c | |
+442 −0 | as7716-32x/modules/accton_as7716_32x_leds.c | |
+381 −0 | as7716-32x/modules/accton_as7716_32x_psu.c | |
+365 −0 | as7716-32x/modules/accton_as7716_32x_sfp.c | |
+259 −0 | as7716-32x/modules/accton_i2c_cpld.c | |
+400 −0 | as7716-32x/modules/cpr_4011_4mxx.c | |
+1,148 −0 | as7716-32x/modules/optoe.c | |
+603 −0 | as7716-32x/modules/ym2651y.c | |
+17 −0 | as7716-32x/service/as7716-platform-monitor.service | |
+16 −0 | as7716-32x/setup.py | |
+117 −0 | as7716-32x/utils/README | |
+207 −0 | as7716-32x/utils/accton_as7716_monitor.py | |
+595 −0 | as7716-32x/utils/accton_as7716_util.py |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_extra_package like above