[devices]: Centec x86 goldengate platforms and devices update (#4248)

* Centec x86 goldengate update (#8)
This commit is contained in:
taochengyi 2020-04-17 15:38:48 +08:00 committed by GitHub
parent 6df0e4be0a
commit 744d33d502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 3289 additions and 1953 deletions

View File

@ -1,24 +1,24 @@
# name lanes alias speed # name lanes alias speed
Ethernet1 75 eth-0-1 1000 Ethernet1 91 eth-0-1 10000
Ethernet2 73 eth-0-2 1000 Ethernet2 89 eth-0-2 10000
Ethernet3 72 eth-0-3 1000 Ethernet3 88 eth-0-3 10000
Ethernet4 70 eth-0-4 1000 Ethernet4 86 eth-0-4 10000
Ethernet5 69 eth-0-5 1000 Ethernet5 85 eth-0-5 10000
Ethernet6 67 eth-0-6 1000 Ethernet6 83 eth-0-6 10000
Ethernet7 66 eth-0-7 1000 Ethernet7 82 eth-0-7 10000
Ethernet8 64 eth-0-8 1000 Ethernet8 80 eth-0-8 10000
Ethernet9 63 eth-0-9 1000 Ethernet9 79 eth-0-9 10000
Ethernet10 61 eth-0-10 1000 Ethernet10 77 eth-0-10 10000
Ethernet11 60 eth-0-11 1000 Ethernet11 76 eth-0-11 10000
Ethernet12 58 eth-0-12 1000 Ethernet12 74 eth-0-12 10000
Ethernet13 57 eth-0-13 10000 Ethernet13 73 eth-0-13 10000
Ethernet14 56 eth-0-14 10000 Ethernet14 72 eth-0-14 10000
Ethernet15 55 eth-0-15 10000 Ethernet15 71 eth-0-15 10000
Ethernet16 53 eth-0-16 10000 Ethernet16 69 eth-0-16 10000
Ethernet17 52 eth-0-17 10000 Ethernet17 68 eth-0-17 10000
Ethernet18 50 eth-0-18 10000 Ethernet18 66 eth-0-18 10000
Ethernet19 49 eth-0-19 10000 Ethernet19 65 eth-0-19 10000
Ethernet20 48 eth-0-20 10000 Ethernet20 64 eth-0-20 10000
Ethernet21 0 eth-0-21 10000 Ethernet21 0 eth-0-21 10000
Ethernet22 1 eth-0-22 10000 Ethernet22 1 eth-0-22 10000
Ethernet23 3 eth-0-23 10000 Ethernet23 3 eth-0-23 10000
@ -46,10 +46,10 @@ Ethernet44 30 eth-0-44 10000
Ethernet45 31 eth-0-45 10000 Ethernet45 31 eth-0-45 10000
Ethernet46 33 eth-0-46 10000 Ethernet46 33 eth-0-46 10000
Ethernet47 34 eth-0-47 10000 Ethernet47 34 eth-0-47 10000
Ethernet48 36 eth-0-48 10000 Ethernet48 48 eth-0-48 10000
Ethernet49 42,41,43,40 eth-0-49 40000 Ethernet49 38,37,39,36 eth-0-49 100000
Ethernet50 45,46,44,47 eth-0-50 40000 Ethernet50 53,54,52,55 eth-0-50 100000
Ethernet51 94,93,95,92 eth-0-51 100000 Ethernet51 118,117,119,116 eth-0-51 100000
Ethernet52 89,90,88,91 eth-0-52 100000 Ethernet52 101,102,100,103 eth-0-52 100000
Ethernet53 85,86,84,87 eth-0-53 100000 Ethernet53 113,114,112,115 eth-0-53 40000
Ethernet54 81,82,80,83 eth-0-54 100000 Ethernet54 97,98,96,99 eth-0-54 40000

View File

@ -1 +1 @@
E582-48x2q4z t1 E582-48x2q4z l2

View File

@ -1,16 +1,16 @@
# name lanes alias speed # name lanes alias speed
Ethernet1 4 eth-0-1 1000 Ethernet1 4 eth-0-1 10000
Ethernet2 5 eth-0-2 1000 Ethernet2 5 eth-0-2 10000
Ethernet3 6 eth-0-3 1000 Ethernet3 6 eth-0-3 10000
Ethernet4 8 eth-0-4 1000 Ethernet4 8 eth-0-4 10000
Ethernet5 9 eth-0-5 1000 Ethernet5 9 eth-0-5 10000
Ethernet6 10 eth-0-6 1000 Ethernet6 10 eth-0-6 10000
Ethernet7 12 eth-0-7 1000 Ethernet7 12 eth-0-7 10000
Ethernet8 13 eth-0-8 1000 Ethernet8 13 eth-0-8 10000
Ethernet9 14 eth-0-9 1000 Ethernet9 14 eth-0-9 10000
Ethernet10 16 eth-0-10 1000 Ethernet10 16 eth-0-10 10000
Ethernet11 17 eth-0-11 1000 Ethernet11 17 eth-0-11 10000
Ethernet12 18 eth-0-12 1000 Ethernet12 18 eth-0-12 10000
Ethernet13 20 eth-0-13 10000 Ethernet13 20 eth-0-13 10000
Ethernet14 21 eth-0-14 10000 Ethernet14 21 eth-0-14 10000
Ethernet15 22 eth-0-15 10000 Ethernet15 22 eth-0-15 10000
@ -23,33 +23,33 @@ Ethernet21 31 eth-0-21 10000
Ethernet22 32 eth-0-22 10000 Ethernet22 32 eth-0-22 10000
Ethernet23 34 eth-0-23 10000 Ethernet23 34 eth-0-23 10000
Ethernet24 35 eth-0-24 10000 Ethernet24 35 eth-0-24 10000
Ethernet25 36 eth-0-25 10000 Ethernet25 48 eth-0-25 10000
Ethernet26 37 eth-0-26 10000 Ethernet26 49 eth-0-26 10000
Ethernet27 39 eth-0-27 10000 Ethernet27 51 eth-0-27 10000
Ethernet28 40 eth-0-28 10000 Ethernet28 36 eth-0-28 10000
Ethernet29 41 eth-0-29 10000 Ethernet29 37 eth-0-29 10000
Ethernet30 43 eth-0-30 10000 Ethernet30 39 eth-0-30 10000
Ethernet31 47 eth-0-31 10000 Ethernet31 55 eth-0-31 10000
Ethernet32 46 eth-0-32 10000 Ethernet32 54 eth-0-32 10000
Ethernet33 45 eth-0-33 10000 Ethernet33 53 eth-0-33 10000
Ethernet34 44 eth-0-34 10000 Ethernet34 52 eth-0-34 10000
Ethernet35 92 eth-0-35 10000 Ethernet35 116 eth-0-35 10000
Ethernet36 93 eth-0-36 10000 Ethernet36 117 eth-0-36 10000
Ethernet37 94 eth-0-37 10000 Ethernet37 118 eth-0-37 10000
Ethernet38 95 eth-0-38 10000 Ethernet38 119 eth-0-38 10000
Ethernet39 90 eth-0-39 10000 Ethernet39 102 eth-0-39 10000
Ethernet40 89 eth-0-40 10000 Ethernet40 101 eth-0-40 10000
Ethernet41 88 eth-0-41 10000 Ethernet41 100 eth-0-41 10000
Ethernet42 87 eth-0-42 10000 Ethernet42 115 eth-0-42 10000
Ethernet43 86 eth-0-43 10000 Ethernet43 114 eth-0-43 10000
Ethernet44 85 eth-0-44 10000 Ethernet44 113 eth-0-44 10000
Ethernet45 84 eth-0-45 10000 Ethernet45 112 eth-0-45 10000
Ethernet46 82 eth-0-46 10000 Ethernet46 98 eth-0-46 10000
Ethernet47 81 eth-0-47 10000 Ethernet47 97 eth-0-47 10000
Ethernet48 80 eth-0-48 10000 Ethernet48 96 eth-0-48 10000
Ethernet49 77,78,76,79 eth-0-49 40000 Ethernet49 93,94,92,95 eth-0-49 40000
Ethernet50 73,74,72,75 eth-0-50 40000 Ethernet50 89,90,88,91 eth-0-50 40000
Ethernet51 70,71,69,68 eth-0-51 40000 Ethernet51 86,87,85,84 eth-0-51 40000
Ethernet52 61,63,60,62 eth-0-52 40000 Ethernet52 77,79,76,78 eth-0-52 40000
Ethernet53 59,57,58,56 eth-0-53 40000 Ethernet53 75,73,74,72 eth-0-53 40000
Ethernet54 53,55,54,52 eth-0-54 40000 Ethernet54 69,71,70,68 eth-0-54 40000

View File

@ -1 +1 @@
E582-48x6q t1 E582-48x6q l2

View File

@ -0,0 +1,70 @@
{# Default values which will be used if no actual configura available #}
{% set default_cable = '40m' %}
{% set default_ports_num = 54 -%}
{# Port configuration to cable length look-up table #}
{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #}
{# Roles described in the minigraph #}
{% set ports2cable = {
'torrouter_server' : '5m',
'leafrouter_torrouter' : '40m',
'spinerouter_leafrouter' : '300m'
}
%}
{%- macro cable_length(port_name) -%}
{%- set cable_len = [] -%}
{%- for local_port in DEVICE_NEIGHBOR -%}
{%- if local_port == port_name -%}
{%- if DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%}
{%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] -%}
{%- set neighbor_role = neighbor.type -%}
{%- set roles1 = switch_role + '_' + neighbor_role %}
{%- set roles2 = neighbor_role + '_' + switch_role -%}
{%- set roles1 = roles1 | lower -%}
{%- set roles2 = roles2 | lower -%}
{%- if roles1 in ports2cable -%}
{%- if cable_len.append(ports2cable[roles1]) -%}{%- endif -%}
{%- elif roles2 in ports2cable -%}
{%- if cable_len.append(ports2cable[roles2]) -%}{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if cable_len -%}
{{ cable_len.0 }}
{%- else -%}
{{ default_cable }}
{%- endif -%}
{% endmacro %}
{%- if DEVICE_METADATA is defined %}
{%- set switch_role = DEVICE_METADATA['localhost']['type'] %}
{%- endif -%}
{# Generate list of ports if not defined #}
{% if PORT is not defined %}
{% set PORT = [] %}
{% for port_idx in range(1,default_ports_num+1) %}
{% if PORT.append("Ethernet%d" % (port_idx)) %}{% endif %}
{% endfor %}
{% endif -%}
{% set port_names_list = [] %}
{% for port in PORT %}
{%- if port_names_list.append(port) %}{% endif %}
{% endfor %}
{% set port_names = port_names_list | join(',') -%}
{
"CABLE_LENGTH": {
"AZURE": {
{% for port in PORT %}
{% set cable = cable_length(port) -%}
"{{ port }}": "{{ cable }}"{%- if not loop.last -%},{% endif %}
{% endfor %}
}
}
}

View File

@ -0,0 +1,21 @@
# PG lossless profiles.
# speed cable size xon xoff threshold
1000 5m 34816 18432 16384 0
10000 5m 34816 18432 16384 0
25000 5m 34816 18432 16384 0
40000 5m 34816 18432 16384 0
50000 5m 34816 18432 16384 0
100000 5m 36864 18432 18432 0
1000 40m 36864 18432 18432 0
10000 40m 36864 18432 18432 0
25000 40m 39936 18432 21504 0
40000 40m 41984 18432 23552 0
50000 40m 41984 18432 23552 0
100000 40m 54272 18432 35840 0
1000 300m 49152 18432 30720 0
10000 300m 49152 18432 30720 0
25000 300m 71680 18432 53248 0
40000 300m 94208 18432 75776 0
50000 300m 94208 18432 75776 0
100000 300m 184320 18432 165888 0

View File

@ -1,33 +1,55 @@
# name lanes # name lanes alias speed
Ethernet0 1 Ethernet1 91 eth-0-1 10000
Ethernet4 2 Ethernet2 89 eth-0-2 10000
Ethernet8 3 Ethernet3 88 eth-0-3 10000
Ethernet12 4 Ethernet4 86 eth-0-4 10000
Ethernet16 5 Ethernet5 85 eth-0-5 10000
Ethernet20 6 Ethernet6 83 eth-0-6 10000
Ethernet24 7 Ethernet7 82 eth-0-7 10000
Ethernet28 8 Ethernet8 80 eth-0-8 10000
Ethernet32 9 Ethernet9 79 eth-0-9 10000
Ethernet36 10 Ethernet10 77 eth-0-10 10000
Ethernet40 11 Ethernet11 76 eth-0-11 10000
Ethernet44 12 Ethernet12 74 eth-0-12 10000
Ethernet48 13 Ethernet13 73 eth-0-13 10000
Ethernet52 14 Ethernet14 72 eth-0-14 10000
Ethernet56 15 Ethernet15 71 eth-0-15 10000
Ethernet60 16 Ethernet16 69 eth-0-16 10000
Ethernet64 17 Ethernet17 68 eth-0-17 10000
Ethernet68 18 Ethernet18 66 eth-0-18 10000
Ethernet72 19 Ethernet19 65 eth-0-19 10000
Ethernet76 20 Ethernet20 64 eth-0-20 10000
Ethernet80 21 Ethernet21 0 eth-0-21 10000
Ethernet84 22 Ethernet22 1 eth-0-22 10000
Ethernet88 23 Ethernet23 3 eth-0-23 10000
Ethernet92 24 Ethernet24 2 eth-0-24 10000
Ethernet96 25 Ethernet25 4 eth-0-25 10000
Ethernet100 26 Ethernet26 5 eth-0-26 10000
Ethernet104 27 Ethernet27 6 eth-0-27 10000
Ethernet108 28 Ethernet28 7 eth-0-28 10000
Ethernet112 29 Ethernet29 8 eth-0-29 10000
Ethernet116 30 Ethernet30 9 eth-0-30 10000
Ethernet120 31 Ethernet31 10 eth-0-31 10000
Ethernet124 32 Ethernet32 12 eth-0-32 10000
Ethernet33 13 eth-0-33 10000
Ethernet34 15 eth-0-34 10000
Ethernet35 16 eth-0-35 10000
Ethernet36 18 eth-0-36 10000
Ethernet37 19 eth-0-37 10000
Ethernet38 21 eth-0-38 10000
Ethernet39 22 eth-0-39 10000
Ethernet40 24 eth-0-40 10000
Ethernet41 25 eth-0-41 10000
Ethernet42 27 eth-0-42 10000
Ethernet43 28 eth-0-43 10000
Ethernet44 30 eth-0-44 10000
Ethernet45 31 eth-0-45 10000
Ethernet46 33 eth-0-46 10000
Ethernet47 34 eth-0-47 10000
Ethernet48 48 eth-0-48 10000
Ethernet49 38,37,39,36 eth-0-49 100000
Ethernet50 53,54,52,55 eth-0-50 100000
Ethernet51 118,117,119,116 eth-0-51 100000
Ethernet52 101,102,100,103 eth-0-52 100000
Ethernet53 113,114,112,115 eth-0-53 40000
Ethernet54 97,98,96,99 eth-0-54 40000

View File

@ -0,0 +1,133 @@
{
"DSCP_TO_TC_MAP": {
"AZURE": {
"0":"0",
"1":"0",
"2":"0",
"3":"0",
"4":"0",
"5":"0",
"6":"0",
"7":"0",
"8":"1",
"9":"1",
"10":"1",
"11":"1",
"12":"1",
"13":"1",
"14":"1",
"15":"1",
"16":"2",
"17":"2",
"18":"2",
"19":"2",
"20":"2",
"21":"2",
"22":"2",
"23":"2",
"24":"3",
"25":"3",
"26":"3",
"27":"3",
"28":"3",
"29":"3",
"30":"3",
"31":"3",
"32":"4",
"33":"4",
"34":"4",
"35":"4",
"36":"4",
"37":"4",
"38":"4",
"39":"4",
"40":"5",
"41":"5",
"42":"5",
"43":"5",
"44":"5",
"45":"5",
"46":"5",
"47":"5",
"48":"6",
"49":"6",
"50":"6",
"51":"6",
"52":"6",
"53":"6",
"54":"6",
"55":"6",
"56":"7",
"57":"7",
"58":"7",
"59":"7",
"60":"7",
"61":"7",
"62":"7",
"63":"7"
}
},
"SCHEDULER": {
"scheduler.0": {
"type":"DWRR",
"weight": "25"
},
"scheduler.1": {
"type":"DWRR",
"weight": "30"
},
"scheduler.2": {
"type":"DWRR",
"weight": "20"
}
},
"PORT_QOS_MAP": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54": {
"dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]",
"pfc_enable": "3,4"
}
},
"WRED_PROFILE": {
"AZURE_LOSSY": {
"wred_green_enable":"true",
"wred_yellow_enable":"true",
"red_max_threshold":"32760",
"red_min_threshold":"4095",
"yellow_max_threshold":"32760",
"yellow_min_threshold":"4095",
"green_max_threshold": "32760",
"green_min_threshold": "4095"
},
"AZURE_LOSSLESS": {
"wred_green_enable":"true",
"wred_yellow_enable":"true",
"red_max_threshold":"32760",
"red_min_threshold":"4095",
"yellow_max_threshold":"32760",
"yellow_min_threshold":"4095",
"green_max_threshold": "32760",
"green_min_threshold": "4095"
}
},
"QUEUE": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|0-2": {
"scheduler" : "[SCHEDULER|scheduler.1]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|5-7": {
"scheduler" : "[SCHEDULER|scheduler.2]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|0-2": {
"wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|5-7": {
"wred_profile" : "[WRED_PROFILE|AZURE_LOSSY]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|3-4": {
"scheduler" : "[SCHEDULER|scheduler.0]",
"wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]"
}
}
}

View File

@ -1 +1,2 @@
BOARD_CONFIG_FILE_PATH=/etc/centec/ES6428A-X48Q2H4.json SAI_INIT_CONFIG_FILE=/etc/centec/ES6428A-X48Q2H4-chip-profile.txt
SAI_HW_PORT_PROFILE_ID_CONFIG_FILE=/etc/centec/ES6428A-X48Q2H4-datapath-cfg.txt

View File

@ -1 +1 @@
ES6428A-X48Q2H4 t1 ES6428A-X48Q2H4 l2

View File

@ -0,0 +1,3 @@
CONSOLE_SPEED=115200
CONSOLE_DEV=2
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=no"

View File

@ -0,0 +1,33 @@
#!/usr/bin/env python
#############################################################################
# EmbedWay
#
# 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:
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):
def __init__(self, name, path, cpld_root, ro):
#output = os.popen('i2cdetect -l | grep CP')
#a=output.read()
#b=a[4]
self.eeprom_path = "/home/admin/eeprom.bin"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,57 @@
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/{}-0058/"
self.psu_oper_status = "in1_input"
self.psu_presence = "i2cget -y {} 0x50 0x00"
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
"""
return 2
def get_psu_status(self, index):
if index is None:
return False
Base_bus_number = 39
status = 0
#index from 1, psu attribute bus from 40
try:
with open(self.psu_path.format(index + Base_bus_number) + self.psu_oper_status, 'r') as power_status:
if int(power_status.read()) == 0 :
return False
else:
status = 1
except IOError:
return True
return status == 1
def get_psu_presence(self, index):
if index is None:
return False
Base_bus_number = 39
status = 0
try:
p = os.popen(self.psu_presence.format(index + Base_bus_number)+ "> /dev/null 2>&1")
if p.readline() != None:
status = 1
p.close()
except IOError:
return False
return status == 1

View File

@ -0,0 +1,187 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import time
import os
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 = 53
PORTS_IN_BLOCK = 32
EEPROM_OFFSET = 20
_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 __init__(self):
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
for x in range(0, self.port_end + 1):
self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET)
SfpUtilBase.__init__(self)
def get_presence(self, port_name):
#modify by zhw to get sfp presence
# Check for invalid port_num
port_num = int(port_name[8:])
if port_num < (self.port_start+1) or port_num > (self.port_end+1):
return False
#cpld info from "CPLD Register for es5800A2.2(V1.1)"
cpld_map = {0: '0x82', 1: '0x83', 2: '0x84', 3: '0x85', 4: '0x86', 5: '0x87', 6: '0x8E'}
cpld_key = (port_num - 1)/8
cpld_mask = (1 << (port_num - 1)%8)
#use i2cget cmd to get cpld data
output = os.popen('i2cdetect -l | grep CP')
bus_num = output.read()[4]
cmd = "i2cget -y "+bus_num+" 0x5 "+cpld_map[cpld_key]
tmp = os.popen(cmd).read().replace("\n", "")
cpld_value = int(tmp, 16)
if cpld_value & cpld_mask == 0:
return True
else:
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
try:
reg_file = open("/sys/devices/platform/dell-s6000-cpld.0/qsfp_lpmode")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
content = reg_file.readline().rstrip()
# content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# LPMode is active high
if reg_value & mask == 0:
return False
'''
return False
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
try:
reg_file = open("/sys/devices/platform/dell-s6000-cpld.0/qsfp_lpmode", "r+")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
content = reg_file.readline().rstrip()
# content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# 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
content = hex(reg_value)
reg_file.seek(0)
reg_file.write(content)
reg_file.close()
return True
def reset(self, port_num):
QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/dell-s6000-cpld.0/qsfp_reset"
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
try:
reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "r+")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
content = reg_file.readline().rstrip()
# File content is a string containing the hex representation of the register
reg_value = int(content, 16)
# Mask off the bit corresponding to our port
mask = (1 << port_num)
# ResetL is active low
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
reg_file.seek(0)
reg_file.write(hex(reg_value))
reg_file.close()
# Sleep 1 second to allow it to settle
time.sleep(1)
# Flip the bit back high and write back to the register to take port out of reset
try:
reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "w")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
reg_value = reg_value | mask
reg_file.seek(0)
reg_file.write(hex(reg_value))
reg_file.close()
return True
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

View File

@ -1 +0,0 @@
OSW1800-48x6q t1

View File

@ -1 +0,0 @@
CONSOLE_SPEED=115200

View File

@ -25,10 +25,7 @@ elif [ "$platform" == "cavium" ]; then
elif [ "$platform" == "nephos" ]; then elif [ "$platform" == "nephos" ]; then
ORCHAGENT_ARGS+="-m $MAC_ADDRESS" ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
elif [ "$platform" == "centec" ]; then elif [ "$platform" == "centec" ]; then
last_byte=$(python -c "print '$MAC_ADDRESS'[-2:]") ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
aligned_last_byte=$(python -c "print format(int(int('$last_byte', 16) + 1), '02x')") # put mask and take away the 0x prefix
ALIGNED_MAC_ADDRESS=$(python -c "print '$MAC_ADDRESS'[:-2] + '$aligned_last_byte'") # put aligned byte into the end of MAC
ORCHAGENT_ARGS+="-m $ALIGNED_MAC_ADDRESS"
elif [ "$platform" == "barefoot" ]; then elif [ "$platform" == "barefoot" ]; then
ORCHAGENT_ARGS+="-m $MAC_ADDRESS" ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
elif [ "$platform" == "vs" ]; then elif [ "$platform" == "vs" ]; then

View File

@ -2,6 +2,6 @@
DOCKER_PTF_CENTEC = docker-ptf-centec.gz DOCKER_PTF_CENTEC = docker-ptf-centec.gz
$(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift $(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT_CENTEC) $(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF) $(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC) SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC)

View File

@ -17,7 +17,7 @@ SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC)
endif endif
$(DOCKER_SYNCD_CENTEC_RPC)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_CENTEC_RPC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += --net=host --privileged -t $(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd $(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SYNCD_CENTEC_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

View File

@ -10,14 +10,14 @@ $(DOCKER_SYNCD_CENTEC)_DEPENDS += $(SYNCD_DBG) \
$(LIBSAIMETADATA_DBG) \ $(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG) $(LIBSAIREDIS_DBG)
endif endif
$(DOCKER_SYNCD_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) $(DOCKER_SYNCD_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC)
ifneq ($(ENABLE_SYNCD_RPC),y) ifneq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC)
endif endif
$(DOCKER_SYNCD_CENTEC)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_CENTEC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += --net=host --privileged -t $(DOCKER_SYNCD_CENTEC)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

View File

@ -1,4 +1,4 @@
FROM docker-config-engine FROM docker-config-engine-stretch
ARG docker_container_name ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
@ -20,7 +20,7 @@ debs/{{ deb }}{{' '}}
{%- endfor %} {%- endfor %}
## TODO: add kmod into Depends ## TODO: add kmod into Depends
RUN apt-get install -f kmod RUN apt-get install -yf kmod
COPY ["start.sh", "/usr/bin/"] COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

View File

@ -5,7 +5,8 @@ $(SONIC_ONE_IMAGE)_MACHINE = centec
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS = $(SYSTEMD_SONIC_GENERATOR) $(SONIC_ONE_IMAGE)_INSTALLS = $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(CENTEC_E582_48X6Q_PLATFORM_MODULE) \ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(CENTEC_E582_48X6Q_PLATFORM_MODULE) \
$(CENTEC_E582_48X2Q4Z_PLATFORM_MODULE) $(CENTEC_E582_48X2Q4Z_PLATFORM_MODULE) \
$(EMBEDWAY_ES6220_PLATFORM_MODULE)
ifeq ($(INSTALL_DEBUG_TOOLS),y) ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))

View File

@ -0,0 +1,13 @@
# embedway es6220 Platform modules
EMBEDWAY_ES6220_PLATFORM_MODULE_VERSION =1.1
export EMBEDWAY_ES6220_PLATFORM_MODULE_VERSION
EMBEDWAY_ES6220_PLATFORM_MODULE = platform-modules-embedway-es6220_$(EMBEDWAY_ES6220_PLATFORM_MODULE_VERSION)_amd64.deb
$(EMBEDWAY_ES6220_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-embedway
$(EMBEDWAY_ES6220_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(EMBEDWAY_ES6220_PLATFORM_MODULE)_PLATFORM = x86_64-ew_es6220_x48q2h4-r0
SONIC_STRETCH_DEBS += $(EMBEDWAY_ES6220_PLATFORM_MODULE)
SONIC_DPKG_DEBS += $(EMBEDWAY_ES6220_PLATFORM_MODULE)

View File

@ -1,4 +1,5 @@
include $(PLATFORM_PATH)/platform-modules-centec-e582.mk include $(PLATFORM_PATH)/platform-modules-centec-e582.mk
include $(PLATFORM_PATH)/platform-modules-embedway.mk
include $(PLATFORM_PATH)/sdk.mk include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/docker-syncd-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
@ -7,7 +8,6 @@ include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-centec.mk include $(PLATFORM_PATH)/docker-ptf-centec.mk
SONIC_ALL += $(SONIC_ONE_IMAGE) \ SONIC_ALL += $(SONIC_ONE_IMAGE) \
$(DOCKER_PTF_CENTEC) \
$(DOCKER_SYNCD_CENTEC_RPC) $(DOCKER_SYNCD_CENTEC_RPC)
# Inject centec sai into sairedis # Inject centec sai into sairedis

View File

@ -1,5 +1,5 @@
# Centec SAI # Centec SAI
CENTEC_SAI = libsai_1.3.3_amd64.deb CENTEC_SAI = libsai_1.5.1_amd64.deb
$(CENTEC_SAI)_URL = https://github.com/CentecNetworks/goldengate-sai/raw/master/lib/SONiC_1.3.3/libsai_1.3.3-1.0_amd64.deb $(CENTEC_SAI)_URL = https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/libsai_1.5.1-1.0_amd64.deb
SONIC_ONLINE_DEBS += $(CENTEC_SAI) SONIC_ONLINE_DEBS += $(CENTEC_SAI)

View File

@ -1,302 +0,0 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": 65100,
"deployment_id": null,
"hostname": "switch1",
"type": "LeafRouter",
"hwsku": "E582-48x6q"
}
},
"BGP_PEER_RANGE": {},
"VLAN": {},
"PORT": {
"Ethernet1": {
"alias": "eth-0-1",
"speed": "1000",
"mtu": "9100"
},
"Ethernet2": {
"alias": "eth-0-2",
"speed": "1000",
"mtu": "9100"
},
"Ethernet3": {
"alias": "eth-0-3",
"speed": "1000",
"mtu": "9100"
},
"Ethernet4": {
"alias": "eth-0-4",
"speed": "1000",
"mtu": "9100"
},
"Ethernet5": {
"alias": "eth-0-5",
"speed": "1000",
"mtu": "9100"
},
"Ethernet6": {
"alias": "eth-0-6",
"speed": "1000",
"mtu": "9100"
},
"Ethernet7": {
"alias": "eth-0-7",
"speed": "1000",
"mtu": "9100"
},
"Ethernet8": {
"alias": "eth-0-8",
"speed": "1000",
"mtu": "9100"
},
"Ethernet9": {
"alias": "eth-0-9",
"speed": "1000",
"mtu": "9100"
},
"Ethernet10": {
"alias": "eth-0-10",
"speed": "1000",
"mtu": "9100"
},
"Ethernet11": {
"alias": "eth-0-11",
"speed": "1000",
"mtu": "9100"
},
"Ethernet12": {
"alias": "eth-0-12",
"speed": "1000",
"mtu": "9100"
},
"Ethernet13": {
"alias": "eth-0-13",
"speed": "10000",
"mtu": "9100"
},
"Ethernet14": {
"alias": "eth-0-14",
"speed": "10000",
"mtu": "9100"
},
"Ethernet15": {
"alias": "eth-0-15",
"speed": "10000",
"mtu": "9100"
},
"Ethernet16": {
"alias": "eth-0-16",
"speed": "10000",
"mtu": "9100"
},
"Ethernet17": {
"alias": "eth-0-17",
"speed": "10000",
"mtu": "9100"
},
"Ethernet18": {
"alias": "eth-0-18",
"speed": "10000",
"mtu": "9100"
},
"Ethernet19": {
"alias": "eth-0-19",
"speed": "10000",
"mtu": "9100"
},
"Ethernet20": {
"alias": "eth-0-20",
"speed": "10000",
"mtu": "9100"
},
"Ethernet21": {
"alias": "eth-0-21",
"speed": "10000",
"mtu": "9100"
},
"Ethernet22": {
"alias": "eth-0-22",
"speed": "10000",
"mtu": "9100"
},
"Ethernet23": {
"alias": "eth-0-23",
"speed": "10000",
"mtu": "9100"
},
"Ethernet24": {
"alias": "eth-0-24",
"speed": "10000",
"mtu": "9100"
},
"Ethernet25": {
"alias": "eth-0-25",
"speed": "10000",
"mtu": "9100"
},
"Ethernet26": {
"alias": "eth-0-26",
"speed": "10000",
"mtu": "9100"
},
"Ethernet27": {
"alias": "eth-0-27",
"speed": "10000",
"mtu": "9100"
},
"Ethernet28": {
"alias": "eth-0-28",
"speed": "10000",
"mtu": "9100"
},
"Ethernet29": {
"alias": "eth-0-29",
"speed": "10000",
"mtu": "9100"
},
"Ethernet30": {
"alias": "eth-0-30",
"speed": "10000",
"mtu": "9100"
},
"Ethernet31": {
"alias": "eth-0-31",
"speed": "10000",
"mtu": "9100"
},
"Ethernet32": {
"alias": "eth-0-32",
"speed": "10000",
"mtu": "9100"
},
"Ethernet33": {
"alias": "eth-0-33",
"speed": "10000",
"mtu": "9100"
},
"Ethernet34": {
"alias": "eth-0-34",
"speed": "10000",
"mtu": "9100"
},
"Ethernet35": {
"alias": "eth-0-35",
"speed": "10000",
"mtu": "9100"
},
"Ethernet36": {
"alias": "eth-0-36",
"speed": "10000",
"mtu": "9100"
},
"Ethernet37": {
"alias": "eth-0-37",
"speed": "10000",
"mtu": "9100"
},
"Ethernet38": {
"alias": "eth-0-38",
"speed": "10000",
"mtu": "9100"
},
"Ethernet39": {
"alias": "eth-0-39",
"speed": "10000",
"mtu": "9100"
},
"Ethernet40": {
"alias": "eth-0-40",
"speed": "10000",
"mtu": "9100"
},
"Ethernet41": {
"alias": "eth-0-41",
"speed": "10000",
"mtu": "9100"
},
"Ethernet42": {
"alias": "eth-0-42",
"speed": "10000",
"mtu": "9100"
},
"Ethernet43": {
"alias": "eth-0-43",
"speed": "10000",
"mtu": "9100"
},
"Ethernet44": {
"alias": "eth-0-44",
"speed": "10000",
"mtu": "9100"
},
"Ethernet45": {
"alias": "eth-0-45",
"speed": "10000",
"mtu": "9100"
},
"Ethernet46": {
"alias": "eth-0-46",
"speed": "10000",
"mtu": "9100"
},
"Ethernet47": {
"alias": "eth-0-47",
"speed": "10000",
"mtu": "9100"
},
"Ethernet48": {
"alias": "eth-0-48",
"speed": "10000",
"mtu": "9100"
},
"Ethernet49": {
"alias": "eth-0-49",
"speed": "40000",
"mtu": "9100"
},
"Ethernet50": {
"alias": "eth-0-50",
"speed": "40000",
"mtu": "9100"
},
"Ethernet51": {
"alias": "eth-0-51",
"speed": "100000",
"mtu": "9100"
},
"Ethernet52": {
"alias": "eth-0-52",
"speed": "100000",
"mtu": "9100"
},
"Ethernet53": {
"alias": "eth-0-53",
"speed": "100000",
"mtu": "9100"
},
"Ethernet54": {
"alias": "eth-0-54",
"speed": "100000",
"mtu": "9100"
}
},
"SYSLOG_SERVER": {},
"VLAN_INTERFACE": {},
"PORTCHANNEL_INTERFACE": {},
"PORTCHANNEL": {},
"MGMT_INTERFACE": {},
"DHCP_SERVER": {},
"LOOPBACK_INTERFACE": {
"Loopback0|127.0.0.1/8": {}
},
"ACL_TABLE": {},
"INTERFACE": {
"Ethernet1|192.168.1.1/24": {},
"Ethernet2|192.168.2.1/24": {},
"Ethernet3|192.168.3.1/24": {},
"Ethernet4|192.168.4.1/24": {}
}
}

View File

@ -1,610 +0,0 @@
{
"QUEUE": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|0-2": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSY]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|3-4": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
"scheduler": "[SCHEDULER|scheduler.0]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|5-7": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSY]"
}
},
"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"red_max_threshold": "32760",
"yellow_max_threshold": "32760",
"green_min_threshold": "4095",
"red_min_threshold": "4095",
"yellow_min_threshold": "4095",
"green_max_threshold": "32760",
"wred_yellow_enable": "true",
"wred_green_enable": "true"
},
"AZURE_LOSSY": {
"red_max_threshold": "32760",
"yellow_max_threshold": "32760",
"green_min_threshold": "4095",
"red_min_threshold": "4095",
"yellow_min_threshold": "4095",
"green_max_threshold": "32760",
"wred_yellow_enable": "true",
"wred_green_enable": "true"
}
},
"DSCP_TO_TC_MAP": {
"AZURE": {
"56": "7",
"54": "6",
"28": "3",
"48": "6",
"29": "3",
"60": "7",
"61": "7",
"62": "7",
"63": "7",
"49": "6",
"34": "4",
"24": "3",
"25": "3",
"26": "3",
"27": "3",
"20": "2",
"21": "2",
"22": "2",
"23": "2",
"46": "5",
"47": "5",
"44": "5",
"45": "5",
"42": "5",
"43": "5",
"40": "5",
"41": "5",
"1": "0",
"0": "0",
"3": "0",
"2": "0",
"5": "0",
"4": "0",
"7": "0",
"6": "0",
"9": "1",
"8": "1",
"35": "4",
"13": "1",
"12": "1",
"15": "1",
"58": "7",
"11": "1",
"10": "1",
"39": "4",
"38": "4",
"59": "7",
"14": "1",
"17": "2",
"16": "2",
"19": "2",
"18": "2",
"31": "3",
"30": "3",
"51": "6",
"36": "4",
"53": "6",
"52": "6",
"33": "4",
"55": "6",
"37": "4",
"32": "4",
"57": "7",
"50": "6"
}
},
"DEVICE_METADATA": {
"localhost": {
"hwsku": "E582-48x6q",
"hostname": "switch1",
"bgp_asn": "None",
"deployment_id": "None",
"type": "LeafRouter"
}
},
"PORT": {
"Ethernet1": {
"alias": "eth-0-1",
"speed": "1000",
"mtu": "9100"
},
"Ethernet2": {
"alias": "eth-0-2",
"speed": "1000",
"mtu": "9100"
},
"Ethernet3": {
"alias": "eth-0-3",
"speed": "1000",
"mtu": "9100"
},
"Ethernet4": {
"alias": "eth-0-4",
"speed": "1000",
"mtu": "9100"
},
"Ethernet5": {
"alias": "eth-0-5",
"speed": "1000",
"mtu": "9100"
},
"Ethernet6": {
"alias": "eth-0-6",
"speed": "1000",
"mtu": "9100"
},
"Ethernet7": {
"alias": "eth-0-7",
"speed": "1000",
"mtu": "9100"
},
"Ethernet8": {
"alias": "eth-0-8",
"speed": "1000",
"mtu": "9100"
},
"Ethernet9": {
"alias": "eth-0-9",
"speed": "1000",
"mtu": "9100"
},
"Ethernet10": {
"alias": "eth-0-10",
"speed": "1000",
"mtu": "9100"
},
"Ethernet11": {
"alias": "eth-0-11",
"speed": "1000",
"mtu": "9100"
},
"Ethernet12": {
"alias": "eth-0-12",
"speed": "1000",
"mtu": "9100"
},
"Ethernet13": {
"alias": "eth-0-13",
"speed": "10000",
"mtu": "9100"
},
"Ethernet14": {
"alias": "eth-0-14",
"speed": "10000",
"mtu": "9100"
},
"Ethernet15": {
"alias": "eth-0-15",
"speed": "10000",
"mtu": "9100"
},
"Ethernet16": {
"alias": "eth-0-16",
"speed": "10000",
"mtu": "9100"
},
"Ethernet17": {
"alias": "eth-0-17",
"speed": "10000",
"mtu": "9100"
},
"Ethernet18": {
"alias": "eth-0-18",
"speed": "10000",
"mtu": "9100"
},
"Ethernet19": {
"alias": "eth-0-19",
"speed": "10000",
"mtu": "9100"
},
"Ethernet20": {
"alias": "eth-0-20",
"speed": "10000",
"mtu": "9100"
},
"Ethernet21": {
"alias": "eth-0-21",
"speed": "10000",
"mtu": "9100"
},
"Ethernet22": {
"alias": "eth-0-22",
"speed": "10000",
"mtu": "9100"
},
"Ethernet23": {
"alias": "eth-0-23",
"speed": "10000",
"mtu": "9100"
},
"Ethernet24": {
"alias": "eth-0-24",
"speed": "10000",
"mtu": "9100"
},
"Ethernet25": {
"alias": "eth-0-25",
"speed": "10000",
"mtu": "9100"
},
"Ethernet26": {
"alias": "eth-0-26",
"speed": "10000",
"mtu": "9100"
},
"Ethernet27": {
"alias": "eth-0-27",
"speed": "10000",
"mtu": "9100"
},
"Ethernet28": {
"alias": "eth-0-28",
"speed": "10000",
"mtu": "9100"
},
"Ethernet29": {
"alias": "eth-0-29",
"speed": "10000",
"mtu": "9100"
},
"Ethernet30": {
"alias": "eth-0-30",
"speed": "10000",
"mtu": "9100"
},
"Ethernet31": {
"alias": "eth-0-31",
"speed": "10000",
"mtu": "9100"
},
"Ethernet32": {
"alias": "eth-0-32",
"speed": "10000",
"mtu": "9100"
},
"Ethernet33": {
"alias": "eth-0-33",
"speed": "10000",
"mtu": "9100"
},
"Ethernet34": {
"alias": "eth-0-34",
"speed": "10000",
"mtu": "9100"
},
"Ethernet35": {
"alias": "eth-0-35",
"speed": "10000",
"mtu": "9100"
},
"Ethernet36": {
"alias": "eth-0-36",
"speed": "10000",
"mtu": "9100"
},
"Ethernet37": {
"alias": "eth-0-37",
"speed": "10000",
"mtu": "9100"
},
"Ethernet38": {
"alias": "eth-0-38",
"speed": "10000",
"mtu": "9100"
},
"Ethernet39": {
"alias": "eth-0-39",
"speed": "10000",
"mtu": "9100"
},
"Ethernet40": {
"alias": "eth-0-40",
"speed": "10000",
"mtu": "9100"
},
"Ethernet41": {
"alias": "eth-0-41",
"speed": "10000",
"mtu": "9100"
},
"Ethernet42": {
"alias": "eth-0-42",
"speed": "10000",
"mtu": "9100"
},
"Ethernet43": {
"alias": "eth-0-43",
"speed": "10000",
"mtu": "9100"
},
"Ethernet44": {
"alias": "eth-0-44",
"speed": "10000",
"mtu": "9100"
},
"Ethernet45": {
"alias": "eth-0-45",
"speed": "10000",
"mtu": "9100"
},
"Ethernet46": {
"alias": "eth-0-46",
"speed": "10000",
"mtu": "9100"
},
"Ethernet47": {
"alias": "eth-0-47",
"speed": "10000",
"mtu": "9100"
},
"Ethernet48": {
"alias": "eth-0-48",
"speed": "10000",
"mtu": "9100"
},
"Ethernet49": {
"alias": "eth-0-49",
"speed": "40000",
"mtu": "9100"
},
"Ethernet50": {
"alias": "eth-0-50",
"speed": "40000",
"mtu": "9100"
},
"Ethernet51": {
"alias": "eth-0-51",
"speed": "100000",
"mtu": "9100"
},
"Ethernet52": {
"alias": "eth-0-52",
"speed": "100000",
"mtu": "9100"
},
"Ethernet53": {
"alias": "eth-0-53",
"speed": "100000",
"mtu": "9100"
},
"Ethernet54": {
"alias": "eth-0-54",
"speed": "100000",
"mtu": "9100"
}
},
"PORT_QOS_MAP": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54": {
"pfc_enable": "3,4",
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]"
}
},
"SCHEDULER": {
"scheduler.0": {
"type": "DWRR",
"weight": "25"
},
"scheduler.1": {
"type": "DWRR",
"weight": "30"
},
"scheduler.2": {
"type": "DWRR",
"weight": "20"
}
},
"VLAN": {
"Vlan500": {
"dhcp_servers": [
"192.168.5.1",
"192.168.5.2",
"192.168.5.3",
"192.168.5.4"
],
"members": [
"Ethernet5",
"Ethernet6",
"Ethernet7",
"Ethernet8"
],
"vlanid": "500"
},
"Vlan600": {
"dhcp_servers": [
"192.168.6.1",
"192.168.6.2",
"192.168.6.3",
"192.168.6.4"
],
"members": [
"Ethernet5",
"Ethernet6"
],
"vlanid": "600"
},
"Vlan700": {
"dhcp_servers": [
"192.168.7.1",
"192.168.7.2",
"192.168.7.3",
"192.168.7.4"
],
"members": [
"Ethernet5",
"Ethernet7"
],
"vlanid": "700"
},
"Vlan800": {
"dhcp_servers": [
"192.168.8.1",
"192.168.8.2",
"192.168.8.3",
"192.168.8.4"
],
"members": [
"Ethernet5",
"Ethernet8"
],
"vlanid": "800"
}
},
"VLAN_MEMBER": {
"Vlan500|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan500|Ethernet6": {
"tagging_mode": "untagged"
},
"Vlan500|Ethernet7": {
"tagging_mode": "untagged"
},
"Vlan500|Ethernet8": {
"tagging_mode": "untagged"
},
"Vlan600|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan600|Ethernet6": {
"tagging_mode": "tagged"
},
"Vlan700|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan700|Ethernet7": {
"tagging_mode": "tagged"
},
"Vlan800|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan800|Ethernet8": {
"tagging_mode": "tagged"
}
},
"INTERFACE": {
"Ethernet1|192.168.1.1/24": {},
"Ethernet2|192.168.2.1/24": {},
"Ethernet3|192.168.3.1/24": {},
"Ethernet4|192.168.4.1/24": {}
},
"VLAN_INTERFACE": {
"Vlan500|192.168.5.1/24": {},
"Vlan600|192.168.6.1/24": {},
"Vlan700|192.168.7.1/24": {},
"Vlan800|192.168.8.1/24": {}
},
"LOOPBACK_INTERFACE": {
"Loopback0|127.0.0.1/8": {}
},
"CABLE_LENGTH": {
"AZURE": {
"Ethernet8": "40m",
"Ethernet9": "40m",
"Ethernet2": "40m",
"Ethernet3": "40m",
"Ethernet1": "40m",
"Ethernet6": "40m",
"Ethernet7": "40m",
"Ethernet4": "40m",
"Ethernet5": "40m",
"Ethernet22": "40m",
"Ethernet50": "40m",
"Ethernet51": "40m",
"Ethernet52": "40m",
"Ethernet53": "40m",
"Ethernet54": "40m",
"Ethernet38": "40m",
"Ethernet39": "40m",
"Ethernet18": "40m",
"Ethernet19": "40m",
"Ethernet14": "40m",
"Ethernet15": "40m",
"Ethernet16": "40m",
"Ethernet17": "40m",
"Ethernet10": "40m",
"Ethernet11": "40m",
"Ethernet12": "40m",
"Ethernet35": "40m",
"Ethernet37": "40m",
"Ethernet32": "40m",
"Ethernet33": "40m",
"Ethernet30": "40m",
"Ethernet31": "40m",
"Ethernet49": "40m",
"Ethernet48": "40m",
"Ethernet47": "40m",
"Ethernet36": "40m",
"Ethernet45": "40m",
"Ethernet44": "40m",
"Ethernet43": "40m",
"Ethernet42": "40m",
"Ethernet41": "40m",
"Ethernet40": "40m",
"Ethernet29": "40m",
"Ethernet28": "40m",
"Ethernet34": "40m",
"Ethernet46": "40m",
"Ethernet21": "40m",
"Ethernet20": "40m",
"Ethernet23": "40m",
"Ethernet13": "40m",
"Ethernet25": "40m",
"Ethernet24": "40m",
"Ethernet27": "40m",
"Ethernet26": "40m"
}
},
"CRM": {
"Config": {
"acl_table_threshold_type": "percentage",
"nexthop_group_threshold_type": "percentage",
"fdb_entry_high_threshold": "85",
"acl_entry_threshold_type": "percentage",
"ipv6_neighbor_low_threshold": "70",
"nexthop_group_member_low_threshold": "70",
"acl_group_high_threshold": "85",
"ipv4_route_high_threshold": "85",
"acl_counter_high_threshold": "85",
"ipv4_route_low_threshold": "70",
"ipv4_route_threshold_type": "percentage",
"ipv4_neighbor_low_threshold": "70",
"acl_group_threshold_type": "percentage",
"ipv4_nexthop_high_threshold": "85",
"ipv6_route_threshold_type": "percentage",
"nexthop_group_low_threshold": "70",
"ipv4_neighbor_high_threshold": "85",
"ipv6_route_high_threshold": "85",
"ipv6_nexthop_threshold_type": "percentage",
"polling_interval": "300",
"ipv4_nexthop_threshold_type": "percentage",
"acl_group_low_threshold": "70",
"acl_entry_low_threshold": "70",
"nexthop_group_member_threshold_type": "percentage",
"ipv4_nexthop_low_threshold": "70",
"acl_counter_threshold_type": "percentage",
"ipv6_neighbor_high_threshold": "85",
"nexthop_group_member_high_threshold": "85",
"acl_table_low_threshold": "70",
"fdb_entry_threshold_type": "percentage",
"ipv6_neighbor_threshold_type": "percentage",
"acl_table_high_threshold": "85",
"ipv6_nexthop_low_threshold": "70",
"acl_counter_low_threshold": "70",
"ipv4_neighbor_threshold_type": "percentage",
"nexthop_group_high_threshold": "85",
"ipv6_route_low_threshold": "70",
"acl_entry_high_threshold": "85",
"fdb_entry_low_threshold": "70",
"ipv6_nexthop_high_threshold": "85"
}
}
}

View File

@ -1249,7 +1249,7 @@ static ssize_t e582_48x2q4z_sfp_write_enable(struct device *dev, struct device_a
} }
else if ((portNum >= 41) && (portNum <= 48)) else if ((portNum >= 41) && (portNum <= 48))
{ {
reg_no = portNum - 17;/*8-13*/ reg_no = portNum - 33;/*8-13*/
i2c_sfp_client = i2c_client_gpio3; i2c_sfp_client = i2c_client_gpio3;
} }
else if ((portNum >= 49) && (portNum <= 54)) else if ((portNum >= 49) && (portNum <= 54))

View File

@ -58,7 +58,7 @@ if [ "$1" == "init" ]; then
i2cset -y 17 0x22 0x1a 0xff i2cset -y 17 0x22 0x1a 0xff
i2cset -y 17 0x22 0x1b 0x0 i2cset -y 17 0x22 0x1b 0x0
i2cset -y 17 0x22 0x1c 0xff i2cset -y 17 0x22 0x1c 0xff
i2cset -y 17 0x22 0x9 0x0 i2cset -y 17 0x22 0x9 0xf0
i2cset -y 17 0x22 0xb 0x0c i2cset -y 17 0x22 0xb 0x0c
#start platform monitor #start platform monitor

View File

@ -1,302 +0,0 @@
{
"DEVICE_METADATA": {
"localhost": {
"bgp_asn": 65100,
"deployment_id": null,
"hostname": "switch1",
"type": "LeafRouter",
"hwsku": "E582-48x6q"
}
},
"BGP_PEER_RANGE": {},
"VLAN": {},
"PORT": {
"Ethernet1": {
"alias": "eth-0-1",
"speed": "1000",
"mtu": "9100"
},
"Ethernet2": {
"alias": "eth-0-2",
"speed": "1000",
"mtu": "9100"
},
"Ethernet3": {
"alias": "eth-0-3",
"speed": "1000",
"mtu": "9100"
},
"Ethernet4": {
"alias": "eth-0-4",
"speed": "1000",
"mtu": "9100"
},
"Ethernet5": {
"alias": "eth-0-5",
"speed": "1000",
"mtu": "9100"
},
"Ethernet6": {
"alias": "eth-0-6",
"speed": "1000",
"mtu": "9100"
},
"Ethernet7": {
"alias": "eth-0-7",
"speed": "1000",
"mtu": "9100"
},
"Ethernet8": {
"alias": "eth-0-8",
"speed": "1000",
"mtu": "9100"
},
"Ethernet9": {
"alias": "eth-0-9",
"speed": "1000",
"mtu": "9100"
},
"Ethernet10": {
"alias": "eth-0-10",
"speed": "1000",
"mtu": "9100"
},
"Ethernet11": {
"alias": "eth-0-11",
"speed": "1000",
"mtu": "9100"
},
"Ethernet12": {
"alias": "eth-0-12",
"speed": "1000",
"mtu": "9100"
},
"Ethernet13": {
"alias": "eth-0-13",
"speed": "10000",
"mtu": "9100"
},
"Ethernet14": {
"alias": "eth-0-14",
"speed": "10000",
"mtu": "9100"
},
"Ethernet15": {
"alias": "eth-0-15",
"speed": "10000",
"mtu": "9100"
},
"Ethernet16": {
"alias": "eth-0-16",
"speed": "10000",
"mtu": "9100"
},
"Ethernet17": {
"alias": "eth-0-17",
"speed": "10000",
"mtu": "9100"
},
"Ethernet18": {
"alias": "eth-0-18",
"speed": "10000",
"mtu": "9100"
},
"Ethernet19": {
"alias": "eth-0-19",
"speed": "10000",
"mtu": "9100"
},
"Ethernet20": {
"alias": "eth-0-20",
"speed": "10000",
"mtu": "9100"
},
"Ethernet21": {
"alias": "eth-0-21",
"speed": "10000",
"mtu": "9100"
},
"Ethernet22": {
"alias": "eth-0-22",
"speed": "10000",
"mtu": "9100"
},
"Ethernet23": {
"alias": "eth-0-23",
"speed": "10000",
"mtu": "9100"
},
"Ethernet24": {
"alias": "eth-0-24",
"speed": "10000",
"mtu": "9100"
},
"Ethernet25": {
"alias": "eth-0-25",
"speed": "10000",
"mtu": "9100"
},
"Ethernet26": {
"alias": "eth-0-26",
"speed": "10000",
"mtu": "9100"
},
"Ethernet27": {
"alias": "eth-0-27",
"speed": "10000",
"mtu": "9100"
},
"Ethernet28": {
"alias": "eth-0-28",
"speed": "10000",
"mtu": "9100"
},
"Ethernet29": {
"alias": "eth-0-29",
"speed": "10000",
"mtu": "9100"
},
"Ethernet30": {
"alias": "eth-0-30",
"speed": "10000",
"mtu": "9100"
},
"Ethernet31": {
"alias": "eth-0-31",
"speed": "10000",
"mtu": "9100"
},
"Ethernet32": {
"alias": "eth-0-32",
"speed": "10000",
"mtu": "9100"
},
"Ethernet33": {
"alias": "eth-0-33",
"speed": "10000",
"mtu": "9100"
},
"Ethernet34": {
"alias": "eth-0-34",
"speed": "10000",
"mtu": "9100"
},
"Ethernet35": {
"alias": "eth-0-35",
"speed": "10000",
"mtu": "9100"
},
"Ethernet36": {
"alias": "eth-0-36",
"speed": "10000",
"mtu": "9100"
},
"Ethernet37": {
"alias": "eth-0-37",
"speed": "10000",
"mtu": "9100"
},
"Ethernet38": {
"alias": "eth-0-38",
"speed": "10000",
"mtu": "9100"
},
"Ethernet39": {
"alias": "eth-0-39",
"speed": "10000",
"mtu": "9100"
},
"Ethernet40": {
"alias": "eth-0-40",
"speed": "10000",
"mtu": "9100"
},
"Ethernet41": {
"alias": "eth-0-41",
"speed": "10000",
"mtu": "9100"
},
"Ethernet42": {
"alias": "eth-0-42",
"speed": "10000",
"mtu": "9100"
},
"Ethernet43": {
"alias": "eth-0-43",
"speed": "10000",
"mtu": "9100"
},
"Ethernet44": {
"alias": "eth-0-44",
"speed": "10000",
"mtu": "9100"
},
"Ethernet45": {
"alias": "eth-0-45",
"speed": "10000",
"mtu": "9100"
},
"Ethernet46": {
"alias": "eth-0-46",
"speed": "10000",
"mtu": "9100"
},
"Ethernet47": {
"alias": "eth-0-47",
"speed": "10000",
"mtu": "9100"
},
"Ethernet48": {
"alias": "eth-0-48",
"speed": "10000",
"mtu": "9100"
},
"Ethernet49": {
"alias": "eth-0-49",
"speed": "40000",
"mtu": "9100"
},
"Ethernet50": {
"alias": "eth-0-50",
"speed": "40000",
"mtu": "9100"
},
"Ethernet51": {
"alias": "eth-0-51",
"speed": "40000",
"mtu": "9100"
},
"Ethernet52": {
"alias": "eth-0-52",
"speed": "40000",
"mtu": "9100"
},
"Ethernet53": {
"alias": "eth-0-53",
"speed": "40000",
"mtu": "9100"
},
"Ethernet54": {
"alias": "eth-0-54",
"speed": "40000",
"mtu": "9100"
}
},
"SYSLOG_SERVER": {},
"VLAN_INTERFACE": {},
"PORTCHANNEL_INTERFACE": {},
"PORTCHANNEL": {},
"MGMT_INTERFACE": {},
"DHCP_SERVER": {},
"LOOPBACK_INTERFACE": {
"Loopback0|127.0.0.1/8": {}
},
"ACL_TABLE": {},
"INTERFACE": {
"Ethernet1|192.168.1.1/24": {},
"Ethernet2|192.168.2.1/24": {},
"Ethernet3|192.168.3.1/24": {},
"Ethernet4|192.168.4.1/24": {}
}
}

View File

@ -1,610 +0,0 @@
{
"QUEUE": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|0-2": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSY]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|3-4": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
"scheduler": "[SCHEDULER|scheduler.0]"
},
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54|5-7": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSY]"
}
},
"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"red_max_threshold": "32760",
"yellow_max_threshold": "32760",
"green_min_threshold": "4095",
"red_min_threshold": "4095",
"yellow_min_threshold": "4095",
"green_max_threshold": "32760",
"wred_yellow_enable": "true",
"wred_green_enable": "true"
},
"AZURE_LOSSY": {
"red_max_threshold": "32760",
"yellow_max_threshold": "32760",
"green_min_threshold": "4095",
"red_min_threshold": "4095",
"yellow_min_threshold": "4095",
"green_max_threshold": "32760",
"wred_yellow_enable": "true",
"wred_green_enable": "true"
}
},
"DSCP_TO_TC_MAP": {
"AZURE": {
"56": "7",
"54": "6",
"28": "3",
"48": "6",
"29": "3",
"60": "7",
"61": "7",
"62": "7",
"63": "7",
"49": "6",
"34": "4",
"24": "3",
"25": "3",
"26": "3",
"27": "3",
"20": "2",
"21": "2",
"22": "2",
"23": "2",
"46": "5",
"47": "5",
"44": "5",
"45": "5",
"42": "5",
"43": "5",
"40": "5",
"41": "5",
"1": "0",
"0": "0",
"3": "0",
"2": "0",
"5": "0",
"4": "0",
"7": "0",
"6": "0",
"9": "1",
"8": "1",
"35": "4",
"13": "1",
"12": "1",
"15": "1",
"58": "7",
"11": "1",
"10": "1",
"39": "4",
"38": "4",
"59": "7",
"14": "1",
"17": "2",
"16": "2",
"19": "2",
"18": "2",
"31": "3",
"30": "3",
"51": "6",
"36": "4",
"53": "6",
"52": "6",
"33": "4",
"55": "6",
"37": "4",
"32": "4",
"57": "7",
"50": "6"
}
},
"DEVICE_METADATA": {
"localhost": {
"hwsku": "E582-48x6q",
"hostname": "switch1",
"bgp_asn": "None",
"deployment_id": "None",
"type": "LeafRouter"
}
},
"PORT": {
"Ethernet1": {
"alias": "eth-0-1",
"speed": "1000",
"mtu": "9100"
},
"Ethernet2": {
"alias": "eth-0-2",
"speed": "1000",
"mtu": "9100"
},
"Ethernet3": {
"alias": "eth-0-3",
"speed": "1000",
"mtu": "9100"
},
"Ethernet4": {
"alias": "eth-0-4",
"speed": "1000",
"mtu": "9100"
},
"Ethernet5": {
"alias": "eth-0-5",
"speed": "1000",
"mtu": "9100"
},
"Ethernet6": {
"alias": "eth-0-6",
"speed": "1000",
"mtu": "9100"
},
"Ethernet7": {
"alias": "eth-0-7",
"speed": "1000",
"mtu": "9100"
},
"Ethernet8": {
"alias": "eth-0-8",
"speed": "1000",
"mtu": "9100"
},
"Ethernet9": {
"alias": "eth-0-9",
"speed": "1000",
"mtu": "9100"
},
"Ethernet10": {
"alias": "eth-0-10",
"speed": "1000",
"mtu": "9100"
},
"Ethernet11": {
"alias": "eth-0-11",
"speed": "1000",
"mtu": "9100"
},
"Ethernet12": {
"alias": "eth-0-12",
"speed": "1000",
"mtu": "9100"
},
"Ethernet13": {
"alias": "eth-0-13",
"speed": "10000",
"mtu": "9100"
},
"Ethernet14": {
"alias": "eth-0-14",
"speed": "10000",
"mtu": "9100"
},
"Ethernet15": {
"alias": "eth-0-15",
"speed": "10000",
"mtu": "9100"
},
"Ethernet16": {
"alias": "eth-0-16",
"speed": "10000",
"mtu": "9100"
},
"Ethernet17": {
"alias": "eth-0-17",
"speed": "10000",
"mtu": "9100"
},
"Ethernet18": {
"alias": "eth-0-18",
"speed": "10000",
"mtu": "9100"
},
"Ethernet19": {
"alias": "eth-0-19",
"speed": "10000",
"mtu": "9100"
},
"Ethernet20": {
"alias": "eth-0-20",
"speed": "10000",
"mtu": "9100"
},
"Ethernet21": {
"alias": "eth-0-21",
"speed": "10000",
"mtu": "9100"
},
"Ethernet22": {
"alias": "eth-0-22",
"speed": "10000",
"mtu": "9100"
},
"Ethernet23": {
"alias": "eth-0-23",
"speed": "10000",
"mtu": "9100"
},
"Ethernet24": {
"alias": "eth-0-24",
"speed": "10000",
"mtu": "9100"
},
"Ethernet25": {
"alias": "eth-0-25",
"speed": "10000",
"mtu": "9100"
},
"Ethernet26": {
"alias": "eth-0-26",
"speed": "10000",
"mtu": "9100"
},
"Ethernet27": {
"alias": "eth-0-27",
"speed": "10000",
"mtu": "9100"
},
"Ethernet28": {
"alias": "eth-0-28",
"speed": "10000",
"mtu": "9100"
},
"Ethernet29": {
"alias": "eth-0-29",
"speed": "10000",
"mtu": "9100"
},
"Ethernet30": {
"alias": "eth-0-30",
"speed": "10000",
"mtu": "9100"
},
"Ethernet31": {
"alias": "eth-0-31",
"speed": "10000",
"mtu": "9100"
},
"Ethernet32": {
"alias": "eth-0-32",
"speed": "10000",
"mtu": "9100"
},
"Ethernet33": {
"alias": "eth-0-33",
"speed": "10000",
"mtu": "9100"
},
"Ethernet34": {
"alias": "eth-0-34",
"speed": "10000",
"mtu": "9100"
},
"Ethernet35": {
"alias": "eth-0-35",
"speed": "10000",
"mtu": "9100"
},
"Ethernet36": {
"alias": "eth-0-36",
"speed": "10000",
"mtu": "9100"
},
"Ethernet37": {
"alias": "eth-0-37",
"speed": "10000",
"mtu": "9100"
},
"Ethernet38": {
"alias": "eth-0-38",
"speed": "10000",
"mtu": "9100"
},
"Ethernet39": {
"alias": "eth-0-39",
"speed": "10000",
"mtu": "9100"
},
"Ethernet40": {
"alias": "eth-0-40",
"speed": "10000",
"mtu": "9100"
},
"Ethernet41": {
"alias": "eth-0-41",
"speed": "10000",
"mtu": "9100"
},
"Ethernet42": {
"alias": "eth-0-42",
"speed": "10000",
"mtu": "9100"
},
"Ethernet43": {
"alias": "eth-0-43",
"speed": "10000",
"mtu": "9100"
},
"Ethernet44": {
"alias": "eth-0-44",
"speed": "10000",
"mtu": "9100"
},
"Ethernet45": {
"alias": "eth-0-45",
"speed": "10000",
"mtu": "9100"
},
"Ethernet46": {
"alias": "eth-0-46",
"speed": "10000",
"mtu": "9100"
},
"Ethernet47": {
"alias": "eth-0-47",
"speed": "10000",
"mtu": "9100"
},
"Ethernet48": {
"alias": "eth-0-48",
"speed": "10000",
"mtu": "9100"
},
"Ethernet49": {
"alias": "eth-0-49",
"speed": "40000",
"mtu": "9100"
},
"Ethernet50": {
"alias": "eth-0-50",
"speed": "40000",
"mtu": "9100"
},
"Ethernet51": {
"alias": "eth-0-51",
"speed": "40000",
"mtu": "9100"
},
"Ethernet52": {
"alias": "eth-0-52",
"speed": "40000",
"mtu": "9100"
},
"Ethernet53": {
"alias": "eth-0-53",
"speed": "40000",
"mtu": "9100"
},
"Ethernet54": {
"alias": "eth-0-54",
"speed": "40000",
"mtu": "9100"
}
},
"PORT_QOS_MAP": {
"Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet5,Ethernet6,Ethernet7,Ethernet8,Ethernet9,Ethernet10,Ethernet11,Ethernet12,Ethernet13,Ethernet14,Ethernet15,Ethernet16,Ethernet17,Ethernet18,Ethernet19,Ethernet20,Ethernet21,Ethernet22,Ethernet23,Ethernet24,Ethernet25,Ethernet26,Ethernet27,Ethernet28,Ethernet29,Ethernet30,Ethernet31,Ethernet32,Ethernet33,Ethernet34,Ethernet35,Ethernet36,Ethernet37,Ethernet38,Ethernet39,Ethernet40,Ethernet41,Ethernet42,Ethernet43,Ethernet44,Ethernet45,Ethernet46,Ethernet47,Ethernet48,Ethernet49,Ethernet50,Ethernet51,Ethernet52,Ethernet53,Ethernet54": {
"pfc_enable": "3,4",
"dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]"
}
},
"SCHEDULER": {
"scheduler.0": {
"type": "DWRR",
"weight": "25"
},
"scheduler.1": {
"type": "DWRR",
"weight": "30"
},
"scheduler.2": {
"type": "DWRR",
"weight": "20"
}
},
"VLAN": {
"Vlan500": {
"dhcp_servers": [
"192.168.5.1",
"192.168.5.2",
"192.168.5.3",
"192.168.5.4"
],
"members": [
"Ethernet5",
"Ethernet6",
"Ethernet7",
"Ethernet8"
],
"vlanid": "500"
},
"Vlan600": {
"dhcp_servers": [
"192.168.6.1",
"192.168.6.2",
"192.168.6.3",
"192.168.6.4"
],
"members": [
"Ethernet5",
"Ethernet6"
],
"vlanid": "600"
},
"Vlan700": {
"dhcp_servers": [
"192.168.7.1",
"192.168.7.2",
"192.168.7.3",
"192.168.7.4"
],
"members": [
"Ethernet5",
"Ethernet7"
],
"vlanid": "700"
},
"Vlan800": {
"dhcp_servers": [
"192.168.8.1",
"192.168.8.2",
"192.168.8.3",
"192.168.8.4"
],
"members": [
"Ethernet5",
"Ethernet8"
],
"vlanid": "800"
}
},
"VLAN_MEMBER": {
"Vlan500|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan500|Ethernet6": {
"tagging_mode": "untagged"
},
"Vlan500|Ethernet7": {
"tagging_mode": "untagged"
},
"Vlan500|Ethernet8": {
"tagging_mode": "untagged"
},
"Vlan600|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan600|Ethernet6": {
"tagging_mode": "tagged"
},
"Vlan700|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan700|Ethernet7": {
"tagging_mode": "tagged"
},
"Vlan800|Ethernet5": {
"tagging_mode": "tagged"
},
"Vlan800|Ethernet8": {
"tagging_mode": "tagged"
}
},
"INTERFACE": {
"Ethernet1|192.168.1.1/24": {},
"Ethernet2|192.168.2.1/24": {},
"Ethernet3|192.168.3.1/24": {},
"Ethernet4|192.168.4.1/24": {}
},
"VLAN_INTERFACE": {
"Vlan500|192.168.5.1/24": {},
"Vlan600|192.168.6.1/24": {},
"Vlan700|192.168.7.1/24": {},
"Vlan800|192.168.8.1/24": {}
},
"LOOPBACK_INTERFACE": {
"Loopback0|127.0.0.1/8": {}
},
"CABLE_LENGTH": {
"AZURE": {
"Ethernet8": "40m",
"Ethernet9": "40m",
"Ethernet2": "40m",
"Ethernet3": "40m",
"Ethernet1": "40m",
"Ethernet6": "40m",
"Ethernet7": "40m",
"Ethernet4": "40m",
"Ethernet5": "40m",
"Ethernet22": "40m",
"Ethernet50": "40m",
"Ethernet51": "40m",
"Ethernet52": "40m",
"Ethernet53": "40m",
"Ethernet54": "40m",
"Ethernet38": "40m",
"Ethernet39": "40m",
"Ethernet18": "40m",
"Ethernet19": "40m",
"Ethernet14": "40m",
"Ethernet15": "40m",
"Ethernet16": "40m",
"Ethernet17": "40m",
"Ethernet10": "40m",
"Ethernet11": "40m",
"Ethernet12": "40m",
"Ethernet35": "40m",
"Ethernet37": "40m",
"Ethernet32": "40m",
"Ethernet33": "40m",
"Ethernet30": "40m",
"Ethernet31": "40m",
"Ethernet49": "40m",
"Ethernet48": "40m",
"Ethernet47": "40m",
"Ethernet36": "40m",
"Ethernet45": "40m",
"Ethernet44": "40m",
"Ethernet43": "40m",
"Ethernet42": "40m",
"Ethernet41": "40m",
"Ethernet40": "40m",
"Ethernet29": "40m",
"Ethernet28": "40m",
"Ethernet34": "40m",
"Ethernet46": "40m",
"Ethernet21": "40m",
"Ethernet20": "40m",
"Ethernet23": "40m",
"Ethernet13": "40m",
"Ethernet25": "40m",
"Ethernet24": "40m",
"Ethernet27": "40m",
"Ethernet26": "40m"
}
},
"CRM": {
"Config": {
"acl_table_threshold_type": "percentage",
"nexthop_group_threshold_type": "percentage",
"fdb_entry_high_threshold": "85",
"acl_entry_threshold_type": "percentage",
"ipv6_neighbor_low_threshold": "70",
"nexthop_group_member_low_threshold": "70",
"acl_group_high_threshold": "85",
"ipv4_route_high_threshold": "85",
"acl_counter_high_threshold": "85",
"ipv4_route_low_threshold": "70",
"ipv4_route_threshold_type": "percentage",
"ipv4_neighbor_low_threshold": "70",
"acl_group_threshold_type": "percentage",
"ipv4_nexthop_high_threshold": "85",
"ipv6_route_threshold_type": "percentage",
"nexthop_group_low_threshold": "70",
"ipv4_neighbor_high_threshold": "85",
"ipv6_route_high_threshold": "85",
"ipv6_nexthop_threshold_type": "percentage",
"polling_interval": "300",
"ipv4_nexthop_threshold_type": "percentage",
"acl_group_low_threshold": "70",
"acl_entry_low_threshold": "70",
"nexthop_group_member_threshold_type": "percentage",
"ipv4_nexthop_low_threshold": "70",
"acl_counter_threshold_type": "percentage",
"ipv6_neighbor_high_threshold": "85",
"nexthop_group_member_high_threshold": "85",
"acl_table_low_threshold": "70",
"fdb_entry_threshold_type": "percentage",
"ipv6_neighbor_threshold_type": "percentage",
"acl_table_high_threshold": "85",
"ipv6_nexthop_low_threshold": "70",
"acl_counter_low_threshold": "70",
"ipv4_neighbor_threshold_type": "percentage",
"nexthop_group_high_threshold": "85",
"ipv6_route_low_threshold": "70",
"acl_entry_high_threshold": "85",
"fdb_entry_low_threshold": "70",
"ipv6_nexthop_high_threshold": "85"
}
}
}

View File

@ -1,6 +1,4 @@
48x2q4z/cfg/48x2q4z-modules.conf etc/modules-load.d 48x2q4z/cfg/48x2q4z-modules.conf etc/modules-load.d
48x2q4z/cfg/config_db.json etc/sonic
48x2q4z/cfg/config_db_l2l3.json etc/sonic
48x2q4z/scripts/48x2q4z_platform.sh usr/bin 48x2q4z/scripts/48x2q4z_platform.sh usr/bin
48x2q4z/scripts/48x2q4z_platform_monitor.py usr/bin 48x2q4z/scripts/48x2q4z_platform_monitor.py usr/bin
48x2q4z/service/48x2q4z_platform.service lib/systemd/system 48x2q4z/service/48x2q4z_platform.service lib/systemd/system

View File

@ -1,6 +1,4 @@
48x6q/cfg/48x6q-modules.conf etc/modules-load.d 48x6q/cfg/48x6q-modules.conf etc/modules-load.d
48x6q/cfg/config_db.json etc/sonic
48x6q/cfg/config_db_l2l3.json etc/sonic
48x6q/scripts/48x6q_platform.sh usr/bin 48x6q/scripts/48x6q_platform.sh usr/bin
48x6q/scripts/48x6q_platform_monitor.py usr/bin 48x6q/scripts/48x6q_platform_monitor.py usr/bin
48x6q/service/48x6q_platform.service lib/systemd/system 48x6q/service/48x6q_platform.service lib/systemd/system

View File

@ -0,0 +1,15 @@
Copyright (C) 2017 Centec, Inc
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

View File

@ -0,0 +1 @@
platform drivers for Centec E582 for the SONiC project

View File

@ -0,0 +1,5 @@
sonic-platform-modules-embedway (1.1) unstable; urgency=low
* Initial release
-- yangbs <yangbs@centecnetworks.com> Mon, 22 Jan 2018 13:43:40 +0800

View File

@ -0,0 +1 @@
9

View File

@ -0,0 +1,12 @@
Source: sonic-platform-modules-embedway
Section: main
Priority: extra
Maintainer: yangbs <yangbs@centecnetworks.com>
Build-Depends: debhelper (>= 8.0.0), bzip2
Standards-Version: 3.9.3
Package: platform-modules-embedway-es6220
Architecture: amd64
Depends: linux-image-4.9.0-9-2-amd64
Description: kernel modules for platform devices such as fan, led, sfp

View File

@ -0,0 +1,41 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: setup-board
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Setup e582-48x2q4z board.
### END INIT INFO
case "$1" in
start)
echo -n "Setting up board... "
/usr/bin/es6220_platform.sh init
/usr/bin/add_crontab_remove_syslog.sh
/usr/bin/remove_syslog.sh
/usr/bin/create_eeprom.sh
echo "done."
;;
stop)
/usr/bin/es6220_platform.sh deinit
echo "done."
;;
force-reload|restart)
echo "Not supported"
;;
*)
echo "Usage: service platform-modules-embedway-es6220 {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,5 @@
es6220/scripts/es6220_platform.sh usr/bin
es6220/scripts/create_eeprom.sh usr/bin
es6220/scripts/add_crontab_remove_syslog.sh usr/bin
es6220/scripts/remove_syslog.sh usr/bin
es6220/service/es6220_platform.service lib/systemd/system

View File

@ -0,0 +1,3 @@
depmod -a
systemctl enable es6220_platform.service
systemctl start es6220_platform.service

View File

@ -0,0 +1,35 @@
#!/usr/bin/make -f
export INSTALL_MOD_DIR:=extra
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
MOD_SRC_DIR:= $(shell pwd)
MODULE_DIRS:= es6220
%:
dh $@
override_dh_auto_build:
(for mod in $(MODULE_DIRS); do \
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
done)
override_dh_auto_install:
(for mod in $(MODULE_DIRS); do \
dh_installdirs -pplatform-modules-embedway-$${mod} \
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
cp -f $(MOD_SRC_DIR)/$${mod}/modules/*.ko \
debian/platform-modules-embedway-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
done)
override_dh_usrlocal:
override_dh_clean:
dh_clean
(for mod in $(MODULE_DIRS); do \
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
rm -rf $(MOD_SRC_DIR)/$${mod}/modules/*.ko; \
rm -rf debian/platform-modules-embedway-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR)/*.ko; \
done)

View File

@ -0,0 +1,2 @@
obj-m := dal.o
dal-y := dal_kernel.o dal_mpool.o

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,171 @@
/**
@file dal_kernel_io.h
@author Copyright (C) 2012 Centec Networks Inc. All rights reserved.
@date 2012-4-9
@version v2.0
*/
#ifndef _DAL_KERNEL_H_
#define _DAL_KERNEL_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_RESOURCES_64BIT) || defined(CONFIG_PHYS_ADDR_T_64BIT)
#define PHYS_ADDR_IS_64BIT
#endif
#ifndef SDK_IN_USERMODE
#ifdef PHYS_ADDR_IS_64BIT
typedef long long intptr;
typedef unsigned long long uintptr;
#else
typedef int intptr;
typedef unsigned int uintptr;
#endif
#endif
#define DAL_PCI_READ_ADDR 0x0
#define DAL_PCI_READ_DATA 0xc
#define DAL_PCI_WRITE_ADDR 0x8
#define DAL_PCI_WRITE_DATA 0x4
#define DAL_PCI_STATUS 0x10
#define DAL_PCI_STATUS_IN_PROCESS 31
#define DAL_PCI_STATUS_BAD_PARITY 5
#define DAL_PCI_STATUS_CPU_ACCESS_ERR 4
#define DAL_PCI_STATUS_READ_CMD 3
#define DAL_PCI_STATUS_REGISTER_ERR 1
#define DAL_PCI_STATUS_REGISTER_ACK 0
#define DAL_PCI_ACCESS_TIMEOUT 0x64
#define DAL_NAME "linux_dal" /* "linux_dal" */
#define DAL_DEV_MAJOR 198
#define DAL_DEV_INTR_MAJOR_BASE 200
#define DAL_DEV_NAME "/dev/" DAL_NAME
#define DAL_ONE_KB 1024
#define DAL_ONE_MB (1024*1024)
struct dal_chip_parm_s
{
unsigned int lchip; /*tmp should be uint8*/
unsigned int fpga_id; /*tmp add*/
unsigned int reg_addr;
unsigned int value;
};
typedef struct dal_chip_parm_s dal_chip_parm_t;
struct dal_intr_parm_s
{
unsigned int irq;
unsigned int enable;
};
typedef struct dal_intr_parm_s dal_intr_parm_t;
struct dal_irq_mapping_s
{
unsigned int hw_irq;
unsigned int sw_irq;
};
typedef struct dal_irq_mapping_s dal_irq_mapping_t;
struct dal_user_dev_s
{
unsigned int chip_num; /*output: local chip number*/
unsigned int lchip; /*input: local chip id*/
unsigned int phy_base0; /* low 32bits physical base address */
unsigned int phy_base1; /* high 32bits physical base address */
unsigned int bus_no;
unsigned int dev_no;
unsigned int fun_no;
void* virt_base[2]; /* Virtual base address; this must be last member */
};
typedef struct dal_user_dev_s dal_user_dev_t;
struct dma_info_s
{
unsigned int lchip;
unsigned int phy_base;
unsigned int phy_base_hi;
unsigned int size;
unsigned int* virt_base;
};
typedef struct dma_info_s dma_info_t;
struct dal_pci_cfg_ioctl_s
{
unsigned int lchip; /* Device ID */
unsigned int offset;
unsigned int value;
};
typedef struct dal_pci_cfg_ioctl_s dal_pci_cfg_ioctl_t;
struct dal_msi_info_s
{
unsigned int lchip;
unsigned int irq_base;
unsigned int irq_num;
};
typedef struct dal_msi_info_s dal_msi_info_t;
struct dal_intr_info_s
{
unsigned int irq;
unsigned int irq_idx;
};
typedef struct dal_intr_info_s dal_intr_info_t;
struct dal_dma_cache_info_s
{
unsigned long ptr;
unsigned int length;
};
typedef struct dal_dma_cache_info_s dal_dma_cache_info_t;
#define CMD_MAGIC 'C'
#define CMD_WRITE_CHIP _IO(CMD_MAGIC, 0) /* for humber ioctrol*/
#define CMD_READ_CHIP _IO(CMD_MAGIC, 1) /* for humber ioctrol*/
#define CMD_GET_DEVICES _IO(CMD_MAGIC, 2)
#define CMD_GET_DAL_VERSION _IO(CMD_MAGIC, 3)
#define CMD_PCI_CONFIG_WRITE _IO(CMD_MAGIC, 4)
#define CMD_PCI_CONFIG_READ _IO(CMD_MAGIC, 5)
#define CMD_GET_DMA_INFO _IO(CMD_MAGIC, 6)
#define CMD_REG_INTERRUPTS _IO(CMD_MAGIC, 7)
#define CMD_UNREG_INTERRUPTS _IO(CMD_MAGIC, 8)
#define CMD_EN_INTERRUPTS _IO(CMD_MAGIC, 9)
#define CMD_I2C_READ _IO(CMD_MAGIC, 10)
#define CMD_I2C_WRITE _IO(CMD_MAGIC, 11)
#define CMD_GET_MSI_INFO _IO(CMD_MAGIC, 12)
#define CMD_SET_MSI_CAP _IO(CMD_MAGIC, 13)
#define CMD_IRQ_MAPPING _IO(CMD_MAGIC, 14)
#define CMD_GET_INTR_INFO _IO(CMD_MAGIC, 15)
#define CMD_CACHE_INVAL _IO(CMD_MAGIC, 16)
#define CMD_CACHE_FLUSH _IO(CMD_MAGIC, 17)
enum dal_version_e
{
VERSION_MIN,
VERSION_1DOT0,
VERSION_1DOT1,
VERSION_1DOT2,
VERSION_MAX
};
typedef enum dal_version_e dal_version_t;
/* We try to assemble a contiguous segment from chunks of this size */
#define DMA_BLOCK_SIZE (512 * DAL_ONE_KB)
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,350 @@
#include "dal_mpool.h"
#ifdef __KERNEL__
#include <linux/spinlock.h>
#include <linux/slab.h>
#define DAL_MALLOC(x) kmalloc(x, GFP_ATOMIC)
#define DAL_FREE(x) kfree(x)
static spinlock_t dal_mpool_lock;
#define MPOOL_LOCK_INIT() spin_lock_init(&dal_mpool_lock)
#define MPOOL_LOCK() unsigned long flags; spin_lock_irqsave(&dal_mpool_lock, flags)
#define MPOOL_UNLOCK() spin_unlock_irqrestore(&dal_mpool_lock, flags)
#define DAL_PRINT(fmt,arg...) printk(fmt,##arg)
#else /* !__KERNEL__*/
#include <stdlib.h>
#include "sal.h"
#define DAL_MALLOC(x) malloc(x)
#define DAL_FREE(x) free(x)
static sal_mutex_t* dal_mpool_lock;
#define MPOOL_LOCK_INIT() sal_mutex_create(&dal_mpool_lock)
#define MPOOL_LOCK() sal_mutex_lock(dal_mpool_lock)
#define MPOOL_UNLOCK() sal_mutex_unlock(dal_mpool_lock)
#define DAL_PRINT(fmt,arg...) sal_printf(fmt,##arg)
#endif /* __KERNEL__ */
dal_mpool_mem_t* g_free_block_ptr = NULL;
/* System cache line size */
#ifndef DAL_CACHE_LINE_BYTES
#define DAL_CACHE_LINE_BYTES 256
#endif
#define DAL_MAX_CHIP_NUM 32
static dal_mpool_mem_t* p_desc_pool[DAL_MAX_CHIP_NUM] = {0};
static dal_mpool_mem_t* p_data_pool[DAL_MAX_CHIP_NUM] = {0};
int
dal_mpool_init(void)
{
MPOOL_LOCK_INIT();
return 0;
}
dal_mpool_mem_t*
_dal_mpool_create(void* base, int size, int type)
{
dal_mpool_mem_t* head = NULL;
dal_mpool_mem_t* tail = NULL;
head = (dal_mpool_mem_t*)DAL_MALLOC(sizeof(dal_mpool_mem_t));
if (head == NULL)
{
return NULL;
}
tail = (dal_mpool_mem_t*)DAL_MALLOC(sizeof(dal_mpool_mem_t));
if (tail == NULL)
{
DAL_FREE(head);
return NULL;
}
head->size = tail->size = 0;
head->type = type;
head->address = base;
tail->address = head->address + size;
head->next = tail;
tail->next = NULL;
return head;
}
dal_mpool_mem_t*
dal_mpool_create(unsigned char lchip, void* base, int size)
{
dal_mpool_mem_t* head = NULL;
int mod = (int)(((unsigned long)base) & (DAL_CACHE_LINE_BYTES - 1));
MPOOL_LOCK();
if (mod)
{
base = (char*)base + (DAL_CACHE_LINE_BYTES - mod);
size -= (DAL_CACHE_LINE_BYTES - mod);
}
size &= ~(DAL_CACHE_LINE_BYTES - 1);
/* init for common linkptr, only used for GB */
head = _dal_mpool_create(base, size, DAL_MPOOL_TYPE_USELESS);
if (NULL == head)
{
MPOOL_UNLOCK();
return NULL;
}
/* init for desc linkptr */
p_desc_pool[lchip] = _dal_mpool_create(base, DAL_MPOOL_MAX_DESX_SIZE, DAL_MPOOL_TYPE_DESC);
if (NULL == p_desc_pool[lchip])
{
MPOOL_UNLOCK();
DAL_FREE(head->next);
DAL_FREE(head);
return NULL;
}
/* init for data linkptr */
p_data_pool[lchip] = _dal_mpool_create(((char*)base+DAL_MPOOL_MAX_DESX_SIZE), (size - DAL_MPOOL_MAX_DESX_SIZE), DAL_MPOOL_TYPE_DATA);
if (NULL == p_data_pool[lchip])
{
MPOOL_UNLOCK();
DAL_FREE(head->next);
DAL_FREE(head);
DAL_FREE(p_desc_pool[lchip]->next);
DAL_FREE(p_desc_pool[lchip]);
return NULL;
}
MPOOL_UNLOCK();
return head;
}
dal_mpool_mem_t*
_dal_mpool_alloc_comon(dal_mpool_mem_t* ptr, int size, int type)
{
dal_mpool_mem_t* new_ptr = NULL;
while (ptr && ptr->next)
{
if (ptr->next->address - (ptr->address + ptr->size) >= size)
{
break;
}
ptr = ptr->next;
}
if (!(ptr && ptr->next))
{
return NULL;
}
new_ptr = DAL_MALLOC(sizeof(dal_mpool_mem_t));
if (!new_ptr)
{
return NULL;
}
new_ptr->type = type;
new_ptr->address = ptr->address + ptr->size;
new_ptr->size = size;
new_ptr->next = ptr->next;
ptr->next = new_ptr;
return new_ptr;
}
void*
dal_mpool_alloc(unsigned char lchip, dal_mpool_mem_t* pool, int size, int type)
{
dal_mpool_mem_t* ptr = NULL;
dal_mpool_mem_t* new_ptr = NULL;
int mod;
MPOOL_LOCK();
mod = size & (DAL_CACHE_LINE_BYTES - 1);
if (mod != 0)
{
size += (DAL_CACHE_LINE_BYTES - mod);
}
switch(type)
{
case DAL_MPOOL_TYPE_USELESS:
ptr = pool;
new_ptr = _dal_mpool_alloc_comon(ptr, size, type);
if (NULL == new_ptr)
{
MPOOL_UNLOCK();
return NULL;
}
break;
case DAL_MPOOL_TYPE_DESC:
ptr = p_desc_pool[lchip];
new_ptr = _dal_mpool_alloc_comon(ptr, size, type);
if (NULL == new_ptr)
{
MPOOL_UNLOCK();
return NULL;
}
break;
case DAL_MPOOL_TYPE_DATA:
ptr = p_data_pool[lchip];
new_ptr = _dal_mpool_alloc_comon(ptr, size, type);
if (NULL == new_ptr)
{
MPOOL_UNLOCK();
return NULL;
}
break;
default:
MPOOL_UNLOCK();
return NULL;
break;
}
MPOOL_UNLOCK();
if( NULL == new_ptr )
{
return NULL;
}
return new_ptr->address;
}
void
_dal_mpool_free(dal_mpool_mem_t* ptr, void* addr, int type)
{
unsigned char* address = (unsigned char*)addr;
dal_mpool_mem_t* prev = NULL;
while (ptr && ptr->next)
{
if (ptr->next->address == address)
{
break;
}
ptr = ptr->next;
}
if (ptr && ptr->next)
{
prev = ptr;
ptr = ptr->next;
prev->next = ptr->next;
DAL_FREE(ptr);
}
return;
}
void
dal_mpool_free(unsigned char lchip, dal_mpool_mem_t* pool, void* addr)
{
dal_mpool_mem_t* ptr = pool;
MPOOL_LOCK();
switch(pool->type)
{
case DAL_MPOOL_TYPE_USELESS:
ptr = pool;
_dal_mpool_free(ptr, addr, DAL_MPOOL_TYPE_USELESS);
break;
case DAL_MPOOL_TYPE_DESC:
ptr = p_desc_pool[lchip];
_dal_mpool_free(ptr, addr, DAL_MPOOL_TYPE_DESC);
break;
case DAL_MPOOL_TYPE_DATA:
ptr = p_data_pool[lchip];
_dal_mpool_free(ptr, addr, DAL_MPOOL_TYPE_DATA);
break;
default:
break;
}
MPOOL_UNLOCK();
return;
}
int
dal_mpool_destroy(unsigned char lchip, dal_mpool_mem_t* pool)
{
dal_mpool_mem_t* ptr, * next;
MPOOL_LOCK();
for (ptr = pool; ptr; ptr = next)
{
next = ptr->next;
DAL_FREE(ptr);
}
for (ptr = p_desc_pool[lchip]; ptr; ptr = next)
{
next = ptr->next;
DAL_FREE(ptr);
}
for (ptr = p_data_pool[lchip]; ptr; ptr = next)
{
next = ptr->next;
DAL_FREE(ptr);
}
MPOOL_UNLOCK();
return 0;
}
int
dal_mpool_usage(dal_mpool_mem_t* pool, int type)
{
int usage = 0;
dal_mpool_mem_t* ptr;
MPOOL_LOCK();
for (ptr = pool; ptr; ptr = ptr->next)
{
if (ptr->type == type || ptr->type == -1)
{
usage += ptr->size;
}
}
MPOOL_UNLOCK();
return usage;
}
int
dal_mpool_debug(dal_mpool_mem_t* pool)
{
dal_mpool_mem_t* ptr;
int index = 0;
MPOOL_LOCK();
for (ptr = pool; ptr; ptr = ptr->next)
{
// DAL_PRINT("%2dst mpool block: address=0x%8x, size=0x%x \n", index, (unsigned int)ptr->address, ptr->size);
DAL_PRINT("%2dst mpool block: address=%p, size=0x%x \n", index, ptr->address, ptr->size); // note
index++;
}
MPOOL_UNLOCK();
return 0;
}

View File

@ -0,0 +1,72 @@
/**
@file dal_mpool.h
@author Copyright (C) 2011 Centec Networks Inc. All rights reserved.
@date 2012-5-10
@version v2.0
This file contains the dma memory init, allocation and free APIs
*/
#ifndef _DMA_MPOOL_H
#define _DMA_MPOOL_H
#ifdef __cplusplus
extern "C" {
#endif
#define DAL_MPOOL_MAX_DESX_SIZE (1024*1024)
enum dal_mpool_type_e
{
DAL_MPOOL_TYPE_USELESS, /* just compatible with GB */
DAL_MPOOL_TYPE_DESC, /* dma mpool op for desc */
DAL_MPOOL_TYPE_DATA /* dma mpool op for data */
};
typedef enum dal_mpool_type_e dal_mpool_type_t;
struct dal_mpool_mem_s
{
unsigned char* address;
int size;
int type;
struct dal_mpool_mem_s* next;
};
typedef struct dal_mpool_mem_s dal_mpool_mem_t;
/**
@brief This function is to alloc dma memory
@param[in] size size of memory
@return NULL
*/
extern int
dal_mpool_init(void);
extern dal_mpool_mem_t*
dal_mpool_create(unsigned char lchip, void* base_ptr, int size);
extern void*
dal_mpool_alloc(unsigned char lchip, dal_mpool_mem_t* pool, int size, int type);
extern void
dal_mpool_free(unsigned char lchip, dal_mpool_mem_t* pool, void* addr);
extern int
dal_mpool_destroy(unsigned char lchip, dal_mpool_mem_t* pool);
extern int
dal_mpool_usage(dal_mpool_mem_t* pool, int type);
extern int
dal_mpool_debug(dal_mpool_mem_t* pool);
#ifdef __cplusplus
}
#endif
#endif /* !_DMA_MPOOL_H */

View File

@ -0,0 +1,12 @@
#!/bin/bash
#sed -n '7p' /etc/rsyslog.d/99-default.conf
sudo sed -i '7c !user.debug;*.*;cron,auth,authpriv.none -/var/log/syslog' /etc/rsyslog.d/99-default.conf
sudo sed -i '10c user.debug /var/log/sdkdebug' /etc/rsyslog.d/99-default.conf
#sed -n '7p' /etc/rsyslog.d/99-default.conf
sudo service rsyslog restart
sudo sed -i '9c */5 * * * * root /usr/bin/remove_syslog.sh' /etc/crontab
#echo "*/5 * * * * root /usr/bin/remove_syslog.sh" >> /etc/crontab
exit 0

View File

@ -0,0 +1,18 @@
#! /bin/bash
#find cache of eeprom and delete, otherwise will dislay cache
cache_file="/var/cache/sonic/decode-syseeprom/syseeprom_cache"
if [ -f $cache_file ]; then
rm -f $cache_file
fi
#create new device for eeprom
tmp=`i2cdetect -l | grep CP`
bus_num=${tmp:4:1}
path="/sys/bus/i2c/devices/i2c-${bus_num}"
cd $path
echo "24c512 0x56" > new_device
sudo dd if=/sys/bus/i2c/devices/${bus_num}-0056/eeprom of=/home/admin/eeprom.bin bs=1 count=512

View File

@ -0,0 +1,30 @@
#!/bin/bash
#platform init script for embedway es6220
init_devnum() {
found=0
for devnum in 0 1; do
devname=`cat /sys/bus/i2c/devices/i2c-${devnum}/name`
# I801 adapter can be at either dffd0000 or dfff0000
if [[ $devname == 'SMBus I801 adapter at '* ]]; then
found=1
break
fi
done
[ $found -eq 0 ] && echo "cannot find I801" && exit 1
}
init_devnum
if [ "$1" == "init" ]; then
#install drivers and dependencies
depmod -a
modprobe dal
elif [ "$1" == "deinit" ]; then
modprobe -r dal
else
echo "e582-48x2q4z_platform : Invalid option !"
fi

View File

@ -0,0 +1,9 @@
#!/bin/bash
#remove syslog
sudo find /var/log/ -mtime +7 -name "syslog.*" | sudo xargs rm -rf
#echo "remove_syslog.sh crontab is running" >> /home/admin/shell.txt
exit 0

View File

@ -0,0 +1,13 @@
[Unit]
Description=embedway es6220 platform modules
After=local-fs.target
Before=pmon.service
[Service]
Type=oneshot
ExecStart=-/etc/init.d/platform-modules-embedway-es6220 start
ExecStop=-/etc/init.d/platform-modules-embedway-es6220 stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -93,7 +93,7 @@ def get_system_mac():
# Align last byte of MAC if necessary # Align last byte of MAC if necessary
if version_info and version_info['asic_type'] == 'centec': if version_info and version_info['asic_type'] == 'centec':
last_byte = mac[-2:] last_byte = mac[-2:]
aligned_last_byte = format(int(int(last_byte, 16) & 0b11000000), '02x') aligned_last_byte = format(int(int(last_byte, 16) + 1), '02x')
mac = mac[:-2] + aligned_last_byte mac = mac[:-2] + aligned_last_byte
return mac return mac