From d53df059d4fac2fac416a118d4606412c8b7ece4 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 14 Feb 2019 09:08:04 +0200 Subject: [PATCH] [devices]: Added new SN3700/SN3700C Mellanox platforms (#2548) * [mlnx-msn3700]: Added MSN3700 platform. Signed-off-by: Nazarii Hnydyn * [mlnx-msn3700]: Upgrade FW burn: use ASIC auto detect. Signed-off-by: Nazarii Hnydyn * [mlnx-msn3700]: Updated HW-MGMT/FW/MFT/SAI/SDK. Signed-off-by: Nazarii Hnydyn * [mlnx-msn3700]: Added MSN3700C platform. Signed-off-by: Nazarii Hnydyn --- .../x86_64-mlnx_msn2700-r0/plugins/sfputil.py | 2 +- .../ACS-MSN3700/buffers.json.j2 | 1 + .../ACS-MSN3700/buffers_defaults_t0.j2 | 91 +++++++ .../ACS-MSN3700/buffers_defaults_t1.j2 | 91 +++++++ .../ACS-MSN3700/pg_profile_lookup.ini | 22 ++ .../ACS-MSN3700/port_config.ini | 1 + .../ACS-MSN3700/qos.json.j2 | 1 + .../ACS-MSN3700/sai.profile | 1 + .../ACS-MSN3700/sai_3700.xml | 243 ++++++++++++++++++ .../x86_64-mlnx_msn3700-r0/default_sku | 1 + .../x86_64-mlnx_msn3700-r0/platform_reboot | 1 + .../x86_64-mlnx_msn3700-r0/plugins/eeprom.py | 1 + .../x86_64-mlnx_msn3700-r0/plugins/psuutil.py | 1 + .../plugins/sfplpmget.py | 1 + .../plugins/sfplpmset.py | 1 + .../plugins/sfpreset.py | 1 + .../x86_64-mlnx_msn3700-r0/plugins/sfputil.py | 1 + .../x86_64-mlnx_msn3700-r0/sensors.conf | 89 +++++++ .../ACS-MSN3700C/buffers.json.j2 | 1 + .../ACS-MSN3700C/buffers_defaults_t0.j2 | 1 + .../ACS-MSN3700C/buffers_defaults_t1.j2 | 1 + .../ACS-MSN3700C/pg_profile_lookup.ini | 1 + .../ACS-MSN3700C/port_config.ini | 1 + .../ACS-MSN3700C/qos.json.j2 | 1 + .../ACS-MSN3700C/sai.profile | 1 + .../ACS-MSN3700C/sai_3700c.xml | 1 + .../x86_64-mlnx_msn3700c-r0/default_sku | 1 + .../x86_64-mlnx_msn3700c-r0/platform_reboot | 1 + .../x86_64-mlnx_msn3700c-r0/plugins/eeprom.py | 1 + .../plugins/psuutil.py | 1 + .../plugins/sfplpmget.py | 1 + .../plugins/sfplpmset.py | 1 + .../plugins/sfpreset.py | 1 + .../plugins/sfputil.py | 1 + .../x86_64-mlnx_msn3700c-r0/sensors.conf | 89 +++++++ .../build_templates/sonic_debian_extension.j2 | 3 +- platform/mellanox/fw.mk | 20 +- platform/mellanox/hw-management/hw-mgmt | 2 +- platform/mellanox/mft.mk | 4 +- platform/mellanox/mlnx-fw-upgrade.j2 | 165 +++++++++--- platform/mellanox/mlnx-sai.mk | 4 +- platform/mellanox/one-image.mk | 2 +- platform/mellanox/sdk.mk | 3 +- 43 files changed, 810 insertions(+), 48 deletions(-) create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers.json.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/pg_profile_lookup.ini create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/port_config.ini create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/qos.json.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai_3700.xml create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/default_sku create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/eeprom.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/psuutil.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmget.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmset.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfpreset.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfputil.py create mode 100644 device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers.json.j2 create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t0.j2 create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t1.j2 create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/pg_profile_lookup.ini create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/port_config.ini create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/qos.json.j2 create mode 100644 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai_3700c.xml create mode 100644 device/mellanox/x86_64-mlnx_msn3700c-r0/default_sku create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/eeprom.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/psuutil.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmget.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmset.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfpreset.py create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfputil.py create mode 100644 device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index e4f9f05d41..34f285bf7c 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -22,7 +22,7 @@ GET_HWSKU_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.hwsku" # magic code defnition for port number, qsfp port position of each hwsku # port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) -hwsku_dict = {'ACS-MSN2700': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, } +hwsku_dict = {'ACS-MSN2700': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0} port_position_tuple_list = [(0, 0, 31, 32, 1), (0, 0, 15, 16, 1), (0, 48, 55, 56, 1),(0, 18, 21, 22, 1)] class SfpUtil(SfpUtilBase): diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers.json.j2 new file mode 120000 index 0000000000..add8bf8bb7 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 new file mode 100644 index 0000000000..bf3d79aa4e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 @@ -0,0 +1,91 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '8224768' %} +{% set ingress_lossy_pool_size = '8224768' %} +{% set egress_lossless_pool_size = '41943024' %} +{% set egress_lossy_pool_size = '8224768' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"0" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "{{ port_names }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "{{ port_names }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { + "{{ port_names }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port_names }}|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "{{ port_names }}|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } + } +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 new file mode 100644 index 0000000000..d92c6e1252 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 @@ -0,0 +1,91 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '12042240' %} +{% set ingress_lossy_pool_size = '12042240' %} +{% set egress_lossless_pool_size = '41943024' %} +{% set egress_lossy_pool_size = '12042240' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"0" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "{{ port_names }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "{{ port_names }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { + "{{ port_names }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port_names }}|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "{{ port_names }}|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } + } +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/pg_profile_lookup.ini new file mode 100644 index 0000000000..6cd06326cf --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/pg_profile_lookup.ini @@ -0,0 +1,22 @@ +# speed cable size xon xoff threshold + 1000 5m 35840 18432 17408 0 + 10000 5m 36864 18432 18432 0 + 25000 5m 36864 18432 18432 0 + 40000 5m 36864 18432 18432 0 + 50000 5m 37888 18432 19456 0 + 100000 5m 38912 18432 20480 0 + 200000 5m 41984 18432 23552 0 + 1000 40m 36864 18432 18432 0 + 10000 40m 38912 18432 20480 0 + 25000 40m 41984 18432 23552 0 + 40000 40m 45056 18432 26624 0 + 50000 40m 47104 18432 28672 0 + 100000 40m 59392 18432 40960 0 + 200000 40m 81920 18432 63488 0 + 1000 300m 37888 18432 19456 0 + 10000 300m 53248 18432 34816 0 + 25000 300m 78848 18432 60416 0 + 40000 300m 104448 18432 86016 0 + 50000 300m 121856 18432 103424 0 + 100000 300m 206848 18432 188416 0 + 200000 300m 376832 18432 358400 0 diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/port_config.ini b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/port_config.ini new file mode 120000 index 0000000000..73505f3a0b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/port_config.ini @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/qos.json.j2 new file mode 120000 index 0000000000..eccf286dc8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile new file mode 100644 index 0000000000..4907e971a2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700.xml diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai_3700.xml b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai_3700.xml new file mode 100644 index 0000000000..8f6c427888 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai_3700.xml @@ -0,0 +1,243 @@ + + + + + + 00:02:03:04:05:00 + + + 32 + + + + + 1 + 4 + 16 + + + 3 + + + 1536 + + + 5 + 4 + 17 + 3 + 1536 + + + 9 + 4 + 18 + 3 + 1536 + + + 13 + 4 + 19 + 3 + 1536 + + + 17 + 4 + 20 + 3 + 1536 + + + 21 + 4 + 21 + 3 + 1536 + + + 25 + 4 + 22 + 3 + 1536 + + + 29 + 4 + 23 + 3 + 1536 + + + 33 + 4 + 14 + 3 + 1536 + + + 37 + 4 + 15 + 3 + 1536 + + + 41 + 4 + 12 + 3 + 1536 + + + 45 + 4 + 13 + 3 + 1536 + + + 49 + 4 + 10 + 3 + 1536 + + + 53 + 4 + 11 + 3 + 1536 + + + 57 + 4 + 8 + 3 + 1536 + + + 61 + 4 + 9 + 3 + 1536 + + + 65 + 4 + 30 + 3 + 1536 + + + 69 + 4 + 31 + 3 + 1536 + + + 73 + 4 + 28 + 3 + 1536 + + + 77 + 4 + 29 + 3 + 1536 + + + 81 + 4 + 26 + 3 + 1536 + + + 85 + 4 + 27 + 3 + 1536 + + + 89 + 4 + 24 + 3 + 1536 + + + 93 + 4 + 25 + 3 + 1536 + + + 97 + 4 + 0 + 3 + 1536 + + + 101 + 4 + 1 + 3 + 1536 + + + 105 + 4 + 2 + 3 + 1536 + + + 109 + 4 + 3 + 3 + 1536 + + + 113 + 4 + 4 + 3 + 1536 + + + 117 + 4 + 5 + 3 + 1536 + + + 121 + 4 + 6 + 3 + 1536 + + + 125 + 4 + 7 + 3 + 1536 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/default_sku b/device/mellanox/x86_64-mlnx_msn3700-r0/default_sku new file mode 100644 index 0000000000..5385adf06a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/default_sku @@ -0,0 +1 @@ +ACS-MSN3700 t1 diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot new file mode 120000 index 0000000000..43c8ea5674 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_reboot @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/eeprom.py new file mode 120000 index 0000000000..b4e2a6a616 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/eeprom.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/psuutil.py new file mode 120000 index 0000000000..9f724238a8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/psuutil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmget.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmget.py new file mode 120000 index 0000000000..2e84f435ab --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmget.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmget.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmset.py new file mode 120000 index 0000000000..6a88bac304 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfplpmset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfpreset.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfpreset.py new file mode 120000 index 0000000000..fef2063e34 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfpreset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfpreset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfputil.py new file mode 120000 index 0000000000..45909b880f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf new file mode 100644 index 0000000000..592964d75c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -0,0 +1,89 @@ +################################################################################ +# Copyright (c) 2019 Mellanox Technologies +# +# Platform specific sensors config for MSN3700 +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "tps53679-i2c-*-70" + label in1 "PMIC-1 PSU 12V Rail (in)" + label in2 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in3 "PMIC-1 ASIC 1.2V Rail (out)" + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "tps53679-i2c-*-71" + label in1 "PMIC-2 PSU 12V Rail (in)" + label in2 "PMIC-2 ASIC 3.3V Rail (out)" + label in3 "PMIC-2 ASIC 1.8V Rail (out)" + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2 220V Rail (in)" + ignore in2 + label in3 "PSU-2 12V Rail (out)" + label fan1 "PSU-2 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2 Temp 1" + label temp2 "PSU-2 Temp 2" + label temp3 "PSU-2 Temp 3" + label power1 "PSU-2 220V Rail Pwr (in)" + label power2 "PSU-2 12V Rail Pwr (out)" + label curr1 "PSU-2 220V Rail Curr (in)" + label curr2 "PSU-2 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + label fan9 "Chassis Fan Drawer-5 Tach 1" + label fan10 "Chassis Fan Drawer-5 Tach 2" + label fan11 "Chassis Fan Drawer-6 Tach 1" + label fan12 "Chassis Fan Drawer-6 Tach 2" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers.json.j2 new file mode 120000 index 0000000000..add8bf8bb7 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t0.j2 new file mode 120000 index 0000000000..85f0b6b6b3 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t1.j2 new file mode 120000 index 0000000000..3bb496a510 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/pg_profile_lookup.ini new file mode 120000 index 0000000000..252ae8d414 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/pg_profile_lookup.ini @@ -0,0 +1 @@ +../../x86_64-mlnx_msn3700-r0/ACS-MSN3700/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/port_config.ini b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/port_config.ini new file mode 120000 index 0000000000..73505f3a0b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/port_config.ini @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/qos.json.j2 new file mode 120000 index 0000000000..eccf286dc8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile new file mode 100644 index 0000000000..46750fb2e0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700c.xml diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai_3700c.xml b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai_3700c.xml new file mode 120000 index 0000000000..58740b9776 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai_3700c.xml @@ -0,0 +1 @@ +../../x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai_3700.xml \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/default_sku b/device/mellanox/x86_64-mlnx_msn3700c-r0/default_sku new file mode 100644 index 0000000000..12f543e1cc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/default_sku @@ -0,0 +1 @@ +ACS-MSN3700C t1 diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot new file mode 120000 index 0000000000..43c8ea5674 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_reboot @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/eeprom.py new file mode 120000 index 0000000000..b4e2a6a616 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/eeprom.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/psuutil.py new file mode 120000 index 0000000000..9f724238a8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/psuutil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmget.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmget.py new file mode 120000 index 0000000000..2e84f435ab --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmget.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmget.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmset.py new file mode 120000 index 0000000000..6a88bac304 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfplpmset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfpreset.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfpreset.py new file mode 120000 index 0000000000..fef2063e34 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfpreset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfpreset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfputil.py new file mode 120000 index 0000000000..45909b880f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf new file mode 100644 index 0000000000..1570ac30b6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -0,0 +1,89 @@ +################################################################################ +# Copyright (c) 2019 Mellanox Technologies +# +# Platform specific sensors config for MSN3700C +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "tps53679-i2c-*-70" + label in1 "PMIC-1 PSU 12V Rail (in)" + label in2 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in3 "PMIC-1 ASIC 1.2V Rail (out)" + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "tps53679-i2c-*-71" + label in1 "PMIC-2 PSU 12V Rail (in)" + label in2 "PMIC-2 ASIC 3.3V Rail (out)" + label in3 "PMIC-2 ASIC 1.8V Rail (out)" + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2 220V Rail (in)" + ignore in2 + label in3 "PSU-2 12V Rail (out)" + label fan1 "PSU-2 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2 Temp 1" + label temp2 "PSU-2 Temp 2" + label temp3 "PSU-2 Temp 3" + label power1 "PSU-2 220V Rail Pwr (in)" + label power2 "PSU-2 12V Rail Pwr (out)" + label curr1 "PSU-2 220V Rail Curr (in)" + label curr2 "PSU-2 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + ignore fan9 + ignore fan10 + ignore fan11 + ignore fan12 + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index f78d4c2d14..da7ad28b54 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -314,7 +314,8 @@ sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}} {% if sonic_asic_platform == "mellanox" %} sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ -sudo cp target/files/$MLNX_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa +sudo cp target/files/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa +sudo cp target/files/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa sudo cp target/files/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version sudo cp target/files/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh j2 platform/mellanox/mlnx-fw-upgrade.j2 | sudo tee $FILESYSTEM_ROOT/usr/bin/mlnx-fw-upgrade.sh diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 99414ff945..e29e686267 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -1,9 +1,17 @@ # mellanox firmware -MLNX_FW_VERSION = 13.1910.0906 -MLNX_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_FW_VERSION))-EVB.mfa -$(MLNX_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_FW_FILE) -SONIC_ONLINE_FILES += $(MLNX_FW_FILE) +MLNX_SPC_FW_VERSION = 13.1910.0906 +MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa +$(MLNX_SPC_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_SPC_FW_FILE) +SONIC_ONLINE_FILES += $(MLNX_SPC_FW_FILE) -export MLNX_FW_VERSION -export MLNX_FW_FILE +MLNX_SPC2_FW_VERSION = 29.1961.0006 +MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa +$(MLNX_SPC2_FW_FILE)_URL = $(MLNX_SDK_BASE_URL)/$(MLNX_SPC2_FW_FILE) +SONIC_ONLINE_FILES += $(MLNX_SPC2_FW_FILE) + +export MLNX_SPC_FW_VERSION +export MLNX_SPC_FW_FILE + +export MLNX_SPC2_FW_VERSION +export MLNX_SPC2_FW_FILE diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index 344e81942c..f58710c8f3 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit 344e81942c02c279db03c3aba40db4142dc6817d +Subproject commit f58710c8f348fdaefdafbefeb0261ccac3b85f24 diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 5191fa41bc..2233d96d44 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MFT_VERSION = 4.9.0 -MFT_REVISION = 38 +MFT_VERSION = 4.11.0 +MFT_REVISION = 65 export MFT_VERSION MFT_REVISION diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 28df25f43e..ebdad993f8 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -4,39 +4,65 @@ declare -r SCRIPT_NAME="$(basename "$0")" declare -r SCRIPT_PATH="$(readlink -f "$0")" declare -r SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" +declare -r YES_PARAM="yes" +declare -r NO_PARAM="no" + +declare -r VERBOSE_ERROR="1" +declare -r VERBOSE_WARNING="2" +declare -r VERBOSE_NOTICE="3" +declare -r VERBOSE_INFO="4" + +declare -r VERBOSE_MAX="${VERBOSE_INFO}" +declare -r VERBOSE_MIN="${VERBOSE_ERROR}" + declare -r EXIT_SUCCESS="0" -declare -r EXIT_ERROR="1" +declare -r EXIT_FAILURE="1" declare -r QUERY_CMD="mlxfwmanager --query" declare -r BURN_CMD="mlxfwmanager -u -f -y" -declare -r FW_FILE="/etc/mlnx/fw-SPC.mfa" -declare -r QUERY_FILE="/tmp/mlnxfwmanager-query.txt" +declare -r QUERY_FILE="/tmp/mlxfwmanager-query.log" -declare -r FW_REQUIRED="{{ MLNX_FW_VERSION }}" +declare -r SPC1_ASIC="spc1" +declare -r SPC2_ASIC="spc2" +declare -r UNKN_ASIC="unknown" -IMAGE_UPGRADE="no" +declare -rA FW_FILE_MAP=( \ + [$SPC1_ASIC]="/etc/mlnx/fw-SPC.mfa" \ + [$SPC2_ASIC]="/etc/mlnx/fw-SPC2.mfa" \ +) +declare -rA FW_REQUIRED_MAP=( \ + [$SPC1_ASIC]="{{ MLNX_SPC_FW_VERSION }}" \ + [$SPC2_ASIC]="{{ MLNX_SPC2_FW_VERSION }}" \ +) + +IMAGE_UPGRADE="${NO_PARAM}" +VERBOSE_LEVEL="${VERBOSE_MIN}" function PrintHelp() { echo echo "Usage: ./${SCRIPT_NAME} [OPTIONS]" echo echo "OPTIONS:" - echo " -u, --upgrade Upgrade MLNX ASIC firmware using next boot image (useful after SONiC-To-SONiC update)" + echo " -u, --upgrade Upgrade ASIC firmware using next boot image (useful after SONiC-To-SONiC update)" + echo " -v, --verbose Verbose mode" echo " -h, --help Print help" echo echo "Examples:" - echo " ./${SCRIPT_NAME}" + echo " ./${SCRIPT_NAME} --verbose" echo " ./${SCRIPT_NAME} --upgrade" echo " ./${SCRIPT_NAME} --help" echo } function ParseArguments() { - while [ $# -ge 1 ]; do + while [ "$#" -ge "1" ]; do case "$1" in -u|--upgrade) - IMAGE_UPGRADE="yes" + IMAGE_UPGRADE="${YES_PARAM}" + ;; + -v|--verbose) + VERBOSE_LEVEL="${VERBOSE_MAX}" ;; -h|--help) PrintHelp @@ -47,65 +73,138 @@ function ParseArguments() { done } +function LogError() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_ERROR}" ]]; then + echo "ERROR: $*" + fi +} + +function LogWarning() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_WARNING}" ]]; then + echo "WARNING: $*" + fi +} + +function LogNotice() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_NOTICE}" ]]; then + echo "NOTICE: $*" + fi +} + +function LogInfo() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_INFO}" ]]; then + echo "INFO: $*" + fi +} + +function ExitFailure() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_ERROR}" ]]; then + echo + LogError "$@" + echo + fi + + exit "${EXIT_FAILURE}" +} + +function ExitSuccess() { + if [[ "${VERBOSE_LEVEL}" -ge "${VERBOSE_INFO}" ]]; then + echo + LogInfo "$@" + echo + fi + + exit "${EXIT_SUCCESS}" +} + function WaitForDevice() { local -i QUERY_RETRY_COUNT_MAX="10" local -i QUERY_RETRY_COUNT="0" ${QUERY_CMD} > /dev/null - while [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("$?" -ne "0") ]]; do + while [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("$?" -ne "${EXIT_SUCCESS}") ]]; do sleep 1s ((QUERY_RETRY_COUNT++)) ${QUERY_CMD} > /dev/null done } +function GetAsicType() { + local -r VENDOR_ID="15b3" + + local -r SPC1_PRODUCT_ID="cb84" + local -r SPC2_PRODUCT_ID="cf6c" + + if lspci -n | grep "${VENDOR_ID}:${SPC1_PRODUCT_ID}" &>/dev/null; then + echo "${SPC1_ASIC}" + exit "${EXIT_SUCCESS}" + elif lspci -n | grep "${VENDOR_ID}:${SPC2_PRODUCT_ID}" &>/dev/null; then + echo "${SPC2_ASIC}" + exit "${EXIT_SUCCESS}" + fi + + echo "${UNKN_ASIC}" + exit "${EXIT_FAILURE}" +} + function RunCmd() { - $1 - if [[ $? != 0 ]]; then - echo "Command failed: cmd=$1, errno=$?" - exit "${EXIT_ERROR}" + local ERROR_CODE="${EXIT_SUCCESS}" + + if [[ "${VERBOSE_LEVEL}" -eq "${VERBOSE_MAX}" ]]; then + eval "$@" + else + eval "$@" &>/dev/null + fi + + ERROR_CODE="$?" + if [[ "${ERROR_CODE}" != "${EXIT_SUCCESS}" ]]; then + ExitFailure "command failed: $@" fi } function UpgradeFW() { - local _FW_FILE="$1" + local -r _FS_MOUNTPOINT="$1" + + local -r _ASIC_TYPE="$(GetAsicType)" + if [[ "${_ASIC_TYPE}" = "${UNKN_ASIC}" ]]; then + ExitFailure "failed to detect ASIC type" + fi + + if [ ! -z "${_FS_MOUNTPOINT}" ]; then + local -r _FW_FILE="${_FS_MOUNTPOINT}/${FW_FILE_MAP[$_ASIC_TYPE]}" - if [ ! -z "${_FW_FILE}" ]; then if [ ! -f "${_FW_FILE}" ]; then - echo "No such file: ${_FW_FILE}" - exit "${EXIT_ERROR}" + ExitFailure "no such file: ${_FW_FILE}" fi - RunCmd "${QUERY_CMD} -i ${_FW_FILE}" > "${QUERY_FILE}" + RunCmd "${QUERY_CMD} -i ${_FW_FILE} -L ${QUERY_FILE}" &>/dev/null local -r _FW_INFO="$(grep FW ${QUERY_FILE})" local -r _FW_CURRENT="$(echo ${_FW_INFO} | cut -f2 -d' ')" local -r _FW_AVAILABLE="$(echo ${_FW_INFO} | cut -f3 -d' ')" else - RunCmd "${QUERY_CMD}" > "${QUERY_FILE}" + local -r _FW_FILE="${FW_FILE_MAP[$_ASIC_TYPE]}" + + RunCmd "${QUERY_CMD} -L ${QUERY_FILE}" &>/dev/null local -r _FW_INFO="$(grep FW ${QUERY_FILE})" local -r _FW_CURRENT="$(echo ${_FW_INFO} | cut -f2 -d' ')" - local -r _FW_AVAILABLE="${FW_REQUIRED}" - - _FW_FILE="${FW_FILE}" + local -r _FW_AVAILABLE="${FW_REQUIRED_MAP[$_ASIC_TYPE]}" fi if [[ -z "${_FW_CURRENT}" ]]; then - echo "Could not retreive current FW version" - exit "${EXIT_ERROR}" + ExitFailure "could not retreive current FW version" fi if [[ -z "${_FW_AVAILABLE}" ]]; then - echo "Could not retreive available FW version" - exit "${EXIT_ERROR}" + ExitFailure "could not retreive available FW version" fi if [[ "${_FW_CURRENT}" == "${_FW_AVAILABLE}" ]]; then - echo "Mellanox firmware is up to date" + ExitSuccess "firmware is up to date" else - echo "Mellanox firmware upgrade is required. Installing compatible version..." + LogNotice "firmware upgrade is required. Installing compatible version..." RunCmd "${BURN_CMD} -i ${_FW_FILE}" fi } @@ -118,12 +217,12 @@ function UpgradeFWFromImage() { local -r _FS_MOUNTPOINT="/tmp/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}-fs" if [[ "${_CURRENT_SONIC_IMAGE}" == "${_NEXT_SONIC_IMAGE}" ]]; then - echo "Mellanox firmware is up to date" + ExitSuccess "firmware is up to date" else mkdir -p "${_FS_MOUNTPOINT}" mount -t squashfs "${_FS_PATH}" "${_FS_MOUNTPOINT}" - UpgradeFW "${_FS_MOUNTPOINT}/etc/mlnx/fw-SPC.mfa" + UpgradeFW "${_FS_MOUNTPOINT}" umount -rf "${_FS_MOUNTPOINT}" rm -rf "${_FS_MOUNTPOINT}" @@ -134,10 +233,10 @@ ParseArguments "$@" WaitForDevice -if [ "${IMAGE_UPGRADE}" != "yes" ]; then +if [ "${IMAGE_UPGRADE}" != "${YES_PARAM}" ]; then UpgradeFW else UpgradeFWFromImage fi -exit "${EXIT_SUCCESS}" +ExitSuccess "firmware upgrade is completed" diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index d5d3d53830..8dc27bf532 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIRel1.13.3-master -MLNX_SAI_REVISION = 7cc737246fce514372cf8fd447360c5f11e7c8b9 +MLNX_SAI_VERSION = SAIRel1.13.4-master +MLNX_SAI_REVISION = 079a5aebf184d707847a4e2aa1cfb502e1def32a export MLNX_SAI_VERSION MLNX_SAI_REVISION diff --git a/platform/mellanox/one-image.mk b/platform/mellanox/one-image.mk index 6fd5af1932..0558985514 100644 --- a/platform/mellanox/one-image.mk +++ b/platform/mellanox/one-image.mk @@ -5,5 +5,5 @@ $(SONIC_ONE_IMAGE)_MACHINE = mellanox $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT_OEM) $(MFT) $(MLNX_HW_MANAGEMENT) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) -$(SONIC_ONE_IMAGE)_FILES += $(MLNX_FW_FILE) $(MLNX_FFB_SCRIPT) $(ISSU_VERSION_FILE) +$(SONIC_ONE_IMAGE)_FILES += $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_FFB_SCRIPT) $(ISSU_VERSION_FILE) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 6150c9dcce..4c0d1864ce 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,5 +1,6 @@ -MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/e791ebf6e88933da35aa4bf11dda57655322bae5/sdk +MLNX_SDK_BASE_URL = https://github.com/Mellanox/SAI-Implementation/raw/079a5aebf184d707847a4e2aa1cfb502e1def32a/sdk MLNX_SDK_VERSION = 4.3.0134 + MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_ACL_RM) $(SX_COMPLIB) \ $(SX_EXAMPLES) $(SX_GEN_UTILS) $(SX_SCEW) $(SX_SDN_HAL) \ $(SXD_LIBS) $(TESTX)