1e17d9c5b2
Why I did it Adding platform support for centec v682-48y8c and v682-48x8c. V682-48y8c switch has 48 SFP+ (1G/10G/25G) ports, 8 QSFP28 (40G/100G) ports on CENTEC TsingMa.MX. V682-48y8c is different from V682-48y8c_d in that: transceiver is managed by cpu smbus rather than TsingMa.MX i2c bus. port led is managed by mcu inside TsingMa.MX. fan, psu, sensors, leds are managed by cpu smbus other than the cpu board vendor's close sourse driver. V682-48x8c switch has 48 SFP+ (1G/10G) ports, 8 QSFP28 (40G/100G) ports on CENTEC TsingMa.MX. CPU used in v682-48y8c and v682-48x8c is Intel(R) Xeon(R) CPU D-1527. How I did it Modify related code in platform and device directory. Upgrade centec sai to v1.9. upgrade python to python3 and kernel version to 5.0 for V682-48y8c_d. How to verify it Build centec amd64 sonic image, verify platform functions (port, sfp, led etc) on centec v682-48y8c and v682-48x8c board. Co-authored-by: shil <shil@centecnetworks.com>
71 lines
2.3 KiB
Django/Jinja
71 lines
2.3 KiB
Django/Jinja
{# 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 %}
|
|
}
|
|
}
|
|
}
|
|
|